From e45f5e3369a63a474e216442b78095c47e8dc30d Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Fri, 2 Dec 2022 10:59:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=9F=E4=B8=80=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=93=8D=E4=BD=9C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/hooks/use-delete-data.ts | 6 ------ frontend/src/lang/modules/zh.ts | 2 +- frontend/src/views/app-store/installed/backups.vue | 2 +- frontend/src/views/container/image/index.vue | 2 +- frontend/src/views/container/network/index.vue | 2 +- frontend/src/views/container/repo/index.vue | 2 +- frontend/src/views/container/template/index.vue | 2 +- frontend/src/views/container/volume/index.vue | 2 +- frontend/src/views/cronjob/index.vue | 2 +- frontend/src/views/database/mysql/backup/index.vue | 2 +- frontend/src/views/database/mysql/index.vue | 2 +- frontend/src/views/database/mysql/upload/index.vue | 2 +- .../src/views/database/redis/setting/persistence/index.vue | 2 +- frontend/src/views/host/file-management/index.vue | 2 +- frontend/src/views/host/terminal/command/index.vue | 2 +- frontend/src/views/host/terminal/host/index.vue | 4 ++-- frontend/src/views/setting/tabs/backup.vue | 2 +- frontend/src/views/setting/tabs/monitor.vue | 2 +- frontend/src/views/website/ssl/acme-account/index.vue | 2 +- frontend/src/views/website/ssl/dns-account/index.vue | 2 +- frontend/src/views/website/ssl/index.vue | 2 +- frontend/src/views/website/website/backup/index.vue | 2 +- .../src/views/website/website/config/basic/domain/index.vue | 2 +- frontend/src/views/website/website/upload/index.vue | 2 +- 24 files changed, 24 insertions(+), 30 deletions(-) diff --git a/frontend/src/hooks/use-delete-data.ts b/frontend/src/hooks/use-delete-data.ts index 34dd40070..55f9e909f 100644 --- a/frontend/src/hooks/use-delete-data.ts +++ b/frontend/src/hooks/use-delete-data.ts @@ -7,7 +7,6 @@ import i18n from '@/lang'; * @param {Function} api 操作数据接口的api方法(必传) * @param {Object} params 携带的操作数据参数 {id,params}(必传) * @param {String} message 提示信息(必传) - * @param {String} loading 页面loading * @param {String} confirmType icon类型(不必传,默认为 warning) * @return Promise */ @@ -15,11 +14,9 @@ export const useDeleteData =

