main #2

Merged
jingrow merged 250 commits from main into v1 2026-01-13 22:45:50 +08:00
2 changed files with 9 additions and 58 deletions
Showing only changes of commit 93136d0ea5 - Show all commits

View File

@ -2,23 +2,16 @@
<Dialog :options="{ title: '修改DNS服务器', size: 'lg' }" v-model="show">
<template #body-content>
<div class="p-4 sm:p-6">
<div class="mb-6">
<p class="mt-1 text-sm text-gray-600">
域名 <span class="font-medium">{{ domainDoc?.domain }}</span>
</p>
</div>
<div class="space-y-4">
<!-- DNS1 -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
主DNS服务器 <span class="text-red-500">*</span>
DNS1主DNS服务器<span class="text-red-500">*</span>
</label>
<input
v-model="dnsServers.dns1"
type="text"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="例如ns1.example.com"
:class="{ 'border-red-300': errors.dns1 }"
/>
<p v-if="errors.dns1" class="mt-1 text-sm text-red-600">{{ errors.dns1 }}</p>
@ -27,13 +20,12 @@
<!-- DNS2 -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
辅DNS服务器 <span class="text-red-500">*</span>
DNS2辅DNS服务器<span class="text-red-500">*</span>
</label>
<input
v-model="dnsServers.dns2"
type="text"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="例如ns2.example.com"
:class="{ 'border-red-300': errors.dns2 }"
/>
<p v-if="errors.dns2" class="mt-1 text-sm text-red-600">{{ errors.dns2 }}</p>
@ -42,87 +34,51 @@
<!-- DNS3 -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
第三个DNS服务器
DNS3可选
</label>
<input
v-model="dnsServers.dns3"
type="text"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="例如ns3.example.com可选"
/>
</div>
<!-- DNS4 -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
第四个DNS服务器
DNS4可选
</label>
<input
v-model="dnsServers.dns4"
type="text"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="例如ns4.example.com可选"
/>
</div>
<!-- DNS5 -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
第五个DNS服务器
DNS5可选
</label>
<input
v-model="dnsServers.dns5"
type="text"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="例如ns5.example.com可选"
/>
</div>
<!-- DNS6 -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
第六个DNS服务器
DNS6可选
</label>
<input
v-model="dnsServers.dns6"
type="text"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="例如ns6.example.com可选"
/>
</div>
</div>
<!-- 当前DNS服务器信息 -->
<div class="mt-6 p-4 bg-gray-50 rounded-md">
<h4 class="text-sm font-medium text-gray-700 mb-3">当前DNS服务器</h4>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="text-gray-600">主DNS:</span>
<span class="font-mono text-gray-900">{{ domainDoc?.dns_host1 || '未设置' }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">辅DNS:</span>
<span class="font-mono text-gray-900">{{ domainDoc?.dns_host2 || '未设置' }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">DNS3:</span>
<span class="font-mono text-gray-900">{{ domainDoc?.dns_host3 || '未设置' }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">DNS4:</span>
<span class="font-mono text-gray-900">{{ domainDoc?.dns_host4 || '未设置' }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">DNS5:</span>
<span class="font-mono text-gray-900">{{ domainDoc?.dns_host5 || '未设置' }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">DNS6:</span>
<span class="font-mono text-gray-900">{{ domainDoc?.dns_host6 || '未设置' }}</span>
</div>
</div>
</div>
<div v-if="error" class="mt-4 p-3 bg-red-50 text-red-700 rounded-md text-sm">
{{ error }}
</div>
@ -140,11 +96,11 @@
</button>
<button
type="button"
class="px-4 py-2 bg-blue-600 border border-transparent rounded-md text-sm font-medium text-white hover:bg-blue-700 focus:outline-none disabled:bg-gray-300 disabled:cursor-not-allowed"
class="px-4 py-2 bg-black border border-transparent rounded-md text-sm font-medium text-white hover:bg-gray-800 focus:outline-none disabled:bg-gray-300 disabled:cursor-not-allowed"
@click="modifyDNSServer"
:disabled="isLoading || !isValid"
>
{{ isLoading ? '修改中...' : '确认修改' }}
{{ isLoading ? '修改中...' : '确' }}
</button>
</div>
</template>

View File

@ -2395,7 +2395,6 @@ def west_domain_modify_dns_server(**data):
# 异步更新本地域名记录的DNS服务器字段
try:
# 查找对应的Jsite Domain记录
domain_records = jingrow.get_all(
"Jsite Domain",
{"domain": domain},
@ -2403,7 +2402,6 @@ def west_domain_modify_dns_server(**data):
)
if domain_records:
# 如果找到记录异步更新DNS服务器
jingrow.enqueue_pg(
"Jsite Domain",
domain_records[0].name,
@ -2415,11 +2413,8 @@ def west_domain_modify_dns_server(**data):
dns5=dns5,
dns6=dns6
)
jingrow.log_error("DNS服务器异步更新", f"已为域名 {domain} 安排异步更新DNS服务器")
else:
jingrow.log_error("DNS服务器异步更新", f"未找到域名 {domain} 对应的Jsite Domain记录")
except Exception as e:
jingrow.log_error("DNS服务器异步更新失败", f"域名 {domain} 异步更新失败: {str(e)}")
jingrow.log_error(f"域名 {domain} DNS服务器更新失败", f"错误: {str(e)}")
# 返回成功结果
return {