完善系统健康面板并接入AI运行态观测

This commit is contained in:
liuwei
2026-04-30 15:12:47 +08:00
parent 83910b287b
commit 4ddab01b8d
4 changed files with 206 additions and 9 deletions

View File

@@ -355,6 +355,26 @@
recent_24h_count: 0,
summary: '加载中...'
},
infrastructure: {
status: 'warning',
summary: '加载中...',
mysql: {
status: 'warning',
summary: '加载中...'
},
redis: {
status: 'warning',
summary: '加载中...'
}
},
ai_runtime: {
status: 'warning',
total_calls: 0,
failed_calls: 0,
avg_latency_ms: 0,
summary: '加载中...',
last_call: {}
},
md2img: {
status: 'warning',
healthy: false,
@@ -401,6 +421,8 @@
const robot = this.healthSummary.robot || {};
const plugins = this.healthSummary.plugins || {};
const errors = this.healthSummary.errors || {};
const infrastructure = this.healthSummary.infrastructure || {};
const aiRuntime = this.healthSummary.ai_runtime || {};
const md2img = this.healthSummary.md2img || {};
return [
{
@@ -427,6 +449,22 @@
summary: errors.summary || '暂无状态',
extra: '统计窗口:近 24 小时'
},
{
key: 'infrastructure',
title: '基础设施',
status: infrastructure.status || 'warning',
value: infrastructure.status === 'healthy' ? '正常' : '异常',
summary: infrastructure.summary || '暂无状态',
extra: `MySQL${((infrastructure.mysql || {}).status === 'healthy') ? '正常' : '异常'} / Redis${((infrastructure.redis || {}).status === 'healthy') ? '正常' : '异常'}`
},
{
key: 'ai_runtime',
title: 'AI 运行态',
status: aiRuntime.status || 'warning',
value: `${aiRuntime.avg_latency_ms || 0} ms`,
summary: aiRuntime.summary || '暂无状态',
extra: `最近调用 ${aiRuntime.total_calls || 0} 次,失败 ${aiRuntime.failed_calls || 0}`
},
{
key: 'md2img',
title: 'Markdown 转图',
@@ -978,7 +1016,7 @@
.health-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 16px;
margin-top: 18px;
}