( api: (params: P) => Promise, params: Parameters[0], message: string, - loading: boolean, confirmType: HandleData.MessageType = 'error', ) => { return new Promise((resolve, reject) => { - loading = true; ElMessageBox.confirm(i18n.global.t(`${message}`) + '?', i18n.global.t('commons.msg.deleteTitle'), { confirmButtonText: i18n.global.t('commons.button.confirm'), cancelButtonText: i18n.global.t('commons.button.cancel'), @@ -35,9 +32,6 @@ export const useDeleteData =

( }); resolve(true); }) - .finally(() => { - loading = false; - }) .catch(() => {}); }); }; diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 1ac918f08..f2bfb055e 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -60,7 +60,7 @@ export default { interval: '耗时', }, msg: { - delete: '此操作不可回滚,是否继续', + delete: '删除 操作不可回滚,是否继续', deleteTitle: '删除', deleteSuccess: '删除成功', loginSuccess: '登录成功', diff --git a/frontend/src/views/app-store/installed/backups.vue b/frontend/src/views/app-store/installed/backups.vue index b89757ea7..3657bac96 100644 --- a/frontend/src/views/app-store/installed/backups.vue +++ b/frontend/src/views/app-store/installed/backups.vue @@ -167,7 +167,7 @@ const restore = async () => { }; const deleteBackup = async (ids: number[]) => { - await useDeleteData(DelAppBackups, { ids: ids }, 'commons.msg.delete', loading.value); + await useDeleteData(DelAppBackups, { ids: ids }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/container/image/index.vue b/frontend/src/views/container/image/index.vue index b5de14746..6de5de715 100644 --- a/frontend/src/views/container/image/index.vue +++ b/frontend/src/views/container/image/index.vue @@ -157,7 +157,7 @@ const batchDelete = async (option: string) => { ids.push(item); } } - await useDeleteData(imageRemove, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(imageRemove, { ids: ids }, 'commons.msg.delete'); deleteVisiable.value = false; search(); }; diff --git a/frontend/src/views/container/network/index.vue b/frontend/src/views/container/network/index.vue index dc3953c42..d0de6d571 100644 --- a/frontend/src/views/container/network/index.vue +++ b/frontend/src/views/container/network/index.vue @@ -111,7 +111,7 @@ const batchDelete = async (row: Container.NetworkInfo | null) => { } else { ids.push(row.id); } - await useDeleteData(deleteNetwork, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteNetwork, { ids: ids }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/container/repo/index.vue b/frontend/src/views/container/repo/index.vue index 7d1faf9aa..6fb327688 100644 --- a/frontend/src/views/container/repo/index.vue +++ b/frontend/src/views/container/repo/index.vue @@ -87,7 +87,7 @@ const onBatchDelete = async (row: Container.RepoInfo | null) => { ids.push(item.id); }); } - await useDeleteData(deleteImageRepo, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteImageRepo, { ids: ids }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/container/template/index.vue b/frontend/src/views/container/template/index.vue index 53d067a44..ab02df9ac 100644 --- a/frontend/src/views/container/template/index.vue +++ b/frontend/src/views/container/template/index.vue @@ -141,7 +141,7 @@ const onBatchDelete = async (row: Container.RepoInfo | null) => { ids.push(item.id); }); } - await useDeleteData(deleteComposeTemplate, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteComposeTemplate, { ids: ids }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/container/volume/index.vue b/frontend/src/views/container/volume/index.vue index ebe4cb269..3bdd9d5e8 100644 --- a/frontend/src/views/container/volume/index.vue +++ b/frontend/src/views/container/volume/index.vue @@ -103,7 +103,7 @@ const batchDelete = async (row: Container.VolumeInfo | null) => { } else { ids.push(row.name); } - await useDeleteData(deleteVolume, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteVolume, { ids: ids }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/cronjob/index.vue b/frontend/src/views/cronjob/index.vue index dfff68e2e..64352145c 100644 --- a/frontend/src/views/cronjob/index.vue +++ b/frontend/src/views/cronjob/index.vue @@ -164,7 +164,7 @@ const onBatchDelete = async (row: Cronjob.CronjobInfo | null) => { ids.push(item.id); }); } - await useDeleteData(deleteCronjob, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteCronjob, { ids: ids }, 'commons.msg.delete'); search(); }; const beforeChangeStatus = () => { diff --git a/frontend/src/views/database/mysql/backup/index.vue b/frontend/src/views/database/mysql/backup/index.vue index bbf530f8f..9897ea8c5 100644 --- a/frontend/src/views/database/mysql/backup/index.vue +++ b/frontend/src/views/database/mysql/backup/index.vue @@ -123,7 +123,7 @@ const onBatchDelete = async (row: Backup.RecordInfo | null) => { ids.push(item.id); }); } - await useDeleteData(deleteBackupRecord, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteBackupRecord, { ids: ids }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/database/mysql/index.vue b/frontend/src/views/database/mysql/index.vue index 6db48236b..d2e56c90d 100644 --- a/frontend/src/views/database/mysql/index.vue +++ b/frontend/src/views/database/mysql/index.vue @@ -227,7 +227,7 @@ const onBatchDelete = async (row: Database.MysqlDBInfo | null) => { ids.push(item.id); }); } - await useDeleteData(deleteMysqlDB, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteMysqlDB, { ids: ids }, 'commons.msg.delete'); search(); }; const buttons = [ diff --git a/frontend/src/views/database/mysql/upload/index.vue b/frontend/src/views/database/mysql/upload/index.vue index f376f43bb..13e264539 100644 --- a/frontend/src/views/database/mysql/upload/index.vue +++ b/frontend/src/views/database/mysql/upload/index.vue @@ -173,7 +173,7 @@ const onBatchDelete = async (row: File.File | null) => { files.push(baseDir + item.name); }); } - await useDeleteData(BatchDeleteFile, { paths: files, isDir: false }, 'commons.msg.delete', true); + await useDeleteData(BatchDeleteFile, { paths: files, isDir: false }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/database/redis/setting/persistence/index.vue b/frontend/src/views/database/redis/setting/persistence/index.vue index 8d79a7612..f565f0b3d 100644 --- a/frontend/src/views/database/redis/setting/persistence/index.vue +++ b/frontend/src/views/database/redis/setting/persistence/index.vue @@ -215,7 +215,7 @@ const onBatchDelete = async (row: Database.FileRecord | null) => { files.push(item.fileDir + '/' + item.fileName); }); } - await useDeleteData(BatchDeleteFile, { isDir: false, paths: files }, 'commons.msg.delete', true); + await useDeleteData(BatchDeleteFile, { isDir: false, paths: files }, 'commons.msg.delete'); loadBackupRecords(); }; const buttons = [ diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue index c93eadebb..b9bb2b807 100644 --- a/frontend/src/views/host/file-management/index.vue +++ b/frontend/src/views/host/file-management/index.vue @@ -341,7 +341,7 @@ const handleCreate = (commnad: string) => { }; const delFile = async (row: File.File | null) => { - await useDeleteData(DeleteFile, row as File.FileDelete, 'commons.msg.delete', loading.value); + await useDeleteData(DeleteFile, row as File.FileDelete, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/host/terminal/command/index.vue b/frontend/src/views/host/terminal/command/index.vue index 6135c19f4..52a08c1f8 100644 --- a/frontend/src/views/host/terminal/command/index.vue +++ b/frontend/src/views/host/terminal/command/index.vue @@ -115,7 +115,7 @@ const batchDelete = async (row: Command.CommandInfo | null) => { } else { ids.push(row.id); } - await useDeleteData(deleteCommand, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteCommand, { ids: ids }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/host/terminal/host/index.vue b/frontend/src/views/host/terminal/host/index.vue index c629cdc75..48afa85b2 100644 --- a/frontend/src/views/host/terminal/host/index.vue +++ b/frontend/src/views/host/terminal/host/index.vue @@ -279,10 +279,10 @@ const onDelete = async (node: Node, data: Tree) => { return; } if (node.level === 1) { - await useDeleteData(deleteGroup, data.id - 10000, i18n.global.t('terminal.groupDeleteHelper'), true); + await useDeleteData(deleteGroup, data.id - 10000, i18n.global.t('terminal.groupDeleteHelper')); loadGroups(); } else { - await useDeleteData(deleteHost, data.id, 'commons.msg.delete', true); + await useDeleteData(deleteHost, data.id, 'commons.msg.delete'); } loadHostTree(); loadGroups(); diff --git a/frontend/src/views/setting/tabs/backup.vue b/frontend/src/views/setting/tabs/backup.vue index d5c3896dc..95f1d842e 100644 --- a/frontend/src/views/setting/tabs/backup.vue +++ b/frontend/src/views/setting/tabs/backup.vue @@ -224,7 +224,7 @@ const onBatchDelete = async (row: Backup.BackupInfo | null) => { } else { ids.push(row.id); } - await useDeleteData(deleteBackup, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteBackup, { ids: ids }, 'commons.msg.delete'); search(); restForm(); }; diff --git a/frontend/src/views/setting/tabs/monitor.vue b/frontend/src/views/setting/tabs/monitor.vue index 1829a9f22..d4d8a780f 100644 --- a/frontend/src/views/setting/tabs/monitor.vue +++ b/frontend/src/views/setting/tabs/monitor.vue @@ -72,6 +72,6 @@ function onSave(formEl: FormInstance | undefined, key: string, val: any) { } const onClean = async () => { - await useDeleteData(cleanMonitors, {}, 'commons.msg.delete', true); + await useDeleteData(cleanMonitors, {}, 'commons.msg.delete'); }; diff --git a/frontend/src/views/website/ssl/acme-account/index.vue b/frontend/src/views/website/ssl/acme-account/index.vue index 72040c2bc..e3f727e4d 100644 --- a/frontend/src/views/website/ssl/acme-account/index.vue +++ b/frontend/src/views/website/ssl/acme-account/index.vue @@ -71,7 +71,7 @@ const openCreate = () => { }; const deleteAccount = async (id: number) => { - await useDeleteData(DeleteAcmeAccount, id, 'commons.msg.delete', loading.value); + await useDeleteData(DeleteAcmeAccount, id, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/website/ssl/dns-account/index.vue b/frontend/src/views/website/ssl/dns-account/index.vue index 0fd25bd7f..f52c46092 100644 --- a/frontend/src/views/website/ssl/dns-account/index.vue +++ b/frontend/src/views/website/ssl/dns-account/index.vue @@ -87,7 +87,7 @@ const openEdit = (form: WebSite.DnsAccount) => { const deleteAccount = async (id: number) => { loading.value = true; - await useDeleteData(DeleteDnsAccount, id, 'commons.msg.delete', false); + await useDeleteData(DeleteDnsAccount, id, 'commons.msg.delete'); loading.value = false; search(); }; diff --git a/frontend/src/views/website/ssl/index.vue b/frontend/src/views/website/ssl/index.vue index f7b200dee..f99c5d90b 100644 --- a/frontend/src/views/website/ssl/index.vue +++ b/frontend/src/views/website/ssl/index.vue @@ -124,7 +124,7 @@ const openRenewSSL = (id: number) => { const deleteSSL = async (id: number) => { loading.value = true; - await useDeleteData(DeleteSSL, id, 'commons.msg.delete', false); + await useDeleteData(DeleteSSL, id, 'commons.msg.delete'); loading.value = false; search(); }; diff --git a/frontend/src/views/website/website/backup/index.vue b/frontend/src/views/website/website/backup/index.vue index 1fe12cc3f..3b79dca3c 100644 --- a/frontend/src/views/website/website/backup/index.vue +++ b/frontend/src/views/website/website/backup/index.vue @@ -144,7 +144,7 @@ const onBatchDelete = async (row: Backup.RecordInfo | null) => { ids.push(item.id); }); } - await useDeleteData(deleteBackupRecord, { ids: ids }, 'commons.msg.delete', true); + await useDeleteData(deleteBackupRecord, { ids: ids }, 'commons.msg.delete'); search(); }; diff --git a/frontend/src/views/website/website/config/basic/domain/index.vue b/frontend/src/views/website/website/config/basic/domain/index.vue index 045d83ec2..36a6b73cd 100644 --- a/frontend/src/views/website/website/config/basic/domain/index.vue +++ b/frontend/src/views/website/website/config/basic/domain/index.vue @@ -49,7 +49,7 @@ const openCreate = () => { }; const deleteDoamin = async (domainId: number) => { - await useDeleteData(DeleteDomain, domainId, 'commons.msg.delete', loading.value); + await useDeleteData(DeleteDomain, domainId, 'commons.msg.delete'); search(id.value); }; diff --git a/frontend/src/views/website/website/upload/index.vue b/frontend/src/views/website/website/upload/index.vue index c3c62405a..0379adc69 100644 --- a/frontend/src/views/website/website/upload/index.vue +++ b/frontend/src/views/website/website/upload/index.vue @@ -183,7 +183,7 @@ const onBatchDelete = async (row: File.File | null) => { files.push(baseDir.value + '/' + item.name); }); } - await useDeleteData(BatchDeleteFile, { isDir: false, paths: files }, 'commons.msg.delete', true); + await useDeleteData(BatchDeleteFile, { isDir: false, paths: files }, 'commons.msg.delete'); search(); };