120 lines
5.2 KiB
XML
120 lines
5.2 KiB
XML
{% set embed = params_kw.get('embed','') == '1' %}
|
|
{% set pl_id = params_kw.get('pipeline_id','') or '' %}
|
|
{% if embed %}
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"width": "100%", "height": "100%", "padding": "0"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "urlwidget",
|
|
"options": {"url": "/pipeline_core/api/agent_menus.dspy?pipeline_id={{pl_id}}&session_id=m_{{pl_id}}"}
|
|
},
|
|
{
|
|
"widgettype": "AgentIO",
|
|
"options": {
|
|
"css": "filler",
|
|
"margin": "0 8px 8px 8px",
|
|
"url": "/pipeline_core/api/agent_chat.dspy?pipeline_id={{pl_id}}&session_id=m_{{pl_id}}",
|
|
"model_dataurl": "/pipeline_core/api/agent_model_options.dspy?capabilities=chat&pipeline_id={{pl_id}}&session_id=m_{{pl_id}}",
|
|
"model_cwidth": 14,
|
|
"placeholder": "输入你的需求..."
|
|
}
|
|
}
|
|
]
|
|
}
|
|
{% else %}
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"width": "100%", "height": "100%", "padding": "0", "css": "pl-gate-root"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "ChipBar",
|
|
"id": "mobile_pipeline_chips",
|
|
"options": {
|
|
"width": "100%",
|
|
"height": "auto",
|
|
"dataurl": "/pipeline_core/api/my_pipelines.dspy",
|
|
"valueField": "id",
|
|
"textField": "name",
|
|
"empty_text": "暂无已购产线"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "select",
|
|
"actiontype": "method",
|
|
"target": "app.mobile_agent_io",
|
|
"method": "set_pipeline"
|
|
},
|
|
{
|
|
"wid": "self",
|
|
"event": "select",
|
|
"actiontype": "urlwidget",
|
|
"target": "app.mobile_menus_wrap",
|
|
"options": {"url": "/pipeline_core/api/agent_menus.dspy", "method": "GET"}
|
|
},
|
|
{
|
|
"wid": "self",
|
|
"event": "select",
|
|
"actiontype": "script",
|
|
"target": "self",
|
|
"script": "var ov=bricks.getWidgetById('mobile_gate_overlay',bricks.app);if(!ov)return;var has=!!(event.params&&(event.params.id||event.params.pipeline_id));if(has){ov.hide();}else{ov.show();}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"id": "mobile_menus_wrap",
|
|
"options": {"width": "100%", "height": "auto"}
|
|
},
|
|
{
|
|
"widgettype": "AgentIO",
|
|
"id": "mobile_agent_io",
|
|
"options": {
|
|
"css": "filler",
|
|
"margin": "0 24px 24px 24px",
|
|
"mobile_opts": {"margin": "0 8px 8px 8px"},
|
|
"url": "/pipeline_core/api/agent_chat.dspy",
|
|
"model_dataurl": "/pipeline_core/api/agent_model_options.dspy?capabilities=chat",
|
|
"model_cwidth": 14,
|
|
"placeholder": "输入你的需求..."
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"id": "mobile_gate_overlay",
|
|
"options": {
|
|
"css": "pl-gate",
|
|
"width": "100%",
|
|
"height": "100%",
|
|
"bgcolor": "#0b1120",
|
|
"opacity": 0.97,
|
|
"zIndex": 500,
|
|
"alignItems": "center",
|
|
"justifyContent": "center",
|
|
"gap": "14px",
|
|
"padding": "24px",
|
|
"desktop_hidden": true
|
|
},
|
|
"subwidgets": [
|
|
{"widgettype": "Title3", "options": {"otext": "尚未购买任何产线", "i18n": true, "color": "#f1f5f9"}},
|
|
{"widgettype": "Text", "options": {"otext": "购买产线后即可在此对话;通用助手无需购买。", "i18n": true, "cfontsize": 0.9, "color": "#94a3b8", "textAlign": "center", "width": "100%"}},
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {"label": "去产品商城购买", "otext": "去产品商城购买", "i18n": true, "css": "primary", "bgcolor": "#2563eb", "color": "#ffffff", "padding": "12px 28px", "borderRadius": "999px"},
|
|
"binds": [{"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "PopupWindow",
|
|
"popup_options": {"title": "产品商城"},
|
|
"options": {"url": "/product_management/storefront/index.ui"}}]
|
|
},
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {"label": "使用通用助手", "otext": "使用通用助手", "i18n": true, "css": "small", "bgcolor": "transparent", "color": "#94a3b8"},
|
|
"binds": [{"wid": "self", "event": "click", "actiontype": "script", "target": "self",
|
|
"script": "var tp=bricks.getWidgetById('main_content',bricks.app);if(!tp)return;tp.open_tab({name:'m_generic',label:'助手',url:'/pipeline_core/agent_generic',removable:false,refresh:false});if(tp.mobile_bar)tp.mobile_bar.set_active('m_generic');"}]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
{% endif %}
|