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

View File

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

View File

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

View File

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