82 Commits

Author SHA1 Message Date
ad58dab697 docs: add qwen-image-2.0 and qwen-image-plus models to image generation API docs 2026-06-02 15:08:27 +08:00
aa2c553ff0 docs: add GET /v1/models/catelog endpoint to API docs 2026-06-02 11:21:30 +08:00
398e90fa17 fix: dashboard布局重构 - 修复遮挡/热门模型金额/今日指标缺失
1. 热门模型: valueFields改为[total_amount, cnt],与用户/供应商一致
2. 布局重构:
   - 第一行: 今日调用总量+今日交易金额(2个50%宽卡片)
   - 第二行: 用户总数+活跃用户+在线用户+记账异常(4个25%宽卡片)
   - 第三行: 热门模型+用户排行+供应商排行(3个33%宽图表)
3. 图表高度统一250px,间距16px
4. 移除ResponsableBox改用HBox,避免卡片溢出遮挡
5. 移除stat_new_users_month和stat_total_orgs,精简指标
2026-06-02 00:25:12 +08:00
a1fb0089ad force: re-sync load_dashboard.py (ensure full 614-line version) 2026-06-01 16:50:58 +08:00
401c7a15bb fix: restore load_dashboard.py (truncated), use CSS vars for dark mode, improve card spacing 2026-06-01 16:39:57 +08:00
759d629bb3 fix: fullscreen background color and stat card layout 2026-06-01 16:14:56 +08:00
bf5cf2b1b2 fix: fullscreen targets dashboard container instead of entire page 2026-06-01 16:09:05 +08:00
966c89080b fix: reduce margins, padding, chart heights to eliminate scrollbar 2026-06-01 16:08:14 +08:00
c89c0d89de refactor: arrange model/user/provider charts in single row 2026-06-01 15:56:14 +08:00
80785e7ace fix: use entire_url() for chart data URLs to include module prefix 2026-06-01 15:52:10 +08:00
9cc59160e8 feat: add trend indicators and color accents to stat cards
- Add get_usage_trend() and get_amount_trend() functions for day-over-day comparison
- Display trend arrows (up/down/flat) with percentage change in stat_today_usage and stat_today_amount
- Add colored left borders to all stat cards for visual distinction:
  - Blue: usage, total users
  - Purple: amount, total orgs
  - Green: active users, new users this month
  - Cyan: concurrent users
  - Red: errors
- Enhance visual hierarchy with accent colors matching SVG icons
2026-06-01 15:49:46 +08:00
855f376671 refactor: consolidate rankings into combined charts
- Change top models from Top 3 to Top 5
- Simplify titles: remove 'Top X' and parenthetical details
- Replace separate user tables (by amount/by count) with single ChartBar
- Replace separate provider tables with single ChartBar
- Add get_top_users_combined and get_top_providers_combined functions
2026-06-01 15:41:40 +08:00
c9e860c691 remove quick-links panel, chart takes full width 2026-06-01 15:34:18 +08:00
8bed983919 fix: hide '我的今日模型使用' card for non-customer roles
Remove duplicate unprotected card that was always rendered regardless
of role, causing 403 for non-customer users. Keep only the customer-
only version wrapped in {% if 'customer.*' in roles %}.
2026-06-01 15:32:16 +08:00
66f588cd80 add reseller.* role support alongside owner.* 2026-06-01 15:28:36 +08:00
69264b6ec6 restrict my-today-models and customer-monitor to customer.* role only 2026-06-01 15:25:29 +08:00
3cbb0a4719 fix: double comma causing blank page for owner role 2026-06-01 15:06:06 +08:00
14881f83f2 fix: remove stray endif that caused 500 error 2026-06-01 15:01:36 +08:00
40706c4c72 hide customer monitoring from non-customer users 2026-06-01 14:57:27 +08:00
9b52cd2e04 fix: 使用Iframe widget替代urlwidget加载HTML页面 2026-06-01 13:32:34 +08:00
afdbb2ed37 feat: Apifox风格API文档页面,替代MarkdownViewer平铺展示 2026-06-01 13:26:46 +08:00
d65629afb2 bugfix 2026-05-31 15:03:55 +08:00
650d2e6feb docs: add reallife_asset API section to unified api_doc.md 2026-05-31 13:24:31 +08:00
0d62b568e2 fix: sageOnLogin skips dashboard load when Router has saved route
Added sageOnLogin(dashboardUrl) function that checks if the SPA Router
has a route (via Router.current() or URL ?page= param) before loading
the dashboard. This prevents user_logined event from overwriting
Router-restored content on page refresh with deep links.
2026-05-31 13:08:45 +08:00
97ca142092 feat: add fullscreen toggle button to dashboard
Added a fullscreen button (⛶) next to the last-update timestamp.
Clicking it toggles browser fullscreen mode using the Fullscreen API.
2026-05-31 13:02:10 +08:00
28e538750b docs: 补充catelogid必填参数说明
在图像生成API文档中明确catelogid为必填参数,文生图固定为t2i
2026-05-31 12:28:58 +08:00
84817a6805 docs: 添加图像生成API详细模型参数文档
补充 POST /v1/image/generations 接口的4个生图模型详细参数说明:
- 百炼万象系列(wan2.2-t2i-plus, wan2.5-t2i-preview, wan2.2-t2i-flash)- 异步模式
- 智谱CogView(cogview-3-flash)- 同步模式

