fix: llm CRUD json URLs match generated dspy names; rebuild llm index.ui

This commit is contained in:
yumoqing 2026-08-01 11:33:32 +08:00
parent 7288eb5ba8
commit 0b01c58534
2 changed files with 188 additions and 44 deletions

View File

@ -9,9 +9,9 @@
}, },
"editexclouded": ["id", "created_at", "updated_at"], "editexclouded": ["id", "created_at", "updated_at"],
"editable": { "editable": {
"new_data_url": "{{entire_url('../api/llm_create.dspy')}}", "new_data_url": "{{entire_url('./add_llm.dspy')}}",
"update_data_url": "{{entire_url('../api/llm_update.dspy')}}", "update_data_url": "{{entire_url('./update_llm.dspy')}}",
"delete_data_url": "{{entire_url('../api/llm_delete.dspy')}}" "delete_data_url": "{{entire_url('./delete_llm.dspy')}}"
}, },
"confidential_fields": ["api_key"] "confidential_fields": ["api_key"]
} }

View File

@ -1,43 +1,187 @@
{
"widgettype":"VBox",
"options":{"height":"100%","width":"100%"},
"subwidgets":[
{ {
"widgettype": "Tabular",
"id":"llm_tbl", "id":"llm_tbl",
"widgettype":"Tabular",
"options":{ "options":{
"width":"100%", "width":"100%",
"title": "大模型管理", "height":"100%",
"title":"大语言模型表",
"css":"card", "css":"card",
"data_url": "{{entire_url('./get_llms.dspy')}}",
"data_method": "GET",
"editable":{ "editable":{
"new_data_url": "{{entire_url('./create_llm.dspy')}}",
"update_data_url": "{{entire_url('./update_llm.dspy')}}", "new_data_url": "{{entire_url('./add_llm.dspy')}}",
"delete_data_url": "{{entire_url('./delete_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": { "browserfields": {
"exclouded": ["id", "api_key"], "exclouded": [
"alters": { "id",
"status": { "api_key"
"uitype": "code", ],
"data": [ "cwidth": {}
{"value": "active", "text": "启用"},
{"value": "inactive", "text": "停用"}
]
}
}
}, },
"editexclouded": ["id", "created_at", "updated_at"],
"confidential_fields": ["api_key"],
"editexclouded":[
"id",
"created_at",
"updated_at"
],
"fields":[ "fields":[
{"name": "id", "title": "ID", "type": "str", "cwidth": 0}, {
{"name": "name", "title": "模型名称", "type": "str", "cwidth": 18}, "name": "id",
{"name": "provider", "title": "供应商", "type": "str", "cwidth": 12}, "title": "主键",
{"name": "model_id", "title": "模型标识", "type": "str", "cwidth": 18}, "type": "str",
{"name": "api_base", "title": "API地址", "type": "str", "cwidth": 20}, "length": 32,
{"name": "api_key", "title": "API密钥", "type": "str", "cwidth": 14}, "nullable": "no",
{"name": "max_tokens", "title": "最大Token", "type": "str", "cwidth": 10}, "cwidth": 18,
{"name": "status", "title": "状态", "type": "str", "cwidth": 8}, "uitype": "str",
{"name": "description", "title": "描述", "type": "str", "cwidth": 16}, "datatype": "str",
{"name": "created_at", "title": "创建时间", "type": "str", "cwidth": 14}, "label": "主键"
{"name": "updated_at", "title": "更新时间", "type": "str", "cwidth": 14} },
{
"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":[]
}]
} }