Feat/monitor (#1928)

* feat: add monitor

* feat: fix tab

* feat: work

* feat: not reliable monitor

* feat: enhance monitoring page layout with integrated filters and refresh button

* feat: add support for runner recording

* feat: add jump button & alignment

* feat: new

* fix: not show query variables in local agent

* fix: pnpm lint and python ruff check

* fix: ruff fromat

* chore: remove unnecessary migration

* style: optimize monitoring page layout and fix sticky filter issues

- Enhanced metric cards with gradient backgrounds and hover effects
- Increased traffic chart height from 200px to 300px
- Adjusted grid layout and spacing for better visual appeal
- Fixed sticky filter area to properly cover parent padding without transparent gaps
- Used negative margins and positioning to eliminate scrolling artifacts
- Matched padding/margins with other pages (pipelines, bots) for consistency
- Removed duplicate title/subtitle from page content
- Added cursor-pointer styling to tab triggers
- Removed border between tab list and tab content

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: apply prettier formatting to monitoring components

- Fixed indentation and spacing in MetricCard.tsx
- Fixed formatting in TrafficChart.tsx
- Applied prettier formatting to page.tsx

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: update HomeSidebar to trigger action on child selection and localize monitoring titles

* refactor: streamline LLM and embedding invocation methods

* feat: add embedding model monitor

* fix: database version

* chore: simplify pnpm-lock.yaml formatting

---------

Co-authored-by: Junyan Qin <rockchinq@gmail.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Guanchao Wang
2026-01-26 21:08:23 +08:00
committed by GitHub
parent b73847f1a6
commit 5d9f6ec763
37 changed files with 6706 additions and 3182 deletions
+139 -1
View File
@@ -265,6 +265,10 @@ const zhHans = {
allLevels: '全部级别',
selectLevel: '选择级别',
levelsSelected: '个级别已选',
viewDetailedLogs: '查看详细日志',
viewDetails: '详情',
collapse: '收起',
imagesAttached: '张图片',
},
plugins: {
title: '插件扩展',
@@ -729,7 +733,7 @@ const zhHans = {
},
llm: {
llmModels: '对话模型',
description: '管理 LLM 模型用于对话消息生成',
description: '管理 LLM 模型,用于对话消息生成',
extraParametersDescription:
'将在请求时附加到请求体中,如 max_tokens, temperature, top_p 等',
},
@@ -763,6 +767,140 @@ const zhHans = {
setPasswordHint: '设置密码后可使用邮箱密码登录',
spaceEmailMismatch: 'Space登录账号邮箱与本实例账号邮箱不匹配',
},
monitoring: {
title: '日志监控',
description: '查看机器人活动、LLM调用和系统性能',
overview: '概览',
totalMessages: '总消息数',
llmCallsCount: 'LLM调用',
modelCallsCount: '模型调用',
successRate: '成功率',
activeSessions: '活跃会话',
last24Hours: '最近24小时',
filters: {
title: '筛选',
bot: '机器人',
pipeline: '流水线',
allBots: '全部机器人',
selectBot: '选择机器人',
allPipelines: '全部流水线',
selectPipeline: '选择流水线',
loading: '加载中...',
timeRange: '时间范围',
customRange: '自定义范围',
from: '从',
to: '到',
apply: '应用',
reset: '重置筛选',
lastHour: '最近1小时',
last6Hours: '最近6小时',
last24Hours: '最近24小时',
last7Days: '最近7天',
last30Days: '最近30天',
},
tabs: {
messages: '消息记录',
llmCalls: 'LLM调用',
embeddingCalls: 'Embedding调用',
modelCalls: '模型调用',
sessions: '会话分析',
errors: '错误日志',
},
messageList: {
timestamp: '时间戳',
bot: '机器人',
pipeline: '流水线',
message: '消息',
sessionId: '会话ID',
status: '状态',
actions: '操作',
viewDetails: '查看详情',
copyId: '复制ID',
noMessages: '未找到消息',
noMessagesDescription: '尝试调整筛选条件或稍后查看',
loading: '加载消息中...',
loadMore: '加载更多',
autoRefresh: '自动刷新',
platform: '角色',
user: '用户',
level: '级别',
runner: '执行器',
viewConversation: '显示对话详情',
},
llmCalls: {
title: 'LLM调用',
model: '模型',
tokens: 'Token数',
duration: '持续时间',
cost: '成本',
noData: '未找到LLM调用记录',
inputTokens: '输入Token',
outputTokens: '输出Token',
totalTokens: '总Token数',
avgDuration: '平均耗时',
calls: '调用次数',
},
embeddingCalls: {
title: 'Embedding调用',
model: '模型',
tokens: 'Token数',
duration: '持续时间',
noData: '未找到Embedding调用记录',
promptTokens: '输入Token',
totalTokens: '总Token数',
inputCount: '输入数量',
knowledgeBase: '知识库',
queryText: '查询文本',
},
modelCalls: {
title: '模型调用',
llmModel: '对话模型',
embeddingModel: '嵌入模型',
embeddingCall: '嵌入调用',
retrieveCall: '检索调用',
noData: '未找到模型调用记录',
},
sessions: {
sessionId: '会话ID',
messageCount: '消息数',
duration: '持续时间',
lastActivity: '最后活动',
noSessions: '未找到会话',
startTime: '开始时间',
messageStats: '消息统计',
totalMessages: '总消息数',
successMessages: '成功',
errorMessages: '失败',
llmStats: 'LLM统计',
noData: '会话未找到',
},
errors: {
title: '错误',
errorType: '错误类型',
errorMessage: '错误消息',
occurredAt: '发生时间',
noErrors: '未找到错误',
stackTrace: '堆栈追踪',
},
queries: {
title: '查询记录',
},
messageDetails: {
noData: '此查询没有LLM调用或错误记录',
},
queryVariables: {
title: '查询变量',
},
trafficChart: {
title: '流量概览',
messages: '消息数',
llmCalls: 'LLM调用',
noData: '暂无流量数据',
},
viewMonitoring: '查看日志监控',
refreshData: '刷新数据',
exportData: '导出数据',
},
};
export default zhHans;