diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index a02a700..45787d9 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -312,44 +312,106 @@ class WestDomain:
return self._make_request('/domain/?act=modifydns', 'POST', body_params=body_params)
def add_dns_record(self, domain: str, record_type: str,
- host: str, value: str, ttl: int = 600, level: int = 10) -> Dict[str, Any]:
+ host: str, value: str, ttl: int = 600, level: int = 10, line: str = "") -> Dict[str, Any]:
"""
添加DNS记录
Args:
domain: 域名
- record_type: 记录类型 (A, CNAME, MX, TXT等)
+ record_type: 记录类型 (A, CNAME, MX, TXT, AAAA, SRV)
host: 主机记录
value: 记录值
- ttl: TTL值
- level: 优先级(MX记录使用)
+ ttl: TTL值 (60~86400秒,默认900)
+ level: 优先级(MX记录使用,1-100,默认10)
+ line: 线路 (默认="", 电信="LTEL", 联通="LCNC", 移动="LMOB", 教育网="LEDU", 搜索引擎="LSEO")
"""
- record = {
- 'type': record_type,
+ body_params = {
+ 'act': 'adddnsrecord',
+ 'domain': domain,
'host': host,
+ 'type': record_type,
'value': value,
'ttl': ttl,
+ 'level': level,
+ 'line': line,
+ }
+ return self._make_request('/domain/', 'POST', body_params=body_params)
+
+ def modify_dns_record(self, domain: str, value: str, ttl: int = 600, level: int = 10,
+ record_id: Optional[str] = None, host: Optional[str] = None,
+ record_type: Optional[str] = None, line: str = "", old_value: Optional[str] = None) -> Dict[str, Any]:
+ """
+ 修改DNS记录
+
+ Args:
+ domain: 域名
+ value: 新的解析值
+ ttl: TTL值 (60~86400秒,默认900)
+ level: 优先级(MX记录使用,1-100,默认10)
+ record_id: 解析记录编号(优先使用)
+ host: 主机头(当record_id未提供时必填)
+ record_type: 解析类型(当record_id未提供时必填)
+ line: 线路 (默认="", 电信="LTEL", 联通="LCNC", 移动="LMOB", 教育网="LEDU", 搜索引擎="LSEO")
+ old_value: 旧解析值(可选,用于确定唯一记录)
+ """
+ body_params = {
+ 'act': 'moddnsrecord',
+ 'domain': domain,
+ 'value': value,
+ 'ttl': ttl,
+ 'level': level,
+ 'line': line,
}
- # 如果是MX记录,添加优先级
- if record_type == 'MX':
- record['level'] = level
-
- return self.modify_dns_records(domain, [record])
+ # 优先使用record_id
+ if record_id:
+ body_params['id'] = record_id
+ else:
+ # 必须提供host和type
+ if not host or not record_type:
+ return {"status": "error", "message": "当未提供记录ID时,主机头和解析类型为必填项"}
+ body_params['host'] = host
+ body_params['type'] = record_type
+
+ # 添加旧值(可选)
+ if old_value:
+ body_params['oldvalue'] = old_value
+
+ return self._make_request('/domain/', 'POST', body_params=body_params)
- def delete_dns_record(self, domain: str, record_id: str) -> Dict[str, Any]:
+ def delete_dns_record(self, domain: str, record_id: Optional[str] = None,
+ host: Optional[str] = None, record_type: Optional[str] = None,
+ value: Optional[str] = None, line: str = "") -> Dict[str, Any]:
"""
删除DNS记录
Args:
domain: 域名
- record_id: 记录ID
+ record_id: 解析记录ID(优先使用)
+ host: 主机头(当record_id未提供时必填)
+ record_type: 解析类型(当record_id未提供时必填)
+ value: 解析值(可选)
+ line: 线路 (默认="", 电信="LTEL", 联通="LCNC", 移动="LMOB", 教育网="LEDU", 搜索引擎="LSEO")
"""
body_params = {
+ 'act': 'deldnsrecord',
'domain': domain,
- 'record_id': record_id,
+ 'line': line,
}
- return self._make_request('/domain/?act=deletedns', 'POST', body_params=body_params)
+
+ # 优先使用record_id
+ if record_id:
+ body_params['id'] = record_id
+ else:
+ # 必须提供host和type
+ if not host or not record_type:
+ return {"status": "error", "message": "当未提供记录ID时,主机头和解析类型为必填项"}
+ body_params['host'] = host
+ body_params['type'] = record_type
+ if value:
+ body_params['value'] = value
+
+ return self._make_request('/domain/', 'POST', body_params=body_params)
def transfer_domain(self, domain: str, auth_code: str) -> Dict[str, Any]:
"""
@@ -822,7 +884,7 @@ def get_west_domain_dns_records(**data):
@jingrow.whitelist()
def west_domain_modify_dns(**data):
- """修改域名DNS记录"""
+ """修改域名DNS记录(批量修改,兼容旧版本)"""
client = get_west_client()
if not client:
return {"status": "error", "message": "API客户端初始化失败"}
@@ -835,23 +897,80 @@ def west_domain_modify_dns(**data):
if not records:
return {"status": "error", "message": "缺少DNS记录参数"}
- # 处理记录数据,确保MX记录有正确的优先级字段
- processed_records = []
+ # 逐个修改记录
+ results = []
for record in records:
- processed_record = {
- 'type': record.get('type'),
- 'host': record.get('host'),
- 'value': record.get('value'),
- 'ttl': record.get('ttl', 600)
- }
+ record_type = record.get('type')
+ host = record.get('host')
+ value = record.get('value')
+ ttl = record.get('ttl', 600)
+ level = record.get('level', 10)
+ line = record.get('line', '')
+ record_id = record.get('record_id')
+ old_value = record.get('old_value')
- # 如果是MX记录,添加优先级
- if record.get('type') == 'MX':
- processed_record['level'] = record.get('level', 10)
-
- processed_records.append(processed_record)
+ # 验证必要参数
+ if not value:
+ results.append({"status": "error", "message": "缺少解析值"})
+ continue
+
+ # 如果没有提供record_id,则必须提供host和record_type
+ if not record_id and (not host or not record_type):
+ results.append({"status": "error", "message": "当未提供记录ID时,主机头和解析类型为必填项"})
+ continue
+
+ # 验证TTL值
+ if ttl < 60 or ttl > 86400:
+ results.append({"status": "error", "message": "TTL值必须在60~86400秒之间"})
+ continue
+
+ # 验证优先级
+ if level < 1 or level > 100:
+ results.append({"status": "error", "message": "优先级必须在1~100之间"})
+ continue
+
+ # 验证记录类型
+ if record_type:
+ valid_types = ['A', 'CNAME', 'MX', 'TXT', 'AAAA', 'SRV']
+ if record_type not in valid_types:
+ results.append({"status": "error", "message": f"不支持的记录类型: {record_type}"})
+ continue
+
+ # 调用单个记录修改API
+ response = client.modify_dns_record(
+ domain, value, ttl, level, record_id, host, record_type, line, old_value
+ )
+
+ if response.get("status") == "error":
+ results.append(response)
+ elif response.get("result") != 200:
+ error_msg = response.get('msg', response.get('message', '未知错误'))
+ results.append({"status": "error", "message": f"修改DNS记录失败: {error_msg}"})
+ else:
+ results.append({
+ "status": "success",
+ "message": "DNS记录修改成功",
+ "data": {
+ "domain": domain,
+ "value": value,
+ "ttl": ttl,
+ "level": level,
+ "record_id": record_id,
+ "host": host,
+ "record_type": record_type,
+ "line": line
+ }
+ })
- return client.modify_dns_records(domain, processed_records)
+ # 返回批量操作结果
+ success_count = sum(1 for r in results if r.get("status") == "success")
+ error_count = len(results) - success_count
+
+ return {
+ "status": "success" if error_count == 0 else "partial_success",
+ "message": f"批量修改完成,成功: {success_count},失败: {error_count}",
+ "results": results
+ }
@jingrow.whitelist()
@@ -867,11 +986,54 @@ def west_domain_add_dns_record(**data):
value = data.get('value')
ttl = data.get('ttl', 600)
level = data.get('level', 10)
+ line = data.get('line', '')
if not all([domain, record_type, host, value]):
return {"status": "error", "message": "缺少必要参数"}
- return client.add_dns_record(domain, record_type, host, value, ttl, level)
+ # 验证记录类型
+ valid_types = ['A', 'CNAME', 'MX', 'TXT', 'AAAA', 'SRV']
+ if record_type not in valid_types:
+ return {"status": "error", "message": f"不支持的记录类型: {record_type},支持的类型: {', '.join(valid_types)}"}
+
+ # 验证TTL值
+ if ttl < 60 or ttl > 86400:
+ return {"status": "error", "message": "TTL值必须在60~86400秒之间"}
+
+ # 验证优先级
+ if level < 1 or level > 100:
+ return {"status": "error", "message": "优先级必须在1~100之间"}
+
+ response = client.add_dns_record(domain, record_type, host, value, ttl, level, line)
+
+ if response.get("status") == "error":
+ return response
+
+ try:
+ # 检查响应格式
+ if response.get("result") != 200:
+ error_msg = response.get('msg', response.get('message', '未知错误'))
+ return {"status": "error", "message": f"添加DNS记录失败: {error_msg}"}
+
+ # 返回成功结果
+ return {
+ "status": "success",
+ "message": "DNS记录添加成功",
+ "data": {
+ "id": response.get("data", {}).get("id"),
+ "domain": domain,
+ "host": host,
+ "type": record_type,
+ "value": value,
+ "ttl": ttl,
+ "level": level,
+ "line": line
+ }
+ }
+
+ except Exception as e:
+ jingrow.log_error("添加DNS记录响应解析失败", error=str(e))
+ return {"status": "error", "message": "添加DNS记录响应解析失败"}
@jingrow.whitelist()
@@ -883,13 +1045,52 @@ def west_domain_delete_dns_record(**data):
domain = data.get('domain')
record_id = data.get('record_id')
+ host = data.get('host')
+ record_type = data.get('record_type')
+ value = data.get('value')
+ line = data.get('line', '')
if not domain:
return {"status": "error", "message": "缺少域名参数"}
- if not record_id:
- return {"status": "error", "message": "缺少记录ID参数"}
- return client.delete_dns_record(domain, record_id)
+ # 如果没有提供record_id,则必须提供host和record_type
+ if not record_id and (not host or not record_type):
+ return {"status": "error", "message": "当未提供记录ID时,主机头和解析类型为必填项"}
+
+ # 验证记录类型
+ if record_type:
+ valid_types = ['A', 'CNAME', 'MX', 'TXT', 'AAAA', 'SRV']
+ if record_type not in valid_types:
+ return {"status": "error", "message": f"不支持的记录类型: {record_type},支持的类型: {', '.join(valid_types)}"}
+
+ response = client.delete_dns_record(domain, record_id, host, record_type, value, line)
+
+ if response.get("status") == "error":
+ return response
+
+ try:
+ # 检查响应格式
+ if response.get("result") != 200:
+ error_msg = response.get('msg', response.get('message', '未知错误'))
+ return {"status": "error", "message": f"删除DNS记录失败: {error_msg}"}
+
+ # 返回成功结果
+ return {
+ "status": "success",
+ "message": "DNS记录删除成功",
+ "data": {
+ "domain": domain,
+ "record_id": record_id,
+ "host": host,
+ "record_type": record_type,
+ "value": value,
+ "line": line
+ }
+ }
+
+ except Exception as e:
+ jingrow.log_error("删除DNS记录响应解析失败", error=str(e))
+ return {"status": "error", "message": "删除DNS记录响应解析失败"}
@jingrow.whitelist()
@@ -1955,3 +2156,146 @@ def west_upload_real_name_files(**data):
return {"status": "error", "message": "实名资料上传响应解析失败"}
+@jingrow.whitelist()
+def west_domain_modify_dns_record(**data):
+ """修改DNS记录"""
+ client = get_west_client()
+ if not client:
+ return {"status": "error", "message": "API客户端初始化失败"}
+
+ domain = data.get('domain')
+ value = data.get('value')
+ ttl = data.get('ttl', 600)
+ level = data.get('level', 10)
+ record_id = data.get('record_id')
+ host = data.get('host')
+ record_type = data.get('record_type')
+ line = data.get('line', '')
+ old_value = data.get('old_value')
+
+ if not domain:
+ return {"status": "error", "message": "缺少域名参数"}
+ if not value:
+ return {"status": "error", "message": "缺少新的解析值"}
+
+ # 验证TTL值
+ if ttl < 60 or ttl > 86400:
+ return {"status": "error", "message": "TTL值必须在60~86400秒之间"}
+
+ # 验证优先级
+ if level < 1 or level > 100:
+ return {"status": "error", "message": "优先级必须在1~100之间"}
+
+ # 如果没有提供record_id,则必须提供host和record_type
+ if not record_id and (not host or not record_type):
+ return {"status": "error", "message": "当未提供记录ID时,主机头和解析类型为必填项"}
+
+ # 验证记录类型
+ if record_type:
+ valid_types = ['A', 'CNAME', 'MX', 'TXT', 'AAAA', 'SRV']
+ if record_type not in valid_types:
+ return {"status": "error", "message": f"不支持的记录类型: {record_type},支持的类型: {', '.join(valid_types)}"}
+
+ response = client.modify_dns_record(
+ domain, value, ttl, level, record_id, host, record_type, line, old_value
+ )
+
+ if response.get("status") == "error":
+ return response
+
+ try:
+ # 检查响应格式
+ if response.get("result") != 200:
+ error_msg = response.get('msg', response.get('message', '未知错误'))
+ return {"status": "error", "message": f"修改DNS记录失败: {error_msg}"}
+
+ # 返回成功结果
+ return {
+ "status": "success",
+ "message": "DNS记录修改成功",
+ "data": {
+ "domain": domain,
+ "value": value,
+ "ttl": ttl,
+ "level": level,
+ "record_id": record_id,
+ "host": host,
+ "record_type": record_type,
+ "line": line
+ }
+ }
+
+ except Exception as e:
+ jingrow.log_error("修改DNS记录响应解析失败", error=str(e))
+ return {"status": "error", "message": "修改DNS记录响应解析失败"}
+
+
+@jingrow.whitelist()
+def test_dns_record_management():
+ """测试DNS记录管理功能"""
+ try:
+ # 测试参数
+ test_domain = "test.com"
+ test_host = "www"
+ test_value = "127.0.0.1"
+ test_record_type = "A"
+
+ client = get_west_client()
+ if not client:
+ return {"status": "error", "message": "API客户端初始化失败"}
+
+ # 测试1: 添加DNS记录
+ jingrow.log_error("DNS测试", "开始测试添加DNS记录")
+ add_result = client.add_dns_record(
+ domain=test_domain,
+ record_type=test_record_type,
+ host=test_host,
+ value=test_value,
+ ttl=900,
+ level=10,
+ line=""
+ )
+ jingrow.log_error("DNS测试", f"添加DNS记录结果: {add_result}")
+
+ # 测试2: 获取DNS记录列表
+ jingrow.log_error("DNS测试", "开始测试获取DNS记录列表")
+ list_result = client.get_dns_records_paginated(test_domain, 20, 1)
+ jingrow.log_error("DNS测试", f"获取DNS记录列表结果: {list_result}")
+
+ # 测试3: 修改DNS记录(如果添加成功)
+ if add_result.get("result") == 200:
+ record_id = add_result.get("data", {}).get("id")
+ if record_id:
+ jingrow.log_error("DNS测试", f"开始测试修改DNS记录,记录ID: {record_id}")
+ modify_result = client.modify_dns_record(
+ domain=test_domain,
+ value="127.0.0.2",
+ ttl=600,
+ level=10,
+ record_id=record_id,
+ line=""
+ )
+ jingrow.log_error("DNS测试", f"修改DNS记录结果: {modify_result}")
+
+ # 测试4: 删除DNS记录
+ jingrow.log_error("DNS测试", "开始测试删除DNS记录")
+ delete_result = client.delete_dns_record(
+ domain=test_domain,
+ record_id=record_id
+ )
+ jingrow.log_error("DNS测试", f"删除DNS记录结果: {delete_result}")
+
+ return {
+ "status": "success",
+ "message": "DNS记录管理功能测试完成",
+ "data": {
+ "add_result": add_result,
+ "list_result": list_result
+ }
+ }
+
+ except Exception as e:
+ jingrow.log_error("DNS测试异常", str(e))
+ return {"status": "error", "message": f"DNS记录管理功能测试失败: {str(e)}"}
+
+
--
2.48.1
From ec5dd732ddae54eb932e6ba4c345ad6ec76eece7 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Sun, 3 Aug 2025 20:35:16 +0800
Subject: [PATCH 116/250] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9F=9F=E5=90=8D?=
=?UTF-8?q?=E8=A7=A3=E6=9E=90=E8=AE=B0=E5=BD=95=E7=BB=84=E4=BB=B6=E5=86=97?=
=?UTF-8?q?=E4=BD=99=E7=9A=84=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dashboard/src2/components/JsiteDomainDNSRecords.vue | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index e84a833..6dfca71 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -86,8 +86,8 @@
|
-
- {{ record.item || record.host || '@' }}
+ |
+ {{ record.item }}
|
默认
|
-
+ |
{{ record.value }}
|
@@ -330,7 +330,7 @@ export default {
deleteRecord(record) {
confirmDialog({
title: '删除DNS记录',
- message: `确定要删除这条DNS记录吗?\n类型: ${record.type}\n主机记录: ${record.item || record.host || '@'}\n记录值: ${record.value}`,
+ message: `确定要删除这条DNS记录吗?\n类型: ${record.type}\n主机记录: ${record.item}\n记录值: ${record.value}`,
primaryAction: {
label: '删除',
variant: 'danger',
--
2.48.1
From 3e36095b83714bb61681b6da9e0f00e900fe3c2b Mon Sep 17 00:00:00 2001
From: jingrow
Date: Sun, 3 Aug 2025 21:00:09 +0800
Subject: [PATCH 117/250] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4=E5=9F=9F=E5=90=8D=E8=A7=A3?=
=?UTF-8?q?=E6=9E=90=E8=AE=B0=E5=BD=95=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainDNSRecords.vue | 351 ++++++++++++++----
1 file changed, 282 insertions(+), 69 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index 6dfca71..24cb479 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -3,7 +3,7 @@
- 域名解析记录
+ DNS解析记录
管理域名的DNS解析记录
@@ -17,12 +17,12 @@
刷新
@@ -47,7 +47,7 @@
-
+
@@ -56,16 +56,19 @@
|
- 主机名
+ 编号
|
- 类型
+ 主机名 *
|
- 线路类型
+ 类型 *
|
- 对应值
+ 线路
+ |
+
+ 对应值 *
|
TTL
@@ -77,43 +80,125 @@
状态
|
- 操作
+ ⚙️
|
-
+
+
|
|
-
- {{ record.item }}
+ |
+ {{ index + 1 }}
|
-
- {{ record.type || '未知' }}
-
+
+
+
+
+
+ {{ record.item || '-' }}
+
|
-
- 默认
+ |
+
+
+
+
+
+
+ {{ record.type || '未知' }}
+
+
|
-
- {{ record.value }}
+ |
+
+
+
+
+
+ {{ getLineDisplayName(record.line) }}
+
|
-
- {{ record.ttl || '600' }}
+ |
+
+
+
+
+
+ {{ record.value || '-' }}
+
|
-
- {{ record.type === 'MX' && record.level ? record.level : '-' }}
+ |
+
+
+
+
+
+ {{ record.ttl || '600' }}
+
+ |
+
+
+
+
+
+
+ {{ record.type === 'MX' && record.level ? record.level : '-' }}
+
|
@@ -123,12 +208,40 @@
|
+
+
+
|
@@ -187,12 +300,12 @@
-
+
暂无DNS记录
开始添加您的第一个DNS解析记录
-
@@ -75,7 +75,7 @@
--
2.48.1
From 24b2e99019643d29bee71c5d93f229be2b2814dd Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 16:18:41 +0800
Subject: [PATCH 125/250] =?UTF-8?q?=E4=BF=AE=E6=94=B9DNS=E6=9C=8D=E5=8A=A1?=
=?UTF-8?q?=E5=99=A8=E6=97=B6=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF=E6=A3=80?=
=?UTF-8?q?=E6=9F=A5=E5=8F=8A=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../JsiteDomainModifyDNSServerDialog.vue | 136 +++++++++++++-----
1 file changed, 98 insertions(+), 38 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainModifyDNSServerDialog.vue b/dashboard/src2/components/JsiteDomainModifyDNSServerDialog.vue
index 601f3a8..b5d75f8 100644
--- a/dashboard/src2/components/JsiteDomainModifyDNSServerDialog.vue
+++ b/dashboard/src2/components/JsiteDomainModifyDNSServerDialog.vue
@@ -13,6 +13,7 @@
type="text"
class="w-full px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
:class="{ 'border-red-300': errors.dns1 }"
+ @blur="validateDNSField('dns1', '主DNS服务器')"
/>
{{ errors.dns1 }}
@@ -27,6 +28,7 @@
type="text"
class="w-full px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
:class="{ 'border-red-300': errors.dns2 }"
+ @blur="validateDNSField('dns2', '辅DNS服务器')"
/>
{{ errors.dns2 }}
@@ -40,7 +42,10 @@
v-model="dnsServers.dns3"
type="text"
class="w-full px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
+ :class="{ 'border-red-300': errors.dns3 }"
+ @blur="validateDNSField('dns3', '第三个DNS服务器')"
/>
+ {{ errors.dns3 }}
@@ -52,7 +57,10 @@
v-model="dnsServers.dns4"
type="text"
class="w-full px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
+ :class="{ 'border-red-300': errors.dns4 }"
+ @blur="validateDNSField('dns4', '第四个DNS服务器')"
/>
+ {{ errors.dns4 }}
@@ -64,7 +72,10 @@
v-model="dnsServers.dns5"
type="text"
class="w-full px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
+ :class="{ 'border-red-300': errors.dns5 }"
+ @blur="validateDNSField('dns5', '第五个DNS服务器')"
/>
+ {{ errors.dns5 }}
@@ -76,7 +87,10 @@
v-model="dnsServers.dns6"
type="text"
class="w-full px-3 py-1.5 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
+ :class="{ 'border-red-300': errors.dns6 }"
+ @blur="validateDNSField('dns6', '第六个DNS服务器')"
/>
+ {{ errors.dns6 }}
@@ -154,40 +168,14 @@ export default {
return Object.keys(this.errors).length > 0;
}
},
+
resources: {
modifyDNSServer() {
return {
url: 'jcloud.api.domain_west.west_domain_modify_dns_server',
validate() {
- this.errors = {};
-
- if (!this.dnsServers.dns1) {
- this.errors.dns1 = '主DNS服务器不能为空';
- } else if (!this.isValidDNSFormat(this.dnsServers.dns1)) {
- this.errors.dns1 = '主DNS服务器格式不正确';
- }
-
- if (!this.dnsServers.dns2) {
- this.errors.dns2 = '辅DNS服务器不能为空';
- } else if (!this.isValidDNSFormat(this.dnsServers.dns2)) {
- this.errors.dns2 = '辅DNS服务器格式不正确';
- }
-
- // 验证可选的DNS服务器格式
- if (this.dnsServers.dns3 && !this.isValidDNSFormat(this.dnsServers.dns3)) {
- this.errors.dns3 = '第三个DNS服务器格式不正确';
- }
- if (this.dnsServers.dns4 && !this.isValidDNSFormat(this.dnsServers.dns4)) {
- this.errors.dns4 = '第四个DNS服务器格式不正确';
- }
- if (this.dnsServers.dns5 && !this.isValidDNSFormat(this.dnsServers.dns5)) {
- this.errors.dns5 = '第五个DNS服务器格式不正确';
- }
- if (this.dnsServers.dns6 && !this.isValidDNSFormat(this.dnsServers.dns6)) {
- this.errors.dns6 = '第六个DNS服务器格式不正确';
- }
-
- if (Object.keys(this.errors).length > 0) {
+ // 实时验证已经完成,这里只需要检查是否有错误
+ if (this.hasErrors) {
throw new DashboardError('请检查DNS服务器格式');
}
},
@@ -219,20 +207,92 @@ export default {
this.error = null;
this.$resources.modifyDNSServer.submit({
domain: this.domainDoc?.domain,
- dns1: this.dnsServers.dns1,
- dns2: this.dnsServers.dns2,
- dns3: this.dnsServers.dns3 || undefined,
- dns4: this.dnsServers.dns4 || undefined,
- dns5: this.dnsServers.dns5 || undefined,
- dns6: this.dnsServers.dns6 || undefined
+ dns1: this.dnsServers.dns1?.trim() || '',
+ dns2: this.dnsServers.dns2?.trim() || '',
+ dns3: this.dnsServers.dns3?.trim() || undefined,
+ dns4: this.dnsServers.dns4?.trim() || undefined,
+ dns5: this.dnsServers.dns5?.trim() || undefined,
+ dns6: this.dnsServers.dns6?.trim() || undefined
});
},
+ validateDNSField(fieldName, fieldLabel) {
+ const value = this.dnsServers[fieldName];
+
+ // 清除该字段的错误
+ if (this.errors[fieldName]) {
+ delete this.errors[fieldName];
+ }
+
+ // 如果是必填字段且为空,不显示错误(让用户继续输入)
+ if ((fieldName === 'dns1' || fieldName === 'dns2') && !value) {
+ return;
+ }
+
+ // 检查是否有首尾空格
+ if (value && (value !== value.trim())) {
+ this.errors[fieldName] = `${fieldLabel}不能包含首尾空格`;
+ return;
+ }
+
+ // 如果字段有值但格式不正确,显示错误
+ if (value && !this.isValidDNSFormat(value)) {
+ this.errors[fieldName] = `${fieldLabel}格式不正确`;
+ }
+ },
isValidDNSFormat(dns) {
if (!dns) return false;
- // 简单的DNS格式验证
- const dnsRegex = /^[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)*$/;
- return dnsRegex.test(dns) && dns.length >= 3 && dns.length <= 253;
+ // 检查长度
+ if (dns.length < 3 || dns.length > 253) {
+ return false;
+ }
+
+ // 检查是否包含至少一个点号(域名必须有点号分隔)
+ if (!dns.includes('.')) {
+ return false;
+ }
+
+ // 检查是否以点号开头或结尾
+ if (dns.startsWith('.') || dns.endsWith('.')) {
+ return false;
+ }
+
+ // 检查是否包含连续的点号
+ if (dns.includes('..')) {
+ return false;
+ }
+
+ // 分割域名部分进行详细验证
+ const parts = dns.split('.');
+
+ for (let part of parts) {
+ // 每个部分不能为空
+ if (!part) {
+ return false;
+ }
+
+ // 每个部分长度不能超过63个字符
+ if (part.length > 63) {
+ return false;
+ }
+
+ // 每个部分不能以连字符开头或结尾
+ if (part.startsWith('-') || part.endsWith('-')) {
+ return false;
+ }
+
+ // 每个部分只能包含字母、数字和连字符
+ if (!/^[a-zA-Z0-9-]+$/.test(part)) {
+ return false;
+ }
+
+ // 顶级域名(最后一部分)不能全是数字
+ if (parts.indexOf(part) === parts.length - 1 && /^\d+$/.test(part)) {
+ return false;
+ }
+ }
+
+ return true;
}
}
};
--
2.48.1
From 41412190efccce25c85a1c117222caf847ddcf36 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 20:46:18 +0800
Subject: [PATCH 126/250] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=B9=E9=87=8F?=
=?UTF-8?q?=E5=88=A0=E9=99=A4DNS=E8=AE=B0=E5=BD=95=E7=9A=84api=E7=AB=AF?=
=?UTF-8?q?=E7=82=B9=E5=8F=8A=E5=AE=9E=E7=8E=B0=E5=89=8D=E7=AB=AF=E6=89=B9?=
=?UTF-8?q?=E9=87=8F=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD=E5=B9=B6=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95=E9=80=9A=E8=BF=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainDNSRecords.vue | 218 +++++++++++++++---
jcloud/api/domain_west.py | 89 ++++++-
2 files changed, 268 insertions(+), 39 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index 24cb479..f4cfcb8 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -16,6 +16,16 @@
刷新
+
+
+ 删除选中 ({{ selectedRecords.length }})
+
|
-
+
|
编号
@@ -88,7 +104,13 @@
|
|
-
+
|
{{ index + 1 }}
@@ -250,26 +272,8 @@
|
-
-
-
-
- 已选 0 条
-
- 批量暂停
- 批量启用
- 批量修改
- 批量删除
-
-
-
- 导出解析记录
- 导入解析记录
-
-
-
-
+
显示第 {{ (pagination.pageno - 1) * pagination.limit + 1 }} -
{{ Math.min(pagination.pageno * pagination.limit, pagination.total) }} 条,
@@ -281,19 +285,34 @@
:disabled="pagination.pageno <= 1"
variant="outline"
size="sm"
+ class="px-3"
>
- 上一页
+ ←
-
- {{ pagination.pageno }} / {{ pagination.pagecount }}
-
+
+
+ {{ page }}
+
+
- 下一页
+ →
@@ -338,10 +357,11 @@ export default {
dnsRecords: [],
pagination: {
pageno: 1,
- limit: 20,
+ limit: 5,
total: 0,
pagecount: 0
- }
+ },
+ selectedRecords: [] // 用于存储选中的记录ID
};
},
methods: {
@@ -553,8 +573,9 @@ export default {
title: '删除DNS记录',
message: `确定要删除这条DNS记录吗?\n类型: ${record.type}\n主机记录: ${record.item}\n记录值: ${record.value}`,
primaryAction: {
- label: '删除',
- variant: 'danger',
+ label: '确定',
+ variant: 'solid',
+ class: 'bg-black text-white hover:bg-gray-800',
onClick: ({ hide }) => {
this.performDeleteRecord(record, hide);
}
@@ -589,11 +610,148 @@ export default {
toast.error('删除DNS记录失败');
console.error('删除DNS记录失败:', error);
}
+ },
+
+ // 批量删除记录
+ async batchDeleteRecords() {
+ if (this.selectedRecords.length === 0) {
+ toast.info('请选择要删除的记录');
+ return;
+ }
+
+ confirmDialog({
+ title: '批量删除DNS记录',
+ message: `确定要删除选中的 ${this.selectedRecords.length} 条DNS记录吗?`,
+ primaryAction: {
+ label: '确定',
+ variant: 'solid',
+ class: 'bg-black text-white hover:bg-gray-800',
+ onClick: ({ hide }) => {
+ this.performBatchDeleteRecords(this.selectedRecords, hide);
+ }
+ }
+ });
+ },
+
+ // 执行批量删除记录
+ async performBatchDeleteRecords(recordIds, hide) {
+ // 过滤出有效的记录ID
+ const validRecordIds = recordIds
+ .filter(id => id)
+ .map(id => String(id))
+ .filter(id => !id.startsWith('temp-'));
+
+ if (validRecordIds.length === 0) {
+ toast.error('没有有效的记录可以删除');
+ return;
+ }
+
+ try {
+ const request = createResource({
+ url: 'jcloud.api.domain_west.west_domain_delete_dns_records',
+ params: {
+ domain: this.$domain.pg.domain,
+ record_ids: validRecordIds
+ },
+ onSuccess: (response) => {
+ if (response.status === 'success') {
+ toast.success(response.message || `批量删除 ${validRecordIds.length} 条DNS记录成功`);
+ hide();
+ this.loadDNSRecords();
+ this.selectedRecords = []; // 清空选中
+ } else if (response.status === 'partial_success') {
+ toast.success(response.message || '批量删除部分成功');
+ hide();
+ this.loadDNSRecords();
+ this.selectedRecords = []; // 清空选中
+ } else {
+ toast.error(response.message || '批量删除DNS记录失败');
+ }
+ },
+ onError: (error) => {
+ toast.error(getToastErrorMessage(error));
+ }
+ });
+ request.submit();
+ } catch (error) {
+ toast.error('批量删除DNS记录失败');
+ console.error('批量删除DNS记录失败:', error);
+ }
+ },
+
+ // 切换记录选中状态
+ toggleRecordSelection(recordId) {
+ // 只允许选择有效的记录ID(排除新增记录和空ID)
+ if (!recordId) {
+ return;
+ }
+
+ // 确保recordId是字符串类型
+ const recordIdStr = String(recordId);
+ if (recordIdStr.startsWith('temp-')) {
+ return;
+ }
+
+ const index = this.selectedRecords.indexOf(recordIdStr);
+ if (index > -1) {
+ this.selectedRecords.splice(index, 1);
+ } else {
+ this.selectedRecords.push(recordIdStr);
+ }
+ },
+
+ // 全选/取消全选
+ toggleSelectAll(event) {
+ const checkbox = event.target;
+ if (checkbox.checked) {
+ // 只选择有真实ID的记录(排除新增的记录)
+ this.selectedRecords = this.dnsRecords
+ .filter(record => record.id && !record.isNew)
+ .map(record => String(record.id));
+ } else {
+ this.selectedRecords = [];
+ }
+ },
+
+
+
+ // 获取可见的页码
+ getVisiblePages() {
+ const current = this.pagination.pageno;
+ const total = this.pagination.pagecount;
+ const pages = [];
+
+ // 如果总页数小于等于5,显示所有页码
+ if (total <= 5) {
+ for (let i = 1; i <= total; i++) {
+ pages.push(i);
+ }
+ } else {
+ // 显示当前页附近的页码
+ const start = Math.max(1, current - 2);
+ const end = Math.min(total, current + 2);
+
+ for (let i = start; i <= end; i++) {
+ pages.push(i);
+ }
+ }
+
+ return pages;
}
},
computed: {
$domain() {
return getCachedDocumentResource('Jsite Domain', this.domain);
+ },
+
+ // 判断是否全选
+ isAllSelected() {
+ return this.dnsRecords.length > 0 && this.selectedRecords.length === this.dnsRecords.length;
+ },
+
+ // 判断是否半选
+ isIndeterminate() {
+ return this.selectedRecords.length > 0 && this.selectedRecords.length < this.dnsRecords.length;
}
},
mounted() {
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index b7efc5d..a5257a4 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -1097,21 +1097,92 @@ def west_domain_delete_dns_record(**data):
# 返回成功结果
return {
"status": "success",
- "message": "DNS记录删除成功",
- "data": {
- "domain": domain,
- "record_id": record_id,
- "host": host,
- "record_type": record_type,
- "value": value,
- "line": line
- }
+ "message": "DNS记录删除成功"
}
except Exception as e:
return {"status": "error", "message": "删除DNS记录响应解析失败"}
+@jingrow.whitelist()
+def west_domain_delete_dns_records(**data):
+ """批量删除DNS记录"""
+ client = get_west_client()
+ if not client:
+ return {"status": "error", "message": "API客户端初始化失败"}
+
+ domain = data.get('domain')
+ record_ids = data.get('record_ids')
+
+ if not domain:
+ return {"status": "error", "message": "缺少域名参数"}
+
+ if not record_ids:
+ return {"status": "error", "message": "缺少记录ID列表"}
+
+ # 处理record_ids参数,支持字符串和列表格式
+ if isinstance(record_ids, str):
+ # 如果是逗号分隔的字符串,转换为列表
+ record_ids = [rid.strip() for rid in record_ids.split(',') if rid.strip()]
+ elif not isinstance(record_ids, list):
+ return {"status": "error", "message": "记录ID列表格式错误"}
+
+ if not record_ids:
+ return {"status": "error", "message": "记录ID列表不能为空"}
+
+ # 验证记录ID格式
+ for record_id in record_ids:
+ if not record_id or not isinstance(record_id, str):
+ return {"status": "error", "message": "记录ID格式错误"}
+
+ # 批量删除逻辑
+ results = []
+ success_count = 0
+ error_count = 0
+
+ for record_id in record_ids:
+ try:
+ result = client.delete_dns_record(domain, record_id)
+ if result.get("status") == "error" or result.get("result") != 200:
+ error_count += 1
+ error_msg = result.get('msg', result.get('message', '删除失败'))
+ results.append({
+ "record_id": record_id,
+ "status": "error",
+ "message": error_msg
+ })
+ else:
+ success_count += 1
+ results.append({
+ "record_id": record_id,
+ "status": "success"
+ })
+ except Exception as e:
+ error_count += 1
+ results.append({
+ "record_id": record_id,
+ "status": "error",
+ "message": str(e)
+ })
+
+ # 返回批量删除结果
+ if error_count == 0:
+ return {
+ "status": "success",
+ "message": f"批量删除成功,共删除 {success_count} 条记录"
+ }
+ elif success_count == 0:
+ return {
+ "status": "error",
+ "message": f"批量删除失败,共 {error_count} 条记录删除失败"
+ }
+ else:
+ return {
+ "status": "partial_success",
+ "message": f"批量删除部分成功,成功 {success_count} 条,失败 {error_count} 条"
+ }
+
+
@jingrow.whitelist()
def west_domain_transfer(**data):
"""域名转入"""
--
2.48.1
From 88e84917208e69dac4c8f2ce250bc50121135cee Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 20:53:51 +0800
Subject: [PATCH 127/250] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9F=9F=E5=90=8D?=
=?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=88=97=E8=A1=A8=E9=A1=B5=E6=8E=92=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainDNSRecords.vue | 29 ++++++++++++++-----
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index f4cfcb8..5f98d6a 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -3,8 +3,6 @@
@@ -357,7 +355,7 @@ export default {
dnsRecords: [],
pagination: {
pageno: 1,
- limit: 5,
+ limit: 10,
total: 0,
pagecount: 0
},
@@ -387,11 +385,15 @@ export default {
this.loading = false;
if (response.status === 'success' && response.data) {
// 为每个记录添加编辑状态
- this.dnsRecords = (response.data.items || []).map(record => ({
+ const records = (response.data.items || []).map(record => ({
...record,
editing: false,
isNew: false
}));
+
+ // 按类型排序
+ this.dnsRecords = this.sortRecordsByType(records);
+
this.pagination = {
pageno: response.data.pageno || 1,
limit: response.data.limit || 20,
@@ -456,7 +458,7 @@ export default {
// 添加新行
addNewRow() {
- this.dnsRecords.push({
+ const newRecord = {
id: null, // 新增记录没有ID
item: '',
type: 'A',
@@ -466,7 +468,11 @@ export default {
level: 10,
editing: true, // 新增记录直接进入编辑模式
isNew: true
- });
+ };
+
+ // 添加新记录并重新排序
+ this.dnsRecords.push(newRecord);
+ this.dnsRecords = this.sortRecordsByType(this.dnsRecords);
},
// 编辑记录
@@ -715,6 +721,15 @@ export default {
+ // 按类型排序DNS记录
+ sortRecordsByType(records) {
+ return records.sort((a, b) => {
+ const typeA = a.type || '';
+ const typeB = b.type || '';
+ return typeA.localeCompare(typeB);
+ });
+ },
+
// 获取可见的页码
getVisiblePages() {
const current = this.pagination.pageno;
--
2.48.1
From c53f4bf4219d20658f04f4c620c01340dd9fa03f Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 21:14:33 +0800
Subject: [PATCH 128/250] =?UTF-8?q?=E5=9F=9F=E5=90=8D=E8=A7=A3=E6=9E=90?=
=?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E5=AE=9E=E7=8E=B0=E5=90=8E?=
=?UTF-8?q?=E7=AB=AF=E9=80=9A=E8=BF=87=E8=AE=B0=E5=BD=95=E7=B1=BB=E5=9E=8B?=
=?UTF-8?q?=E6=8E=92=E7=89=88=E5=B9=B6=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?=
=?UTF-8?q?=E6=8C=89=E7=B1=BB=E5=9E=8B=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainDNSRecords.vue | 17 ++----------
jcloud/api/domain_west.py | 26 ++++++++++++++-----
2 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index 5f98d6a..94046b6 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -385,15 +385,12 @@ export default {
this.loading = false;
if (response.status === 'success' && response.data) {
// 为每个记录添加编辑状态
- const records = (response.data.items || []).map(record => ({
+ this.dnsRecords = (response.data.items || []).map(record => ({
...record,
editing: false,
isNew: false
}));
- // 按类型排序
- this.dnsRecords = this.sortRecordsByType(records);
-
this.pagination = {
pageno: response.data.pageno || 1,
limit: response.data.limit || 20,
@@ -470,9 +467,8 @@ export default {
isNew: true
};
- // 添加新记录并重新排序
+ // 添加新记录
this.dnsRecords.push(newRecord);
- this.dnsRecords = this.sortRecordsByType(this.dnsRecords);
},
// 编辑记录
@@ -721,15 +717,6 @@ export default {
- // 按类型排序DNS记录
- sortRecordsByType(records) {
- return records.sort((a, b) => {
- const typeA = a.type || '';
- const typeB = b.type || '';
- return typeA.localeCompare(typeB);
- });
- },
-
// 获取可见的页码
getVisiblePages() {
const current = this.pagination.pageno;
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index a5257a4..7a98389 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -875,7 +875,8 @@ def get_west_domain_dns_records(**data):
if not domain:
return {"status": "error", "message": "缺少域名参数"}
- response = client.get_dns_records_paginated(domain, limit, pageno)
+ # 获取所有记录(不分页)
+ response = client.get_dns_records_paginated(domain, 1000, 1) # 获取足够多的记录
if response.get("status") == "error":
return response
@@ -886,16 +887,29 @@ def get_west_domain_dns_records(**data):
return {"status": "error", "message": "API查询失败"}
data = response.get("data", {})
+ all_items = data.get("items", [])
+
+ # 对所有记录按类型排序
+ sorted_items = sorted(all_items, key=lambda x: x.get('type', ''))
+
+ # 计算分页
+ total = len(sorted_items)
+ pagecount = (total + limit - 1) // limit
+ start_index = (pageno - 1) * limit
+ end_index = start_index + limit
+
+ # 返回当前页的记录
+ current_page_items = sorted_items[start_index:end_index]
# 返回格式化的解析记录信息
return {
"status": "success",
"data": {
- "pageno": data.get("pageno", 1),
- "limit": data.get("limit", 20),
- "total": data.get("total", 0),
- "pagecount": data.get("pagecount", 0),
- "items": data.get("items", [])
+ "pageno": pageno,
+ "limit": limit,
+ "total": total,
+ "pagecount": pagecount,
+ "items": current_page_items
}
}
--
2.48.1
From 7b2a949dba205c4517622b3f9eb8bf0294019a8a Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 21:22:55 +0800
Subject: [PATCH 129/250] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9A=84=E5=9F=9F?=
=?UTF-8?q?=E5=90=8D=E8=A7=A3=E6=9E=90=E8=AE=B0=E5=BD=95=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E5=9C=A8=E6=9C=80=E5=89=8D=E9=9D=A2=E4=B8=94=E4=B8=8D=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E5=BA=8F=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dashboard/src2/components/JsiteDomainDNSRecords.vue | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index 94046b6..fe61ee6 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -111,7 +111,7 @@
/>
|
- {{ index + 1 }}
+ {{ record.isNew ? '-' : index + 1 }}
|
@@ -467,8 +467,8 @@ export default {
isNew: true
};
- // 添加新记录
- this.dnsRecords.push(newRecord);
+ // 添加新记录到最前面
+ this.dnsRecords.unshift(newRecord);
},
// 编辑记录
--
2.48.1
From 52818a5162f6f82f1070a76260eed7e242c4d577 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 21:25:54 +0800
Subject: [PATCH 130/250] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E5=9F=9F=E5=90=8D=E8=A7=A3=E6=9E=90=E8=AE=B0=E5=BD=95=E7=9A=84?=
=?UTF-8?q?=E4=B8=BB=E6=9C=BA=E5=90=8D=E5=92=8C=E7=B1=BB=E5=9E=8B=E6=97=B6?=
=?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dashboard/src2/components/JsiteDomainDNSRecords.vue | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index fe61ee6..75c7968 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -519,6 +519,8 @@ export default {
params = {
domain: this.$domain.pg.domain,
record_id: record.id,
+ record_type: record.type,
+ host: record.item,
value: record.value,
ttl: record.ttl,
level: record.level,
--
2.48.1
From 29ca4bab25cb55513098e641d64810a9081df6a5 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 22:19:04 +0800
Subject: [PATCH 131/250] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E5=9F=9F=E5=90=8D=E8=A7=A3=E6=9E=90=E8=AE=B0=E5=BD=95=E6=97=B6?=
=?UTF-8?q?=E7=BC=96=E5=8F=B7=E9=94=99=E4=B9=B1=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dashboard/src2/components/JsiteDomainDNSRecords.vue | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index 75c7968..74ecff5 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -94,7 +94,7 @@
状态
|
- ⚙️
+ 操作
|
@@ -111,7 +111,7 @@
/>
|
- {{ record.isNew ? '-' : index + 1 }}
+ {{ record.isNew ? '-' : (dnsRecords.filter(r => !r.isNew).findIndex(r => r.id === record.id) + 1) }}
|
@@ -234,7 +234,7 @@
size="sm"
class="text-blue-600 hover:text-blue-700"
>
- ✏️
+ 编辑
Date: Mon, 4 Aug 2025 22:39:23 +0800
Subject: [PATCH 132/250] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9F=9F=E5=90=8D?=
=?UTF-8?q?=E8=A7=A3=E6=9E=90=E8=AE=B0=E5=BD=95=E6=97=B6=E4=B8=BB=E6=9C=BA?=
=?UTF-8?q?=E5=90=8D=E5=92=8C=E7=B1=BB=E5=9E=8B=E8=AE=BE=E7=BD=AE=E4=B8=BA?=
=?UTF-8?q?=E7=A6=81=E6=AD=A2=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dashboard/src2/components/JsiteDomainDNSRecords.vue | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index 74ecff5..bbfa697 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -120,7 +120,9 @@
v-model="record.item"
type="text"
class="w-24 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 }"
placeholder="主机名"
+ :disabled="!record.isNew"
/>
@@ -133,6 +135,8 @@
@@ -153,6 +154,7 @@
'bg-blue-100 text-blue-800': record.type === 'AAAA',
'bg-yellow-100 text-yellow-800': record.type === 'CNAME',
'bg-purple-100 text-purple-800': record.type === 'MX',
+ 'bg-indigo-100 text-indigo-800': record.type === 'NS',
'bg-gray-100 text-gray-800': record.type === 'TXT',
'bg-orange-100 text-orange-800': record.type === 'SRV',
'bg-gray-100 text-gray-800': !record.type
@@ -439,8 +441,9 @@ export default {
'AAAA': 'info',
'CNAME': 'warning',
'MX': 'primary',
+ 'NS': 'info',
'TXT': 'secondary',
- 'NS': 'default'
+ 'SRV': 'warning'
};
return variantMap[type] || 'default';
},
@@ -519,13 +522,11 @@ export default {
line: record.line
};
} else {
- // 修改记录
+ // 修改记录 - 只传递可修改的字段
url = 'jcloud.api.domain_west.west_domain_modify_dns_record';
params = {
domain: this.$domain.pg.domain,
record_id: record.id,
- record_type: record.type,
- host: record.item,
value: record.value,
ttl: record.ttl,
level: record.level,
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index 7a98389..e492af6 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -315,7 +315,7 @@ class WestDomain:
Args:
domain: 域名
- record_type: 记录类型 (A, CNAME, MX, TXT, AAAA, SRV)
+ record_type: 记录类型 (A, AAAA, CNAME, MX, NS, TXT, SRV)
host: 主机记录
value: 记录值
ttl: TTL值 (60~86400秒,默认900)
@@ -966,7 +966,7 @@ def west_domain_modify_dns(**data):
# 验证记录类型
if record_type:
- valid_types = ['A', 'CNAME', 'MX', 'TXT', 'AAAA', 'SRV']
+ valid_types = ['A', 'AAAA', 'CNAME', 'MX', 'NS', 'TXT', 'SRV']
if record_type not in valid_types:
results.append({"status": "error", "message": f"不支持的记录类型: {record_type}"})
continue
@@ -1027,7 +1027,7 @@ def west_domain_add_dns_record(**data):
return {"status": "error", "message": "缺少必要参数"}
# 验证记录类型
- valid_types = ['A', 'CNAME', 'MX', 'TXT', 'AAAA', 'SRV']
+ valid_types = ['A', 'AAAA', 'CNAME', 'MX', 'NS', 'TXT', 'SRV']
if record_type not in valid_types:
return {"status": "error", "message": f"不支持的记录类型: {record_type},支持的类型: {', '.join(valid_types)}"}
@@ -1093,7 +1093,7 @@ def west_domain_delete_dns_record(**data):
# 验证记录类型
if record_type:
- valid_types = ['A', 'CNAME', 'MX', 'TXT', 'AAAA', 'SRV']
+ valid_types = ['A', 'AAAA', 'CNAME', 'MX', 'NS', 'TXT', 'SRV']
if record_type not in valid_types:
return {"status": "error", "message": f"不支持的记录类型: {record_type},支持的类型: {', '.join(valid_types)}"}
@@ -2225,7 +2225,7 @@ def west_upload_real_name_files(**data):
@jingrow.whitelist()
def west_domain_modify_dns_record(**data):
- """修改DNS记录"""
+ """修改DNS记录 - 只修改可修改的字段(值、TTL、优先级、线路)"""
client = get_west_client()
if not client:
return {"status": "error", "message": "API客户端初始化失败"}
@@ -2235,15 +2235,7 @@ def west_domain_modify_dns_record(**data):
ttl = data.get('ttl', 600)
level = data.get('level', 10)
record_id = data.get('record_id')
- host = data.get('host')
- record_type = data.get('record_type')
line = data.get('line', '')
- old_value = data.get('old_value')
-
- if not domain:
- return {"status": "error", "message": "缺少域名参数"}
- if not value:
- return {"status": "error", "message": "缺少新的解析值"}
# 验证TTL值
if ttl < 60 or ttl > 86400:
@@ -2253,18 +2245,9 @@ def west_domain_modify_dns_record(**data):
if level < 1 or level > 100:
return {"status": "error", "message": "优先级必须在1~100之间"}
- # 如果没有提供record_id,则必须提供host和record_type
- if not record_id and (not host or not record_type):
- return {"status": "error", "message": "当未提供记录ID时,主机头和解析类型为必填项"}
-
- # 验证记录类型
- if record_type:
- valid_types = ['A', 'CNAME', 'MX', 'TXT', 'AAAA', 'SRV']
- if record_type not in valid_types:
- return {"status": "error", "message": f"不支持的记录类型: {record_type},支持的类型: {', '.join(valid_types)}"}
-
+ # 只传递可修改的字段给底层API
response = client.modify_dns_record(
- domain, value, ttl, level, record_id, host, record_type, line, old_value
+ domain, value, ttl, level, record_id, None, None, line, None
)
if response.get("status") == "error":
@@ -2286,8 +2269,6 @@ def west_domain_modify_dns_record(**data):
"ttl": ttl,
"level": level,
"record_id": record_id,
- "host": host,
- "record_type": record_type,
"line": line
}
}
--
2.48.1
From 3cfab004f0fcb0c49f5fdfb6390ec20ef62bae6c Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 23:10:53 +0800
Subject: [PATCH 134/250] =?UTF-8?q?=E5=8F=AA=E5=9C=A8=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=88=96=E4=BF=AE=E6=94=B9MX=E5=92=8CSRV=E7=B1=BB=E5=9E=8B?=
=?UTF-8?q?=E7=9A=84=E8=AE=B0=E5=BD=95=E6=97=B6=E6=98=BE=E7=A4=BA=E4=BC=98?=
=?UTF-8?q?=E5=85=88=E7=BA=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainDNSRecords.vue | 20 ++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index 2f707be..2db51f8 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -213,7 +213,7 @@
|
-
+
- {{ record.type === 'MX' && record.level ? record.level : '-' }}
+ {{ (record.type === 'MX' || record.type === 'SRV') && record.level ? record.level : '-' }}
|
@@ -470,7 +470,7 @@ export default {
line: '',
value: '',
ttl: 600,
- level: 10,
+ level: null, // 默认不设置优先级
editing: true, // 新增记录直接进入编辑模式
isNew: true
};
@@ -500,8 +500,8 @@ export default {
return;
}
- // 验证优先级
- if (record.level < 1 || record.level > 100) {
+ // 验证优先级 - 只在MX或SRV类型时验证
+ if ((record.type === 'MX' || record.type === 'SRV') && (record.level < 1 || record.level > 100)) {
toast.error('优先级必须在1~100之间');
return;
}
@@ -518,9 +518,12 @@ export default {
host: record.item,
value: record.value,
ttl: record.ttl,
- level: record.level,
line: record.line
};
+ // 只在MX或SRV类型时添加level参数
+ if (record.type === 'MX' || record.type === 'SRV') {
+ params.level = record.level;
+ }
} else {
// 修改记录 - 只传递可修改的字段
url = 'jcloud.api.domain_west.west_domain_modify_dns_record';
@@ -529,9 +532,12 @@ export default {
record_id: record.id,
value: record.value,
ttl: record.ttl,
- level: record.level,
line: record.line
};
+ // 只在MX或SRV类型时添加level参数
+ if (record.type === 'MX' || record.type === 'SRV') {
+ params.level = record.level;
+ }
}
const request = createResource({
--
2.48.1
From 1ceb618288e11883100d81614afaafc118c04187 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Mon, 4 Aug 2025 23:17:28 +0800
Subject: [PATCH 135/250] =?UTF-8?q?=E6=96=B0=E5=BB=BAMX=E6=88=96SRV?=
=?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=B6=E4=BC=98=E5=85=88=E7=BA=A7=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E5=80=BC=E8=AE=BE=E7=BD=AE=E4=B8=BA10?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainDNSRecords.vue | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index 2db51f8..1defca3 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -134,6 +134,7 @@
|
@@ -466,7 +466,7 @@ export default {
addNewRow() {
const newRecord = {
id: null, // 新增记录没有ID
- item: '',
+ host: '',
type: 'A',
line: '',
value: '',
@@ -506,7 +506,7 @@ export default {
// 保存记录
async saveRecord(record) {
- if (!record.item || !record.type || !record.value) {
+ if (!record.host || !record.type || !record.value) {
toast.error('主机名、类型和记录值不能为空');
return;
}
@@ -532,7 +532,7 @@ export default {
params = {
domain: this.$domain.pg.domain,
record_type: record.type,
- host: record.item,
+ host: record.host,
value: record.value,
ttl: record.ttl,
line: record.line
@@ -604,7 +604,7 @@ export default {
deleteRecord(record) {
confirmDialog({
title: '删除DNS记录',
- message: `确定要删除这条DNS记录吗?\n类型: ${record.type}\n主机记录: ${record.item}\n记录值: ${record.value}`,
+ message: `确定要删除这条DNS记录吗?\n类型: ${record.type}\n主机记录: ${record.host}\n记录值: ${record.value}`,
primaryAction: {
label: '确定',
variant: 'solid',
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index 9aab0cd..22bd98b 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -2613,3 +2613,119 @@ def west_domain_modify_dns_server(**data):
return {"status": "error", "message": "修改DNS服务器响应解析失败"}
+@jingrow.whitelist()
+def sync_domain_info_from_west(**data):
+ """从西部数据同步域名信息"""
+ jingrow.log_error("域名同步", f"开始同步域名信息,参数: {data}")
+
+ try:
+ client = get_west_client()
+ if not client:
+ jingrow.log_error("域名同步", "API客户端初始化失败")
+ return {"status": "error", "message": "API客户端初始化失败"}
+
+ domain = data.get('domain')
+ if not domain:
+ jingrow.log_error("域名同步", "缺少域名参数")
+ return {"status": "error", "message": "缺少域名参数"}
+
+ jingrow.log_error("域名同步", f"开始同步域名: {domain}")
+
+ # 获取域名DNS记录 - 参考get_west_domain_dns_records使用分页API
+ dns_response = client.get_dns_records_paginated(domain, 1000, 1) # 获取足够多的记录
+ jingrow.log_error("域名同步", f"域名DNS记录响应: {dns_response}")
+
+ # 获取域名实名信息
+ real_info_response = client.get_domain_real_info(domain)
+ jingrow.log_error("域名同步", f"域名实名信息响应: {real_info_response}")
+
+ # 处理DNS记录 - 参考get_west_domain_dns_records的处理方式
+ dns_data = {}
+ if dns_response.get("result") == 200:
+ data = dns_response.get("data", {})
+ all_items = data.get("items", [])
+ # 对所有记录按类型排序
+ sorted_items = sorted(all_items, key=lambda x: x.get('type', ''))
+ dns_data = {
+ "items": sorted_items,
+ "total": len(sorted_items)
+ }
+
+ real_data = real_info_response.get("data", {}) if real_info_response.get("result") == 200 else {}
+
+ # 更新本地域名记录
+ try:
+ domain_doc = jingrow.get_pg("Jsite Domain", {"domain": domain})
+ if not domain_doc:
+ return {"status": "error", "message": "本地未找到该域名记录"}
+
+ # 更新基本信息 - 从实名信息中获取
+ if real_data:
+ domain_doc.registration_date = real_data.get("regdate")
+ domain_doc.end_date = real_data.get("rexpiredate")
+ domain_doc.status = "Active" if real_data.get("status") == "ok" else "Expired"
+
+ # 更新DNS服务器信息
+ domain_doc.dns_host1 = real_data.get("dns_host1", "")
+ domain_doc.dns_host2 = real_data.get("dns_host2", "")
+ domain_doc.dns_host3 = real_data.get("dns_host3", "")
+ domain_doc.dns_host4 = real_data.get("dns_host4", "")
+ domain_doc.dns_host5 = real_data.get("dns_host5", "")
+ domain_doc.dns_host6 = real_data.get("dns_host6", "")
+
+ jingrow.log_error("域名同步", f"更新基本信息: 注册日期={real_data.get('regdate')}, 到期日期={real_data.get('rexpiredate')}")
+
+ # 更新DNS解析记录
+ if dns_data and "items" in dns_data:
+ jingrow.log_error("域名同步", f"正在更新DNS解析记录,共{len(dns_data.get('items', []))}条记录")
+ # 清空现有DNS解析记录
+ domain_doc.dns_resolution = []
+
+ # 添加新的DNS解析记录
+ for record in dns_data.get("items", []):
+ # 确保必需字段有值 - 注意字段名是item不是host
+ host = record.get("item", "") # 修正字段名
+ record_type = record.get("type", "")
+ value = record.get("value", "")
+
+ # 只有当必需字段都有值时才添加记录
+ if host and record_type and value:
+ domain_doc.append("dns_resolution", {
+ "type": record_type,
+ "host": host,
+ "value": value,
+ "ttl": record.get("ttl", 600),
+ "level": record.get("level", 10),
+ "line": record.get("line", ""),
+ "record_id": record.get("id", ""),
+ "record_status": record.get("status", "")
+ })
+ jingrow.log_error("域名同步", f"添加DNS记录: {host} {record_type} {value}")
+ else:
+ jingrow.log_error("域名同步", f"跳过无效DNS记录: {record}")
+
+ jingrow.log_error("域名同步", f"DNS解析记录更新完成")
+
+ # 保存更新
+ domain_doc.save()
+
+ jingrow.log_error("域名同步", f"域名 {domain} 同步成功")
+
+ return {
+ "status": "success",
+ "message": "域名信息同步成功",
+ "data": {
+ "dns_records": dns_data,
+ "real_info": real_data
+ }
+ }
+
+ except Exception as e:
+ jingrow.log_error("域名信息同步失败", f"域名: {domain}, 错误: {str(e)}")
+ return {"status": "error", "message": f"更新本地记录失败: {str(e)}"}
+
+ except Exception as e:
+ jingrow.log_error("域名信息同步失败", f"域名: {domain}, 错误: {str(e)}")
+ return {"status": "error", "message": f"同步失败: {str(e)}"}
+
+
diff --git a/jcloud/jcloud/pagetype/dns_resolution/dns_resolution.json b/jcloud/jcloud/pagetype/dns_resolution/dns_resolution.json
index 975ff90..7914e6f 100644
--- a/jcloud/jcloud/pagetype/dns_resolution/dns_resolution.json
+++ b/jcloud/jcloud/pagetype/dns_resolution/dns_resolution.json
@@ -29,7 +29,7 @@
"fieldtype": "Select",
"in_list_view": 1,
"label": "类型",
- "options": "\nA\nCNAME\nMX\nTXT\nAAAA\nSRV",
+ "options": "\nA\nAAAA\nCNAME\nMX\nNS\nTXT\nSRV",
"reqd": 1
},
{
@@ -50,7 +50,6 @@
},
{
"columns": 1,
- "default": "10",
"fieldname": "level",
"fieldtype": "Data",
"in_list_view": 1,
@@ -83,7 +82,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
- "modified": "2025-08-05 01:00:02.459889",
+ "modified": "2025-08-05 03:04:50.722407",
"modified_by": "Administrator",
"module": "Jcloud",
"name": "Dns Resolution",
diff --git a/jcloud/jcloud/pagetype/dns_resolution/dns_resolution.py b/jcloud/jcloud/pagetype/dns_resolution/dns_resolution.py
index a04a6af..00ba8cc 100644
--- a/jcloud/jcloud/pagetype/dns_resolution/dns_resolution.py
+++ b/jcloud/jcloud/pagetype/dns_resolution/dns_resolution.py
@@ -23,7 +23,7 @@ class DnsResolution(Document):
record_id: DF.Data | None
record_status: DF.Data | None
ttl: DF.Data | None
- type: DF.Literal["", "A", "CNAME", "MX", "TXT", "AAAA", "SRV"]
+ type: DF.Literal["", "A", "AAAA", "CNAME", "MX", "NS", "TXT", "SRV"]
value: DF.Data
# end: auto-generated types
pass
diff --git a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.js b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.js
index e721d71..196744c 100644
--- a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.js
+++ b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.js
@@ -1,8 +1,80 @@
// Copyright (c) 2025, Jingrow and contributors
// For license information, please see license.txt
-// jingrow.ui.form.on("Jsite Domain", {
-// refresh(frm) {
+jingrow.ui.form.on("Jsite Domain", {
+ refresh(frm) {
+ // 添加同步按钮到右上角
+ frm.add_custom_button(__('同步域名信息'), function() {
+ sync_domain_info(frm);
+ }, __('操作'));
+ },
+});
-// },
-// });
+// 同步域名信息函数
+function sync_domain_info(frm) {
+ console.log('=== 开始同步域名信息 ===');
+ console.log('当前记录:', frm.pg);
+ console.log('域名字段:', frm.pg.domain);
+
+ if (!frm.pg.domain) {
+ console.log('❌ 域名字段为空');
+ jingrow.msgprint(__('当前记录没有域名信息'));
+ return;
+ }
+
+ console.log('✅ 域名字段存在:', frm.pg.domain);
+
+ // 显示加载状态
+ frm.dashboard.clear_headline();
+ frm.dashboard.set_headline(__('正在同步域名信息...'));
+
+ console.log('准备调用API,参数:', {
+ method: 'jcloud.api.domain_west.sync_domain_info_from_west',
+ args: {
+ domain: frm.pg.domain
+ }
+ });
+
+ // 调用API同步域名信息
+ jingrow.call({
+ method: 'jcloud.api.domain_west.sync_domain_info_from_west',
+ args: {
+ domain: frm.pg.domain
+ },
+ callback: function(r) {
+ console.log('API调用成功,响应:', r);
+ frm.dashboard.clear_headline();
+
+ // 检查响应结构
+ if (r && r.message && r.message.status === 'success') {
+ console.log('✅ 同步成功');
+ jingrow.msgprint({
+ title: __('同步成功'),
+ message: __('域名信息已成功从西部数据同步'),
+ indicator: 'green'
+ });
+
+ // 刷新页面以显示更新后的数据
+ frm.refresh();
+ } else {
+ console.log('❌ 同步失败:', r);
+ jingrow.msgprint({
+ title: __('同步失败'),
+ message: (r && r.message && r.message.message) || __('同步域名信息时发生错误'),
+ indicator: 'red'
+ });
+ }
+ },
+ error: function(err) {
+ console.log('❌ API调用失败:', err);
+ frm.dashboard.clear_headline();
+ jingrow.msgprint({
+ title: __('同步失败'),
+ message: __('网络错误或服务器异常'),
+ indicator: 'red'
+ });
+ }
+ });
+
+ console.log('API调用已发送');
+}
--
2.48.1
From 7a4bd9271097360e3ce3c3eef8f9f37ab625a5b4 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 03:30:11 +0800
Subject: [PATCH 142/250] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=90=8C=E6=AD=A5?=
=?UTF-8?q?=E5=9F=9F=E5=90=8D=E4=BF=A1=E6=81=AF=E7=9B=B8=E5=85=B3=E7=9A=84?=
=?UTF-8?q?=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jcloud/api/domain_west.py | 47 ++++++-------------
.../pagetype/jsite_domain/jsite_domain.js | 24 +---------
2 files changed, 16 insertions(+), 55 deletions(-)
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index 22bd98b..991e9ff 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -2616,28 +2616,21 @@ def west_domain_modify_dns_server(**data):
@jingrow.whitelist()
def sync_domain_info_from_west(**data):
"""从西部数据同步域名信息"""
- jingrow.log_error("域名同步", f"开始同步域名信息,参数: {data}")
try:
client = get_west_client()
if not client:
- jingrow.log_error("域名同步", "API客户端初始化失败")
return {"status": "error", "message": "API客户端初始化失败"}
domain = data.get('domain')
if not domain:
- jingrow.log_error("域名同步", "缺少域名参数")
return {"status": "error", "message": "缺少域名参数"}
- jingrow.log_error("域名同步", f"开始同步域名: {domain}")
-
# 获取域名DNS记录 - 参考get_west_domain_dns_records使用分页API
dns_response = client.get_dns_records_paginated(domain, 1000, 1) # 获取足够多的记录
- jingrow.log_error("域名同步", f"域名DNS记录响应: {dns_response}")
# 获取域名实名信息
real_info_response = client.get_domain_real_info(domain)
- jingrow.log_error("域名同步", f"域名实名信息响应: {real_info_response}")
# 处理DNS记录 - 参考get_west_domain_dns_records的处理方式
dns_data = {}
@@ -2655,31 +2648,28 @@ def sync_domain_info_from_west(**data):
# 更新本地域名记录
try:
- domain_doc = jingrow.get_pg("Jsite Domain", {"domain": domain})
- if not domain_doc:
+ domain_pg = jingrow.get_pg("Jsite Domain", {"domain": domain})
+ if not domain_pg:
return {"status": "error", "message": "本地未找到该域名记录"}
# 更新基本信息 - 从实名信息中获取
if real_data:
- domain_doc.registration_date = real_data.get("regdate")
- domain_doc.end_date = real_data.get("rexpiredate")
- domain_doc.status = "Active" if real_data.get("status") == "ok" else "Expired"
+ domain_pg.registration_date = real_data.get("regdate")
+ domain_pg.end_date = real_data.get("rexpiredate")
+ domain_pg.status = "Active" if real_data.get("status") == "ok" else "Expired"
# 更新DNS服务器信息
- domain_doc.dns_host1 = real_data.get("dns_host1", "")
- domain_doc.dns_host2 = real_data.get("dns_host2", "")
- domain_doc.dns_host3 = real_data.get("dns_host3", "")
- domain_doc.dns_host4 = real_data.get("dns_host4", "")
- domain_doc.dns_host5 = real_data.get("dns_host5", "")
- domain_doc.dns_host6 = real_data.get("dns_host6", "")
-
- jingrow.log_error("域名同步", f"更新基本信息: 注册日期={real_data.get('regdate')}, 到期日期={real_data.get('rexpiredate')}")
+ domain_pg.dns_host1 = real_data.get("dns_host1", "")
+ domain_pg.dns_host2 = real_data.get("dns_host2", "")
+ domain_pg.dns_host3 = real_data.get("dns_host3", "")
+ domain_pg.dns_host4 = real_data.get("dns_host4", "")
+ domain_pg.dns_host5 = real_data.get("dns_host5", "")
+ domain_pg.dns_host6 = real_data.get("dns_host6", "")
# 更新DNS解析记录
if dns_data and "items" in dns_data:
- jingrow.log_error("域名同步", f"正在更新DNS解析记录,共{len(dns_data.get('items', []))}条记录")
# 清空现有DNS解析记录
- domain_doc.dns_resolution = []
+ domain_pg.dns_resolution = []
# 添加新的DNS解析记录
for record in dns_data.get("items", []):
@@ -2690,7 +2680,7 @@ def sync_domain_info_from_west(**data):
# 只有当必需字段都有值时才添加记录
if host and record_type and value:
- domain_doc.append("dns_resolution", {
+ domain_pg.append("dns_resolution", {
"type": record_type,
"host": host,
"value": value,
@@ -2700,16 +2690,9 @@ def sync_domain_info_from_west(**data):
"record_id": record.get("id", ""),
"record_status": record.get("status", "")
})
- jingrow.log_error("域名同步", f"添加DNS记录: {host} {record_type} {value}")
- else:
- jingrow.log_error("域名同步", f"跳过无效DNS记录: {record}")
-
- jingrow.log_error("域名同步", f"DNS解析记录更新完成")
# 保存更新
- domain_doc.save()
-
- jingrow.log_error("域名同步", f"域名 {domain} 同步成功")
+ domain_pg.save()
return {
"status": "success",
@@ -2721,11 +2704,9 @@ def sync_domain_info_from_west(**data):
}
except Exception as e:
- jingrow.log_error("域名信息同步失败", f"域名: {domain}, 错误: {str(e)}")
return {"status": "error", "message": f"更新本地记录失败: {str(e)}"}
except Exception as e:
- jingrow.log_error("域名信息同步失败", f"域名: {domain}, 错误: {str(e)}")
return {"status": "error", "message": f"同步失败: {str(e)}"}
diff --git a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.js b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.js
index 196744c..cfefac7 100644
--- a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.js
+++ b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.js
@@ -6,35 +6,21 @@ jingrow.ui.form.on("Jsite Domain", {
// 添加同步按钮到右上角
frm.add_custom_button(__('同步域名信息'), function() {
sync_domain_info(frm);
- }, __('操作'));
+ });
},
});
// 同步域名信息函数
function sync_domain_info(frm) {
- console.log('=== 开始同步域名信息 ===');
- console.log('当前记录:', frm.pg);
- console.log('域名字段:', frm.pg.domain);
-
if (!frm.pg.domain) {
- console.log('❌ 域名字段为空');
jingrow.msgprint(__('当前记录没有域名信息'));
return;
}
- console.log('✅ 域名字段存在:', frm.pg.domain);
-
// 显示加载状态
frm.dashboard.clear_headline();
frm.dashboard.set_headline(__('正在同步域名信息...'));
- console.log('准备调用API,参数:', {
- method: 'jcloud.api.domain_west.sync_domain_info_from_west',
- args: {
- domain: frm.pg.domain
- }
- });
-
// 调用API同步域名信息
jingrow.call({
method: 'jcloud.api.domain_west.sync_domain_info_from_west',
@@ -42,22 +28,19 @@ function sync_domain_info(frm) {
domain: frm.pg.domain
},
callback: function(r) {
- console.log('API调用成功,响应:', r);
frm.dashboard.clear_headline();
// 检查响应结构
if (r && r.message && r.message.status === 'success') {
- console.log('✅ 同步成功');
jingrow.msgprint({
title: __('同步成功'),
- message: __('域名信息已成功从西部数据同步'),
+ message: __('域名信息已成功同步'),
indicator: 'green'
});
// 刷新页面以显示更新后的数据
frm.refresh();
} else {
- console.log('❌ 同步失败:', r);
jingrow.msgprint({
title: __('同步失败'),
message: (r && r.message && r.message.message) || __('同步域名信息时发生错误'),
@@ -66,7 +49,6 @@ function sync_domain_info(frm) {
}
},
error: function(err) {
- console.log('❌ API调用失败:', err);
frm.dashboard.clear_headline();
jingrow.msgprint({
title: __('同步失败'),
@@ -75,6 +57,4 @@ function sync_domain_info(frm) {
});
}
});
-
- console.log('API调用已发送');
}
--
2.48.1
From 22740d5bf07329334ef4c0e8ef13e6774b5deff9 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 04:24:43 +0800
Subject: [PATCH 143/250] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=9F=9F=E5=90=8D?=
=?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=97=B6=E5=A2=9E=E5=8A=A0=E6=9B=B4=E6=96=B0?=
=?UTF-8?q?=E6=89=80=E6=9C=89=E8=80=85=E6=A8=A1=E6=9D=BF=E5=B9=B6=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95=E9=80=9A=E8=BF=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jcloud/api/domain_west.py | 184 +++++++++++++++++++++++++++++++++++++-
1 file changed, 180 insertions(+), 4 deletions(-)
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index 991e9ff..c9af74c 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -2646,11 +2646,182 @@ def sync_domain_info_from_west(**data):
real_data = real_info_response.get("data", {}) if real_info_response.get("result") == 200 else {}
+ # 获取当前域名记录的团队信息
+ domain_pg = jingrow.get_pg("Jsite Domain", {"domain": domain})
+ if not domain_pg:
+ return {"status": "error", "message": "本地未找到该域名记录"}
+
+ # 从域名记录获取团队信息
+ team_name = domain_pg.team
+ if not team_name:
+ return {"status": "error", "message": "域名记录中未找到团队信息"}
+
+ team = jingrow.get_pg("Team", team_name)
+ if not team:
+ return {"status": "error", "message": "未找到团队信息"}
+
+ # 同步Domain Owner信息
+ domain_owner_name = None
+ if real_data:
+ # 从实名信息中提取c_sysid和所有者信息
+ c_sysid = real_data.get("c_sysid")
+ owner_info = real_data.get("owner", {})
+
+ # 添加调试日志
+ jingrow.log_error(f"Domain Owner同步调试", f"域名: {domain}, c_sysid: {c_sysid}, owner_info: {owner_info}")
+ jingrow.log_error(f"real_data完整信息", f"real_data: {real_data}")
+
+ if c_sysid:
+ # 如果owner_info为空,使用real_data中的所有者字段
+ if not owner_info:
+ owner_info = real_data
+
+ if owner_info:
+ # 根据c_sysid查找是否已存在Domain Owner - 只按c_sysid查找,不限制团队
+ existing_owners = jingrow.get_all(
+ "Domain Owner",
+ {"c_sysid": c_sysid},
+ ["name", "team"]
+ )
+
+ # 添加调试日志
+ jingrow.log_error(f"Domain Owner查找结果", f"c_sysid: {c_sysid}, 域名团队: {team.name}, 找到记录数: {len(existing_owners)}")
+ if existing_owners:
+ jingrow.log_error(f"找到的Domain Owner", f"名称: {existing_owners[0].name}, 原团队: {existing_owners[0].team or '空'}")
+ else:
+ jingrow.log_error(f"未找到Domain Owner", f"将创建新的")
+
+ if existing_owners:
+ # 更新已存在的Domain Owner
+ domain_owner_name = existing_owners[0].name
+ existing_team = existing_owners[0].team
+ jingrow.log_error(f"Domain Owner更新逻辑", f"找到现有记录: {domain_owner_name}, 原团队: {existing_team}, 当前团队: {team.name}")
+ try:
+ domain_owner_pg = jingrow.get_pg("Domain Owner", domain_owner_name)
+ if domain_owner_pg:
+ # 更新团队信息(如果不同或为空)
+ if not domain_owner_pg.team or domain_owner_pg.team != team.name:
+ old_team = domain_owner_pg.team or "空"
+ jingrow.log_error(f"Domain Owner团队更新", f"从 {old_team} 更新为 {team.name}")
+ domain_owner_pg.team = team.name
+
+ # 更新所有者信息
+ owner_name = owner_info.get("dom_org_m") or owner_info.get("dom_ln_m", "") + owner_info.get("dom_fn_m", "")
+ domain_owner_pg.fullname = owner_name
+ domain_owner_pg.r_status = 1 # 已实名认证
+
+ # 根据类型更新不同字段
+ c_regtype = "E" if owner_info.get("dom_org_m") else "I"
+ domain_owner_pg.c_regtype = c_regtype
+
+ if c_regtype == "E": # 企业
+ domain_owner_pg.c_org_m = owner_info.get("dom_org_m", "")
+ domain_owner_pg.c_org = owner_info.get("dom_org", "")
+ domain_owner_pg.c_ln_m = owner_info.get("dom_ln_m", "")
+ domain_owner_pg.c_fn_m = owner_info.get("dom_fn_m", "")
+ domain_owner_pg.c_ln = owner_info.get("dom_ln", "")
+ domain_owner_pg.c_fn = owner_info.get("dom_fn", "")
+ domain_owner_pg.title = owner_info.get("dom_org_m", "")
+ else: # 个人
+ domain_owner_pg.c_ln_m = owner_info.get("dom_ln_m", "")
+ domain_owner_pg.c_fn_m = owner_info.get("dom_fn_m", "")
+ domain_owner_pg.c_ln = owner_info.get("dom_ln", "")
+ domain_owner_pg.c_fn = owner_info.get("dom_fn", "")
+ domain_owner_pg.title = owner_info.get("dom_ln_m", "") + owner_info.get("dom_fn_m", "")
+
+ # 更新地址信息
+ domain_owner_pg.c_st_m = owner_info.get("dom_st_m", "")
+ domain_owner_pg.c_ct_m = owner_info.get("dom_ct_m", "")
+ domain_owner_pg.c_adr_m = owner_info.get("dom_adr_m", "")
+ domain_owner_pg.c_pc = owner_info.get("dom_pc", "")
+ domain_owner_pg.c_st = owner_info.get("dom_st", "")
+ domain_owner_pg.c_ct = owner_info.get("dom_ct", "")
+ domain_owner_pg.c_adr = owner_info.get("dom_adr", "")
+ domain_owner_pg.c_em = owner_info.get("dom_em", "")
+ domain_owner_pg.c_ph = owner_info.get("dom_ph", "")
+ domain_owner_pg.c_ph_type = "0" # 默认为手机
+
+ domain_owner_pg.save(ignore_permissions=True)
+ jingrow.log_error(f"Domain Owner更新成功", f"名称: {domain_owner_name}")
+ except Exception as e:
+ jingrow.log_error(f"更新Domain Owner失败", f"域名: {domain}, c_sysid: {c_sysid}, 错误: {str(e)}")
+ else:
+ # 创建新的Domain Owner
+ jingrow.log_error(f"Domain Owner创建逻辑", f"未找到现有记录,将创建新记录,c_sysid: {c_sysid}, 域名团队: {team.name}")
+ try:
+ # 判断所有者类型(个人或企业)
+ c_regtype = "E" if owner_info.get("dom_org_m") else "I"
+
+ # 生成所有者名称
+ owner_name = owner_info.get("dom_org_m") or owner_info.get("dom_ln_m", "") + owner_info.get("dom_fn_m", "")
+
+ # 构建Domain Owner数据
+ owner_data = {
+ "pagetype": "Domain Owner",
+ "team": team.name, # 使用当前团队
+ "c_sysid": c_sysid,
+ "c_regtype": c_regtype,
+ "fullname": owner_name,
+ "c_co": "CN",
+ "cocode": "+86",
+ "reg_contact_type": "cg",
+ "r_status": 1, # 已实名认证
+ "title": owner_name
+ }
+
+ # 根据类型设置不同字段
+ if c_regtype == "E": # 企业
+ owner_data.update({
+ "c_org_m": owner_info.get("dom_org_m", ""),
+ "c_org": owner_info.get("dom_org", ""),
+ "c_ln_m": owner_info.get("dom_ln_m", ""),
+ "c_fn_m": owner_info.get("dom_fn_m", ""),
+ "c_ln": owner_info.get("dom_ln", ""),
+ "c_fn": owner_info.get("dom_fn", ""),
+ "title": owner_info.get("dom_org_m", "")
+ })
+ else: # 个人
+ owner_data.update({
+ "c_ln_m": owner_info.get("dom_ln_m", ""),
+ "c_fn_m": owner_info.get("dom_fn_m", ""),
+ "c_ln": owner_info.get("dom_ln", ""),
+ "c_fn": owner_info.get("dom_fn", ""),
+ "title": owner_info.get("dom_ln_m", "") + owner_info.get("dom_fn_m", "")
+ })
+
+ # 设置地址信息
+ owner_data.update({
+ "c_st_m": owner_info.get("dom_st_m", ""),
+ "c_ct_m": owner_info.get("dom_ct_m", ""),
+ "c_adr_m": owner_info.get("dom_adr_m", ""),
+ "c_pc": owner_info.get("dom_pc", ""),
+ "c_st": owner_info.get("dom_st", ""),
+ "c_ct": owner_info.get("dom_ct", ""),
+ "c_adr": owner_info.get("dom_adr", ""),
+ "c_em": owner_info.get("dom_em", ""),
+ "c_ph": owner_info.get("dom_ph", ""),
+ "c_ph_type": "0" # 默认为手机
+ })
+
+ # 设置证件信息(如果有)
+ if owner_info.get("dom_idtype"):
+ owner_data["c_idtype_gswl"] = owner_info.get("dom_idtype")
+ if owner_info.get("dom_idnum"):
+ owner_data["c_idnum_gswl"] = owner_info.get("dom_idnum")
+
+ # 创建Domain Owner记录
+ domain_owner_pg = jingrow.get_pg(owner_data)
+ domain_owner_pg.insert(ignore_permissions=True)
+ domain_owner_name = domain_owner_pg.name
+ jingrow.log_error(f"Domain Owner创建成功", f"名称: {domain_owner_name}, c_sysid: {c_sysid}")
+
+ except Exception as e:
+ jingrow.log_error(f"创建Domain Owner失败", f"域名: {domain}, c_sysid: {c_sysid}, 错误: {str(e)}")
+ domain_owner_name = None
+
# 更新本地域名记录
try:
- domain_pg = jingrow.get_pg("Jsite Domain", {"domain": domain})
- if not domain_pg:
- return {"status": "error", "message": "本地未找到该域名记录"}
+ # domain_pg 已经在前面获取过了,直接使用
# 更新基本信息 - 从实名信息中获取
if real_data:
@@ -2665,6 +2836,10 @@ def sync_domain_info_from_west(**data):
domain_pg.dns_host4 = real_data.get("dns_host4", "")
domain_pg.dns_host5 = real_data.get("dns_host5", "")
domain_pg.dns_host6 = real_data.get("dns_host6", "")
+
+ # 更新Domain Owner
+ if domain_owner_name:
+ domain_pg.domain_owner = domain_owner_name
# 更新DNS解析记录
if dns_data and "items" in dns_data:
@@ -2699,7 +2874,8 @@ def sync_domain_info_from_west(**data):
"message": "域名信息同步成功",
"data": {
"dns_records": dns_data,
- "real_info": real_data
+ "real_info": real_data,
+ "domain_owner": domain_owner_name
}
}
--
2.48.1
From 7e40d5c78eb808fd30ac667187cef4ff178b634b Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 05:06:35 +0800
Subject: [PATCH 144/250] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=9F=9F=E5=90=8D=E4=BF=A1=E6=81=AF=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jcloud/api/domain_west.py | 58 +++++++++++++--------------------------
1 file changed, 19 insertions(+), 39 deletions(-)
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index c9af74c..5581b94 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -2128,38 +2128,6 @@ def create_domain_owner_with_template(**data):
return {"status": "Error", "message": f"创建域名所有者失败: {str(e)}"}
-@jingrow.whitelist()
-def test_create_domain_owner_with_template():
- """测试创建域名所有者(包含模板创建)的API端点"""
- try:
- # 硬编码的测试参数
- test_data = {
- 'c_regtype': 'I',
- 'c_ln_m': '李',
- 'c_fn_m': '长生',
- 'c_co': 'CN',
- 'cocode': '+86',
- 'c_st_m': '广东省',
- 'c_ct_m': '广州市',
- 'c_dt_m': '花都区',
- 'c_adr_m': '狮岭镇龙头市场2栋',
- 'c_pc': '510000',
- 'c_ph_type': '0',
- 'c_ph': '13926598569',
- 'c_em': '13926598569@139.com',
- 'c_idtype_gswl': 'SFZ',
- 'c_idnum_gswl': '430524198506259568'
- }
-
- # 调用create_domain_owner_with_template函数
- result = create_domain_template(**test_data)
-
- return result
-
- except Exception as e:
- return {"status": "Error", "message": f"测试API调用失败: {str(e)}"}
-
-
@jingrow.whitelist()
def get_west_domain_real_info(**data):
"""获取域名实名信息"""
@@ -2710,6 +2678,10 @@ def sync_domain_info_from_west(**data):
domain_owner_pg.fullname = owner_name
domain_owner_pg.r_status = 1 # 已实名认证
+ # 更新国家代码和电话代码
+ domain_owner_pg.c_co = owner_info.get("dom_co", "CN")
+ domain_owner_pg.cocode = owner_info.get("dom_ph", "").split('.')[0] if '.' in owner_info.get("dom_ph", "") else "+86" # 从手机号提取电话代码
+
# 根据类型更新不同字段
c_regtype = "E" if owner_info.get("dom_org_m") else "I"
domain_owner_pg.c_regtype = c_regtype
@@ -2741,6 +2713,13 @@ def sync_domain_info_from_west(**data):
domain_owner_pg.c_ph = owner_info.get("dom_ph", "")
domain_owner_pg.c_ph_type = "0" # 默认为手机
+ # 更新证件信息(从orgfile中获取)
+ orgfile = real_data.get("orgfile", {})
+ if orgfile.get("f_code"):
+ domain_owner_pg.c_idnum_gswl = orgfile.get("f_code")
+ if orgfile.get("f_type"):
+ domain_owner_pg.c_idtype_gswl = str(orgfile.get("f_type"))
+
domain_owner_pg.save(ignore_permissions=True)
jingrow.log_error(f"Domain Owner更新成功", f"名称: {domain_owner_name}")
except Exception as e:
@@ -2762,8 +2741,8 @@ def sync_domain_info_from_west(**data):
"c_sysid": c_sysid,
"c_regtype": c_regtype,
"fullname": owner_name,
- "c_co": "CN",
- "cocode": "+86",
+ "c_co": owner_info.get("dom_co", "CN"), # 从数据中获取国家代码
+ "cocode": owner_info.get("dom_ph", "").split('.')[0] if '.' in owner_info.get("dom_ph", "") else "+86", # 从手机号提取电话代码
"reg_contact_type": "cg",
"r_status": 1, # 已实名认证
"title": owner_name
@@ -2803,11 +2782,12 @@ def sync_domain_info_from_west(**data):
"c_ph_type": "0" # 默认为手机
})
- # 设置证件信息(如果有)
- if owner_info.get("dom_idtype"):
- owner_data["c_idtype_gswl"] = owner_info.get("dom_idtype")
- if owner_info.get("dom_idnum"):
- owner_data["c_idnum_gswl"] = owner_info.get("dom_idnum")
+ # 设置证件信息(从orgfile中获取)
+ orgfile = real_data.get("orgfile", {})
+ if orgfile.get("f_code"):
+ owner_data["c_idnum_gswl"] = orgfile.get("f_code")
+ if orgfile.get("f_type"):
+ owner_data["c_idtype_gswl"] = str(orgfile.get("f_type"))
# 创建Domain Owner记录
domain_owner_pg = jingrow.get_pg(owner_data)
--
2.48.1
From 4f9a4fedbe7155ad2a80d1c67080ba1ecf5e8b5f Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 05:41:22 +0800
Subject: [PATCH 145/250] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4=E5=9F=9F=E5=90=8D=E8=A7=A3?=
=?UTF-8?q?=E6=9E=90=E8=AE=B0=E5=BD=95=E6=97=B6=E6=97=A0=E6=B3=95=E8=87=AA?=
=?UTF-8?q?=E5=8A=A8=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainDNSRecords.vue | 168 +++++++++++-------
1 file changed, 101 insertions(+), 67 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue
index a7de16f..0089b14 100644
--- a/dashboard/src2/components/JsiteDomainDNSRecords.vue
+++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue
@@ -7,7 +7,7 @@
@@ -36,7 +36,7 @@
-
+
正在加载DNS记录...
@@ -44,18 +44,18 @@
-
+
加载失败
- {{ error }}
+ {{ $resources.dnsRecords.error }}
-
+
@@ -324,7 +324,7 @@
-
+
暂无DNS记录
开始添加您的第一个DNS解析记录
@@ -358,8 +358,6 @@ export default {
props: ['domain'],
data() {
return {
- loading: false,
- error: null,
dnsRecords: [],
pagination: {
pageno: 1,
@@ -370,68 +368,68 @@ export default {
selectedRecords: [] // 用于存储选中的记录ID
};
},
- methods: {
- // 获取DNS记录
- async loadDNSRecords() {
- if (!this.$domain.pg?.domain) {
- this.error = '域名信息不存在';
- return;
- }
-
- this.loading = true;
- this.error = null;
-
- try {
- const request = createResource({
- url: 'jcloud.api.domain_west.get_jingrow_domain_dns_records',
- params: {
- domain: this.$domain.pg.domain,
- limit: this.pagination.limit,
- pageno: this.pagination.pageno
- },
- onSuccess: (response) => {
- this.loading = false;
- if (response.status === 'success' && response.data) {
- // 为每个记录添加编辑状态
- this.dnsRecords = (response.data.items || []).map(record => ({
- ...record,
- editing: false,
- isNew: false
- }));
-
- this.pagination = {
- pageno: response.data.pageno || 1,
- limit: response.data.limit || 20,
- total: response.data.total || 0,
- pagecount: response.data.pagecount || 0
- };
- } else {
- this.error = response.message || '获取DNS记录失败';
- }
- },
- onError: (error) => {
- this.loading = false;
- this.error = getToastErrorMessage(error);
+ resources: {
+ dnsRecords() {
+ return {
+ url: 'jcloud.api.domain_west.get_jingrow_domain_dns_records',
+ params: {
+ domain: this.$domain.pg?.domain,
+ limit: this.pagination.limit,
+ pageno: this.pagination.pageno
+ },
+ auto: true,
+ onSuccess: (response) => {
+ if (response.status === 'success' && response.data) {
+ // 为每个记录添加编辑状态
+ this.dnsRecords = (response.data.items || []).map(record => ({
+ ...record,
+ editing: false,
+ isNew: false
+ }));
+
+ this.pagination = {
+ pageno: response.data.pageno || 1,
+ limit: response.data.limit || 20,
+ total: response.data.total || 0,
+ pagecount: response.data.pagecount || 0
+ };
+ } else {
+ this.error = response.message || '获取DNS记录失败';
}
- });
- request.submit();
- } catch (error) {
- this.loading = false;
- this.error = '获取DNS记录时发生错误';
- console.error('加载DNS记录失败:', error);
- }
- },
-
+ },
+ onError: (error) => {
+ this.error = getToastErrorMessage(error);
+ }
+ };
+ }
+ },
+ methods: {
// 刷新记录
refreshRecords() {
- this.loadDNSRecords();
+ // 更新资源参数并立即重新加载
+ this.$resources.dnsRecords.update({
+ params: {
+ domain: this.$domain.pg?.domain,
+ limit: this.pagination.limit,
+ pageno: this.pagination.pageno
+ }
+ });
+ this.$resources.dnsRecords.reload();
},
// 切换页面
changePage(page) {
if (page >= 1 && page <= this.pagination.pagecount) {
this.pagination.pageno = page;
- this.loadDNSRecords();
+ // 更新资源参数并立即重新加载
+ this.$resources.dnsRecords.update({
+ params: {
+ domain: this.$domain.pg?.domain,
+ limit: this.pagination.limit,
+ pageno: this.pagination.pageno
+ }
+ });
+ this.$resources.dnsRecords.reload();
}
},
@@ -565,8 +563,17 @@ export default {
toast.success('DNS记录保存成功');
record.editing = false;
record.isNew = false;
- // 重新加载记录列表
- this.loadDNSRecords();
+ // 重新加载记录列表(等待异步操作完成)
+ setTimeout(() => {
+ this.$resources.dnsRecords.update({
+ params: {
+ domain: this.$domain.pg?.domain,
+ limit: this.pagination.limit,
+ pageno: this.pagination.pageno
+ }
+ });
+ this.$resources.dnsRecords.reload();
+ }, 1000);
} else {
toast.error(response.message || '保存DNS记录失败');
}
@@ -629,7 +636,16 @@ export default {
if (response.status === 'success') {
toast.success('DNS记录删除成功');
hide();
- this.loadDNSRecords();
+ setTimeout(() => {
+ this.$resources.dnsRecords.update({
+ params: {
+ domain: this.$domain.pg?.domain,
+ limit: this.pagination.limit,
+ pageno: this.pagination.pageno
+ }
+ });
+ this.$resources.dnsRecords.reload();
+ }, 1000);
} else {
toast.error(response.message || '删除DNS记录失败');
}
@@ -690,12 +706,30 @@ export default {
if (response.status === 'success') {
toast.success(response.message || `批量删除 ${validRecordIds.length} 条DNS记录成功`);
hide();
- this.loadDNSRecords();
+ setTimeout(() => {
+ this.$resources.dnsRecords.update({
+ params: {
+ domain: this.$domain.pg?.domain,
+ limit: this.pagination.limit,
+ pageno: this.pagination.pageno
+ }
+ });
+ this.$resources.dnsRecords.reload();
+ }, 1000);
this.selectedRecords = []; // 清空选中
} else if (response.status === 'partial_success') {
toast.success(response.message || '批量删除部分成功');
hide();
- this.loadDNSRecords();
+ setTimeout(() => {
+ this.$resources.dnsRecords.update({
+ params: {
+ domain: this.$domain.pg?.domain,
+ limit: this.pagination.limit,
+ pageno: this.pagination.pageno
+ }
+ });
+ this.$resources.dnsRecords.reload();
+ }, 1000);
this.selectedRecords = []; // 清空选中
} else {
toast.error(response.message || '批量删除DNS记录失败');
@@ -788,7 +822,7 @@ export default {
}
},
mounted() {
- this.loadDNSRecords();
+ // 组件会自动加载DNS记录,因为resources设置了auto: true
}
};
\ No newline at end of file
--
2.48.1
From 182eb5b4649bfcb7008551630281f1cbe0964414 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 06:46:05 +0800
Subject: [PATCH 146/250] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8F=8A=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E5=9F=9F=E5=90=8D=E8=A7=A3=E6=9E=90=E8=AE=B0=E5=BD=95=E6=88=90?=
=?UTF-8?q?=E5=8A=9F=E5=90=8E=E7=9A=84=E6=9B=B4=E6=96=B0=E6=9C=AC=E5=9C=B0?=
=?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=9A=84=E6=93=8D=E4=BD=9C=E7=94=B1=E5=BC=82?=
=?UTF-8?q?=E6=AD=A5=E9=98=9F=E5=88=97=E7=BB=9F=E4=B8=80=E6=94=B9=E4=B8=BA?=
=?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=89=A7=E8=A1=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
....timestamp-1754345788699-f26a21cb45774.mjs | 69 +++++++++++++++
jcloud/api/domain_west.py | 84 +++++++++----------
2 files changed, 108 insertions(+), 45 deletions(-)
create mode 100644 dashboard/vite.config.ts.timestamp-1754345788699-f26a21cb45774.mjs
diff --git a/dashboard/vite.config.ts.timestamp-1754345788699-f26a21cb45774.mjs b/dashboard/vite.config.ts.timestamp-1754345788699-f26a21cb45774.mjs
new file mode 100644
index 0000000..9f816a0
--- /dev/null
+++ b/dashboard/vite.config.ts.timestamp-1754345788699-f26a21cb45774.mjs
@@ -0,0 +1,69 @@
+// vite.config.ts
+import path from "path";
+import { defineConfig } from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/vite/dist/node/index.js";
+import vue from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/@vitejs/plugin-vue/dist/index.mjs";
+import vueJsx from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs";
+import jingrowui from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/jingrow-ui/vite.js";
+import pluginRewriteAll from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/vite-plugin-rewrite-all/dist/index.mjs";
+import Components from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/unplugin-vue-components/dist/vite.mjs";
+import Icons from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/unplugin-icons/dist/vite.mjs";
+import IconsResolver from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/unplugin-icons/dist/resolver.mjs";
+import { sentryVitePlugin } from "file:///home/jingrow/jingrow-bench/apps/jcloud/dashboard/node_modules/@sentry/vite-plugin/dist/esm/index.mjs";
+var __vite_injected_original_dirname = "/home/jingrow/jingrow-bench/apps/jcloud/dashboard";
+var vite_config_default = defineConfig({
+ plugins: [
+ vue(),
+ vueJsx(),
+ pluginRewriteAll(),
+ jingrowui(),
+ Components({
+ dirs: [
+ "src/components",
+ // 'src2/components',
+ "node_modules/jingrow-ui/src/components"
+ ],
+ resolvers: [IconsResolver()]
+ }),
+ Icons(),
+ sentryVitePlugin({
+ url: process.env.SENTRY_URL,
+ org: process.env.SENTRY_ORG,
+ project: process.env.SENTRY_PROJECT,
+ applicationKey: "jcloud-dashboard",
+ authToken: process.env.SENTRY_AUTH_TOKEN
+ })
+ ],
+ resolve: {
+ alias: {
+ "@": path.resolve(__vite_injected_original_dirname, "src")
+ }
+ },
+ optimizeDeps: {
+ include: ["feather-icons", "showdown"]
+ },
+ build: {
+ outDir: "../jcloud/public/dashboard",
+ emptyOutDir: true,
+ sourcemap: true,
+ target: "es2015",
+ rollupOptions: {
+ input: {
+ main: path.resolve(__vite_injected_original_dirname, "index.html")
+ }
+ }
+ },
+ // @ts-ignore
+ test: {
+ globals: true,
+ environment: "jsdom",
+ setupFiles: "src/tests/setup/msw.js",
+ coverage: {
+ extension: [".vue", ".js"],
+ all: true
+ }
+ }
+});
+export {
+ vite_config_default as default
+};
+//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvaG9tZS9qaW5ncm93L2ppbmdyb3ctYmVuY2gvYXBwcy9qY2xvdWQvZGFzaGJvYXJkXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvaG9tZS9qaW5ncm93L2ppbmdyb3ctYmVuY2gvYXBwcy9qY2xvdWQvZGFzaGJvYXJkL3ZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9ob21lL2ppbmdyb3cvamluZ3Jvdy1iZW5jaC9hcHBzL2pjbG91ZC9kYXNoYm9hcmQvdml0ZS5jb25maWcudHNcIjtpbXBvcnQgcGF0aCBmcm9tICdwYXRoJztcclxuaW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSAndml0ZSc7XHJcbmltcG9ydCB2dWUgZnJvbSAnQHZpdGVqcy9wbHVnaW4tdnVlJztcclxuaW1wb3J0IHZ1ZUpzeCBmcm9tICdAdml0ZWpzL3BsdWdpbi12dWUtanN4JztcclxuaW1wb3J0IGppbmdyb3d1aSBmcm9tICdqaW5ncm93LXVpL3ZpdGUnO1xyXG5pbXBvcnQgcGx1Z2luUmV3cml0ZUFsbCBmcm9tICd2aXRlLXBsdWdpbi1yZXdyaXRlLWFsbCc7XHJcbmltcG9ydCBDb21wb25lbnRzIGZyb20gJ3VucGx1Z2luLXZ1ZS1jb21wb25lbnRzL3ZpdGUnO1xyXG5pbXBvcnQgSWNvbnMgZnJvbSAndW5wbHVnaW4taWNvbnMvdml0ZSc7XHJcbmltcG9ydCBJY29uc1Jlc29sdmVyIGZyb20gJ3VucGx1Z2luLWljb25zL3Jlc29sdmVyJztcclxuaW1wb3J0IHsgc2VudHJ5Vml0ZVBsdWdpbiB9IGZyb20gJ0BzZW50cnkvdml0ZS1wbHVnaW4nO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgZGVmaW5lQ29uZmlnKHtcclxuXHRwbHVnaW5zOiBbXHJcblx0XHR2dWUoKSxcclxuXHRcdHZ1ZUpzeCgpLFxyXG5cdFx0cGx1Z2luUmV3cml0ZUFsbCgpLFxyXG5cdFx0amluZ3Jvd3VpKCksXHJcblx0XHRDb21wb25lbnRzKHtcclxuXHRcdFx0ZGlyczogW1xyXG5cdFx0XHRcdCdzcmMvY29tcG9uZW50cycsXHJcblx0XHRcdFx0Ly8gJ3NyYzIvY29tcG9uZW50cycsXHJcblx0XHRcdFx0J25vZGVfbW9kdWxlcy9qaW5ncm93LXVpL3NyYy9jb21wb25lbnRzJ1xyXG5cdFx0XHRdLFxyXG5cdFx0XHRyZXNvbHZlcnM6IFtJY29uc1Jlc29sdmVyKCldXHJcblx0XHR9KSxcclxuXHRcdEljb25zKCksXHJcblx0XHRzZW50cnlWaXRlUGx1Z2luKHtcclxuXHRcdFx0dXJsOiBwcm9jZXNzLmVudi5TRU5UUllfVVJMLFxyXG5cdFx0XHRvcmc6IHByb2Nlc3MuZW52LlNFTlRSWV9PUkcsXHJcblx0XHRcdHByb2plY3Q6IHByb2Nlc3MuZW52LlNFTlRSWV9QUk9KRUNULFxyXG5cdFx0XHRhcHBsaWNhdGlvbktleTogJ2pjbG91ZC1kYXNoYm9hcmQnLFxyXG5cdFx0XHRhdXRoVG9rZW46IHByb2Nlc3MuZW52LlNFTlRSWV9BVVRIX1RPS0VOXHJcblx0XHR9KVxyXG5cdF0sXHJcblx0cmVzb2x2ZToge1xyXG5cdFx0YWxpYXM6IHtcclxuXHRcdFx0J0AnOiBwYXRoLnJlc29sdmUoX19kaXJuYW1lLCAnc3JjJylcclxuXHRcdH1cclxuXHR9LFxyXG5cdG9wdGltaXplRGVwczoge1xyXG5cdFx0aW5jbHVkZTogWydmZWF0aGVyLWljb25zJywgJ3Nob3dkb3duJ11cclxuXHR9LFxyXG5cdGJ1aWxkOiB7XHJcblx0XHRvdXREaXI6ICcuLi9qY2xvdWQvcHVibGljL2Rhc2hib2FyZCcsXHJcblx0XHRlbXB0eU91dERpcjogdHJ1ZSxcclxuXHRcdHNvdXJjZW1hcDogdHJ1ZSxcclxuXHRcdHRhcmdldDogJ2VzMjAxNScsXHJcblx0XHRyb2xsdXBPcHRpb25zOiB7XHJcblx0XHRcdGlucHV0OiB7XHJcblx0XHRcdFx0bWFpbjogcGF0aC5yZXNvbHZlKF9fZGlybmFtZSwgJ2luZGV4Lmh0bWwnKVxyXG5cdFx0XHR9XHJcblx0XHR9XHJcblx0fSxcclxuXHQvLyBAdHMtaWdub3JlXHJcblx0dGVzdDoge1xyXG5cdFx0Z2xvYmFsczogdHJ1ZSxcclxuXHRcdGVudmlyb25tZW50OiAnanNkb20nLFxyXG5cdFx0c2V0dXBGaWxlczogJ3NyYy90ZXN0cy9zZXR1cC9tc3cuanMnLFxyXG5cdFx0Y292ZXJhZ2U6IHtcclxuXHRcdFx0ZXh0ZW5zaW9uOiBbJy52dWUnLCAnLmpzJ10sXHJcblx0XHRcdGFsbDogdHJ1ZVxyXG5cdFx0fVxyXG5cdH1cclxufSk7XHJcbiJdLAogICJtYXBwaW5ncyI6ICI7QUFBcVUsT0FBTyxVQUFVO0FBQ3RWLFNBQVMsb0JBQW9CO0FBQzdCLE9BQU8sU0FBUztBQUNoQixPQUFPLFlBQVk7QUFDbkIsT0FBTyxlQUFlO0FBQ3RCLE9BQU8sc0JBQXNCO0FBQzdCLE9BQU8sZ0JBQWdCO0FBQ3ZCLE9BQU8sV0FBVztBQUNsQixPQUFPLG1CQUFtQjtBQUMxQixTQUFTLHdCQUF3QjtBQVRqQyxJQUFNLG1DQUFtQztBQVd6QyxJQUFPLHNCQUFRLGFBQWE7QUFBQSxFQUMzQixTQUFTO0FBQUEsSUFDUixJQUFJO0FBQUEsSUFDSixPQUFPO0FBQUEsSUFDUCxpQkFBaUI7QUFBQSxJQUNqQixVQUFVO0FBQUEsSUFDVixXQUFXO0FBQUEsTUFDVixNQUFNO0FBQUEsUUFDTDtBQUFBO0FBQUEsUUFFQTtBQUFBLE1BQ0Q7QUFBQSxNQUNBLFdBQVcsQ0FBQyxjQUFjLENBQUM7QUFBQSxJQUM1QixDQUFDO0FBQUEsSUFDRCxNQUFNO0FBQUEsSUFDTixpQkFBaUI7QUFBQSxNQUNoQixLQUFLLFFBQVEsSUFBSTtBQUFBLE1BQ2pCLEtBQUssUUFBUSxJQUFJO0FBQUEsTUFDakIsU0FBUyxRQUFRLElBQUk7QUFBQSxNQUNyQixnQkFBZ0I7QUFBQSxNQUNoQixXQUFXLFFBQVEsSUFBSTtBQUFBLElBQ3hCLENBQUM7QUFBQSxFQUNGO0FBQUEsRUFDQSxTQUFTO0FBQUEsSUFDUixPQUFPO0FBQUEsTUFDTixLQUFLLEtBQUssUUFBUSxrQ0FBVyxLQUFLO0FBQUEsSUFDbkM7QUFBQSxFQUNEO0FBQUEsRUFDQSxjQUFjO0FBQUEsSUFDYixTQUFTLENBQUMsaUJBQWlCLFVBQVU7QUFBQSxFQUN0QztBQUFBLEVBQ0EsT0FBTztBQUFBLElBQ04sUUFBUTtBQUFBLElBQ1IsYUFBYTtBQUFBLElBQ2IsV0FBVztBQUFBLElBQ1gsUUFBUTtBQUFBLElBQ1IsZUFBZTtBQUFBLE1BQ2QsT0FBTztBQUFBLFFBQ04sTUFBTSxLQUFLLFFBQVEsa0NBQVcsWUFBWTtBQUFBLE1BQzNDO0FBQUEsSUFDRDtBQUFBLEVBQ0Q7QUFBQTtBQUFBLEVBRUEsTUFBTTtBQUFBLElBQ0wsU0FBUztBQUFBLElBQ1QsYUFBYTtBQUFBLElBQ2IsWUFBWTtBQUFBLElBQ1osVUFBVTtBQUFBLE1BQ1QsV0FBVyxDQUFDLFFBQVEsS0FBSztBQUFBLE1BQ3pCLEtBQUs7QUFBQSxJQUNOO0FBQUEsRUFDRDtBQUNELENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index 5581b94..195ed8a 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -1126,7 +1126,7 @@ def west_domain_add_dns_record(**data):
# 获取新增记录的ID
record_id = response.get("data", {}).get("id")
- # 异步添加记录到本地数据库
+ # 同步添加记录到本地数据库
if record_id:
try:
# 查找对应的域名记录
@@ -1138,24 +1138,26 @@ def west_domain_add_dns_record(**data):
if domain_records:
domain_record = domain_records[0]
- jingrow.enqueue(
- "jingrow.client.insert_pg",
- pg={
- "pagetype": "Dns Resolution",
- "parenttype": "Jsite Domain",
- "parent": domain_record.name,
- "parentfield": "dns_resolution",
- "host": host,
- "type": record_type,
- "value": value,
- "ttl": str(ttl),
- "level": str(level),
- "line": line,
- "record_id": record_id
- }
+ # 立即执行插入操作
+ # 先获取父记录
+ parent_pg = jingrow.get_pg("Jsite Domain", domain_record.name)
+ # 创建新的DNS记录作为子记录
+ dns_pg = jingrow.new_pg(
+ "Dns Resolution",
+ parent_pg=parent_pg,
+ parentfield="dns_resolution",
+ host=host,
+ type=record_type,
+ value=value,
+ ttl=str(ttl),
+ level=str(level),
+ line=line,
+ record_id=record_id
)
+ dns_pg.insert(ignore_permissions=True)
+ jingrow.db.commit()
except Exception as e:
- jingrow.log_error(f"域名 {domain} DNS记录异步添加失败", f"错误: {str(e)}")
+ jingrow.log_error(f"域名 {domain} DNS记录同步添加失败", f"错误: {str(e)}")
# 返回成功结果
return {
@@ -1215,7 +1217,7 @@ def west_domain_delete_dns_record(**data):
error_msg = response.get('msg', response.get('message', '未知错误'))
return {"status": "error", "message": f"删除DNS记录失败: {error_msg}"}
- # 异步删除本地数据库中的对应记录
+ # 同步删除本地数据库中的对应记录
if record_id:
try:
dns_records = jingrow.get_all(
@@ -1226,13 +1228,11 @@ def west_domain_delete_dns_record(**data):
if dns_records:
dns_record = dns_records[0]
- jingrow.enqueue(
- "jingrow.client.delete_pg",
- pagetype="Dns Resolution",
- name=dns_record.name
- )
+ # 立即执行删除操作
+ jingrow.delete_pg("Dns Resolution", dns_record.name, ignore_permissions=True)
+ jingrow.db.commit()
except Exception as e:
- jingrow.log_error(f"域名 {domain} DNS记录异步删除失败", f"错误: {str(e)}")
+ jingrow.log_error(f"域名 {domain} DNS记录同步删除失败", f"错误: {str(e)}")
# 返回成功结果
return {
@@ -1298,7 +1298,7 @@ def west_domain_delete_dns_records(**data):
"status": "success"
})
- # 异步删除本地数据库中的对应记录
+ # 同步删除本地数据库中的对应记录
try:
dns_records = jingrow.get_all(
"Dns Resolution",
@@ -1308,13 +1308,11 @@ def west_domain_delete_dns_records(**data):
if dns_records:
dns_record = dns_records[0]
- jingrow.enqueue(
- "jingrow.client.delete_pg",
- pagetype="Dns Resolution",
- name=dns_record.name
- )
+ # 立即执行删除操作
+ jingrow.delete_pg("Dns Resolution", dns_record.name, ignore_permissions=True)
+ jingrow.db.commit()
except Exception as e:
- jingrow.log_error(f"域名 {domain} DNS记录异步删除失败", f"记录ID: {record_id}, 错误: {str(e)}")
+ jingrow.log_error(f"域名 {domain} DNS记录同步删除失败", f"记录ID: {record_id}, 错误: {str(e)}")
except Exception as e:
error_count += 1
@@ -2372,7 +2370,7 @@ def west_domain_modify_dns_record(**data):
error_msg = response.get('msg', response.get('message', '未知错误'))
return {"status": "error", "message": f"修改DNS记录失败: {error_msg}"}
- # 异步更新本地数据库中的对应记录
+ # 同步更新本地数据库中的对应记录
if record_id:
try:
# 查找对应的DNS记录
@@ -2384,20 +2382,16 @@ def west_domain_modify_dns_record(**data):
if dns_records:
dns_record = dns_records[0]
- # 使用jingrow自带的异步更新方法
- jingrow.enqueue(
- "jingrow.client.set_value",
- pagetype="Dns Resolution",
- name=dns_record.name,
- fieldname={
- "value": value,
- "ttl": str(ttl),
- "level": str(level),
- "line": line
- }
- )
+ # 立即执行更新操作
+ jingrow.set_value("Dns Resolution", dns_record.name, {
+ "value": value,
+ "ttl": str(ttl),
+ "level": str(level),
+ "line": line
+ })
+ jingrow.db.commit()
except Exception as e:
- jingrow.log_error(f"域名 {domain} DNS记录异步更新失败", f"错误: {str(e)}")
+ jingrow.log_error(f"域名 {domain} DNS记录同步更新失败", f"错误: {str(e)}")
# 返回成功结果
return {
--
2.48.1
From 059a4aa7b69b040b2c837b4bfb900955a38000f9 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 06:48:06 +0800
Subject: [PATCH 147/250] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=90=8C=E6=AD=A5?=
=?UTF-8?q?=E5=9F=9F=E5=90=8D=E4=BF=A1=E6=81=AF=E5=87=BD=E6=95=B0=E7=9A=84?=
=?UTF-8?q?=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jcloud/api/domain_west.py | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index 195ed8a..923206b 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -2629,9 +2629,7 @@ def sync_domain_info_from_west(**data):
c_sysid = real_data.get("c_sysid")
owner_info = real_data.get("owner", {})
- # 添加调试日志
- jingrow.log_error(f"Domain Owner同步调试", f"域名: {domain}, c_sysid: {c_sysid}, owner_info: {owner_info}")
- jingrow.log_error(f"real_data完整信息", f"real_data: {real_data}")
+
if c_sysid:
# 如果owner_info为空,使用real_data中的所有者字段
@@ -2646,25 +2644,17 @@ def sync_domain_info_from_west(**data):
["name", "team"]
)
- # 添加调试日志
- jingrow.log_error(f"Domain Owner查找结果", f"c_sysid: {c_sysid}, 域名团队: {team.name}, 找到记录数: {len(existing_owners)}")
- if existing_owners:
- jingrow.log_error(f"找到的Domain Owner", f"名称: {existing_owners[0].name}, 原团队: {existing_owners[0].team or '空'}")
- else:
- jingrow.log_error(f"未找到Domain Owner", f"将创建新的")
+
if existing_owners:
# 更新已存在的Domain Owner
domain_owner_name = existing_owners[0].name
existing_team = existing_owners[0].team
- jingrow.log_error(f"Domain Owner更新逻辑", f"找到现有记录: {domain_owner_name}, 原团队: {existing_team}, 当前团队: {team.name}")
try:
domain_owner_pg = jingrow.get_pg("Domain Owner", domain_owner_name)
if domain_owner_pg:
# 更新团队信息(如果不同或为空)
if not domain_owner_pg.team or domain_owner_pg.team != team.name:
- old_team = domain_owner_pg.team or "空"
- jingrow.log_error(f"Domain Owner团队更新", f"从 {old_team} 更新为 {team.name}")
domain_owner_pg.team = team.name
# 更新所有者信息
@@ -2715,12 +2705,10 @@ def sync_domain_info_from_west(**data):
domain_owner_pg.c_idtype_gswl = str(orgfile.get("f_type"))
domain_owner_pg.save(ignore_permissions=True)
- jingrow.log_error(f"Domain Owner更新成功", f"名称: {domain_owner_name}")
except Exception as e:
jingrow.log_error(f"更新Domain Owner失败", f"域名: {domain}, c_sysid: {c_sysid}, 错误: {str(e)}")
else:
# 创建新的Domain Owner
- jingrow.log_error(f"Domain Owner创建逻辑", f"未找到现有记录,将创建新记录,c_sysid: {c_sysid}, 域名团队: {team.name}")
try:
# 判断所有者类型(个人或企业)
c_regtype = "E" if owner_info.get("dom_org_m") else "I"
@@ -2787,7 +2775,6 @@ def sync_domain_info_from_west(**data):
domain_owner_pg = jingrow.get_pg(owner_data)
domain_owner_pg.insert(ignore_permissions=True)
domain_owner_name = domain_owner_pg.name
- jingrow.log_error(f"Domain Owner创建成功", f"名称: {domain_owner_name}, c_sysid: {c_sysid}")
except Exception as e:
jingrow.log_error(f"创建Domain Owner失败", f"域名: {domain}, c_sysid: {c_sysid}, 错误: {str(e)}")
--
2.48.1
From 89da3443a7aafbe6a52271f01eb7ff156d4afd20 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 17:07:42 +0800
Subject: [PATCH 148/250] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9F=9F=E5=90=8D?=
=?UTF-8?q?=E7=8A=B6=E6=80=81=E9=80=89=E9=A1=B9=E5=80=BC=EF=BC=8C=E5=9F=9F?=
=?UTF-8?q?=E5=90=8D=E6=89=80=E6=9C=89=E8=80=85=E5=A2=9E=E5=8A=A0=E5=88=9D?=
=?UTF-8?q?=E5=AE=A1=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainOverview.vue | 23 +++++++++++++++----
.../pagetype/domain_owner/domain_owner.json | 15 ++++++++----
.../pagetype/domain_owner/domain_owner.py | 3 ++-
.../pagetype/jsite_domain/jsite_domain.json | 5 ++--
.../pagetype/jsite_domain/jsite_domain.py | 2 +-
5 files changed, 35 insertions(+), 13 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainOverview.vue b/dashboard/src2/components/JsiteDomainOverview.vue
index 4940080..62bdfa2 100644
--- a/dashboard/src2/components/JsiteDomainOverview.vue
+++ b/dashboard/src2/components/JsiteDomainOverview.vue
@@ -133,6 +133,13 @@
>
{{ $domain.pg.whois_protection ? '关闭隐私保护' : '开启隐私保护' }}
+
+ 上传实名资料
+
@@ -207,15 +214,23 @@ export default {
methods: {
getStatusText(status) {
const statusMap = {
- 'Active': '正常',
- 'Expired': '已过期'
+ 'ok': '正常',
+ 'clientHold': '锁定',
+ 'clientUpdateProhibited': '更新锁定',
+ 'clientTransferProhibited': '转移锁定',
+ 'clientDeleteProhibited': '删除锁定',
+ 'clientRenewProhibited': '续费锁定'
};
return statusMap[status] || status;
},
getStatusVariant(status) {
const variantMap = {
- 'Active': 'success',
- 'Expired': 'danger'
+ 'ok': 'success',
+ 'clientHold': 'danger',
+ 'clientUpdateProhibited': 'danger',
+ 'clientTransferProhibited': 'danger',
+ 'clientDeleteProhibited': 'danger',
+ 'clientRenewProhibited': 'danger'
};
return variantMap[status] || 'default';
},
diff --git a/jcloud/jcloud/pagetype/domain_owner/domain_owner.json b/jcloud/jcloud/pagetype/domain_owner/domain_owner.json
index 44a9070..698233a 100644
--- a/jcloud/jcloud/pagetype/domain_owner/domain_owner.json
+++ b/jcloud/jcloud/pagetype/domain_owner/domain_owner.json
@@ -23,6 +23,7 @@
"c_pc",
"team",
"r_status",
+ "c_status",
"section_break_ssfs",
"c_org_m",
"c_ln_m",
@@ -226,16 +227,22 @@
"label": "模板标识"
},
{
- "default": "0",
"fieldname": "r_status",
- "fieldtype": "Check",
- "label": "实名认证"
+ "fieldtype": "Select",
+ "label": "实名认证",
+ "options": "0\n1\n2\n3\n4\n5"
+ },
+ {
+ "fieldname": "c_status",
+ "fieldtype": "Select",
+ "label": "初审状态",
+ "options": "0\n1\n2\n3\n4"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2025-08-03 12:37:48.526845",
+ "modified": "2025-08-05 16:44:31.926846",
"modified_by": "Administrator",
"module": "Jcloud",
"name": "Domain Owner",
diff --git a/jcloud/jcloud/pagetype/domain_owner/domain_owner.py b/jcloud/jcloud/pagetype/domain_owner/domain_owner.py
index 9d3e349..602fcd4 100644
--- a/jcloud/jcloud/pagetype/domain_owner/domain_owner.py
+++ b/jcloud/jcloud/pagetype/domain_owner/domain_owner.py
@@ -38,10 +38,11 @@ class DomainOwner(Document):
c_regtype: DF.Literal["", "I", "E"]
c_st: DF.Data | None
c_st_m: DF.Data | None
+ c_status: DF.Literal["0", "1", "2", "3", "4"]
c_sysid: DF.Data | None
cocode: DF.Data | None
fullname: DF.Data | None
- r_status: DF.Check
+ r_status: DF.Literal["0", "1", "2", "3", "4", "5"]
reg_contact_type: DF.Literal["", "cg", "hk", "tw", "jingwai"]
team: DF.Link | None
title: DF.Data | None
diff --git a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.json b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.json
index 40ffab9..537dbc1 100644
--- a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.json
+++ b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.json
@@ -40,13 +40,12 @@
"options": "Team"
},
{
- "default": "Active",
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "状态",
- "options": "Active\nExpired"
+ "options": "ok\nclientHold\nclientUpdateProhibited"
},
{
"fieldname": "order_id",
@@ -196,7 +195,7 @@
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2025-08-02 20:35:58.740670",
+ "modified": "2025-08-05 16:59:44.708289",
"modified_by": "Administrator",
"module": "Jcloud",
"name": "Jsite Domain",
diff --git a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.py b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.py
index cc722cc..322d55b 100644
--- a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.py
+++ b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.py
@@ -34,7 +34,7 @@ class JsiteDomain(Document):
period: DF.Int
price: DF.Int
registration_date: DF.Datetime | None
- status: DF.Literal["Active", "Expired"]
+ status: DF.Literal["ok", "clientHold", "clientUpdateProhibited"]
team: DF.Link | None
whois_protection: DF.Check
# end: auto-generated types
--
2.48.1
From 6d981a7dc29f01f7d3b519aca9f9fcc9e138987a Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 18:11:03 +0800
Subject: [PATCH 149/250] =?UTF-8?q?=E5=9F=9F=E5=90=8D=E6=B3=A8=E5=86=8C?=
=?UTF-8?q?=E4=B9=8B=E5=90=8E=E8=87=AA=E5=8A=A8=E5=90=8C=E6=AD=A5=E5=9F=9F?=
=?UTF-8?q?=E5=90=8D=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src2/components/JsiteDomainOverview.vue | 20 ++++++-------
jcloud/api/domain_west.py | 28 +++++++++++--------
.../pagetype/jsite_domain/jsite_domain.json | 4 +--
.../pagetype/jsite_domain/jsite_domain.py | 2 +-
4 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainOverview.vue b/dashboard/src2/components/JsiteDomainOverview.vue
index 62bdfa2..7b58202 100644
--- a/dashboard/src2/components/JsiteDomainOverview.vue
+++ b/dashboard/src2/components/JsiteDomainOverview.vue
@@ -215,22 +215,22 @@ export default {
getStatusText(status) {
const statusMap = {
'ok': '正常',
- 'clientHold': '锁定',
- 'clientUpdateProhibited': '更新锁定',
- 'clientTransferProhibited': '转移锁定',
- 'clientDeleteProhibited': '删除锁定',
- 'clientRenewProhibited': '续费锁定'
+ 'clienthold': '锁定',
+ 'clientupdateprohibited': '更新锁定',
+ 'clienttransferprohibited': '转移锁定',
+ 'clientdeleteprohibited': '删除锁定',
+ 'clientrenewprohibited': '续费锁定'
};
return statusMap[status] || status;
},
getStatusVariant(status) {
const variantMap = {
'ok': 'success',
- 'clientHold': 'danger',
- 'clientUpdateProhibited': 'danger',
- 'clientTransferProhibited': 'danger',
- 'clientDeleteProhibited': 'danger',
- 'clientRenewProhibited': 'danger'
+ 'clienthold': 'danger',
+ 'clientupdateprohibited': 'danger',
+ 'clienttransferprohibited': 'danger',
+ 'clientdeleteprohibited': 'danger',
+ 'clientrenewprohibited': 'danger'
};
return variantMap[status] || 'default';
},
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index 923206b..3334816 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -1458,7 +1458,6 @@ def create_domain_order(domain, period=1, payment_method='balance', domain_owner
"domain_owner": domain_owner,
"yearly_price": yearly_price,
"auto_renew": False,
- "whois_protection": True,
# 注册域名所需参数
"regyear": period,
"dns_host1": "ns1.myhostadmin.net",
@@ -1582,9 +1581,6 @@ def register_domain_from_order(order_name):
domain_name = biz_params.get("domain")
period = biz_params.get("period", 1)
domain_owner = biz_params.get("domain_owner")
- yearly_price = biz_params.get("yearly_price", 0)
- auto_renew = biz_params.get("auto_renew", False)
- whois_protection = biz_params.get("whois_protection", True)
if not domain_name:
raise Exception("订单中缺少域名信息")
@@ -1613,12 +1609,8 @@ def register_domain_from_order(order_name):
"domain": domain_name,
"team": order.team,
"order_id": order.order_id,
- "status": "Active",
- "price": yearly_price,
"period": period,
"domain_owner": domain_owner,
- "auto_renew": auto_renew,
- "whois_protection": whois_protection,
"registration_date": jingrow.utils.nowdate(),
"end_date": jingrow.utils.add_months(jingrow.utils.nowdate(), period * 12)
})
@@ -1630,6 +1622,17 @@ def register_domain_from_order(order_name):
jingrow.db.commit()
+ # 异步执行域名信息同步
+ try:
+ jingrow.enqueue(
+ "jcloud.api.domain_west.sync_domain_info_from_west",
+ domain=domain_name,
+ queue="default",
+ timeout=300
+ )
+ except Exception as e:
+ jingrow.log_error(f"域名 {domain_name} 异步同步任务创建失败", f"错误: {str(e)}")
+
return True
except Exception as e:
@@ -2660,11 +2663,13 @@ def sync_domain_info_from_west(**data):
# 更新所有者信息
owner_name = owner_info.get("dom_org_m") or owner_info.get("dom_ln_m", "") + owner_info.get("dom_fn_m", "")
domain_owner_pg.fullname = owner_name
- domain_owner_pg.r_status = 1 # 已实名认证
+ domain_owner_pg.c_status = real_data.get("c_status")
+ domain_owner_pg.r_status = real_data.get("r_status")
# 更新国家代码和电话代码
domain_owner_pg.c_co = owner_info.get("dom_co", "CN")
domain_owner_pg.cocode = owner_info.get("dom_ph", "").split('.')[0] if '.' in owner_info.get("dom_ph", "") else "+86" # 从手机号提取电话代码
+
# 根据类型更新不同字段
c_regtype = "E" if owner_info.get("dom_org_m") else "I"
@@ -2726,7 +2731,8 @@ def sync_domain_info_from_west(**data):
"c_co": owner_info.get("dom_co", "CN"), # 从数据中获取国家代码
"cocode": owner_info.get("dom_ph", "").split('.')[0] if '.' in owner_info.get("dom_ph", "") else "+86", # 从手机号提取电话代码
"reg_contact_type": "cg",
- "r_status": 1, # 已实名认证
+ "c_status": real_data.get("c_status"),
+ "r_status": real_data.get("r_status"),
"title": owner_name
}
@@ -2788,7 +2794,7 @@ def sync_domain_info_from_west(**data):
if real_data:
domain_pg.registration_date = real_data.get("regdate")
domain_pg.end_date = real_data.get("rexpiredate")
- domain_pg.status = "Active" if real_data.get("status") == "ok" else "Expired"
+ domain_pg.status = real_data.get("status")
# 更新DNS服务器信息
domain_pg.dns_host1 = real_data.get("dns_host1", "")
diff --git a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.json b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.json
index 537dbc1..0c71df3 100644
--- a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.json
+++ b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.json
@@ -45,7 +45,7 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "状态",
- "options": "ok\nclientHold\nclientUpdateProhibited"
+ "options": "ok\nclienthold\nclientHold\nclientupdateprohibited\nclientUpdateProhibited\nclienttransferprohibited\nclientTransferProhibited\nclientdeleteprohibited\nclientDeleteProhibited\nclientrenewprohibited\nclientRenewProhibited"
},
{
"fieldname": "order_id",
@@ -195,7 +195,7 @@
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2025-08-05 16:59:44.708289",
+ "modified": "2025-08-05 17:46:02.311435",
"modified_by": "Administrator",
"module": "Jcloud",
"name": "Jsite Domain",
diff --git a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.py b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.py
index 322d55b..8e82b7c 100644
--- a/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.py
+++ b/jcloud/jcloud/pagetype/jsite_domain/jsite_domain.py
@@ -34,7 +34,7 @@ class JsiteDomain(Document):
period: DF.Int
price: DF.Int
registration_date: DF.Datetime | None
- status: DF.Literal["ok", "clientHold", "clientUpdateProhibited"]
+ status: DF.Literal["ok", "clienthold", "clientHold", "clientupdateprohibited", "clientUpdateProhibited", "clienttransferprohibited", "clientTransferProhibited", "clientdeleteprohibited", "clientDeleteProhibited", "clientrenewprohibited", "clientRenewProhibited"]
team: DF.Link | None
whois_protection: DF.Check
# end: auto-generated types
--
2.48.1
From f3e192d8c44d0ec77945bad75db171d428d856ad Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 18:37:37 +0800
Subject: [PATCH 150/250] =?UTF-8?q?=E5=8F=AA=E5=9C=A8=E6=89=80=E6=9C=89?=
=?UTF-8?q?=E8=80=85=E5=B7=B2=E5=AE=8C=E6=88=90=E5=AE=9E=E5=90=8D=E8=AE=A4?=
=?UTF-8?q?=E8=AF=81=E5=90=8E=E6=89=8D=E6=9B=B4=E6=96=B0=E6=88=96=E5=88=9B?=
=?UTF-8?q?=E5=BB=BA=E5=9F=9F=E5=90=8D=E6=89=80=E6=9C=89=E8=80=85=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jcloud/api/domain_west.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py
index 3334816..eba9be3 100644
--- a/jcloud/api/domain_west.py
+++ b/jcloud/api/domain_west.py
@@ -2627,7 +2627,7 @@ def sync_domain_info_from_west(**data):
# 同步Domain Owner信息
domain_owner_name = None
- if real_data:
+ if real_data and real_data.get("r_status") == 1:
# 从实名信息中提取c_sysid和所有者信息
c_sysid = real_data.get("c_sysid")
owner_info = real_data.get("owner", {})
--
2.48.1
From d80c0ff85dd5772d23ff3872e4b5841e9d4251d6 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 18:53:21 +0800
Subject: [PATCH 151/250] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9F=9F=E5=90=8D?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E7=9A=84=E7=8A=B6=E6=80=81=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5=E6=98=A0=E5=B0=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dashboard/src2/objects/domain.js | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/dashboard/src2/objects/domain.js b/dashboard/src2/objects/domain.js
index 2731a20..3cf31ce 100644
--- a/dashboard/src2/objects/domain.js
+++ b/dashboard/src2/objects/domain.js
@@ -43,8 +43,8 @@ export default {
fieldname: 'status',
options: [
{ label: '', value: '' },
- { label: '正常', value: 'Active' },
- { label: '已过期', value: 'Expired' }
+ { label: '正常', value: 'ok' },
+ { label: '锁定', value: 'clienthold' }
]
}
];
@@ -68,11 +68,8 @@ export default {
width: 0.8,
format(value) {
const statusMap = {
- 'Pending': '待处理',
- 'Active': '正常',
- 'Expired': '已过期',
- 'Suspended': '已暂停',
- 'Cancelled': '已取消'
+ 'ok': '正常',
+ 'clienthold': '锁定'
};
return statusMap[value] || value;
}
--
2.48.1
From 991b34232b3f04f29d07c5718bb69b9decb325f1 Mon Sep 17 00:00:00 2001
From: jingrow
Date: Tue, 5 Aug 2025 21:07:16 +0800
Subject: [PATCH 152/250] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9F=9F=E5=90=8D?=
=?UTF-8?q?=E6=89=80=E6=9C=89=E8=80=85=E5=AE=9E=E5=90=8D=E8=B5=84=E6=96=99?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0api=E7=AB=AF=E7=82=B9=E5=8F=8A=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95=E9=80=9A=E8=BF=87=E4=BD=86=E6=98=AF=E6=B2=A1=E6=9C=89?=
=?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=B7=B2=E6=8F=90=E4=BA=A4=E6=88=90=E5=8A=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../JsiteDomainUploadRealNameDialog.vue | 686 ++++++++----------
jcloud/api/domain_west.py | 187 ++++-
2 files changed, 478 insertions(+), 395 deletions(-)
diff --git a/dashboard/src2/components/JsiteDomainUploadRealNameDialog.vue b/dashboard/src2/components/JsiteDomainUploadRealNameDialog.vue
index 5e5f4d5..fe00039 100644
--- a/dashboard/src2/components/JsiteDomainUploadRealNameDialog.vue
+++ b/dashboard/src2/components/JsiteDomainUploadRealNameDialog.vue
@@ -1,270 +1,196 @@
- |