16 Commits

Author SHA1 Message Date
03645f1128 feat: i18n多语言支持(zh/en/jp/ko)+i18n_getmsgs端点 2026-07-24 13:49:55 +08:00
25cfa19a48 feat: 分销商财务仪表盘(收入/成本/毛利×币种,今天/本月/本年/累计) 2026-07-24 13:08:31 +08:00
59072ef035 feat: 客户视图(隐藏用户区+org过滤图表+API Key排行端点) 2026-07-23 16:53:51 +08:00
a229abfb81 fix: load_path.py Sage路径 ~/repos/sage→~/sage 适配生产环境 2026-07-22 16:09:35 +08:00
7db361425b feat: 6个监控组件改用RefreshWidget+Jinja2服务端渲染,初始即加载+60s刷新 2026-07-22 14:56:20 +08:00
3439ce0a2c fix: dm_model_perf_daily.catelogid 10→32 + GROUP BY userorgid加表前缀 + 独立聚合脚本aggregate_all.py 2026-07-22 10:48:00 +08:00
237c09262f fix: init_data.py补全缺失字段+userorgid为None兜底(空串),支持重复执行 2026-07-21 15:05:02 +08:00
05584d8871 feat: 实时数据Dashboard+客户/分销商角色视图
- dashboards.py: 新增实时指标(直查llmusage,无ETL延迟) + 分销商专用API + scope过滤版
- init.py: 角色检测(_resolve_view),实时卡片J2函数,分销商API端点
- index.ui: 7个实时卡片(15s刷新)替换旧stat_*卡片
- 新增rt_card_*.ui(7个)+api端点(2个)
- load_path.py: 注册新UI路径
2026-07-21 12:03:28 +08:00
e84fc8882b refactor: remove DDL from ETL/init, use llm_api_map for catelogid
- Remove ensure_tables() from etl.py (DDL belongs in models/*.json + build.sh)
- Use llm_api_map.isdefaultcatelog='1' to get catelogid (llm table no longer has catelogid)
- Fix currency field: use amount_currency from llmusage_history
- init_data.py: remove ensure_tables import and call, reduce to 3 steps
2026-07-20 14:11:06 +08:00
2f9a890128 refactor: move init_data to standalone script (not cron endpoint)
- scripts/init_data.py: standalone CLI tool, connects directly to sage DB
- Remove HTTP endpoint (cron/init_data.dspy) - init is one-time operation
- Remove init_datamart from init.py - no longer exposed as web service
- Remove RBAC permission for init_data.dspy

Usage: cd /path/to/sage && python /path/to/sage_datamart/scripts/init_data.py
2026-07-20 13:44:09 +08:00
7f5c1ed372 feat: add init_data script to import historical data from llmusage + llmusage_history into data mart
- init_data.py: batch import with dedup, aggregate all historical dates
- wwwroot/cron/init_data.dspy: trigger endpoint
- init.py: register init_datamart function with IP whitelist
- load_path.py: add RBAC permission for init_data.dspy
2026-07-20 13:08:04 +08:00
4f23e07bcd fix: cron dspy移除import + load_path.py添加cron权限(any) + stat_total_users
- cron/*.dspy: 移除import,改为调用init.py注册的cron_etl_*函数
- init.py: 新增cron_etl_sync/aggregate/provider_cost函数(含IP白名单校验)
- load_path.py: 添加3个cron dspy路径为any角色,补充stat_total_users.ui
- dspy内权限: request['client_ip']不在127.0.0.1则拒绝
2026-07-20 10:55:05 +08:00
8a97ea4a86 refactor: rename sage_datamark → sage_datamart + add ETL cron + stat UIs
- Rename package directory and all references from sage_datamark to sage_datamart
- Add 3 ETL cron dspy files (sync/aggregate/provider_cost) for scheduled data pipelines
- Add 5 stat UI files (total_users/fail_calls/success_rate/avg_ttft/total_calls)
- Register j2_ template functions in init.py for UI rendering
- Move j2_avg_ttft SQL to dashboards.py for DRY
- Clean unused imports (getConfig/DBPools/exception)
- Update git remote to sage_datamart.git
2026-07-20 10:49:15 +08:00
054b0dd8e2 feat: unified dashboard — all dashboard_for_sage metrics from data mart, 6 stat cards, perf+ops 2026-07-17 18:11:19 +08:00
8aafb31ef4 rename: data_mart → sage_datamark 2026-07-17 17:20:13 +08:00
4d24094048 feat: data_mart module — model perf monitoring + provider ROI dashboard 2026-07-17 16:56:52 +08:00