fix(ops): surface backend reason when system log cleanup is rejected

This commit is contained in:
feitianbubu
2026-07-21 20:28:01 +08:00
parent 5a8d6c4e41
commit 61a80114eb
3 changed files with 8 additions and 1 deletions
@@ -6,6 +6,7 @@ import { opsAPI, type OpsRuntimeLogConfig, type OpsSystemLog, type OpsSystemLogS
import Pagination from '@/components/common/Pagination.vue'
import Select from '@/components/common/Select.vue'
import { useAppStore } from '@/stores'
import { extractApiErrorMessage } from '@/utils/apiError'
const appStore = useAppStore()
const { t } = useI18n()
@@ -312,7 +313,11 @@ const cleanupCurrentFilter = async () => {
await Promise.all([fetchLogs(), fetchHealth()])
} catch (err: any) {
console.error('[OpsSystemLogTable] Failed to cleanup logs', err)
appStore.showError(err?.response?.data?.detail || t('admin.ops.systemLogs.cleanupFailed'))
appStore.showError(
extractApiErrorMessage(err, t('admin.ops.systemLogs.cleanupFailed'), {
OPS_SYSTEM_LOG_CLEANUP_FILTER_REQUIRED: t('admin.ops.systemLogs.cleanupFilterRequired')
})
)
}
}