192 Commits

Author SHA1 Message Date
44d94dace5 refactor: optimize debug output - use debug_params for compact logging, truncate SQL; add CRUD definitions 2026-05-29 12:07:53 +08:00
eed21ce6a5 fix: responsive UI with VScrollPanel, cfontsize, css:card 2026-05-29 00:13:08 +08:00
d6e4221a7b feat: add model publish/unpublish (上架/下架) functionality
- llm table: add status field (published/unpublished, default unpublished)
- User-facing queries: filter by status='published' in 11 query points:
  - utils.py: get_llms_by_catelog_to_customer, get_llms_by_catelog,
    get_llm, get_llmproviders, get_llms_sort_by_provider
  - v1 endpoints: chat/completions, image/generations, video/generations
  - user pages: t2t, get_type_llms, list_catelog_models,
    list_paging_catelog_llms, llmcheck
- CRUD: status column visible/editable with select dropdown
- Admin CRUD list shows ALL models regardless of status
- Migration SQL: sql/add_status_field.sql (existing models set to published)
2026-05-28 23:42:29 +08:00
534e4fe8e0 fix: remove hardcoded dark theme colors from stat cards for light theme support 2026-05-28 16:16:07 +08:00
59d3c406ab fix: remove hardcoded dark theme colors from index.ui and show_llms pages
- Remove bgcolor/color/border hardcoded dark theme values from index.ui
- Use css:'card' class instead of inline bgcolor for navigation cards
- Remove conflicting bgcolor:#def0f0 from show_llms/show_llms_by_providers/show_same_catelog_llm
- Let system theme (bricks.css/shell_theme.css) handle styling
2026-05-27 11:31:13 +08:00
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
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
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
7911750127 feat(llmage): 备份改用INSERT SELECT+DELETE单SQL语句 + 新增失败记录重试功能 2026-05-24 21:57:56 +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
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
410ab1d2e4 buggix 2026-05-22 15:47:00 +08:00
7523e67214 buggix 2026-05-22 14:28:51 +08:00
2f29674ec0 buggix 2026-05-22 14:27:47 +08:00
5b3c7d4d02 refactor: 废弃llm_catalog_rel表, 分类关系改用llm_api_map
- 删除 llm_catalog_rel 表定义(models/json/xlsx)、CRUD文件、管理页面、迁移脚本
- utils.py: get_llms_by_catelog/get_llms_by_catelog_to_customer 的SQL从 llm_catalog_rel 改为 llm_api_map (加distinct去重)
- init.py: 缓存清除事件从 llm_catalog_rel 改为 llm_api_map
- menu.ui/index.ui: 移除类型关联菜单项
- dspy文件: v1/chat/completions, t2t, get_type_llms, list_catelog_models, list_paging_catelog_llms, llmcatelog_delete 全部改为 join llm_api_map
- 迁移脚本: 添加try/except兼容旧表不存在的情况
2026-05-21 16:22:59 +08:00
f1498178cc fix(llm_api_map_manage): 修正uitype规范+VScrollPanel滚动+llmid隐藏字段
- select→code, text→str, number→int 对齐bricks uitype规范
- 表单区域父容器改用VScrollPanel(height:500px)防止超出屏幕
- llmid改为uitype:hidden, 从params_kw.llmid获取值(从llm CRUD tool触发)
- 移除llmid的select下拉和label
2026-05-21 16:11:40 +08:00
76622381be bugfix 2026-05-21 13:19:48 +08:00
1060cac2de feat: llm_api_map CRUD management and ownerid-based data isolation
- Update json/llm.json subtable from llm_catelog_rel to llm_api_map
- Rewrite json/llm_api_map.json as standard CRUD format (tblname+params)
- Add models/llm_api_map.json table definition (summary/fields/indexes/codes)
- Add independent management UI (llm_api_map_manage.ui)
- Add CRUD DSPY APIs (list/create/delete/options) with ownerid filtering
- All operations verify l.ownerid for data isolation
- Add uapi_options.dspy for API selection dropdown
2026-05-20 17:29:27 +08:00
d2ffd9c6d0 refactor: introduce llm_api_map table and remove uapiset intermediate layer
- New llm_api_map table: extract ability-specific fields (apiname,
  query_apiname, query_period, ppid) from llm table to support
  one-model-multi-ability without redundancy
- Remove uapiset from llmage JOIN chain: upapp.apisetid now directly
  joins uapi.apisetid
- Updated BufferedLLMs.get_llm() to JOIN llm_api_map for
  query_apiname/query_period/ppid fields
- Updated llmcheck.dspy and list_paging_catelog_llms.dspy to remove
  uapiset references
- Added migration script to generate llm_api_map INSERTs from existing
  llm data
2026-05-20 15:13:07 +08:00
7729d05bbf bugfix 2026-05-19 16:21:23 +08:00
fc2e5c066e bugfix 2026-05-19 16:12:54 +08:00
b60c24c9f6 bugfix 2026-05-19 16:08:34 +08:00
7c7db5bd67 bugfix 2026-05-19 15:56:35 +08:00
efee227cf1 feat: add catalog relation management entry in menu
- Add 类型关联 menu item pointing to llm_catalog_rel_manage.ui
- Allows managing LLM to catalog (type) relations from menu
2026-05-17 01:08:32 +08:00
1b74b5bf10 feat: add llm catalog (type) management module
- Add CRUD API for llmcatelog (list/create/update/delete)
- Add llmcatelog.ui as main entry for catalog management
- Add llmcatelog_list.ui as DataViewer interface
- Add index.ui as module navigation page
- Update json/llmcatelog.json with editable section
2026-05-17 00:46:31 +08:00
6cc3986a2d feat: support multi-catalog for LLMs
- Create llm_catalog_rel model for one-to-many relationship
- Remove llmcatelogid from llm model
- Update SQL queries in utils.py and dspy files to use join
- Add maintenance UI (llm_catalog_rel_manage.ui) and API endpoints
- Filter options by user's orgid
2026-05-16 21:31:19 +08:00
6a33c5e9aa bugfix 2026-05-16 15:14:31 +08:00
be7317eeb8 bugfix 2026-05-16 10:15:11 +08:00
d8146ef2eb bugfix 2026-05-14 11:53:16 +08:00
a5c459599a bugfix 2026-05-08 11:02:00 +08:00
6afbc71b13 bugfix 2026-05-08 10:54:33 +08:00
88e53c213c bugfix 2026-04-28 22:13:03 +08:00
fb9ab5f719 bugfix 2026-04-28 22:08:18 +08:00
dc7a86acf6 bugfix 2026-04-28 21:51:25 +08:00
bef6855811 bugfix 2026-04-28 21:47:03 +08:00
713ae6301a bugfix 2026-04-28 21:46:11 +08:00