Skip to content

Commit bf9c015

Browse files
ghshhflocalai-org-maint-bot
authored andcommitted
feat(ui): add system dashboard with aggregated health and usage stats
New /app/stats dashboard page providing a unified system overview: - System resource cards (GPU/CPU/memory, uptime) from /api/resources - Usage summary (tokens, requests, active models) from /api/usage - P2P network status (when in distributed mode) - Quick-link buttons to Usage, Traces, Nodes, Backends, Settings Also wires the route (/app/stats, admin-only) into the sidebar under System as "Dashboard" with i18n support in all 6 languages. Assisted-by: Claude Code (Sonnet 4.5)
1 parent 7a46841 commit bf9c015

12 files changed

Lines changed: 418 additions & 11 deletions

File tree

core/http/endpoints/openai/realtime_model.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,7 @@ type wrappedModel struct {
8686
// We have to wrap this out as well because we want to load two models one for VAD and one for the actual model.
8787
// In the future there could be models that accept continous audio input only so this design will be useful for that
8888
type anyToAnyModel struct {
89-
LLMConfig *config.ModelConfig
90-
VADConfig *config.ModelConfig
91-
92-
appConfig *config.ApplicationConfig
93-
modelLoader *model.ModelLoader
94-
confLoader *config.ModelConfigLoader
89+
*wrappedModel
9590
}
9691

9792
type transcriptOnlyModel struct {
@@ -910,14 +905,21 @@ func newModel(pipeline *config.Pipeline, cl *config.ModelConfigLoader, ml *model
910905

911906
if isAnyToAny {
912907
xlog.Debug("Loading an any-to-any model (native AudioToAudioStream)")
913-
return &anyToAnyModel{
914-
LLMConfig: cfgLLM,
915-
VADConfig: cfgVAD,
916-
908+
wm := &wrappedModel{
909+
LLMConfig: cfgLLM,
910+
VADConfig: cfgVAD,
917911
confLoader: cl,
918912
modelLoader: ml,
919913
appConfig: appConfig,
920-
}, nil
914+
evaluator: evaluator,
915+
}
916+
if routing != nil {
917+
wm.routerDeps = routing.Deps
918+
wm.routerStore = routing.Store
919+
wm.routerSessionID = routing.SessionID
920+
wm.routerUserID = routing.UserID
921+
}
922+
return &anyToAnyModel{wrappedModel: wm}, nil
921923
}
922924

923925
xlog.Debug("Loading a wrapped model")
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"title": "Dashboard",
3+
"subtitle": "System overview and quick access to administrative tools",
4+
"systemResources": "System Resources",
5+
"gpuMemory": "GPU Memory",
6+
"systemMemory": "System Memory",
7+
"memoryDetail": "{{free}} free of {{total}}",
8+
"cpuInfo": "CPU",
9+
"uptime": "Uptime",
10+
"uptimeValue_one": "{{seconds}} second",
11+
"uptimeValue_other": "{{count}} hours",
12+
"gpuDetails": "GPU Details",
13+
"usageOverview": "Usage Overview",
14+
"totalTokens": "Total Tokens",
15+
"totalRequests": "Total Requests",
16+
"activeModels": "Active Models",
17+
"thisMonth": "this month",
18+
"p2pNetwork": "P2P Network",
19+
"nodesOnline": "Nodes Online",
20+
"quickLinks": "Quick Links",
21+
"linkUsage": "Usage Details",
22+
"linkTraces": "Traces",
23+
"linkNodes": "Nodes",
24+
"linkBackends": "Backends",
25+
"linkSettings": "Settings",
26+
"loading": "Loading..."
27+
}

core/http/react-ui/public/locales/en/nav.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"skills": "Skills",
4747
"memory": "Memory",
4848
"mcpJobs": "MCP CI Jobs",
49+
"dashboard": "Dashboard",
4950
"usage": "Usage",
5051
"users": "Users",
5152
"middleware": "Middleware",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"title": "Dashboard",
3+
"subtitle": "System overview and quick access to administrative tools",
4+
"systemResources": "System Resources",
5+
"gpuMemory": "GPU Memory",
6+
"systemMemory": "System Memory",
7+
"memoryDetail": "{{free}} free of {{total}}",
8+
"cpuInfo": "CPU",
9+
"uptime": "Uptime",
10+
"uptimeValue_one": "{{seconds}} second",
11+
"uptimeValue_other": "{{count}} hours",
12+
"gpuDetails": "GPU Details",
13+
"usageOverview": "Usage Overview",
14+
"totalTokens": "Total Tokens",
15+
"totalRequests": "Total Requests",
16+
"activeModels": "Active Models",
17+
"thisMonth": "this month",
18+
"p2pNetwork": "P2P Network",
19+
"nodesOnline": "Nodes Online",
20+
"quickLinks": "Quick Links",
21+
"linkUsage": "Usage Details",
22+
"linkTraces": "Traces",
23+
"linkNodes": "Nodes",
24+
"linkBackends": "Backends",
25+
"linkSettings": "Settings",
26+
"loading": "Loading..."
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"title": "Dashboard",
3+
"subtitle": "System overview and quick access to administrative tools",
4+
"systemResources": "System Resources",
5+
"gpuMemory": "GPU Memory",
6+
"systemMemory": "System Memory",
7+
"memoryDetail": "{{free}} free of {{total}}",
8+
"cpuInfo": "CPU",
9+
"uptime": "Uptime",
10+
"uptimeValue_one": "{{seconds}} second",
11+
"uptimeValue_other": "{{count}} hours",
12+
"gpuDetails": "GPU Details",
13+
"usageOverview": "Usage Overview",
14+
"totalTokens": "Total Tokens",
15+
"totalRequests": "Total Requests",
16+
"activeModels": "Active Models",
17+
"thisMonth": "this month",
18+
"p2pNetwork": "P2P Network",
19+
"nodesOnline": "Nodes Online",
20+
"quickLinks": "Quick Links",
21+
"linkUsage": "Usage Details",
22+
"linkTraces": "Traces",
23+
"linkNodes": "Nodes",
24+
"linkBackends": "Backends",
25+
"linkSettings": "Settings",
26+
"loading": "Loading..."
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"title": "Dashboard",
3+
"subtitle": "System overview and quick access to administrative tools",
4+
"systemResources": "System Resources",
5+
"gpuMemory": "GPU Memory",
6+
"systemMemory": "System Memory",
7+
"memoryDetail": "{{free}} free of {{total}}",
8+
"cpuInfo": "CPU",
9+
"uptime": "Uptime",
10+
"uptimeValue_one": "{{seconds}} second",
11+
"uptimeValue_other": "{{count}} hours",
12+
"gpuDetails": "GPU Details",
13+
"usageOverview": "Usage Overview",
14+
"totalTokens": "Total Tokens",
15+
"totalRequests": "Total Requests",
16+
"activeModels": "Active Models",
17+
"thisMonth": "this month",
18+
"p2pNetwork": "P2P Network",
19+
"nodesOnline": "Nodes Online",
20+
"quickLinks": "Quick Links",
21+
"linkUsage": "Usage Details",
22+
"linkTraces": "Traces",
23+
"linkNodes": "Nodes",
24+
"linkBackends": "Backends",
25+
"linkSettings": "Settings",
26+
"loading": "Loading..."
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"title": "Dashboard",
3+
"subtitle": "System overview and quick access to administrative tools",
4+
"systemResources": "System Resources",
5+
"gpuMemory": "GPU Memory",
6+
"systemMemory": "System Memory",
7+
"memoryDetail": "{{free}} free of {{total}}",
8+
"cpuInfo": "CPU",
9+
"uptime": "Uptime",
10+
"uptimeValue_one": "{{seconds}} second",
11+
"uptimeValue_other": "{{count}} hours",
12+
"gpuDetails": "GPU Details",
13+
"usageOverview": "Usage Overview",
14+
"totalTokens": "Total Tokens",
15+
"totalRequests": "Total Requests",
16+
"activeModels": "Active Models",
17+
"thisMonth": "this month",
18+
"p2pNetwork": "P2P Network",
19+
"nodesOnline": "Nodes Online",
20+
"quickLinks": "Quick Links",
21+
"linkUsage": "Usage Details",
22+
"linkTraces": "Traces",
23+
"linkNodes": "Nodes",
24+
"linkBackends": "Backends",
25+
"linkSettings": "Settings",
26+
"loading": "Loading..."
27+
}

core/http/react-ui/public/locales/zh-CN/nav.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"skills": "技能",
4747
"memory": "记忆库",
4848
"mcpJobs": "MCP CI 任务",
49+
"dashboard": "仪表盘",
4950
"usage": "用量",
5051
"users": "用户",
5152
"backends": "后端",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"title": "仪表盘",
3+
"subtitle": "系统概览与快速管理入口",
4+
"systemResources": "系统资源",
5+
"gpuMemory": "GPU 显存",
6+
"systemMemory": "系统内存",
7+
"memoryDetail": "空闲 {{free}} / 总计 {{total}}",
8+
"cpuInfo": "CPU",
9+
"uptime": "运行时长",
10+
"uptimeValue_one": "{{seconds}} 秒",
11+
"uptimeValue_other": "{{count}} 小时",
12+
"gpuDetails": "GPU 详情",
13+
"usageOverview": "用量概览",
14+
"totalTokens": "总 Token 数",
15+
"totalRequests": "总请求数",
16+
"activeModels": "活跃模型数",
17+
"thisMonth": "本月",
18+
"p2pNetwork": "P2P 网络",
19+
"nodesOnline": "在线节点",
20+
"quickLinks": "快捷入口",
21+
"linkUsage": "用量详情",
22+
"linkTraces": "追踪记录",
23+
"linkNodes": "节点管理",
24+
"linkBackends": "后端管理",
25+
"linkSettings": "系统设置",
26+
"loading": "加载中..."
27+
}

core/http/react-ui/src/components/console/consoleConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const operateConsole = {
7373
{
7474
titleKey: 'operate.observability',
7575
items: [
76+
{ path: '/app/stats', icon: 'fas fa-gauge-high', labelKey: 'items.dashboard', adminOnly: true },
7677
{ path: '/app/usage', icon: 'fas fa-chart-bar', labelKey: 'items.usage', adminOnly: true },
7778
{ path: '/app/traces', icon: 'fas fa-chart-line', labelKey: 'items.traces', adminOnly: true },
7879
],

0 commit comments

Comments
 (0)