mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-01-22 22:28:14 -05:00
✨ Feature(custom): add delete configuration confirm check
This commit is contained in:
parent
99ab80faca
commit
5fb756c32d
@ -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
|
||||
|
@ -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: 请选择自定义域名
|
||||
|
@ -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: 請選擇自訂域名
|
||||
|
@ -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 () => {
|
||||
|
4
src/universal/types/i18n.d.ts
vendored
4
src/universal/types/i18n.d.ts
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user