{ "widgettype":"VBox", "options":{"cheight":40,"width":"100%"}, "subwidgets":[{ "id":"pipelines_tbl", "widgettype":"Tabular", "options":{ "width":"100%", "height":"100%", "title":"产线定义表", "css":"card", "toolbar":{ "tools":[ { "name":"publish", "label":"发布", "selected_row":true } ] }, "editable":{ "new_data_url":"{{entire_url('add_pipelines.dspy')}}", "delete_data_url":"{{entire_url('delete_pipelines.dspy')}}", "update_data_url":"{{entire_url('update_pipelines.dspy')}}" }, "data_url":"{{entire_url('./get_pipelines.dspy')}}", "data_method":"GET", "data_params":{{json.dumps(params_kw, indent=4, ensure_ascii=False)}}, "row_options":{ "browserfields": { "exclouded": [ "id", "model_api_key", "pipeline_config" ], "cwidth": {} }, "editexclouded":[ "id", "created_at", "updated_at" ], "fields":[ { "name": "id", "title": "id", "type": "str", "length": 32, "nullable": "no", "cwidth": 18, "uitype": "str", "datatype": "str", "label": "id" }, { "name": "name", "title": "产线名称", "type": "str", "length": 200, "nullable": "no", "cwidth": 18, "uitype": "str", "datatype": "str", "label": "产线名称" }, { "name": "description", "title": "产线描述", "type": "text", "length": 0, "uitype": "text", "datatype": "text", "label": "产线描述" }, { "name": "pipeline_type", "title": "产线类型", "type": "str", "length": 50, "nullable": "no", "label": "产线类型", "uitype": "code", "valueField": "pipeline_type", "textField": "pipeline_type_text", "params": { "dbname": "{{{{get_module_dbname('pipeline_core')}}}}", "table": "appcodes_kv", "tblvalue": "k", "tbltext": "v", "valueField": "pipeline_type", "textField": "pipeline_type_text", "cond": "parentid='pipeline_type'" }, "dataurl": "{{entire_url('/appbase/get_code.dspy')}}" }, { "name": "version", "title": "当前版本", "type": "str", "length": 20, "default": "1.0.0", "cwidth": 18, "uitype": "str", "datatype": "str", "label": "当前版本" }, { "name": "status", "title": "状态", "type": "str", "length": 20, "nullable": "no", "default": "draft", "label": "状态", "uitype": "code", "valueField": "status", "textField": "status_text", "params": { "dbname": "{{{{get_module_dbname('pipeline_core')}}}}", "table": "appcodes_kv", "tblvalue": "k", "tbltext": "v", "valueField": "status", "textField": "status_text", "cond": "parentid='pipeline_status'" }, "dataurl": "{{entire_url('/appbase/get_code.dspy')}}" }, { "name": "pipeline_config", "title": "产线配置JSON", "type": "text", "length": 0, "uitype": "text", "datatype": "text", "label": "产线配置JSON" }, { "name": "model_api_url", "title": "模型API地址", "type": "str", "length": 500, "cwidth": 18, "uitype": "str", "datatype": "str", "label": "模型API地址" }, { "name": "model_api_key", "title": "模型API密钥", "type": "str", "length": 500, "cwidth": 18, "uitype": "password", "datatype": "str", "label": "模型API密钥" }, { "name": "org_id", "title": "所属机构ID", "type": "str", "length": 32, "default": "0", "cwidth": 18, "uitype": "str", "datatype": "str", "label": "所属机构ID" }, { "name": "created_by", "title": "创建人", "type": "str", "length": 32, "cwidth": 18, "uitype": "str", "datatype": "str", "label": "创建人" }, { "name": "created_at", "title": "创建时间", "type": "timestamp", "length": 0, "uitype": "str", "datatype": "timestamp", "label": "创建时间" }, { "name": "updated_at", "title": "更新时间", "type": "timestamp", "length": 0, "uitype": "str", "datatype": "timestamp", "label": "更新时间" } ] }, "page_rows":160, "cache_limit":5 } ,"binds":[{ "wid":"self", "event":"publish", "actiontype":"script", "target":"self", "script":"var d=this.select_row.user_data;fetch('{{entire_url('../api/pipeline_publish.dspy')}}',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'pipeline_id='+encodeURIComponent(d.id)}).then(function(r){return r.json()}).then(function(r){if(r.success){this.render({})}else{bricks.show_error({title:'发布失败',message:r.message||'未知错误'})}}.bind(this))" }] }] }