33 lines
1.8 KiB
Plaintext

ns = params_kw.copy()
kb_id = ns.get('kb_id', '')
import json
body = json.dumps({
"widgettype": "VBox",
"options": {"spacing": "16px", "padding": "0"},
"subwidgets": [
{"widgettype": "Text", "options": {"text": "📤 上传文件", "cfontsize": 18, "fontWeight": "bold", "color": "#333"}},
{"widgettype": "Text", "options": {"text": "知识库: " + kb_id, "cfontsize": 12, "color": "#888"}},
{
"widgettype": "VBox",
"options": {"id": "upload_zone", "width": "100%", "cheight": 10, "bgcolor": "#f8f9fa", "padding": "24px", "css": "card", "border": "2px dashed #3b82f6", "alignItems": "center", "justifyContent": "center"},
"subwidgets": [
{"widgettype": "Text", "options": {"text": "📂", "cfontsize": 40}},
{"widgettype": "Text", "options": {"text": "拖拽文件或点击按钮上传", "cfontsize": 15, "color": "#888"}},
{"widgettype": "Text", "options": {"text": "支持: TXT,PDF,JPG,PNG,MP3,WAV,MP4", "cfontsize": 12, "color": "#aaa"}},
{
"widgettype": "Button",
"options": {"label": "选择文件上传", "bgcolor": "#3b82f6", "color": "#fff", "marginTop": "12px"}
},
{"widgettype": "Text", "options": {"text": "", "id": "upload_status", "cfontsize": 12, "color": "#50b86c", "marginTop": "8px"}}
]
},
{
"widgettype": "Button",
"options": {"label": "← 返回文件管理", "bgcolor": "#e0e0e0", "color": "#666"},
"binds": [{"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "app.rag_main_content", "mode": "replace", "options": {"url": entire_url('/rag/knowledge_bases_list/index.ui')}}]
}
]
})
return json.loads(body)