13 Commits

Author SHA1 Message Date
022269040f feat: load_path添加api_doc.ui和api_doc.md权限路径 2026-05-31 09:03:17 +08:00
5ec5946a90 fix: derive sage_root from script location instead of hardcoded path 2026-05-30 13:41:01 +08:00
e494c88977 fix: migrate_llmcatelog_ids script missing database config init
DBPools() was called without config.databases, causing NoneType error.
Load config from sage_root and pass config.databases like the other
migration script does.
2026-05-30 13:30:50 +08:00
3ba1c50eb6 feat: add llmcatelog ID migration script (random IDs to meaningful abbreviations) 2026-05-30 12:07:19 +08:00
c65cf35a85 refactor: use wildcard % in load_path.py for auto-coverage 2026-05-29 00:52:19 +08:00
a4e3411584 feat: add scripts/load_path.py for RBAC permission management
- Migrate all llmage permission entries from sage/load_path.py
- Include new data_filter API endpoints (llm_list/create/update/delete, get_organizations, get_upapps)
- Include all existing v1, api, CRUD directory, and page endpoints
- Follow product_management/scripts/load_path.py pattern
2026-05-26 14:32:44 +08:00
9fa8f9fa62 feat(llmage): 日期变更触发备份(use_date<昨天) + llmusage添加(accounting_status,use_date)组合索引 2026-05-24 17:21:34 +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
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
17f6855b5a feat: add deployment scripts for llm_api_map migration
- scripts/migrate_llm_api_map_db.py: Direct DB migration (create table + migrate data)
  Supports --dry-run and --drop-old flags
- scripts/deploy_llmage.sh: One-click deployment script
  Orchestrates: git pull -> build -> migrate -> perms -> restart
2026-05-21 10:59:15 +08:00
6f851895fe feat: add permissions script for llm_api_map management (Admin + Operator level)
- scripts/setup_llmage_perms.sh: shell-based permission init following sage convention
- Replaces deleted Python/SQL permission scripts
- Authorizes: owner.superuser, *.admin roles, reseller.operator
- Covers: llm_api_map_manage.ui + all CRUD API endpoints + uapi_options
2026-05-20 18:01:53 +08:00
715e759be9 feat: add permission scripts for llm_api_map endpoints
- scripts/add_llm_api_map_perms.sql: SQL to insert permission records
- scripts/add_llm_api_map_perms.py: Python script using getID() for ID generation
- Covers all new llm_api_map CRUD endpoints and uapi_options
2026-05-20 17:36:09 +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