From c7f4a649dfa9322179e9e9d75196cba0dc6d8f86 Mon Sep 17 00:00:00 2001 From: Wang Lvyuan <74089601+LvyuanW@users.noreply.github.com> Date: Fri, 27 Mar 2026 13:54:59 +0800 Subject: [PATCH] fix(admin): use custom select for ops log filters --- .../ops/components/OpsSystemLogTable.vue | 63 +++++++++++-------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/frontend/src/views/admin/ops/components/OpsSystemLogTable.vue b/frontend/src/views/admin/ops/components/OpsSystemLogTable.vue index d2aeb3ca..bfc9397d 100644 --- a/frontend/src/views/admin/ops/components/OpsSystemLogTable.vue +++ b/frontend/src/views/admin/ops/components/OpsSystemLogTable.vue @@ -2,6 +2,7 @@ import { computed, onMounted, reactive, ref, watch } from 'vue' import { opsAPI, type OpsRuntimeLogConfig, type OpsSystemLog, type OpsSystemLogSinkHealth } from '@/api/admin/ops' import Pagination from '@/components/common/Pagination.vue' +import Select from '@/components/common/Select.vue' import { useAppStore } from '@/stores' const appStore = useAppStore() @@ -56,6 +57,37 @@ const filters = reactive({ q: '' }) +const runtimeLevelOptions = [ + { value: 'debug', label: 'debug' }, + { value: 'info', label: 'info' }, + { value: 'warn', label: 'warn' }, + { value: 'error', label: 'error' } +] + +const stacktraceLevelOptions = [ + { value: 'none', label: 'none' }, + { value: 'error', label: 'error' }, + { value: 'fatal', label: 'fatal' } +] + +const timeRangeOptions = [ + { value: '5m', label: '5m' }, + { value: '30m', label: '30m' }, + { value: '1h', label: '1h' }, + { value: '6h', label: '6h' }, + { value: '24h', label: '24h' }, + { value: '7d', label: '7d' }, + { value: '30d', label: '30d' } +] + +const filterLevelOptions = [ + { value: '', label: '全部' }, + { value: 'debug', label: 'debug' }, + { value: 'info', label: 'info' }, + { value: 'warn', label: 'warn' }, + { value: 'error', label: 'error' } +] + const levelBadgeClass = (level: string) => { const v = String(level || '').toLowerCase() if (v === 'error' || v === 'fatal') return 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300' @@ -347,20 +379,11 @@ onMounted(async () => {