content safety

This commit is contained in:
Sense T 2024-04-10 13:41:32 +08:00
parent 29f75938bb
commit ed4fee935d

View File

@ -8,7 +8,7 @@
<NForm :model="record" inline :rules="rules">
<NFormItem :label="t('records.recordType')">
<NSelect v-model:value="record.record_type" :options="recordTypeOptions" />
<NSelect v-model:value="record.record_type" :options="recordTypeOptions" @update:value="clearRecordContent"/>
</NFormItem>
<NFormItem :label="t('records.name')" path="name">
<NInput v-model:value="record.name" />
@ -121,6 +121,7 @@ import {
type SRVRecord,
type TXTRecord,
type MXRecord,
type RecordT,
} from '@/stores/records';
import { Check, Times } from '@vicons/fa';
import { ref } from 'vue';
@ -151,6 +152,10 @@ const rules = {
}
} as FormRules
function clearRecordContent() {
props.record.content = {} as RecordT
}
async function confirm() {
loading.value = true;
try {