{ "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", "options": { "width": "100%", "padding": "8px 24px 8px 24px", "cheight": 4, "gap": "16px" }, "subwidgets": [ { "widgettype": "urlwidget", "id": "stats_row", "options": { "url": "{{entire_url('/pipeline-sdlc/api/cockpit_stats.dspy')}}", "method": "GET" } } ] }, { "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)}).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('任务');}})" } ] }, { "widgettype": "Button", "id": "task_btn", "options": { "label": "任务", "css": "small" } } ], "binds": [] }, { "widgettype": "VBox", "options": { "css": "filler", "width": "100%", "height": "100%", "padding": "0 24px 0 24px", "gap": "0" }, "subwidgets": [ { "widgettype": "VScrollPanel", "id": "chat_scroll", "options": { "css": "filler", "width": "100%", "height": "100%", "bgcolor": "#f8fafc", "border": "1px solid #e2e8f0", "borderBottom": "none", "borderRadius": "8px 8px 0 0", "padding": "16px" }, "subwidgets": [ { "widgettype": "VBox", "options": { "alignItems": "center", "padding": "40px 0", "gap": "12px" }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "选择一个迭代后,在下方输入你的需求。", "cfontsize": 1, "color": "#64748b" } }, { "widgettype": "Text", "options": { "text": "Agent 将自动分析需求、生成设计、驱动产线执行。", "cfontsize": 0.85, "color": "#94a3b8" } } ] } ] }, { "widgettype": "VBox", "options": { "bgcolor": "#fff", "border": "1px solid #e2e8f0", "borderTop": "none", "borderRadius": "0 0 8px 8px", "padding": "0" }, "subwidgets": [ { "widgettype": "AgentInput", "id": "chat_input", "options": { "placeholder": "输入你的需求...", "model_dataurl": "/pipeline-sdlc/api/cockpit_model_options.dspy", "model_cwidth": 14 }, "binds": [ { "wid": "self", "event": "inputed", "actiontype": "script", "target": "self", "script": "var p=params.prompt;var mid=params.model_id||'';if(typeof mid==='object'&&mid!==null)mid=mid.model_id||'';var ctx=bricks.getWidgetById('context_data',bricks.app);var cd=ctx?ctx.getValue():{};var iid=cd.iteration_id||'';var pid=cd.project_id||'';var fnames=params.file_names||[];var chat=bricks.getWidgetById('chat_scroll',bricks.app);var at=null;var _makeWidget=function(desc){if(!desc||!desc.widgettype)return null;var Klass=bricks.Factory.get(desc.widgettype);if(!Klass)return null;var opts=JSON.parse(JSON.stringify(desc.options||{}));if(desc.subwidgets&&desc.subwidgets.length>0){opts.subwidgets=desc.subwidgets.map(function(s){return _makeWidget(s)}).filter(function(s){return s!==null})}return new Klass(opts)};if(chat){var ub=new bricks.HBox({width:'100%'});var um=new bricks.VBox({width:'85%',alignSelf:'flex-end',bgcolor:'#dbeafe',borderRadius:'12px',padding:'12px 16px',marginBottom:'10px',gap:'4px'});um.add_widget(new bricks.Text({text:'你',cfontsize:0.75,color:'#2563eb',fontWeight:'bold'}));um.add_widget(new bricks.Text({text:p,cfontsize:0.95,color:'#1e293b',whiteSpace:'pre-wrap'}));for(var i=0;i