Skip to content

Conversation

@massif-01
Copy link
Contributor

@massif-01 massif-01 commented Jan 6, 2026

robOS Pull Request 信息

目标仓库

  • From: massif-01/robOS (main)
  • To: thomas-hiddenpeak/robOS (main)

PR 标题

feat: Add Model Status Monitoring to Web Dashboard

PR 描述

概述

为 robOS Web Dashboard 添加完整的模型状态监控功能,支持实时监控 vLLM 模型的加载进度和运行日志。

✨ 主要功能

1. 模型状态监控模块

  • 可折叠设计:默认展开,可收起以节省空间
  • 位置:置于推理模组监控上方
  • 支持中英文切换

2. 模型拉起状态

显示三个模型的实时加载进度:

  • 主模型 (LLM)
  • 嵌入模型 (Embedding Model)
  • 重排模型 (Reranker Model)

特性

  • 进度条显示 0-100% 加载进度
  • 加载中显示光线滚动动画(shimmer effect)
  • 完成后显示模型名称和 API 端口
  • 未启用时显示灰色状态

3. 模型运行日志

三个独立的可折叠日志窗口:

  • 默认折叠状态
  • 点击展开后自动获取日志
  • 每 5 秒自动刷新(展开时)
  • 支持滚动查看历史日志
  • 样式与 CPU 监控保持一致

🏗️ 架构设计

数据流

rm01OrinStatus (10.10.99.98:58090)
         │
         ├── HTTP GET /api/model_status → 模型加载进度
         │
         └── HTTP GET /api/model_logs/{type} → 模型运行日志
                    │
                    └──→ Web Frontend (index.htm)

关键特点

  • 前端直接从 rm01OrinStatus 获取模型数据
  • ESP32 不参与模型监控(减轻 ESP32 负载)
  • ESP32 components 保持与上游一致

📝 修改内容

仅修改文件sdcard/web/index.htm (+631, -14 行)

变更类型

  • 新增模型状态监控 UI
  • 新增折叠/展开功能
  • 新增国际化翻译
  • 调整整体布局和间距
  • 更新版权信息为 2026

🎨 UI/UX 改进

  • 卡片透明度调整为 85%,更加协调
  • 模型状态文本使用细体(font-weight: 400)
  • 统一三个监控模块的垂直间距
  • 日志窗口采用浅灰色背景,提升可读性
  • 绿色折叠箭头,易于识别

🌐 国际化支持

完整的中英文翻译:

  • 模型状态监控
  • 模型拉起状态
  • 模型运行日志
  • 所有动态文本(等待、未启用、暂无日志等)

🐛 Bug 修复

  • 修复日志窗口自动关闭问题
  • 修复语言切换时模型状态文本不翻译的问题
  • 移除无效的 CSS 选择器
  • 统一使用 INFERENCE_SERVER_URL 常量

✅ 测试状态

  • ✅ 模型加载进度显示正常
  • ✅ 日志实时获取和刷新正常
  • ✅ 中英文切换完全支持
  • ✅ 折叠/展开功能稳定
  • ✅ 移动端适配正常

📊 统计

  • 13 commits
  • 1 file changed
  • +631 insertions
  • -14 deletions

🔗 相关项目

配合 rm01OrinStatus 项目的模型监控模块使用。


截图(如有)

截屏2026-01-06 22 49 12

Checklist

  • 代码已测试
  • UI 在桌面和移动端均正常显示
  • 支持中英文切换
  • 不影响 ESP32 组件(components 保持原状)
  • 文档已更新(如需要)

Add comprehensive model monitoring system to robOS dashboard:

Backend (ESP32):
- Extended agx_monitor to parse model_status_update WebSocket events
- New data structures for model status (agx_model_status_t, agx_model_monitor_data_t)
- API functions: agx_monitor_get_model_data(), agx_monitor_is_model_data_valid()
- Thread-safe model data storage with mutex protection
- New HTTP endpoint: /api/model_status with CORS support

Frontend (Web Dashboard):
- New "模型状态监控" (Model Status Monitor) section with collapsible UI
- "模型拉起状态" (Model Loading Status):
  * Three progress bars for LLM, embedding, and reranker models
  * Real-time progress tracking (0%-100%)
  * Shimmer animation for loading states
  * Dynamic color coding (gray/green) based on status
  * Display model name and API port when complete
