删除域名详情页的转入和删除域名按钮及相关代码
This commit is contained in:
parent
b218d844fd
commit
45929cee6e
@ -23,13 +23,6 @@
|
||||
>
|
||||
续费
|
||||
</Button>
|
||||
<Button
|
||||
@click="transferDomain"
|
||||
:loading="transferLoading"
|
||||
class="px-5 !bg-[#3b82f6] !hover:bg-[#2563eb] !text-white"
|
||||
>
|
||||
转入
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -98,14 +91,6 @@
|
||||
>
|
||||
{{ $domain.pg.whois_protection ? '关闭隐私保护' : '开启隐私保护' }}
|
||||
</Button>
|
||||
<Button
|
||||
@click="deleteDomain"
|
||||
:loading="deleteLoading"
|
||||
variant="outline"
|
||||
class="bg-red-50 text-red-700 hover:bg-red-100 border-red-200"
|
||||
>
|
||||
删除域名
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -169,11 +154,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
renewLoading: false,
|
||||
transferLoading: false,
|
||||
dnsLoading: false,
|
||||
autoRenewLoading: false,
|
||||
whoisProtectionLoading: false,
|
||||
deleteLoading: false,
|
||||
domainOwner: null,
|
||||
};
|
||||
},
|
||||
@ -247,15 +230,6 @@ export default {
|
||||
onSuccess: this.onRenewalSuccess
|
||||
}));
|
||||
},
|
||||
transferDomain() {
|
||||
const JsiteDomainTransferDialog = defineAsyncComponent(() => import('./JsiteDomainTransferDialog.vue'));
|
||||
|
||||
renderDialog(h(JsiteDomainTransferDialog, {
|
||||
domain: this.domain,
|
||||
domainDoc: this.$domain.pg,
|
||||
onSuccess: this.onTransferSuccess
|
||||
}));
|
||||
},
|
||||
async manageDNS() {
|
||||
if (!this.$domain.pg.domain) {
|
||||
toast.error('域名信息不存在');
|
||||
@ -345,51 +319,10 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
async deleteDomain() {
|
||||
if (!this.$domain.pg.name) {
|
||||
toast.error('域名记录不存在');
|
||||
return;
|
||||
}
|
||||
|
||||
confirmDialog({
|
||||
title: '删除域名',
|
||||
message: `确定要删除域名 "${this.$domain.pg.domain}" 吗?此操作不可逆!`,
|
||||
primaryAction: {
|
||||
label: '确定删除',
|
||||
onClick: ({ hide }) => {
|
||||
toast.success('删除域名请求已提交');
|
||||
hide();
|
||||
|
||||
this.deleteLoading = true;
|
||||
const deleteRequest = createResource({
|
||||
url: 'jcloud.api.domain_west.delete_domain',
|
||||
params: {
|
||||
pagetype: 'Jsite Domain',
|
||||
name: this.$domain.pg.name
|
||||
},
|
||||
onSuccess: () => {
|
||||
this.deleteLoading = false;
|
||||
toast.success('域名删除成功');
|
||||
this.$router.push('/domains');
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error(getToastErrorMessage(error));
|
||||
this.deleteLoading = false;
|
||||
}
|
||||
});
|
||||
deleteRequest.submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onRenewalSuccess(data) {
|
||||
toast.success('域名续费成功!');
|
||||
this.$domain.reload();
|
||||
},
|
||||
onTransferSuccess(data) {
|
||||
toast.success('域名转入成功!');
|
||||
this.$domain.reload();
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// 监听域名数据变化,重新获取所有者信息
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user