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: else:
files_url = entire_url("/pipeline-sdlc/api/workspace_files.dspy")
resp = { resp = {
"widgettype": "PopupWindow", "widgettype": "PopupWindow",
"options": { "options": {
@ -58,12 +59,9 @@ async with DBPools().sqlorContext(dbname) as sor:
"binds": [{ "binds": [{
"wid": "self", "wid": "self",
"event": "selected", "event": "selected",
"actiontype": "urlwidget", "actiontype": "script",
"target": "ws_files", "target": "self",
"options": { "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));"
"url": entire_url("/pipeline-sdlc/api/workspace_files.dspy"),
"params_mapping": {"id": "id"}
}
}] }]
}] }]
}, },
@ -71,7 +69,7 @@ async with DBPools().sqlorContext(dbname) as sor:
"widgettype": "VScrollPanel", "widgettype": "VScrollPanel",
"id": "ws_files", "id": "ws_files",
"options": { "options": {
"dataurl": entire_url("/pipeline-sdlc/api/workspace_files.dspy?id=__root__"), "dataurl": files_url + "?id=__root__",
"css": "filler", "css": "filler",
"padding": "8px", "padding": "8px",
"gap": "4px" "gap": "4px"