llmage/wwwroot/llm_api_map_manage.ui
yumoqing a1c3eb4b25 feat: apiname/query_apiname改为从uapi动态选择
- 新增 get_search_apiname.dspy: 根据llmid查upappid, 从uapi获取API列表
- apiname: code类型下拉选择(必选)
- query_apiname: code类型下拉选择(可选, 含'不指定'选项)
- 更新 json/llm_api_map.json CRUD定义 alters
- 更新 llm_api_map_manage.ui 表单字段
- 重新生成 wwwroot/llm_api_map/index.ui
- 注册 load_path.py RBAC权限
2026-06-05 18:22:14 +08:00

220 lines
6.4 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"spacing": 16
},
"subwidgets": [
{
"widgettype": "Title2",
"options": {
"text": "模型能力映射管理",
"halign": "left"
}
},
{
"widgettype": "VScrollPanel",
"options": {
"height": "500px"
},
"subwidgets": [
{
"widgettype": "VBox",
"options": {
"width": "calc(100% - 40px)",
"margin": "0 20px",
"padding": "16px",
"bgcolor": "#f5f5f5",
"spacing": 12
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "添加新映射",
"fontSize": "16px",
"fontWeight": "bold"
}
},
{
"widgettype": "Form",
"id": "add_form",
"options": {
"layout": "horizontal",
"cols": 3,
"fields": [
{
"name": "llmid",
"uitype": "hidden",
"value": "{{params_kw.llmid}}"
},
{
"name": "llmcatelogid",
"label": "选择分类",
"uitype": "code",
"dataurl": "{{entire_url('./api/get_catelogs.dspy')}}",
"placeholder": "请选择分类"
},
{
"name": "apiname",
"label": "API接口",
"uitype": "code",
"dataurl": "{{entire_url('./api/get_search_apiname.dspy')}}",
"placeholder": "请选择API接口"
},
{
"name": "query_apiname",
"label": "查询API",
"uitype": "code",
"dataurl": "{{entire_url('./api/get_search_apiname.dspy?allow_empty=1')}}",
"placeholder": "不指定或选择查询API"
},
{
"name": "query_period",
"label": "查询间隔(秒)",
"uitype": "int",
"placeholder": "默认30"
},
{
"name": "ppid",
"label": "计费项目",
"uitype": "code",
"dataurl": "{{entire_url('./api/get_ppids.dspy')}}",
"placeholder": "请选择计费项目"
}
],
"buttons": [
{
"name": "add_btn",
"label": "添加映射",
"variant": "primary"
}
]
},
"binds": [
{
"wid": "add_btn",
"event": "click",
"actiontype": "urlwidget",
"target": "PopupWindow",
"popup_options": {
"archor": "cc",
"width": "30%",
"height": "20%"
},
"options": {
"url": "{{entire_url('./api/llm_api_map_create.dspy')}}",
"params": {
"llmid": "$[add_form.llmid]$",
"llmcatelogid": "$[add_form.llmcatelogid]$",
"apiname": "$[add_form.apiname]$",
"query_apiname": "$[add_form.query_apiname]$",
"query_period": "$[add_form.query_period]$",
"ppid": "$[add_form.ppid]$"
}
}
}
]
}
]
}
]
},
{
"widgettype": "VBox",
"options": {
"width": "calc(100% - 40px)",
"margin": "0 20px",
"spacing": 12,
"cheight": 30
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "当前映射列表",
"fontSize": "16px",
"fontWeight": "bold"
}
},
{
"widgettype": "Tabular",
"id": "map_table",
"options": {
"width": "100%",
"height": "400px",
"data_url": "{{entire_url('./api/llm_api_map_list.dspy')}}",
"data_method": "GET",
"page_rows": 20,
"row_options": {
"fields": [
{
"name": "llm_name",
"title": "模型名称",
"width": 180
},
{
"name": "catelog_name",
"title": "分类",
"width": 120
},
{
"name": "apiname",
"title": "API接口",
"width": 150
},
{
"name": "query_apiname",
"title": "查询API",
"width": 180
},
{
"name": "query_period",
"title": "间隔(秒)",
"width": 80
},
{
"name": "ppid_name",
"title": "计费项目",
"width": 150
},
{
"name": "actions",
"title": "操作",
"width": 100,
"uitype": "button",
"data": [
{
"text": "删除",
"event": "delete_map"
}
]
}
]
}
},
"binds": [
{
"wid": "self",
"event": "delete_map",
"actiontype": "urlwidget",
"target": "PopupWindow",
"popup_options": {
"archor": "cc",
"width": "30%",
"height": "20%"
},
"options": {
"url": "{{entire_url('./api/llm_api_map_delete.dspy')}}",
"params": {
"id": "$[event.params.id]$"
}
}
}
]
}
]
}
]
}