diff --git a/wwwroot/index.ui b/wwwroot/index.ui index c72a427..2b8a993 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -24,7 +24,7 @@ "options": { "name": "refresh", "label": "刷新", "css": "small" }, "binds": [{ "wid": "self", "event": "click", "actiontype": "script", "target": "self", - "script": "var c=bricks.getWidgetById('chat_scroll');if(c)c.render({});var s=bricks.getWidgetById('stats_row');if(s)s.render({});" + "script": "var c=bricks.getWidgetById('chat_scroll',bricks.app);if(c)c.render({});var s=bricks.getWidgetById('stats_row',bricks.app);if(s)s.render({});" }] } ] @@ -98,7 +98,7 @@ "event": "inputed", "actiontype": "script", "target": "self", - "script": "var prompt=params.prompt;var files=params.add_files||[];var iid='';try{var iter=bricks.getWidgetById('current_iteration_id');if(iter)iid=iter.options.value||'';}catch(e){}var body='message_text='+encodeURIComponent(prompt)+'&iteration_id='+encodeURIComponent(iid)+'&action=send_message&file_paths='+encodeURIComponent(JSON.stringify(files.map(function(f){return f.name||f})));fetch('/pipeline-sdlc/api/cockpit_chat.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body}).then(function(r){return r.json()}).then(function(r){if(r.success||r.error){var c=bricks.getWidgetById('chat_scroll');if(c)c.render({});}});" + "script": "var prompt=params.prompt;var files=params.add_files||[];var iid='';try{var iter=bricks.getWidgetById('current_iteration_id',bricks.app);if(iter)iid=iter.options.value||'';}catch(e){}var body='message_text='+encodeURIComponent(prompt)+'&iteration_id='+encodeURIComponent(iid)+'&action=send_message&file_paths='+encodeURIComponent(JSON.stringify(files.map(function(f){return f.name||f})));fetch('/pipeline-sdlc/api/cockpit_chat.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body}).then(function(r){return r.json()}).then(function(r){if(r.success||r.error){var c=bricks.getWidgetById('chat_scroll',bricks.app);if(c)c.render({});}});" } ] } diff --git a/wwwroot/sd_cockpit/index.ui b/wwwroot/sd_cockpit/index.ui index c72a427..2b8a993 100644 --- a/wwwroot/sd_cockpit/index.ui +++ b/wwwroot/sd_cockpit/index.ui @@ -24,7 +24,7 @@ "options": { "name": "refresh", "label": "刷新", "css": "small" }, "binds": [{ "wid": "self", "event": "click", "actiontype": "script", "target": "self", - "script": "var c=bricks.getWidgetById('chat_scroll');if(c)c.render({});var s=bricks.getWidgetById('stats_row');if(s)s.render({});" + "script": "var c=bricks.getWidgetById('chat_scroll',bricks.app);if(c)c.render({});var s=bricks.getWidgetById('stats_row',bricks.app);if(s)s.render({});" }] } ] @@ -98,7 +98,7 @@ "event": "inputed", "actiontype": "script", "target": "self", - "script": "var prompt=params.prompt;var files=params.add_files||[];var iid='';try{var iter=bricks.getWidgetById('current_iteration_id');if(iter)iid=iter.options.value||'';}catch(e){}var body='message_text='+encodeURIComponent(prompt)+'&iteration_id='+encodeURIComponent(iid)+'&action=send_message&file_paths='+encodeURIComponent(JSON.stringify(files.map(function(f){return f.name||f})));fetch('/pipeline-sdlc/api/cockpit_chat.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body}).then(function(r){return r.json()}).then(function(r){if(r.success||r.error){var c=bricks.getWidgetById('chat_scroll');if(c)c.render({});}});" + "script": "var prompt=params.prompt;var files=params.add_files||[];var iid='';try{var iter=bricks.getWidgetById('current_iteration_id',bricks.app);if(iter)iid=iter.options.value||'';}catch(e){}var body='message_text='+encodeURIComponent(prompt)+'&iteration_id='+encodeURIComponent(iid)+'&action=send_message&file_paths='+encodeURIComponent(JSON.stringify(files.map(function(f){return f.name||f})));fetch('/pipeline-sdlc/api/cockpit_chat.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body}).then(function(r){return r.json()}).then(function(r){if(r.success||r.error){var c=bricks.getWidgetById('chat_scroll',bricks.app);if(c)c.render({});}});" } ] }