feat: Droppable widget for drag-and-drop upload
This commit is contained in:
parent
bbdafd5d99
commit
c30e9bf09e
@ -53,27 +53,36 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widgettype": "VBox",
|
"widgettype": "VBox",
|
||||||
"options": {"id": "detail_content", "css": "filler", "padding": "16px", "spacing": "12px"},
|
"options": {"id": "detail_content", "css": "filler", "padding": "0", "spacing": 0},
|
||||||
"subwidgets": [
|
"subwidgets": [
|
||||||
{"widgettype": "Text", "options": {"text": "📂 请选择左侧目录查看文件", "cfontsize": 14, "color": "#888"}},
|
|
||||||
{
|
{
|
||||||
"widgettype": "Button",
|
"widgettype": "Droppable",
|
||||||
"options": {
|
"options": {
|
||||||
"label": "📤 上传文件",
|
"width": "100%",
|
||||||
"bgcolor": "#3b82f6",
|
"cheight": 6,
|
||||||
"color": "#fff",
|
"bgcolor": "#f8f9fa",
|
||||||
"padding": "10px 24px",
|
"border": "2px dashed #3b82f6",
|
||||||
"marginTop": "16px",
|
"alignItems": "center",
|
||||||
"cfontsize": 14
|
"justifyContent": "center"
|
||||||
},
|
},
|
||||||
"binds": [{
|
"subwidgets": [
|
||||||
|
{"widgettype": "Text", "options": {"text": "📂 拖拽文件到此处自动上传", "cfontsize": 15, "color": "#888"}},
|
||||||
|
{"widgettype": "Text", "options": {"text": "支持 TXT/PDF/JPG/PNG/MP3/WAV/MP4", "cfontsize": 12, "color": "#aaa"}}
|
||||||
|
],
|
||||||
|
"binds": [
|
||||||
|
{
|
||||||
"wid": "self",
|
"wid": "self",
|
||||||
"event": "click",
|
"event": "drop",
|
||||||
"actiontype": "urlwidget",
|
"actiontype": "urlwidget",
|
||||||
"target": "app.rag_main_content",
|
"target": "app.rag_main_content",
|
||||||
"mode": "replace",
|
"mode": "replace",
|
||||||
"options": {"url": "{{entire_url('./upload.dspy')}}?kb_id=kb1"}
|
"options": {"url": "{{entire_url('./upload.dspy')}}", "params": {"kb_id": "{{params_kw.kb_id}}"}}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype": "Text",
|
||||||
|
"options": {"text": "暂无文件,拖拽文件到上方区域上传", "cfontsize": 13, "color": "#aaa", "padding": "16px", "halign": "center"}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user