包含:输入参数表、可用模型列表、响应示例
2026-05-31 12:28:10 +08:00
915b77cab7 feat: 复制api_doc到dashboard_for_sage供客户用户访问大模型API文档
- 新增 api_doc.ui 和 api_doc.md(从llmage模块复制)
- api_doc.ui中md_url指向/dashboard_for_sage/api_doc.md
- load_path.py注册新路径权限
2026-05-31 10:33:27 +08:00
b648717339 feat: role-based dashboard visibility - customer users see only customer monitoring 2026-05-31 10:22:10 +08:00
98a28d9770 feat: 添加全局今日模型使用图表,替换用户级监控为全量监控
- 新增 get_all_today_models() 函数查询所有用户今日模型使用
- 新增 all_today_models_chart.ui 和 api/all_today_models.dspy
- index.ui 标题改为「今日模型使用(全部)」,数据源改为全量
- load_path.py 注册新路径权限
- 保留原有 user_today_models 供后续个性化需求使用
2026-05-31 10:01:28 +08:00
929ee0e319 feat: 添加客户专属监控 - 组织级每日/每月模型调用统计
- 新增5个后端函数: customer_daily/monthly_models, daily/monthly_summary, daily_trend
- 新增customer_usage.ui主页面: 4个汇总卡片 + 日趋势折线图 + 日/月模型柱状图
- 新增3个API端点(.dspy)和3个图表UI组件
- index.ui添加客户专属监控入口卡片
- RBAC权限配置已更新(load_path.py)
2026-05-31 08:07:25 +08:00
69b7ec5cd0 feat: add user-level model usage chart (我的今日模型使用)
- Add get_user_today_models() function to load_dashboard.py
  Shows current user's today model call counts and amounts
- Create api/user_today_models.dspy endpoint
- Create user_today_models_chart.ui ChartBar widget (30s auto-refresh)
- Add '我的今日模型使用' card section to index.ui with refresh button
- Register new paths in load_path.py (logined permission)
2026-05-31 08:00:22 +08:00
c36ada56b1 fix: sidebar collapse width, CRUD height overflow, dashboard VScrollPanel 2026-05-30 21:20:29 +08:00
d8ec4e7142 fix: tabular row selection visibility - CSS specificity fix for dark/light themes
- Dark theme: .tabular-cell color was overriding .tabular-row-selected color
  due to same specificity and later position. Added !important and combined
  selector .tabular-row-selected .tabular-cell to fix.
