fix: dynamic kb_name+kb_id in detail page from card click
This commit is contained in:
parent
44b287ef4b
commit
96c8661af3
2
init.py
2
init.py
@ -48,7 +48,7 @@ async def kb_list_handler(request, params_kw, *args, **kwargs):
|
||||
{"widgettype":"HBox","options":{"spacing":"12px"},"subwidgets":[
|
||||
{"widgettype":"Text","options":{"text":"📄 "+str(doc_count)+"文档","cfontsize":12,"color":"#666"}},
|
||||
{"widgettype":"Text","options":{"text":"💾 "+size_str,"cfontsize":12,"color":"#666"}}]}],
|
||||
"binds":[{"wid":"self","event":"click","actiontype":"urlwidget","target":"app.rag_main_content","mode":"replace","options":{"url":"/knowledge_bases_list/detail.ui"}}]}
|
||||
"binds":[{"wid":"self","event":"click","actiontype":"urlwidget","target":"app.rag_main_content","mode":"replace","options":{"url":"/knowledge_bases_list/detail.ui","params":{"kb_id":str(r.id),"kb_name":str(r.name)}}}]}
|
||||
cards.append(card)
|
||||
if not cards:
|
||||
cards.append({"widgettype":"Text","options":{"text":"暂无知识库","color":"#aaa","cfontsize":14,"halign":"center"}})
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"options": {"url": "{{entire_url('/knowledge_bases_list/index.ui')}}"}}
|
||||
]},
|
||||
{"widgettype": "Text", "options": {"text": " / ", "cfontsize": 14, "color": "#ccc"}},
|
||||
{"widgettype": "Text", "options": {"text": "📚 产品文档", "cfontsize": 16, "fontWeight": "bold", "color": "#333"}},
|
||||
{"widgettype": "Text", "options": {"text": "📚 {{params_kw.kb_name or '知识库'}}", "cfontsize": 16, "fontWeight": "bold", "color": "#333"}},
|
||||
{"widgettype": "Text", "options": {"text": "", "css": "filler"}}
|
||||
]
|
||||
},
|
||||
@ -37,8 +37,8 @@
|
||||
"parentField": "parentid",
|
||||
"idField": "id",
|
||||
"textField": "label",
|
||||
"dataurl": "{{entire_url('./get_tree_data.dspy')}}?kb_id=kb1",
|
||||
"newdata_params": {"kb_id": "kb1"},
|
||||
"dataurl": "{{entire_url('./get_tree_data.dspy')}}?kb_id={{params_kw.kb_id}}",
|
||||
"newdata_params": {"kb_id": "{{params_kw.kb_id}}"},
|
||||
"editable": {
|
||||
"fields": [
|
||||
{"name": "name", "title": "名称", "type": "str", "length": 255, "uitype": "str", "label": "名称"}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user