From e1ac09542a161b4a3c999c7afedfde181666eb78 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 7 Aug 2026 15:26:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Form=20submit=20+=20urlwidget=20?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3=E7=A1=AE=E5=AE=9A=E6=8C=89=E9=92=AE=EF=BC=8C?= =?UTF-8?q?context=5Fupdate=20=E8=BF=94=E5=9B=9E=20widget=20=E8=87=AA?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/cockpit_context_update.dspy | 31 ++++++++++++++++++------- wwwroot/index.ui | 4 ++-- wwwroot/index_cockpit.ui | 4 ++-- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/wwwroot/api/cockpit_context_update.dspy b/wwwroot/api/cockpit_context_update.dspy index e756a00..cb08ec7 100644 --- a/wwwroot/api/cockpit_context_update.dspy +++ b/wwwroot/api/cockpit_context_update.dspy @@ -65,11 +65,26 @@ async with DBPools().sqlorContext(dbname) as sor: if irecs and len(irecs) > 0: iname = getattr(irecs[0], 'iteration_name', '') or '' - return json.dumps({ - "success": True, - "project_id": new_pid, - "iteration_id": new_iid, - "project_name": pname, - "iteration_name": iname, - "workspace_dir": ws_dir, - }, ensure_ascii=False) + # Return widget descriptor that auto-closes popup and refreshes context + if pid: + label = "项目「" + pname + "」" + else: + label = "迭代「" + iname + "」" + + widget = { + "widgettype": "VBox", + "options": {"padding": "16px", "alignItems": "center", "gap": "8px"}, + "subwidgets": [ + {"widgettype": "Text", "options": {"text": "\u2713 \u5df2\u8bbe\u7f6e", "cfontsize": 1.2, "color": "#16a34a", "fontWeight": "bold"}}, + {"widgettype": "Text", "options": {"text": label, "cfontsize": 0.95, "color": "#475569"}}, + {"widgettype": "Text", "options": {"text": "\u5f39\u7a97\u5c06\u81ea\u52a8\u5173\u95ed", "cfontsize": 0.8, "color": "#94a3b8"}}, + ], + "binds": [{ + "wid": "self", + "event": "render", + "actiontype": "script", + "target": "self", + "script": "setTimeout(function(){var pps=document.querySelectorAll('.popup-window');for(var i=0;i