From 0fe57eaa4a8e878d658f78dd8332daa45e9763df Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 22 Jul 2026 16:55:11 +0800 Subject: [PATCH] feat: switch to Tabular widget with proper row_options.fields --- wwwroot/documents_list/index.ui | 32 ++++++++++++--------------- wwwroot/engine_configs_list/index.ui | 32 ++++++++++++--------------- wwwroot/knowledge_bases_list/index.ui | 32 ++++++++++++--------------- wwwroot/subscriptions_list/index.ui | 32 ++++++++++++--------------- 4 files changed, 56 insertions(+), 72 deletions(-) diff --git a/wwwroot/documents_list/index.ui b/wwwroot/documents_list/index.ui index a42b925..dc0c557 100644 --- a/wwwroot/documents_list/index.ui +++ b/wwwroot/documents_list/index.ui @@ -1,22 +1,18 @@ { - "widgettype": "VBox", + "widgettype": "Tabular", "options": { - "cheight": 40, - "width": "100%" - }, - "subwidgets": [ - { - "widgettype": "DataViewer", - "options": { - "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%"} - ] - } + "title": "文档管理", + "data_url": "{{entire_url('/api/kb/list')}}", + "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"} + ] } - ] + } } diff --git a/wwwroot/engine_configs_list/index.ui b/wwwroot/engine_configs_list/index.ui index 4601c74..72ced31 100644 --- a/wwwroot/engine_configs_list/index.ui +++ b/wwwroot/engine_configs_list/index.ui @@ -1,22 +1,18 @@ { - "widgettype": "VBox", + "widgettype": "Tabular", "options": { - "cheight": 40, - "width": "100%" - }, - "subwidgets": [ - { - "widgettype": "DataViewer", - "options": { - "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%"} - ] - } + "title": "引擎配置", + "data_url": "{{entire_url('/api/engines')}}", + "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"} + ] } - ] + } } diff --git a/wwwroot/knowledge_bases_list/index.ui b/wwwroot/knowledge_bases_list/index.ui index 8bac0bf..59af3f0 100644 --- a/wwwroot/knowledge_bases_list/index.ui +++ b/wwwroot/knowledge_bases_list/index.ui @@ -1,22 +1,18 @@ { - "widgettype": "VBox", + "widgettype": "Tabular", "options": { - "cheight": 40, - "width": "100%" - }, - "subwidgets": [ - { - "widgettype": "DataViewer", - "options": { - "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%"} - ] - } + "title": "知识库管理", + "data_url": "{{entire_url('/api/kb/list')}}", + "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"} + ] } - ] + } } diff --git a/wwwroot/subscriptions_list/index.ui b/wwwroot/subscriptions_list/index.ui index ac91c33..bbba87b 100644 --- a/wwwroot/subscriptions_list/index.ui +++ b/wwwroot/subscriptions_list/index.ui @@ -1,22 +1,18 @@ { - "widgettype": "VBox", + "widgettype": "Tabular", "options": { - "cheight": 40, - "width": "100%" - }, - "subwidgets": [ - { - "widgettype": "DataViewer", - "options": { - "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%"} - ] - } + "title": "订阅管理", + "data_url": "{{entire_url('/api/kb/list')}}", + "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"} + ] } - ] + } }