From dc4a3383f9b8781aa8b44b03a1c921ad7c08608d Mon Sep 17 00:00:00 2001 From: ymq Date: Fri, 4 Sep 2026 18:44:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(cockpit):=20=E4=BF=AE=E5=A4=8D=E9=A9=BE?= =?UTF-8?q?=E9=A9=B6=E8=88=B1=E9=A1=B5=E8=A3=B8JSON=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E2=80=94=E2=80=94.ui=E5=86=85=E5=B5=8CHtml=20widget=E7=9A=84=E5=AD=97=E9=9D=A2=E9=87=8F=E8=A2=AB=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8HTML=E8=A7=A3=E6=9E=90=E5=99=A8=E6=8F=90=E5=89=8D?= =?UTF-8?q?=E9=97=AD=E5=90=88=E5=A4=96=E5=B1=82script=E8=87=B4widget=20JSO?= =?UTF-8?q?N=E5=A4=96=E6=B3=84=E4=B8=BA=E5=8F=AF=E8=A7=81=E6=96=87?= =?UTF-8?q?=E6=9C=AC;=E8=BD=AC=E4=B9=89=E4=B8=BA\u003c(=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6DOM=E8=AE=BE=E7=BD=AE=E4=B8=8D=E5=8F=97=E5=BD=B1?= =?UTF-8?q?=E5=93=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/index.ui | 2 +- wwwroot/index_cockpit.ui | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 2bf2f3b..6a15cad 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -1 +1 @@ -{"widgettype": "VBox", "options": {"width": "100%", "height": "100%", "padding": "0"}, "subwidgets": [{"widgettype": "HBox", "options": {"width": "100%", "alignItems": "center", "padding": "16px 24px 8px 24px", "cheight": 6, "gap": "12px"}, "subwidgets": [{"widgettype": "Title2", "options": {"text": "开发产线驾驶舱"}}, {"widgettype": "Text", "options": {"text": "AI驱动的对话式开发", "cfontsize": 0.9, "color": "#94a3b8"}}, {"widgettype": "Filler"}]}, {"widgettype": "HBox", "id": "context_bar", "options": {"width": "100%", "padding": "4px 24px 4px 24px", "cheight": 2.5, "gap": "12px", "alignItems": "center", "bgcolor": "#e8f0fe"}, "subwidgets": [{"widgettype": "Html", "options": {"html": "", "height": "0", "width": "0"}}, {"widgettype": "Form", "id": "project_form", "options": {"name": "project_form", "cols": 1, "fields": [{"name": "project_id", "uitype": "code", "label": "", "placeholder": "选择项目", "cwidth": 20, "dataurl": "/pipeline-sdlc/api/cockpit_project_picker.dspy", "valueField": "value", "textField": "text", "nullable": true}]}, "binds": [{"wid": "self", "event": "changed", "actiontype": "script", "target": "self", "script": "var v=this.getValue();var pid=(v||{}).project_id||'';if(!pid)return;fetch('/pipeline-sdlc/api/cockpit_context_update.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'project_id='+encodeURIComponent(pid)+'&session_id='+encodeURIComponent(window._sid())}).then(function(r){return r.json()}).then(function(r){if(r.success){var pl=bricks.getWidgetById('task_btn',bricks.app);if(pl&&pl.text_w)pl.text_w.set_text('任务');var io=bricks.getWidgetById('chat_io',bricks.app);var ms=io&&io.inputw&&io.inputw.model_selector;if(ms&&ms.loadData)ms.loadData();}})"}]}, {"widgettype": "Button", "id": "task_btn", "options": {"label": "任务", "css": "small"}, "binds": [{"wid": "self", "event": "click", "actiontype": "script", "target": "self", "script": "fetch('/pipeline-sdlc/api/cockpit_context.dspy?session_id='+window._sid()).then(function(r){return r.json()}).then(function(d){var pid=d.project_id||'';var pn=d.project_name||'';if(!pid){var pw=new bricks.PopupWindow({title:'选择项目',cwidth:32,cheight:16,auto_open:true});var form=new bricks.Form({name:'p_picker',cols:1,fields:[{name:'project_id',uitype:'code',label:'项目',placeholder:'请选择项目',cwidth:26,dataurl:'/pipeline-sdlc/api/cockpit_project_picker.dspy',valueField:'value',textField:'text'}]});var vb=new bricks.VBox({padding:'12px',gap:'12px'});vb.add_widget(new bricks.Text({text:'请选择项目:',cfontsize:0.95,color:'#64748b'}));vb.add_widget(form);pw.content_w.add_widget(vb);setTimeout(function(){var sel=pw.content_w.dom_element.querySelector('select');if(sel)sel.addEventListener('change',function(){var v=sel.value;if(!v)return;fetch('/pipeline-sdlc/api/cockpit_context_update.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'project_id='+encodeURIComponent(v)+'&session_id='+encodeURIComponent(window._sid())}).then(function(r){return r.json()}).then(function(r){if(r.success){pw.destroy();var sel2=bricks.getWidgetById('project_selector',bricks.app);if(sel2)sel2.setValue(r.project_id);var tb=bricks.getWidgetById('task_btn',bricks.app);if(tb&&tb.text_w)tb.text_w.set_text('\\u4efb\\u52a1');}});});},500);return;}var upw=new bricks.PopupWindow({title:pn+' - \\u4efb\\u52a1\\u5217\\u8868',cwidth:60,cheight:30,auto_open:true});var vs=new bricks.VScrollPanel({css:'filler',padding:'12px',gap:'8px'});upw.content_w.add_widget(vs);fetch('/pipeline-sdlc/api/cockpit_project_tasks.dspy?session_id='+window._sid()).then(function(r){return r.json()}).then(function(data){var tasks=data.tasks||[];if(tasks.length===0){vs.add_widget(new bricks.Text({text:'\\u6682\\u65e0\\u4efb\\u52a1',cfontsize:0.9,color:'#94a3b8'}));return;}for(var i=0;isetTimeout(function(){fetch('/pipeline-sdlc/api/cockpit_context.dspy?session_id='+window._sid()).then(function(r){return r.json()}).then(function(d){if(d.project_id){var sel=bricks.getWidgetById('project_selector',bricks.app);if(sel)sel.setValue(d.project_id);}})},200);\u003c/script>", "height": "0", "width": "0"}}, {"widgettype": "Form", "id": "project_form", "options": {"name": "project_form", "cols": 1, "fields": [{"name": "project_id", "uitype": "code", "label": "", "placeholder": "选择项目", "cwidth": 20, "dataurl": "/pipeline-sdlc/api/cockpit_project_picker.dspy", "valueField": "value", "textField": "text", "nullable": true}]}, "binds": [{"wid": "self", "event": "changed", "actiontype": "script", "target": "self", "script": "var v=this.getValue();var pid=(v||{}).project_id||'';if(!pid)return;fetch('/pipeline-sdlc/api/cockpit_context_update.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'project_id='+encodeURIComponent(pid)+'&session_id='+encodeURIComponent(window._sid())}).then(function(r){return r.json()}).then(function(r){if(r.success){var pl=bricks.getWidgetById('task_btn',bricks.app);if(pl&&pl.text_w)pl.text_w.set_text('任务');var io=bricks.getWidgetById('chat_io',bricks.app);var ms=io&&io.inputw&&io.inputw.model_selector;if(ms&&ms.loadData)ms.loadData();}})"}]}, {"widgettype": "Button", "id": "task_btn", "options": {"label": "任务", "css": "small"}, "binds": [{"wid": "self", "event": "click", "actiontype": "script", "target": "self", "script": "fetch('/pipeline-sdlc/api/cockpit_context.dspy?session_id='+window._sid()).then(function(r){return r.json()}).then(function(d){var pid=d.project_id||'';var pn=d.project_name||'';if(!pid){var pw=new bricks.PopupWindow({title:'选择项目',cwidth:32,cheight:16,auto_open:true});var form=new bricks.Form({name:'p_picker',cols:1,fields:[{name:'project_id',uitype:'code',label:'项目',placeholder:'请选择项目',cwidth:26,dataurl:'/pipeline-sdlc/api/cockpit_project_picker.dspy',valueField:'value',textField:'text'}]});var vb=new bricks.VBox({padding:'12px',gap:'12px'});vb.add_widget(new bricks.Text({text:'请选择项目:',cfontsize:0.95,color:'#64748b'}));vb.add_widget(form);pw.content_w.add_widget(vb);setTimeout(function(){var sel=pw.content_w.dom_element.querySelector('select');if(sel)sel.addEventListener('change',function(){var v=sel.value;if(!v)return;fetch('/pipeline-sdlc/api/cockpit_context_update.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'project_id='+encodeURIComponent(v)+'&session_id='+encodeURIComponent(window._sid())}).then(function(r){return r.json()}).then(function(r){if(r.success){pw.destroy();var sel2=bricks.getWidgetById('project_selector',bricks.app);if(sel2)sel2.setValue(r.project_id);var tb=bricks.getWidgetById('task_btn',bricks.app);if(tb&&tb.text_w)tb.text_w.set_text('\\u4efb\\u52a1');}});});},500);return;}var upw=new bricks.PopupWindow({title:pn+' - \\u4efb\\u52a1\\u5217\\u8868',cwidth:60,cheight:30,auto_open:true});var vs=new bricks.VScrollPanel({css:'filler',padding:'12px',gap:'8px'});upw.content_w.add_widget(vs);fetch('/pipeline-sdlc/api/cockpit_project_tasks.dspy?session_id='+window._sid()).then(function(r){return r.json()}).then(function(data){var tasks=data.tasks||[];if(tasks.length===0){vs.add_widget(new bricks.Text({text:'\\u6682\\u65e0\\u4efb\\u52a1',cfontsize:0.9,color:'#94a3b8'}));return;}for(var i=0;isetTimeout(function(){console.log('DIAG: page loaded, checking bricks');var ai=bricks.getWidgetById('chat_input',bricks.app);console.log('DIAG: chat_input widget:',ai?'found':'NOT FOUND','type:',ai?ai.constructor.name:'N/A','url:',ai?ai.opts.url:'N/A');if(ai&&ai.inputw){console.log('DIAG: inputw found, bind check');ai.inputw.unbind('inputed');ai.inputw.bind('inputed',function(e){console.log('DIAG: inputed RAW event:',JSON.stringify(e.params));});}fetch('/pipeline-sdlc/api/cockpit_context.dspy').then(function(r){return r.json()}).then(function(d){if(d.project_id){var sel=bricks.getWidgetById('project_selector',bricks.app);if(sel)sel.setValue(d.project_id);}})},200);", + "html": "\u003cscript>setTimeout(function(){console.log('DIAG: page loaded, checking bricks');var ai=bricks.getWidgetById('chat_input',bricks.app);console.log('DIAG: chat_input widget:',ai?'found':'NOT FOUND','type:',ai?ai.constructor.name:'N/A','url:',ai?ai.opts.url:'N/A');if(ai&&ai.inputw){console.log('DIAG: inputw found, bind check');ai.inputw.unbind('inputed');ai.inputw.bind('inputed',function(e){console.log('DIAG: inputed RAW event:',JSON.stringify(e.params));});}fetch('/pipeline-sdlc/api/cockpit_context.dspy').then(function(r){return r.json()}).then(function(d){if(d.project_id){var sel=bricks.getWidgetById('project_selector',bricks.app);if(sel)sel.setValue(d.project_id);}})},200);\u003c/script>", "height": "0", "width": "0" }