diff --git a/web/src/components/charts/LogTrendChart.vue b/web/src/components/charts/LogTrendChart.vue new file mode 100644 index 0000000..db98a67 --- /dev/null +++ b/web/src/components/charts/LogTrendChart.vue @@ -0,0 +1,152 @@ + + + + 日志总量 + 失败数 + + + + + + + + + + diff --git a/web/src/components/layout/SidebarRail.vue b/web/src/components/layout/SidebarRail.vue index 7208d79..4aede72 100644 --- a/web/src/components/layout/SidebarRail.vue +++ b/web/src/components/layout/SidebarRail.vue @@ -74,6 +74,7 @@ const sidebarMeta = { approval: { label: '审批中心', badge: '12' }, policies: { label: '知识管理' }, audit: { label: '任务规则中心' }, + logs: { label: '日志管理' }, employees: { label: '员工管理' }, settings: { label: '系统设置' } } diff --git a/web/src/components/layout/TopBar.vue b/web/src/components/layout/TopBar.vue index 55b680c..01ff6fc 100644 --- a/web/src/components/layout/TopBar.vue +++ b/web/src/components/layout/TopBar.vue @@ -100,11 +100,21 @@ - {{ kpi.value }}单 - {{ kpi.label }} - {{ kpi.delta }} - - + {{ kpi.value }}单 + {{ kpi.label }} + {{ kpi.delta }} + + + + + + + + {{ kpi.value }}{{ kpi.unit }} + {{ kpi.label }} + {{ kpi.meta }} + + @@ -162,6 +172,10 @@ const props = defineProps({ type: Object, default: () => null }, + logsSummary: { + type: Object, + default: () => null + }, requestSummary: { type: Object, default: () => null @@ -170,6 +184,10 @@ const props = defineProps({ type: Boolean, default: false }, + logDetailMode: { + type: Boolean, + default: false + }, detailAlerts: { type: Array, default: () => [] @@ -193,6 +211,7 @@ const isChat = computed(() => props.activeView === 'chat') const isOverview = computed(() => props.activeView === 'overview') const isRequestDetail = computed(() => props.activeView === 'requests' && props.detailMode) const isRequests = computed(() => props.activeView === 'requests') +const isLogs = computed(() => props.activeView === 'logs' && !props.logDetailMode) const isApproval = computed(() => props.activeView === 'approval') const isPolicies = computed(() => props.activeView === 'policies') const isEmployees = computed(() => props.activeView === 'employees') @@ -211,6 +230,21 @@ const requestKpis = computed(() => { { label: '已完成', value: completed, delta: '已归档', trend: 'up', arrow: 'mdi mdi-arrow-up' , color: '#10b981' } ] }) + +const logsKpis = computed(() => { + const summary = props.logsSummary ?? {} + const total = Number(summary.total ?? 0) + const running = Number(summary.running ?? 0) + const completed = Number(summary.completed ?? 0) + const failed = Number(summary.failed ?? 0) + + return [ + { label: 'Hermes 总任务', value: total, unit: '条', meta: '当前', trend: 'up', color: '#10b981' }, + { label: '运行中', value: running, unit: '条', meta: running > 0 ? '实时执行' : '暂无执行', trend: running > 0 ? 'up' : 'down', color: '#3b82f6' }, + { label: '已完成', value: completed, unit: '条', meta: total ? `占比 ${Math.round((completed / total) * 100)}%` : '等待数据', trend: 'up', color: '#10b981' }, + { label: '失败数', value: failed, unit: '条', meta: failed > 0 ? '需要关注' : '运行正常', trend: failed > 0 ? 'down' : 'up', color: '#ef4444' } + ] +}) const chatKpis = [ { label: '今日已问数', value: 86, unit: '次', meta: '较昨日 +18', trend: 'up', color: '#10b981' },