589 Commits

Author SHA1 Message Date
9aa917bce5 feat: add data_filter and CRUD endpoints for llm table
- Add data_filter with 4 searchable fields (name LIKE, model LIKE, providerid, upappid)
- Add filter_labels for search form display
- Create llm_list.dspy with DBFilter support and LIKE wildcard handling
- Create llm_create.dspy, llm_update.dspy, llm_delete.dspy
- Create get_organizations.dspy and get_upapps.dspy for dropdown options
- Add browserfields alters for providerid and upappid dropdowns
- Add editable URLs for DataViewer CRUD operations
2026-05-26 14:26:38 +08:00
04913dbe42 refactor: 3-part layout - title (fixed), tab header/cards (fixed), content (filler, scrollable) 2026-05-26 13:42:44 +08:00
ca51e168dc docs: add API documentation for all /v1 endpoints
- docs/API.md: comprehensive API docs covering:
  - POST /v1/chat/completions (text generation)
  - POST /v1/video/generations (video generation, new)
  - POST /v1/image/generations (image generation, new)
  - GET /v1/tasks (async task status)
  - GET /v1/models (list available models)
  - Authentication, balance check, and billing notes
2026-05-26 13:10:05 +08:00
e9a20a091f revert: restore self-orgid balance bypass in checkCustomerBalance()
The 'if llm.ownerid == userorgid: return True' shortcut is correct
behavior — own organization's models should not require balance check.
2026-05-26 12:05:46 +08:00
265702b894 fix: remove self-orgid balance bypass in checkCustomerBalance()
Removed the 'if llm.ownerid == userorgid: return True' shortcut from
checkCustomerBalance() in llmage/accounting.py. All requests now go
through the full balance check regardless of whether the model belongs
to the caller's organization.
2026-05-26 12:02:23 +08:00
f151ad2c30 fix: add dark mode background (#0B1120) to llmage index.ui 2026-05-26 11:56:45 +08:00
146ebb2b4a feat: add /v1/video/generations and /v1/image/generations API endpoints
- wwwroot/v1/video/generations/index.dspy: video generation endpoint
  Required params: model, llmcatelogid, prompt
  Supports async task submission via existing inference infrastructure

- wwwroot/v1/image/generations/index.dspy: image generation endpoint
  Required params: model, llmcatelogid, prompt
  Supports both sync and async models depending on config

Both endpoints follow the same pattern as /v1/chat/completions:
  1. Validate required params (model + llmcatelogid + prompt)
  2. Look up llm via llm_api_map join with catalog type
  3. Check customer balance
  4. Route to inference (async/sync based on model config)
2026-05-26 11:45:37 +08:00
b558059dc8 Merge feat/dataviz-llmage: add llmage module stat cards
- Create stats.py with get_llmage_stats() helper function
- Add 4 stat widgets: stat_total_models, stat_today_calls, stat_today_amount, stat_catelog_count
- Update index.ui to display stat cards row above navigation cards
- Register get_llmage_stats in load_llmage()
2026-05-26 11:27:29 +08:00
9364989be3 Merge feat/modern-ui-llmage: modernize llmage index.ui with standardized card navigation
- Replace hardcoded colors with modern #1E293B card style
- Add 12px borderRadius to match design system
- Standardize SVG icons (36px, 1.5 stroke width)
- Fix entire_url paths to use /llmage/ module prefix
- Add page header with Title2 + description text
2026-05-26 11:27:23 +08:00
fd6d17e3c2 feat: add llmage module stat cards - model count, today's usage, amount, catalog count
- Create stats.py with get_llmage_stats() helper function
- Add 4 stat widgets: stat_total_models, stat_today_calls, stat_today_amount, stat_catelog_count
- Update index.ui to display stat cards row above navigation cards
- Register get_llmage_stats in load_llmage()
2026-05-25 18:48:09 +08:00
ae61193454 feat: modernize llmage index.ui with standardized card navigation
- Replace #1e3a5f hardcoded colors with modern #1E293B card style
- Add 12px borderRadius to match design system
- Add subtle #334155 borders for depth
- Standardize SVG icons to 36px with 1.5 stroke width
- Update colors: F1F5F9 text, 94A3B8 secondary descriptions
- Fix entire_url paths to use /llmage/ module prefix
- Add page header with Title2 + description text
2026-05-25 18:27:32 +08:00
56871dc906 fix(llmage): 修复backup_accounted_llmusage中sor.execute()返回值误用(MySQL cursor.execute返回None非rowcount) 2026-05-24 22:03:05 +08:00
7911750127 feat(llmage): 备份改用INSERT SELECT+DELETE单SQL语句 + 新增失败记录重试功能 2026-05-24 21:57:56 +08:00
686b05d8fe bugfix 2026-05-24 20:44:31 +08:00
489ba1ad88 bugfix 2026-05-24 19:48:36 +08:00
9fa8f9fa62 feat(llmage): 日期变更触发备份(use_date<昨天) + llmusage添加(accounting_status,use_date)组合索引 2026-05-24 17:21:34 +08:00
8755ab5d6d fix(llmage): 修复备份SQL条件 use_date < today(非yesterday)+ 提高备份频率到每5分钟 2026-05-24 17:06:23 +08:00
96317c1512 feat(llmage): menu.ui 添加记账失败记录菜单项 2026-05-24 15:36:33 +08:00
93bbd529db fix(llmage): failed_accounting.ui 日期控件改为UiDate 2026-05-24 15:16:01 +08:00
1e335d35cb fix(llmage): 规范检查修复
- accounting.py: 删除重复datetime导入, 清理未使用env变量
- failed_accounting.ui: Button text→label(规范), DatePicker→TextInput(不确定的widget)
- index.ui: backgroundColor→bgcolor(规范), 3处修复
- llmusage_accounting_failed_update.dspy: 删除ServerEnv()违规(.dspy禁用), 用datetime替代
- 新增llmusage_history只读DSPY(create/update/delete返回只读提示)
2026-05-24 14:11:33 +08:00
07b4893252 feat(llmage): 添加llmusage历史记录备份和记账失败检索功能
- 新增 llmusage_history 表:定时备份已记账(use_date<today)的历史记录
- 新增 llmusage_accounting_failed 表:记录记账失败详情,支持检索
- 新增 backup_accounted_llmusage() 函数:备份+清理历史数据
- 新增 get_failed_accounting_records() 函数:按条件检索失败记录
- 更新 llm_accoung_failed():同时写入失败表记录
- 新增 failed_accounting.ui 页面和 failed_accounting_list.dspy API
- 新增 llmusage CRUD API (create/update/delete)
- 新增表索引优化查询性能
- 更新 setup_llmage_perms.sh 添加新端点权限
- 生成生产迁移SQL: scripts/migrate_llmusage_history.sql
2026-05-24 13:55:48 +08:00
e98d9fbce0 bugfix 2026-05-23 22:24:26 +08:00
80f1bae7c7 buggix 2026-05-23 22:22:40 +08:00
9636779d24 buggix 2026-05-23 22:21:58 +08:00
f370277438 buggix 2026-05-23 22:10:17 +08:00
f361200d5c buggix 2026-05-23 22:08:26 +08:00
ac4dea86dd buggix 2026-05-23 21:58:45 +08:00
aca610dd87 bugfix 2026-05-23 21:54:17 +08:00
e587f31c5e bugfix 2026-05-23 21:51:41 +08:00
8c070c692a bugfix 2026-05-23 21:48:46 +08:00
8ca04ba691 bugfix 2026-05-23 21:44:53 +08:00
7cc0d64291 buggix 2026-05-23 20:02:01 +08:00
5994409657 buggix 2026-05-23 19:27:52 +08:00
b3060eee9d buggix 2026-05-23 19:26:52 +08:00
7b7d859be1 bugfix 2026-05-23 18:33:10 +08:00
e37073b713 buggix 2026-05-23 17:22:26 +08:00
4ee67aa022 buggix 2026-05-23 17:21:52 +08:00
0a9ebf48cf buggix 2026-05-23 17:20:26 +08:00
b4d01099ac buggix 2026-05-22 18:18:21 +08:00
408f8acadc buggix 2026-05-22 17:58:34 +08:00
dfe961e4c9 buggix 2026-05-22 17:55:32 +08:00
0723395119 buggix 2026-05-22 17:53:24 +08:00
bcff4e1169 bugfix 2026-05-22 17:51:02 +08:00
7f681e30b9 buggix 2026-05-22 17:38:06 +08:00
d2b97bccdc buggix 2026-05-22 17:35:00 +08:00
2b0283fbae buggix 2026-05-22 17:33:01 +08:00
ef4d854424 buggix 2026-05-22 16:53:10 +08:00
410ab1d2e4 buggix 2026-05-22 15:47:00 +08:00
4807508348 buggix 2026-05-22 14:44:12 +08:00
711e4fa6f9 buggix 2026-05-22 14:43:17 +08:00