新建MX或SRV记录时优先级默认值设置为10
This commit is contained in:
parent
3cfab004f0
commit
1ceb618288
@ -134,6 +134,7 @@
|
||||
<div v-if="record.editing" class="flex items-center space-x-2">
|
||||
<select
|
||||
v-model="record.type"
|
||||
@change="handleRecordTypeChange(record)"
|
||||
class="w-20 px-2 py-1 text-sm border border-gray-300 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||
:class="{ 'bg-gray-100 text-gray-500 cursor-not-allowed': !record.isNew }"
|
||||
:disabled="!record.isNew"
|
||||
@ -477,6 +478,22 @@ export default {
|
||||
|
||||
// 添加新记录到最前面
|
||||
this.dnsRecords.unshift(newRecord);
|
||||
|
||||
// 如果默认类型是MX或SRV,设置默认优先级
|
||||
this.handleRecordTypeChange(newRecord);
|
||||
},
|
||||
|
||||
// 处理记录类型变化时的优先级设置
|
||||
handleRecordTypeChange(record) {
|
||||
if (record.type === 'MX' || record.type === 'SRV') {
|
||||
// 如果是MX或SRV类型且优先级为空,则设置为默认值10
|
||||
if (!record.level) {
|
||||
record.level = 10;
|
||||
}
|
||||
} else {
|
||||
// 其他类型不设置优先级
|
||||
record.level = null;
|
||||
}
|
||||
},
|
||||
|
||||
// 编辑记录
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user