diff --git a/src/composables/config/useDeleteDriver.ts b/src/composables/config/useDeleteDriver.ts index bb62c041..09705471 100644 --- a/src/composables/config/useDeleteDriver.ts +++ b/src/composables/config/useDeleteDriver.ts @@ -7,7 +7,12 @@ export default () => { const { t } = useI18n() const delDriver = async ({ name }: DriverItemInList) => { try { - await EmqxMessageBox({ title: t('common.operateConfirm'), message: t('common.confirmDelete'), type: 'warning' }) + await EmqxMessageBox({ + title: t('common.operateConfirm'), + message: t('common.confirmDelete'), + type: 'warning', + confirmButtonText: t('common.confirmButtonText'), + }) await deleteDriver(name) EmqxMessage.success(t('common.operateSuccessfully')) return Promise.resolve() diff --git a/src/composables/config/useGroupList.ts b/src/composables/config/useGroupList.ts index 036edab9..3bbb049d 100644 --- a/src/composables/config/useGroupList.ts +++ b/src/composables/config/useGroupList.ts @@ -53,7 +53,11 @@ export default () => { } const delGroup = async ({ name }: GroupDataInTable) => { - await EmqxMessageBox({ title: t('common.operateConfirm'), message: t('common.confirmDelete') }) + await EmqxMessageBox({ + title: t('common.operateConfirm'), + message: t('common.confirmDelete'), + confirmButtonText: t('common.confirmButtonText'), + }) await deleteGroup(node.value, name) EmqxMessage.success(t('common.operateSuccessfully')) getGroupList() @@ -66,12 +70,20 @@ export default () => { } const batchDeleteGroup = async () => { - await EmqxMessageBox({ title: t('common.operateConfirm'), message: t('common.confirmDelete') }) + await EmqxMessageBox({ + title: t('common.operateConfirm'), + message: t('common.confirmDelete'), + confirmButtonText: t('common.confirmButtonText'), + }) delGroupList(groupCheckedList.value) } const clearGroup = async () => { - await EmqxMessageBox({ title: t('common.operateConfirm'), message: t('common.confirmClear') }) + await EmqxMessageBox({ + title: t('common.operateConfirm'), + message: t('common.confirmClear'), + confirmButtonText: t('common.confirmButtonText'), + }) delGroupList(groupList.value) } diff --git a/src/composables/config/usePlugin.ts b/src/composables/config/usePlugin.ts index 6a47ae6a..a200f183 100644 --- a/src/composables/config/usePlugin.ts +++ b/src/composables/config/usePlugin.ts @@ -131,7 +131,12 @@ export const useDeletePlugin = () => { const { t } = useI18n() const delPlugin = async ({ name }: CreatedPlugin) => { try { - await EmqxMessageBox({ title: t('common.operateConfirm'), message: t('common.confirmDelete'), type: 'warning' }) + await EmqxMessageBox({ + title: t('common.operateConfirm'), + message: t('common.confirmDelete'), + type: 'warning', + confirmButtonText: t('common.confirmButtonText'), + }) await deletePlugin(name) EmqxMessage.success(t('common.operateSuccessfully')) return Promise.resolve() diff --git a/src/composables/config/useSubscription.ts b/src/composables/config/useSubscription.ts index 6ecb73a5..3b944b3e 100644 --- a/src/composables/config/useSubscription.ts +++ b/src/composables/config/useSubscription.ts @@ -51,7 +51,10 @@ export const useSubscriptionList = () => { const unsubscribe = async (confirmText: string, data: SubscriptionData | Array) => { try { - await EmqxMessageBox.confirm(confirmText, t('common.operateConfirm')) + await EmqxMessageBox.confirm(confirmText, t('common.operateConfirm'), { + confirmButtonText: t('common.confirmButtonText'), + cancelButtonText: t('common.cancelButtonText'), + }) if (Array.isArray(data)) { const requestList = data.map((groupItem: SubscriptionData) => deleteSubscription(groupItem)) await Promise.all(requestList) diff --git a/src/composables/config/useTagList.ts b/src/composables/config/useTagList.ts index a53c692b..036546d1 100644 --- a/src/composables/config/useTagList.ts +++ b/src/composables/config/useTagList.ts @@ -105,13 +105,19 @@ export default () => { } const delTag = async (item: TagDataInTable) => { - await EmqxMessageBox.confirm(t('common.confirmDelete'), t('common.operateConfirm')) + await EmqxMessageBox.confirm(t('common.confirmDelete'), t('common.operateConfirm'), { + confirmButtonText: t('common.confirmButtonText'), + cancelButtonText: t('common.cancelButtonText'), + }) const delList = OmitArrayFields([item], ['checked']) deleteTagList(delList) } const batchDeleteTag = async () => { - await EmqxMessageBox.confirm(t('common.confirmDelete'), t('common.operateConfirm')) + await EmqxMessageBox.confirm(t('common.confirmDelete'), t('common.operateConfirm'), { + confirmButtonText: t('common.confirmButtonText'), + cancelButtonText: t('common.cancelButtonText'), + }) deleteTagList(tagCheckedList.value) } @@ -121,7 +127,11 @@ export default () => { } const clearTag = async () => { - await EmqxMessageBox({ title: t('common.operateConfirm'), message: t('common.confirmClear') }) + await EmqxMessageBox({ + title: t('common.operateConfirm'), + message: t('common.confirmClear'), + confirmButtonText: t('common.confirmButtonText'), + }) deleteTagList(totalData.value) } diff --git a/src/i18n/common.ts b/src/i18n/common.ts index 1a8ff70b..3e9f80f7 100644 --- a/src/i18n/common.ts +++ b/src/i18n/common.ts @@ -219,6 +219,14 @@ export default { zh: '确认', en: 'Confirm', }, + confirmButtonText: { + zh: '确认', + en: 'OK', + }, + cancelButtonText: { + zh: '取消', + en: 'Cancel', + }, back: { zh: '返回', en: 'Back', diff --git a/src/views/admin/Log.vue b/src/views/admin/Log.vue index 376005b5..c39ea46a 100644 --- a/src/views/admin/Log.vue +++ b/src/views/admin/Log.vue @@ -23,7 +23,7 @@ {{ $t('common.submit') }}
- +