diff --git a/public/i18n/en.yml b/public/i18n/en.yml index a27fa9d..f9ef410 100644 --- a/public/i18n/en.yml +++ b/public/i18n/en.yml @@ -711,6 +711,10 @@ MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_C: 'Alias deleted: ' MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D: 'Configuration with alias: ' MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: ' failed to delete' MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_COPY_SUCCESS: 'Copied ' +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TITLE: Are you sure to delete this? +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TIP: Tip +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CONFIRM: Confirm +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CANCEL: Cancel MANAGE_BUCKET_PAGE_LOADING_TEXT: Loading... MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: Please select a custom domain diff --git a/public/i18n/zh-CN.yml b/public/i18n/zh-CN.yml index 4acf3fc..7c42f08 100644 --- a/public/i18n/zh-CN.yml +++ b/public/i18n/zh-CN.yml @@ -715,6 +715,11 @@ MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_C: 已删除别名 MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D: 删除别名为 MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: 的配置失败 MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_COPY_SUCCESS: 已复制 +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TITLE: 确定要删除配置么? +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TIP: 提示 +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CONFIRM: 确定 +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CANCEL: 取消 + MANAGE_BUCKET_PAGE_LOADING_TEXT: 加载文件中... MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: 请选择自定义域名 diff --git a/public/i18n/zh-TW.yml b/public/i18n/zh-TW.yml index 31c627f..26be031 100644 --- a/public/i18n/zh-TW.yml +++ b/public/i18n/zh-TW.yml @@ -711,6 +711,10 @@ MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_C: 已刪除別名 MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D: 刪除別名為 MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: 的配置失敗 MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_COPY_SUCCESS: 已複製 +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TITLE: 確定要删除嗎?? +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TIP: 提示 +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CONFIRM: 確定 +MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CANCEL: 取消 MANAGE_BUCKET_PAGE_LOADING_TEXT: 載入檔案中... MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: 請選擇自訂域名 diff --git a/src/renderer/manage/pages/logIn.vue b/src/renderer/manage/pages/logIn.vue index 85c436b..f4f5981 100644 --- a/src/renderer/manage/pages/logIn.vue +++ b/src/renderer/manage/pages/logIn.vue @@ -277,7 +277,7 @@ import { supportedPicBedList } from '../utils/constants' import { Delete, Edit, Pointer, InfoFilled } from '@element-plus/icons-vue' // Element Plus 消息组件 -import { ElMessage, ElNotification } from 'element-plus' +import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' // 数据发送工具函数 import { getConfig, saveConfig, removeConfig } from '../utils/dataSender' @@ -489,34 +489,40 @@ const handleConfigReset = (name: string) => { } const handleConfigRemove = (name: string) => { - const commonNoticeConfig = { - title: $T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_NAME'), - duration: 2000, - customClass: 'notification', - offset: 100 - } - try { - removeConfig('picBed', name) - ElNotification( - { - ...commonNoticeConfig, - message: `${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_C')}${name}`, - type: 'success', - position: 'bottom-right' - } - ) - manageStore.refreshConfig() - getAllConfigAliasArray() - } catch (error) { - ElNotification( - { - ...commonNoticeConfig, - message: `${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D')}${name}${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E')}`, - type: 'error', - position: 'bottom-right' - } - ) - } + ElMessageBox.confirm($T('MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TITLE'), $T('MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TIP'), { + confirmButtonText: $T('MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CONFIRM'), + cancelButtonText: $T('MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CANCEL'), + type: 'warning' + }).then(async () => { + const commonNoticeConfig = { + title: $T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_NAME'), + duration: 2000, + customClass: 'notification', + offset: 100 + } + try { + removeConfig('picBed', name) + ElNotification( + { + ...commonNoticeConfig, + message: `${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_C')}${name}`, + type: 'success', + position: 'bottom-right' + } + ) + manageStore.refreshConfig() + getAllConfigAliasArray() + } catch (error) { + ElNotification( + { + ...commonNoticeConfig, + message: `${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D')}${name}${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E')}`, + type: 'error', + position: 'bottom-right' + } + ) + } + }) } const getAllConfigAliasArray = async () => { diff --git a/src/universal/types/i18n.d.ts b/src/universal/types/i18n.d.ts index 354d618..e7aa2f1 100644 --- a/src/universal/types/i18n.d.ts +++ b/src/universal/types/i18n.d.ts @@ -670,6 +670,10 @@ interface ILocales { MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D: string MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: string MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_COPY_SUCCESS: string + MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TITLE: string + MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_TIP: string + MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CONFIRM: string + MANAGE_LOGIN_PAGE_PANE_DELETE_CONFIG_CANCEL: string MANAGE_BUCKET_PAGE_LOADING_TEXT: string MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: string MANAGE_BUCKET_PAGE_CUSTOM_URL_INPUT_PLACEHOLDER: string