This commit is contained in:
parent
7cd24a2958
commit
80bcde5fc2
@ -59,6 +59,7 @@ export function usePage() {
|
|||||||
const migrationToken = ref('')
|
const migrationToken = ref('')
|
||||||
const migrationRecord = ref(null)
|
const migrationRecord = ref(null)
|
||||||
const restartPreview = ref(null)
|
const restartPreview = ref(null)
|
||||||
|
let initializationErrorShown = false
|
||||||
|
|
||||||
const canWrite = computed(() => globalStatus.hasCapability('config.write_global'))
|
const canWrite = computed(() => globalStatus.hasCapability('config.write_global'))
|
||||||
const canRollback = computed(() => globalStatus.hasCapability('config.rollback'))
|
const canRollback = computed(() => globalStatus.hasCapability('config.rollback'))
|
||||||
@ -271,10 +272,14 @@ export function usePage() {
|
|||||||
}
|
}
|
||||||
const loadAll = async () => {
|
const loadAll = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
initializationErrorShown = false
|
||||||
try {
|
try {
|
||||||
await Promise.all([loadStatus(), loadSection(), loadBackups(), loadAudit()])
|
await Promise.all([loadStatus(), loadSection(), loadBackups(), loadAudit()])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ElMessage.error(error.message || '配置管理数据读取失败')
|
if (!initializationErrorShown) {
|
||||||
|
initializationErrorShown = true
|
||||||
|
ElMessage.error(error.message || '配置管理数据读取失败')
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,8 @@ export function usePage() {
|
|||||||
const generatedCodes = ref([])
|
const generatedCodes = ref([])
|
||||||
const externalEmails = ref([])
|
const externalEmails = ref([])
|
||||||
const externalLoading = ref(false)
|
const externalLoading = ref(false)
|
||||||
|
let lastNotificationKey = ''
|
||||||
|
let lastNotificationAt = 0
|
||||||
const bindForm = reactive({ email: '', type: 'backup', challengeId: '', bindingId: 0, code: '' })
|
const bindForm = reactive({ email: '', type: 'backup', challengeId: '', bindingId: 0, code: '' })
|
||||||
|
|
||||||
const ruleForm = reactive({ current_pwd: '', new_pwd: '', new_pwd2: '' })
|
const ruleForm = reactive({ current_pwd: '', new_pwd: '', new_pwd2: '' })
|
||||||
@ -59,6 +61,11 @@ export function usePage() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const notify = (message, type = 'error') => {
|
const notify = (message, type = 'error') => {
|
||||||
|
const notificationKey = `${type}:${String(message || '').trim()}`
|
||||||
|
const now = Date.now()
|
||||||
|
if (notificationKey === lastNotificationKey && now - lastNotificationAt < 1500) return
|
||||||
|
lastNotificationKey = notificationKey
|
||||||
|
lastNotificationAt = now
|
||||||
ElNotification({ title: type === 'success' ? '操作成功' : '操作失败', message, type })
|
ElNotification({ title: type === 'success' ? '操作成功' : '操作失败', message, type })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user