All Chinese text strings converted to use otext with i18n:true so
bricks framework can look up translations. Template strings with
{{...}} left as text (correct - dynamic content).
Affected files:
- index.ui: 数据概览, 快捷入口, 模型管理, 用户管理, 知识库, 异常记录,
用户消费排行, 用户调用排行, 供应商交易排行, 供应商调用排行, Top 3 模型
- stat_*.ui: 今日活跃用户, 在线用户, 记账异常, 本月新增用户, 今日消费金额,
今日调用笔数, 组织机构数, 用户总数
- today_amount.ui, today_usage.ui: 今日交易金额, 今日调用笔数
- accounting_errors.ui, concurrent_users.ui, total_users.ui
- table_top_*.ui: 暂无数据
- top_users_amount.ui: 用户金额TOP5, 排名, 用户, 金额, 调用次数
Dashboard for Sage
Sage 数据看板模块,基于 bricks-framework 的 ECharts 扩展控件实现。
功能
- 今日调用笔数和交易金额 - 每10秒自动刷新 llmusage 数据
- 用户总数 - 系统中注册用户数
- 当前并发用户数 - 近5分钟内有活跃记录的用户数
- Top 3 模型排名 - 按当天调用数量和交易金额排名
目录结构
dashboard_for_sage/
├── dashboard_for_sage/
│ ├── __init__.py
│ └── init.py # 模块注册
├── wwwroot/
│ ├── index.ui # 主看板页面
│ ├── menu.ui # 菜单
│ ├── api/
│ │ ├── get_today_usage.dspy # 今日用量API
│ │ ├── get_user_stats.dspy # 用户统计API
│ │ └── get_top_models.dspy # Top模型API
│ └── scripts/
│ └── dashboard_refresh.js # 10秒自动刷新脚本
├── pyproject.toml
└── build.sh
部署
cd ~/repos/dashboard_for_sage
git pull
bash build.sh
# 设置RBAC权限(在生产服务器上执行)
cd ~/repos/sage && git pull
./py3/bin/python load_path.py
# 重启Sage
./stop.sh && ./start.sh
访问地址
/dashboard_for_sage/index.ui
Description
Languages
Python
48.1%
CSS
33%
JavaScript
16.3%
Shell
2.6%