feat: switch to Tabular widget with proper row_options.fields

This commit is contained in:
yumoqing 2026-07-22 16:55:11 +08:00
parent 65078340fc
commit 0fe57eaa4a
4 changed files with 56 additions and 72 deletions

View File

@ -1,22 +1,18 @@
{ {
"widgettype": "VBox", "widgettype": "Tabular",
"options": { "options": {
"cheight": 40, "title": "文档管理",
"width": "100%" "data_url": "{{entire_url('/api/kb/list')}}",
}, "page_rows": 20,
"subwidgets": [ "css": "card",
{ "row_options": {
"widgettype": "DataViewer", "fields": [
"options": { {"name": "file_name", "title": "文件名", "type": "str", "length": 255, "uitype": "str"},
"data_url": "{{entire_url('/api/kb/list')}}", {"name": "file_type", "title": "类型", "type": "str", "length": 32, "uitype": "str"},
"columns": [ {"name": "file_size", "title": "大小", "type": "int", "length": 0, "uitype": "int"},
{"field": "file_name", "title": "文件名", "width": "30%"}, {"name": "status", "title": "状态", "type": "str", "length": 16, "uitype": "str"},
{"field": "file_type", "title": "类型", "width": "15%"}, {"name": "created_at", "title": "上传时间", "type": "str", "length": 0, "uitype": "str"}
{"field": "file_size", "title": "大小", "width": "15%"}, ]
{"field": "status", "title": "状态", "width": "15%"},
{"field": "created_at", "title": "上传时间", "width": "25%"}
]
}
} }
] }
} }

View File

@ -1,22 +1,18 @@
{ {
"widgettype": "VBox", "widgettype": "Tabular",
"options": { "options": {
"cheight": 40, "title": "引擎配置",
"width": "100%" "data_url": "{{entire_url('/api/engines')}}",
}, "page_rows": 20,
"subwidgets": [ "css": "card",
{ "row_options": {
"widgettype": "DataViewer", "fields": [
"options": { {"name": "engine_type", "title": "引擎类型", "type": "str", "length": 32, "uitype": "str"},
"data_url": "{{entire_url('/api/engines')}}", {"name": "engine_name", "title": "名称", "type": "str", "length": 64, "uitype": "str"},
"columns": [ {"name": "endpoint_url", "title": "服务地址", "type": "str", "length": 255, "uitype": "str"},
{"field": "engine_type", "title": "引擎类型", "width": "20%"}, {"name": "model_name", "title": "模型", "type": "str", "length": 128, "uitype": "str"},
{"field": "engine_name", "title": "名称", "width": "20%"}, {"name": "status", "title": "状态", "type": "str", "length": 16, "uitype": "str"}
{"field": "endpoint_url", "title": "服务地址", "width": "30%"}, ]
{"field": "model_name", "title": "模型", "width": "15%"},
{"field": "status", "title": "状态", "width": "15%"}
]
}
} }
] }
} }

View File

@ -1,22 +1,18 @@
{ {
"widgettype": "VBox", "widgettype": "Tabular",
"options": { "options": {
"cheight": 40, "title": "知识库管理",
"width": "100%" "data_url": "{{entire_url('/api/kb/list')}}",
}, "page_rows": 20,
"subwidgets": [ "css": "card",
{ "row_options": {
"widgettype": "DataViewer", "fields": [
"options": { {"name": "name", "title": "名称", "type": "str", "length": 100, "uitype": "str"},
"data_url": "{{entire_url('/api/kb/list')}}", {"name": "description", "title": "描述", "type": "text", "length": 0, "uitype": "text"},
"columns": [ {"name": "doc_count", "title": "文档数", "type": "int", "length": 0, "uitype": "int"},
{"field": "name", "title": "名称", "width": "25%"}, {"name": "embedding_engine", "title": "向量引擎", "type": "str", "length": 64, "uitype": "str"},
{"field": "description", "title": "描述", "width": "35%"}, {"name": "created_at", "title": "创建时间", "type": "str", "length": 0, "uitype": "str"}
{"field": "doc_count", "title": "文档数", "width": "10%"}, ]
{"field": "embedding_engine", "title": "向量引擎", "width": "15%"},
{"field": "created_at", "title": "创建时间", "width": "15%"}
]
}
} }
] }
} }

View File

@ -1,22 +1,18 @@
{ {
"widgettype": "VBox", "widgettype": "Tabular",
"options": { "options": {
"cheight": 40, "title": "订阅管理",
"width": "100%" "data_url": "{{entire_url('/api/kb/list')}}",
}, "page_rows": 20,
"subwidgets": [ "css": "card",
{ "row_options": {
"widgettype": "DataViewer", "fields": [
"options": { {"name": "plan_name", "title": "套餐", "type": "str", "length": 64, "uitype": "str"},
"data_url": "{{entire_url('/api/kb/list')}}", {"name": "disk_quota_bytes", "title": "磁盘配额", "type": "int", "length": 0, "uitype": "int"},
"columns": [ {"name": "disk_used_bytes", "title": "已用磁盘", "type": "int", "length": 0, "uitype": "int"},
{"field": "plan_name", "title": "套餐", "width": "20%"}, {"name": "doc_used", "title": "文档数", "type": "int", "length": 0, "uitype": "int"},
{"field": "disk_quota_bytes", "title": "磁盘配额", "width": "20%"}, {"name": "status", "title": "状态", "type": "str", "length": 16, "uitype": "str"}
{"field": "disk_used_bytes", "title": "已用磁盘", "width": "20%"}, ]
{"field": "doc_used", "title": "文档数", "width": "20%"},
{"field": "status", "title": "状态", "width": "20%"}
]
}
} }
] }
} }