Feature(custom): add delete configuration confirm check

This commit is contained in:
Kuingsmile 2023-12-16 02:55:04 -08:00
parent 99ab80faca
commit 5fb756c32d
5 changed files with 52 additions and 29 deletions

View File

@ -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_D: 'Configuration with alias: '
MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: ' failed to delete' 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_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_LOADING_TEXT: Loading...
MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: Please select a custom domain MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: Please select a custom domain

View File

@ -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_D: 删除别名为
MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: 的配置失败 MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: 的配置失败
MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_COPY_SUCCESS: 已复制 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_LOADING_TEXT: 加载文件中...
MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: 请选择自定义域名 MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: 请选择自定义域名

View File

@ -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_D: 刪除別名為
MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: 的配置失敗 MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E: 的配置失敗
MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_COPY_SUCCESS: 已複製 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_LOADING_TEXT: 載入檔案中...
MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: 請選擇自訂域名 MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: 請選擇自訂域名

View File

@ -277,7 +277,7 @@ import { supportedPicBedList } from '../utils/constants'
import { Delete, Edit, Pointer, InfoFilled } from '@element-plus/icons-vue' import { Delete, Edit, Pointer, InfoFilled } from '@element-plus/icons-vue'
// Element Plus // Element Plus
import { ElMessage, ElNotification } from 'element-plus' import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
// //
import { getConfig, saveConfig, removeConfig } from '../utils/dataSender' import { getConfig, saveConfig, removeConfig } from '../utils/dataSender'
@ -489,6 +489,11 @@ const handleConfigReset = (name: string) => {
} }
const handleConfigRemove = (name: string) => { const handleConfigRemove = (name: string) => {
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 = { const commonNoticeConfig = {
title: $T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_NAME'), title: $T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_NAME'),
duration: 2000, duration: 2000,
@ -517,6 +522,7 @@ const handleConfigRemove = (name: string) => {
} }
) )
} }
})
} }
const getAllConfigAliasArray = async () => { const getAllConfigAliasArray = async () => {

View File

@ -670,6 +670,10 @@ interface ILocales {
MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D: string 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_NOTICE_MESSAGE_E: string
MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_COPY_SUCCESS: 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_LOADING_TEXT: string
MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: string MANAGE_BUCKET_PAGE_CUSTOM_URL_SELECT_PLACEHOLDER: string
MANAGE_BUCKET_PAGE_CUSTOM_URL_INPUT_PLACEHOLDER: string MANAGE_BUCKET_PAGE_CUSTOM_URL_INPUT_PLACEHOLDER: string