From 0b01c585340179fa07c1b2949bfa78a6a4ee889f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 1 Aug 2026 11:33:32 +0800 Subject: [PATCH] fix: llm CRUD json URLs match generated dspy names; rebuild llm index.ui --- pipeline_core/json/llm.json | 6 +- wwwroot/pipeline_core/llm/index.ui | 226 +++++++++++++++++++++++------ 2 files changed, 188 insertions(+), 44 deletions(-) diff --git a/pipeline_core/json/llm.json b/pipeline_core/json/llm.json index 7f22219..0a4e63e 100644 --- a/pipeline_core/json/llm.json +++ b/pipeline_core/json/llm.json @@ -9,9 +9,9 @@ }, "editexclouded": ["id", "created_at", "updated_at"], "editable": { - "new_data_url": "{{entire_url('../api/llm_create.dspy')}}", - "update_data_url": "{{entire_url('../api/llm_update.dspy')}}", - "delete_data_url": "{{entire_url('../api/llm_delete.dspy')}}" + "new_data_url": "{{entire_url('./add_llm.dspy')}}", + "update_data_url": "{{entire_url('./update_llm.dspy')}}", + "delete_data_url": "{{entire_url('./delete_llm.dspy')}}" }, "confidential_fields": ["api_key"] } diff --git a/wwwroot/pipeline_core/llm/index.ui b/wwwroot/pipeline_core/llm/index.ui index ae4b2a0..8757abd 100644 --- a/wwwroot/pipeline_core/llm/index.ui +++ b/wwwroot/pipeline_core/llm/index.ui @@ -1,43 +1,187 @@ + { - "widgettype": "Tabular", - "id": "llm_tbl", - "options": { - "width": "100%", - "title": "大模型管理", - "css": "card", - "data_url": "{{entire_url('./get_llms.dspy')}}", - "data_method": "GET", - "editable": { - "new_data_url": "{{entire_url('./create_llm.dspy')}}", - "update_data_url": "{{entire_url('./update_llm.dspy')}}", - "delete_data_url": "{{entire_url('./delete_llm.dspy')}}" - }, - "browserfields": { - "exclouded": ["id", "api_key"], - "alters": { - "status": { - "uitype": "code", - "data": [ - {"value": "active", "text": "启用"}, - {"value": "inactive", "text": "停用"} - ] - } - } - }, - "editexclouded": ["id", "created_at", "updated_at"], - "confidential_fields": ["api_key"], - "fields": [ - {"name": "id", "title": "ID", "type": "str", "cwidth": 0}, - {"name": "name", "title": "模型名称", "type": "str", "cwidth": 18}, - {"name": "provider", "title": "供应商", "type": "str", "cwidth": 12}, - {"name": "model_id", "title": "模型标识", "type": "str", "cwidth": 18}, - {"name": "api_base", "title": "API地址", "type": "str", "cwidth": 20}, - {"name": "api_key", "title": "API密钥", "type": "str", "cwidth": 14}, - {"name": "max_tokens", "title": "最大Token", "type": "str", "cwidth": 10}, - {"name": "status", "title": "状态", "type": "str", "cwidth": 8}, - {"name": "description", "title": "描述", "type": "str", "cwidth": 16}, - {"name": "created_at", "title": "创建时间", "type": "str", "cwidth": 14}, - {"name": "updated_at", "title": "更新时间", "type": "str", "cwidth": 14} - ] + "widgettype":"VBox", + "options":{"height":"100%","width":"100%"}, + "subwidgets":[ +{ + "id":"llm_tbl", + "widgettype":"Tabular", + "options":{ + "width":"100%", + "height":"100%", + + + "title":"大语言模型表", + + + + + "css":"card", + + + "editable":{ + + "new_data_url": "{{entire_url('./add_llm.dspy')}}", + + + "delete_data_url": "{{entire_url('./delete_llm.dspy')}}", + + + "update_data_url": "{{entire_url('./update_llm.dspy')}}" + + + }, + + + "data_url":"{{entire_url('./get_llm.dspy')}}", + + "data_method":"GET", + "data_params":{{json.dumps(params_kw, indent=4, ensure_ascii=False)}}, + "row_options":{ + + + + "browserfields": { + "exclouded": [ + "id", + "api_key" + ], + "cwidth": {} +}, + + + "editexclouded":[ + "id", + "created_at", + "updated_at" +], + + "fields":[ + { + "name": "id", + "title": "主键", + "type": "str", + "length": 32, + "nullable": "no", + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "主键" + }, + { + "name": "name", + "title": "模型名称", + "type": "str", + "length": 100, + "nullable": "no", + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "模型名称" + }, + { + "name": "provider", + "title": "供应商", + "type": "str", + "length": 50, + "nullable": "no", + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "供应商" + }, + { + "name": "model_id", + "title": "模型标识", + "type": "str", + "length": 100, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "模型标识" + }, + { + "name": "api_base", + "title": "API地址", + "type": "str", + "length": 500, + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "API地址" + }, + { + "name": "api_key", + "title": "API密钥", + "type": "str", + "length": 500, + "cwidth": 18, + "uitype": "password", + "datatype": "str", + "label": "API密钥" + }, + { + "name": "max_tokens", + "title": "最大Token", + "type": "int", + "default": "8192", + "length": 0, + "uitype": "int", + "datatype": "int", + "label": "最大Token" + }, + { + "name": "status", + "title": "状态", + "type": "str", + "length": 20, + "default": "active", + "cwidth": 18, + "uitype": "str", + "datatype": "str", + "label": "状态" + }, + { + "name": "description", + "title": "描述", + "type": "text", + "length": 0, + "uitype": "text", + "datatype": "text", + "label": "描述" + }, + { + "name": "created_at", + "title": "创建时间", + "type": "timestamp", + "length": 0, + "uitype": "str", + "datatype": "timestamp", + "label": "创建时间" + }, + { + "name": "updated_at", + "title": "更新时间", + "type": "timestamp", + "length": 0, + "uitype": "str", + "datatype": "timestamp", + "label": "更新时间" } -} +] + }, + + + + + + + + "page_rows":160, + "cache_limit":5 + } + + ,"binds":[] + +}] +} \ No newline at end of file