mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: priority checks.
This commit is contained in:
+2
-1
@@ -17,6 +17,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import type { RecordType } from '$lib/stores/domains';
|
||||
import { createRecord } from '$lib/helpers/domains';
|
||||
import { showPriority } from './table.svelte';
|
||||
|
||||
export let show = false;
|
||||
|
||||
@@ -110,7 +111,7 @@
|
||||
</span>
|
||||
</Tooltip>
|
||||
</InputNumber>
|
||||
{#if type === 'MX'}
|
||||
{#if showPriority(type)}
|
||||
<InputNumber
|
||||
id="priority"
|
||||
label="Priority"
|
||||
|
||||
+10
-1
@@ -1,3 +1,12 @@
|
||||
<script lang="ts" context="module">
|
||||
import type { RecordType } from '$lib/stores/domains';
|
||||
|
||||
export function showPriority(record: Models.DnsRecord | RecordType): boolean {
|
||||
const type = typeof record === 'string' ? record : record.type;
|
||||
return type.toLowerCase() === 'mx' || type.toLowerCase() === 'srv';
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { PaginationWithLimit } from '$lib/components';
|
||||
import {
|
||||
@@ -86,7 +95,7 @@
|
||||
</Typography.Text>
|
||||
{:else if column.id === 'priority'}
|
||||
<Typography.Text>
|
||||
{record?.priority || '-'}
|
||||
{showPriority(record) ? record?.priority || '-' : '-'}
|
||||
</Typography.Text>
|
||||
{:else if column.id === 'comment'}
|
||||
<Typography.Text truncate>
|
||||
|
||||
+2
-4
@@ -20,6 +20,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import type { RecordType } from '$lib/stores/domains';
|
||||
import { updateRecord } from '$lib/helpers/domains';
|
||||
import { showPriority } from './table.svelte';
|
||||
|
||||
export let show = false;
|
||||
export let selectedRecord: Models.DnsRecord;
|
||||
@@ -63,9 +64,6 @@
|
||||
|
||||
$: isDisabled = !symmetricDifference(Object.values(record), Object.values(selectedRecord))
|
||||
?.length;
|
||||
|
||||
$: showPriority =
|
||||
record.name.toLocaleLowerCase() === 'mx' || record.name.toLocaleLowerCase() === 'srv';
|
||||
</script>
|
||||
|
||||
<Modal title="Update DNS record" bind:show bind:error onSubmit={handleSubmit}>
|
||||
@@ -104,7 +102,7 @@
|
||||
</span>
|
||||
</Tooltip>
|
||||
</InputNumber>
|
||||
{#if showPriority}
|
||||
{#if showPriority(record)}
|
||||
<InputNumber
|
||||
id="priority"
|
||||
label="Priority"
|
||||
|
||||
Reference in New Issue
Block a user