- Added background-color change for selected rows (both themes)
- Added cursor:pointer on .tabular-row for better UX
- Light theme: added blue-tinted background + darker text for selected rows
2026-05-29 13:44:46 +08:00
37b648da0e feat: wire Menu collapse/expand to sidebar toggle button + menu-collapsed CSS 2026-05-29 11:12:56 +08:00
e2687054df fix dashboard UI: quick-link css class, stat-card theming, remove hardcoded colors, light theme overrides 2026-05-28 18:10:59 +08:00
3659533102 fix: responsive layout - sidebar collapse, mobile adaptation, prevent text jumping
- Fix text jumping on right side when screen narrows (min-width:0 on flex item)
- Fix sidebar toggle button not working (retry icon init, proper state sync)
- Mobile adaptation: sidebar as overlay with slide animation
- Auto-collapse sidebar on mobile viewport (<=768px)
- Click outside sidebar to close on mobile
- Responsive padding for stat cards and main content
- Hide brand title on very small screens (<=480px)
- Smooth transitions for sidebar collapse/expand
2026-05-28 16:58:29 +08:00
79a04be92b fix: remove hardcoded dark theme colors from all .ui files for light theme support 2026-05-28 16:14:01 +08:00
cdd812f935 i18n: convert dashboard text fields to otext+i18n:true for translation
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, 排名, 用户, 金额, 调用次数
2026-05-28 14:53:20 +08:00
9f8e5a6d1c fix: retry theme icon update until bricks button element exists 2026-05-28 14:33:59 +08:00
22a8dc7ceb fix: ensure theme switching works for all containers including sage-shell, topbar, sidebar, and main content area 2026-05-28 14:14:19 +08:00
4170c0b009 fix: remove global_menu_widget id from sageReloadMenu urlwidget 2026-05-28 10:35:10 +08:00
56a9a13db1 refactor: remove shell.ui and global_menu.ui (moved to sage/wwwroot)
dashboard_for_sage now only handles dashboard content when the
dashboard menu item is clicked. Shell layout and global menu are
sage-level concerns managed in sage/wwwroot/index.ui and
sage/wwwroot/global_menu.ui.
2026-05-27 18:43:51 +08:00
741daafdef refactor: rename event sage_login to user_logined 2026-05-27 18:01:53 +08:00
cbe725bcee feat: dynamic menu reload on login/logout
- shell.ui: add id to menu urlwidget, binds for sage_login/sage_logout events
- shell_theme.js: add sageReloadMenu() to rebuild menu urlwidget
- global_menu.ui: complete with all 22 modules and role-based visibility
2026-05-27 17:57:40 +08:00
dfe6c0e14f feat: 完善global_menu.ui,添加所有模块菜单项
新增模块:
- 统一仪表板 (unified_dashboard)
- CRM系统 (integrated_crm_app)
- 客户管理 (customer_management)
- 商机管理 (opportunity_management)
- 合同管理 (contract_management)
- 折扣管理 (discount)
- 财务管理 (financial_management)
- 工作流审批 (workflow_approval)
- 算力中心管理 (cpcc)
- 运维管理 (msp)
- 内容管理 (cms/entcms)
- 钉钉审批 (cms/dingdingflow)

总计22个模块菜单项,覆盖所有业务模块
2026-05-27 17:50:19 +08:00
61a1b2b2fa feat: integrate bricks.Router into shell
- shell_theme.js: call bricks.Router.init() with sage_main_content target
- Remove standalone spa_router.js (now built into bricks)
- Remove spa_router.js from load_path.py RBAC
2026-05-27 15:19:19 +08:00
0032e364b1 feat: add spa_router.js RBAC permission (any) 2026-05-27 14:10:14 +08:00
39fe93438c feat: SPA router for bricks - URL state management
- Intercepts buildUrlwidgetHandler to track navigation to sage_main_content
- Updates browser URL via History API (pushState) on page changes
- Restores page state on browser refresh via ?page= URL parameter
- Supports browser back/forward buttons via popstate event
- Supports deep linking (direct URL access to specific pages)
- URL format: /?page=/module/index.ui
2026-05-27 14:08:39 +08:00
7987c24e26 fix: 完善shell_theme.css深色/浅色主题CRUD组件覆盖(tabular/popup/form/accordion等) 2026-05-26 23:44:14 +08:00