This commit is contained in:
xiaojunnuo
2026-01-22 11:55:01 +08:00
parent d947437c10
commit 96c9e74c6f
4 changed files with 15 additions and 2 deletions
@@ -196,6 +196,7 @@ export const useSettingStore = defineStore({
notification.warn({ notification.warn({
message: $t("vip.needVipTip"), message: $t("vip.needVipTip"),
}); });
mitter.emit("openVipModal");
throw new Error($t("vip.needVipTip")); throw new Error($t("vip.needVipTip"));
} }
}, },
@@ -104,6 +104,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
color: "gold", color: "gold",
icon: "mingcute:vip-1-line", icon: "mingcute:vip-1-line",
click: () => { click: () => {
settingStore.checkPlus();
openDomainImportDialog({ openDomainImportDialog({
afterSubmit: () => { afterSubmit: () => {
setTimeout(() => { setTimeout(() => {
@@ -71,11 +71,16 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}, },
actionbar: { actionbar: {
buttons: { buttons: {
add: {
icon: "ion:add-circle-outline",
},
import: { import: {
title: "导入CNAME记录", title: "导入CNAME记录",
type: "primary", type: "primary",
text: "批量导入", text: "批量导入",
icon: "mingcute:vip-1-line",
click: () => { click: () => {
settingStore.checkPlus();
openCnameImportDialog({ openCnameImportDialog({
afterSubmit: () => { afterSubmit: () => {
setTimeout(() => { setTimeout(() => {
@@ -89,7 +94,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
title: "导出CNAME记录之后,可用于批量导入cname解析到域名注册商", title: "导出CNAME记录之后,可用于批量导入cname解析到域名注册商",
type: "primary", type: "primary",
text: "批量导出", text: "批量导出",
icon: "mingcute:vip-1-line",
click: () => { click: () => {
settingStore.checkPlus();
crudBinding.value.toolbar.buttons.export.click({}); crudBinding.value.toolbar.buttons.export.click({});
}, },
}, },
@@ -233,7 +233,11 @@ export class DomainService extends BaseService<DomainEntity> {
}) })
const challengeType = "dns" const challengeType = "dns"
const importDomain = async (domainRecord: any) => { const getPage = async (pager: Pager) => {
return await dnsProvider.getDomainListPage(pager)
}
const itemHandle = async (domainRecord: any) => {
task.incrementCurrent() task.incrementCurrent()
const domain = domainRecord.domain const domain = domainRecord.domain
@@ -273,7 +277,7 @@ export class DomainService extends BaseService<DomainEntity> {
task.setTotal(pageRes.total || 0) task.setTotal(pageRes.total || 0)
} }
const start = async () => { const start = async () => {
await doPageTurn({ pager, getPage: dnsProvider.getDomainListPage, itemHandle: importDomain, batchHandle }) await doPageTurn({ pager, getPage, itemHandle, batchHandle })
} }
start() start()