域名详情页所有者显示为个人姓名或公司名称,状态显示为正常或已到期
This commit is contained in:
parent
e9fb158101
commit
d9b3edb7ae
@ -59,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<span class="text-gray-600">所有者:</span>
|
<span class="text-gray-600">所有者:</span>
|
||||||
<span class="text-lg font-semibold text-purple-600">{{ $domain.pg.domain_owner || '未知' }}</span>
|
<span class="text-lg font-semibold text-purple-600">{{ getOwnerDisplayName() || '未知' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<span class="text-gray-600">购买时长:</span>
|
<span class="text-gray-600">购买时长:</span>
|
||||||
@ -208,29 +208,70 @@ export default {
|
|||||||
autoRenewLoading: false,
|
autoRenewLoading: false,
|
||||||
whoisProtectionLoading: false,
|
whoisProtectionLoading: false,
|
||||||
deleteLoading: false,
|
deleteLoading: false,
|
||||||
|
domainOwner: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getStatusText(status) {
|
getStatusText(status) {
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
'Pending': '待处理',
|
'Active': '正常',
|
||||||
'Active': '活跃',
|
'Expired': '已过期'
|
||||||
'Expired': '已过期',
|
|
||||||
'Suspended': '已暂停',
|
|
||||||
'Cancelled': '已取消'
|
|
||||||
};
|
};
|
||||||
return statusMap[status] || status;
|
return statusMap[status] || status;
|
||||||
},
|
},
|
||||||
getStatusVariant(status) {
|
getStatusVariant(status) {
|
||||||
const variantMap = {
|
const variantMap = {
|
||||||
'Pending': 'warning',
|
|
||||||
'Active': 'success',
|
'Active': 'success',
|
||||||
'Expired': 'danger',
|
'Expired': 'danger'
|
||||||
'Suspended': 'danger',
|
|
||||||
'Cancelled': 'danger'
|
|
||||||
};
|
};
|
||||||
return variantMap[status] || 'default';
|
return variantMap[status] || 'default';
|
||||||
},
|
},
|
||||||
|
// 获取域名所有者显示名称
|
||||||
|
getOwnerDisplayName() {
|
||||||
|
if (!this.domainOwner) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是个人,优先显示fullname,没有的话显示title
|
||||||
|
if (this.domainOwner.c_regtype === 'I') {
|
||||||
|
return this.domainOwner.fullname || this.domainOwner.title;
|
||||||
|
}
|
||||||
|
// 如果是公司,优先显示c_org_m,没有的话显示title
|
||||||
|
else if (this.domainOwner.c_regtype === 'E') {
|
||||||
|
return this.domainOwner.c_org_m || this.domainOwner.title;
|
||||||
|
}
|
||||||
|
// 默认显示title
|
||||||
|
return this.domainOwner.title;
|
||||||
|
},
|
||||||
|
// 获取域名所有者信息
|
||||||
|
async getDomainOwner() {
|
||||||
|
if (!this.$domain.pg?.domain_owner) {
|
||||||
|
this.domainOwner = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const getOwnerRequest = createResource({
|
||||||
|
url: 'jcloud.api.domain_west.get_domain_owner',
|
||||||
|
params: {
|
||||||
|
name: this.$domain.pg.domain_owner
|
||||||
|
},
|
||||||
|
onSuccess: (response) => {
|
||||||
|
if (response && response.status === "Success" && response.data) {
|
||||||
|
this.domainOwner = response.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.error('获取域名所有者信息失败:', error);
|
||||||
|
this.domainOwner = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getOwnerRequest.submit();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取域名所有者信息失败:', error);
|
||||||
|
this.domainOwner = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
renewDomain() {
|
renewDomain() {
|
||||||
const JsiteDomainRenewalDialog = defineAsyncComponent(() => import('./JsiteDomainRenewalDialog.vue'));
|
const JsiteDomainRenewalDialog = defineAsyncComponent(() => import('./JsiteDomainRenewalDialog.vue'));
|
||||||
|
|
||||||
@ -273,12 +314,12 @@ export default {
|
|||||||
primaryAction: {
|
primaryAction: {
|
||||||
label: '确定',
|
label: '确定',
|
||||||
onClick: ({ hide }) => {
|
onClick: ({ hide }) => {
|
||||||
toast.success(`${actionText}自动续费请求已提交`);
|
toast.success(`${actionText}自动续费已开通`);
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
this.autoRenewLoading = true;
|
this.autoRenewLoading = true;
|
||||||
const toggleRequest = createResource({
|
const toggleRequest = createResource({
|
||||||
url: '/api/action/jcloud.api.domain_west.toggle_domain_auto_renew',
|
url: 'jcloud.api.domain_west.toggle_domain_auto_renew',
|
||||||
params: {
|
params: {
|
||||||
pagetype: 'Jsite Domain',
|
pagetype: 'Jsite Domain',
|
||||||
name: this.$domain.pg.name,
|
name: this.$domain.pg.name,
|
||||||
@ -313,12 +354,12 @@ export default {
|
|||||||
primaryAction: {
|
primaryAction: {
|
||||||
label: '确定',
|
label: '确定',
|
||||||
onClick: ({ hide }) => {
|
onClick: ({ hide }) => {
|
||||||
toast.success(`${actionText}隐私保护请求已提交`);
|
toast.success(`${actionText}隐私保护已开启`);
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
this.whoisProtectionLoading = true;
|
this.whoisProtectionLoading = true;
|
||||||
const toggleRequest = createResource({
|
const toggleRequest = createResource({
|
||||||
url: '/api/action/jcloud.api.domain_west.toggle_domain_whois_protection',
|
url: 'jcloud.api.domain_west.toggle_domain_whois_protection',
|
||||||
params: {
|
params: {
|
||||||
pagetype: 'Jsite Domain',
|
pagetype: 'Jsite Domain',
|
||||||
name: this.$domain.pg.name,
|
name: this.$domain.pg.name,
|
||||||
@ -355,7 +396,7 @@ export default {
|
|||||||
|
|
||||||
this.deleteLoading = true;
|
this.deleteLoading = true;
|
||||||
const deleteRequest = createResource({
|
const deleteRequest = createResource({
|
||||||
url: '/api/action/jcloud.api.domain_west.delete_domain',
|
url: 'jcloud.api.domain_west.delete_domain',
|
||||||
params: {
|
params: {
|
||||||
pagetype: 'Jsite Domain',
|
pagetype: 'Jsite Domain',
|
||||||
name: this.$domain.pg.name
|
name: this.$domain.pg.name
|
||||||
@ -384,6 +425,19 @@ export default {
|
|||||||
this.$domain.reload();
|
this.$domain.reload();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听域名数据变化,重新获取所有者信息
|
||||||
|
'$domain.pg.domain_owner': {
|
||||||
|
handler(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.getDomainOwner();
|
||||||
|
} else {
|
||||||
|
this.domainOwner = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
domainInformation() {
|
domainInformation() {
|
||||||
return [
|
return [
|
||||||
@ -405,7 +459,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '所有者',
|
label: '所有者',
|
||||||
value: this.$domain.pg?.domain_owner || '未知',
|
value: this.getOwnerDisplayName() || '未知',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
@ -413,5 +467,11 @@ export default {
|
|||||||
return getCachedDocumentResource('Jsite Domain', this.domain);
|
return getCachedDocumentResource('Jsite Domain', this.domain);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
// 初始化时获取域名所有者信息
|
||||||
|
if (this.$domain.pg?.domain_owner) {
|
||||||
|
this.getDomainOwner();
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -1094,6 +1094,48 @@ def get_domain_owners():
|
|||||||
jingrow.log_error("获取域名所有者列表失败", str(e))
|
jingrow.log_error("获取域名所有者列表失败", str(e))
|
||||||
return {"status": "Error", "message": f"获取域名所有者列表失败: {str(e)}"}
|
return {"status": "Error", "message": f"获取域名所有者列表失败: {str(e)}"}
|
||||||
|
|
||||||
|
@jingrow.whitelist()
|
||||||
|
def get_domain_owner(name):
|
||||||
|
"""获取单个域名所有者信息"""
|
||||||
|
try:
|
||||||
|
if not name:
|
||||||
|
return {"status": "Error", "message": "域名所有者名称不能为空"}
|
||||||
|
|
||||||
|
# 获取指定的域名所有者
|
||||||
|
domain_owner = jingrow.get_pg("Domain Owner", name)
|
||||||
|
if not domain_owner:
|
||||||
|
return {"status": "Error", "message": "未找到指定的域名所有者"}
|
||||||
|
|
||||||
|
# 检查权限(只能查看当前团队的所有者)
|
||||||
|
team = get_current_team()
|
||||||
|
if not team or domain_owner.team != team:
|
||||||
|
return {"status": "Error", "message": "无权访问该域名所有者信息"}
|
||||||
|
|
||||||
|
# 返回所有者信息
|
||||||
|
owner_data = {
|
||||||
|
"name": domain_owner.name,
|
||||||
|
"title": domain_owner.title,
|
||||||
|
"fullname": domain_owner.fullname,
|
||||||
|
"c_regtype": domain_owner.c_regtype,
|
||||||
|
"c_org_m": domain_owner.c_org_m,
|
||||||
|
"c_ln_m": domain_owner.c_ln_m,
|
||||||
|
"c_fn_m": domain_owner.c_fn_m,
|
||||||
|
"c_em": domain_owner.c_em,
|
||||||
|
"c_ph": domain_owner.c_ph,
|
||||||
|
"c_st_m": domain_owner.c_st_m,
|
||||||
|
"c_ct_m": domain_owner.c_ct_m,
|
||||||
|
"c_adr_m": domain_owner.c_adr_m,
|
||||||
|
"c_pc": domain_owner.c_pc
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
"status": "Success",
|
||||||
|
"data": owner_data
|
||||||
|
}
|
||||||
|
except Exception as e:
|
||||||
|
jingrow.log_error("获取域名所有者信息失败", str(e))
|
||||||
|
return {"status": "Error", "message": f"获取域名所有者信息失败: {str(e)}"}
|
||||||
|
|
||||||
@jingrow.whitelist()
|
@jingrow.whitelist()
|
||||||
def create_domain_template(**data):
|
def create_domain_template(**data):
|
||||||
"""创建域名模板"""
|
"""创建域名模板"""
|
||||||
|
|||||||
@ -40,14 +40,13 @@
|
|||||||
"options": "Team"
|
"options": "Team"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "Pending",
|
"default": "Active",
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "状态",
|
"label": "状态",
|
||||||
"options": "Pending\nActive\nExpired\nSuspended\nCancelled",
|
"options": "Active\nExpired"
|
||||||
"read_only": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "order_id",
|
"fieldname": "order_id",
|
||||||
@ -197,7 +196,7 @@
|
|||||||
"grid_page_length": 50,
|
"grid_page_length": 50,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-08-01 04:11:35.696328",
|
"modified": "2025-08-02 20:35:58.740670",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Jcloud",
|
"module": "Jcloud",
|
||||||
"name": "Jsite Domain",
|
"name": "Jsite Domain",
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class JsiteDomain(Document):
|
|||||||
dns_host6: DF.Data | None
|
dns_host6: DF.Data | None
|
||||||
dns_resolution: DF.Table[DnsResolution]
|
dns_resolution: DF.Table[DnsResolution]
|
||||||
domain: DF.Data
|
domain: DF.Data
|
||||||
domain_owner: DF.Data | None
|
domain_owner: DF.Link | None
|
||||||
domain_registrar: DF.Data | None
|
domain_registrar: DF.Data | None
|
||||||
end_date: DF.Datetime | None
|
end_date: DF.Datetime | None
|
||||||
group: DF.Data | None
|
group: DF.Data | None
|
||||||
@ -34,7 +34,7 @@ class JsiteDomain(Document):
|
|||||||
period: DF.Int
|
period: DF.Int
|
||||||
price: DF.Int
|
price: DF.Int
|
||||||
registration_date: DF.Datetime | None
|
registration_date: DF.Datetime | None
|
||||||
status: DF.Literal["Pending", "Active", "Expired", "Suspended", "Cancelled"]
|
status: DF.Literal["Active", "Expired"]
|
||||||
team: DF.Link | None
|
team: DF.Link | None
|
||||||
whois_protection: DF.Check
|
whois_protection: DF.Check
|
||||||
# end: auto-generated types
|
# end: auto-generated types
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user