workspace: script action for tree selected

This commit is contained in:
p 2026-08-12 15:37:49 +08:00
parent f7c68c5d73
commit 3032f26e2d

View File

@ -28,6 +28,7 @@ async with DBPools().sqlorContext(dbname) as sor:
}]
}
else:
files_url = entire_url("/pipeline-sdlc/api/workspace_files.dspy")
resp = {
"widgettype": "PopupWindow",
"options": {
@ -58,12 +59,9 @@ async with DBPools().sqlorContext(dbname) as sor:
"binds": [{
"wid": "self",
"event": "selected",
"actiontype": "urlwidget",
"target": "ws_files",
"options": {
"url": entire_url("/pipeline-sdlc/api/workspace_files.dspy"),
"params_mapping": {"id": "id"}
}
"actiontype": "script",
"target": "self",
"script": f"var nid=this.selected_node.user_data.id;var fp=bricks.getWidgetById('ws_files',bricks.app);if(fp)fp.setUrl('{files_url}?id='+encodeURIComponent(nid));"
}]
}]
},
@ -71,7 +69,7 @@ async with DBPools().sqlorContext(dbname) as sor:
"widgettype": "VScrollPanel",
"id": "ws_files",
"options": {
"dataurl": entire_url("/pipeline-sdlc/api/workspace_files.dspy?id=__root__"),
"dataurl": files_url + "?id=__root__",
"css": "filler",
"padding": "8px",
"gap": "4px"