- "模型运行日志" (Model Runtime Logs):
  * Three collapsible log windows (default collapsed)
  * Auto-refresh every 5 seconds when expanded
  * Fetch logs from http://10.10.99.98:58090/api/model_logs/<type>
  * HTML escaping for XSS prevention
  * Auto-scroll to bottom
  * Proper handling of disabled models
- Collapsible sections for inference/application/model monitors (saved to localStorage)
- Translation support (Chinese/English) for all new UI elements
- Responsive design for mobile and desktop

UI/UX Improvements:
- Progress bars show "--" when no data available
- "未启用" message for disabled models
- "等待状态数据..." when waiting for backend connection
- Right-aligned status text with proper contrast
- Smooth transitions and animations
- State persistence across page reloads

Integration:
- Connects to rm01OrinStatus backend for model status
- WebSocket: model_status_update events (every 2s polling)
- HTTP API: /api/model_logs/<type> (on-demand fetching)
- Proper error handling and fallback states

Documentation:
- Add MODEL_MONITORING_IMPLEMENTATION.md for technical details
- Move model status monitor section above inference module monitor
- Fix log section collapse icons overlapping (add position: relative)
- Remove emojis from card headers
- Update subtitle to '模型加载进度和运行日志监控'
- Fix HTML structure (model section was outside main-panel)
- Fix model section header collapse icon CSS for proper flex layout
- Change collapse icons color to green (#4CAF50) to match progress bars
- Change log window background from dark (#1e1e1e) to light gray (#f8f9fa)
- Change log text color from light gray to dark gray (#333)
- Update scrollbar colors to match light theme
- Add border to log windows for consistency with other cards
- Change year from 2025 to 2026
- Update company name to 'RMinte (Chengdu) Artificial Intelligence Technology Co., Ltd.'
- Add website URL: www.RMinte.com
- Remove 'Panidea' from copyright text
Add translation keys for model log window messages:
- 'waiting-for' / 'status-data': '等待 X 状态数据...'
- 'click-to-view-logs' / 'logs': '点击展开查看 X 日志...'
- 'no-logs-output': '暂无日志输出'

Changes:
- Replace hardcoded Chinese text with getTranslation() calls
- Add English translations for all dynamic log messages
- Call updateModelLogs() in translatePage() to refresh log text on language switch
- Update condition check to include English equivalents ('Not Enabled', 'Waiting')

This ensures all model log messages display correctly when switching between Chinese and English.
Change .model-section-title color to #555 to match the color used in model loading status labels (主模型, 嵌入模型, 重排模型)
Changes:
- Change .model-section-title font-weight from 600 to 500 to match model loading status labels
- Adjust .model-section-header padding from '10px 15px' to '10px 10px 10px 0' to align titles with model loading status section
- Now '主模型', '嵌入模型', '重排模型' labels have consistent styling and alignment across both sections
- Change checkModelStatus() to call rm01OrinStatus directly
- Remove dependency on ESP32's /api/model_status endpoint for model monitoring
- Model data now flows: rm01OrinStatus -> Web Frontend (direct)
- ESP32 components remain unchanged but model monitoring endpoint is no longer needed
- Restore agx_monitor.c to original state (remove model data parsing)
- Restore agx_monitor.h to original state (remove model data structures)
- Restore web_server.c to original state (remove /api/model_status endpoint)
- Remove MODEL_MONITORING_IMPLEMENTATION.md documentation
- Model monitoring now handled entirely by direct frontend-to-rm01OrinStatus communication
1. Add translateStatusText() to translate model status text (模型/端口)
   when switching to English mode

2. Fix log window auto-closing bug in updateModelLogs():
   - Only update placeholder text when window is COLLAPSED
   - When EXPANDED, let fetchModelLogs() handle content updates
   - This prevents actual logs from being replaced with placeholder

3. Refresh model status display after language switch
- Change model status text font-weight from bold to 400 (regular)
- Change all card backgrounds from 95% to 85% opacity
1. Use INFERENCE_SERVER_URL constant in checkModelStatus() instead of hardcoded IP
2. Move INFERENCE_SERVER_URL definition to before its first usage
3. Remove ineffective CSS selectors that never matched actual inline styles
@thomas-hiddenpeak thomas-hiddenpeak merged commit 83bb973 into thomas-hiddenpeak:main Jan 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants