250 lines
14 KiB
XML
250 lines
14 KiB
XML
{
|
|
"widgettype": "VBox",
|
|
"options": {"width": "100%", "height": "100%", "padding": "16px", "gap": "12px"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {"width": "100%", "justifyContent": "space-between", "alignItems": "center"},
|
|
"subwidgets": [
|
|
{"widgettype": "Title", "options": {"text": "开发产线工作台", "cfontsize": 22}},
|
|
{"widgettype": "Filler"}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "Form",
|
|
"id": "quick_submit_form",
|
|
"options": {
|
|
"name": "quick_submit",
|
|
"width": "100%",
|
|
"css": "card",
|
|
"padding": "12px",
|
|
"submit_url": "{{entire_url('api/task_submit.dspy')}}",
|
|
"submit_label": "提交任务",
|
|
"submit_css": "primary",
|
|
"fields": [
|
|
{
|
|
"name": "input_text",
|
|
"uitype": "text",
|
|
"label": "",
|
|
"placeholder": "输入任务描述,如:生成一首中国风歌曲...",
|
|
"cwidth": 40
|
|
},
|
|
{
|
|
"name": "pipeline_id",
|
|
"uitype": "code",
|
|
"label": "产线",
|
|
"placeholder": "选择产线",
|
|
"cwidth": 20,
|
|
"dataurl": "{{entire_url('api/pipeline_options.dspy')}}",
|
|
"valueField": "pipeline_id",
|
|
"textField": "pipeline_id_text",
|
|
"params": {
|
|
"valueField": "pipeline_id",
|
|
"textField": "pipeline_id_text"
|
|
}
|
|
},
|
|
{
|
|
"name": "title",
|
|
"uitype": "hide",
|
|
"value": ""
|
|
}
|
|
]
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "beforesubmit",
|
|
"actiontype": "script",
|
|
"target": "self",
|
|
"script": "var input_el=this.form_element.querySelector('[name=\"input_text\"]');var pipe_el=this.form_element.querySelector('[name=\"pipeline_id\"]');var input_val=input_el?input_el.value:'';var title_el=this.form_element.querySelector('[name=\"title\"]');if(title_el)title_el.value=input_val||'new task';if(!input_val){bricks.show_error({title:'提示',message:'请输入任务描述'});return false;}return true;"
|
|
},
|
|
{
|
|
"wid": "self",
|
|
"event": "submited",
|
|
"actiontype": "script",
|
|
"target": "self",
|
|
"script": "var tbl=bricks.getWidgetById('task_table');setTimeout(function(){if(tbl)tbl.render({});},500);var input_el=this.form_element.querySelector('[name=\"input_text\"]');if(input_el)input_el.value='';"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {"width": "100%", "css": "filler", "gap": "12px"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"width": "60%", "height": "100%", "gap": "4px"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {"width": "100%", "alignItems": "center"},
|
|
"subwidgets": [
|
|
{"widgettype": "Text", "options": {"text": "任务列表", "cfontsize": 14}},
|
|
{"widgettype": "Filler"},
|
|
{"widgettype": "Text", "id": "poll_status", "options": {"text": "", "color": "#888", "cfontsize": 11}}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "Tabular",
|
|
"id": "task_table",
|
|
"options": {
|
|
"width": "100%",
|
|
"height": "100%",
|
|
"css": "card",
|
|
"data_url": "{{entire_url('api/task_list.dspy')}}",
|
|
"data_method": "GET",
|
|
"page_rows": 15,
|
|
"popup": {
|
|
"popup_event": "dblclick",
|
|
"popup_desc": {
|
|
"widgettype": "urlwidget",
|
|
"options": {
|
|
"url": "/pipeline_task/task_tree_popup.ui?task_id=${id}$&title=${encodeURIComponent(title)}$",
|
|
"method": "GET"
|
|
}
|
|
},
|
|
"popupwindow": true,
|
|
"options": {"title": "${title}$"}
|
|
},
|
|
"toolbar": {
|
|
"tools": [
|
|
{"name": "refresh", "label": "刷新", "selected_row": false},
|
|
{"name": "view", "label": "查看详情", "selected_row": true}
|
|
]
|
|
},
|
|
"search_form": {
|
|
"fields": [
|
|
{
|
|
"name": "pipeline_id",
|
|
"label": "产线",
|
|
"uitype": "str",
|
|
"placeholder": "筛选产线ID"
|
|
},
|
|
{
|
|
"name": "state",
|
|
"label": "状态",
|
|
"uitype": "code",
|
|
"data": [
|
|
{"value": "", "text": "全部"},
|
|
{"value": "submitted", "text": "已提交"},
|
|
{"value": "running", "text": "运行中"},
|
|
{"value": "waiting", "text": "等待人工"},
|
|
{"value": "completed", "text": "已完成"},
|
|
{"value": "failed", "text": "失败"},
|
|
{"value": "paused", "text": "已暂停"},
|
|
{"value": "cancelled", "text": "已取消"}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"row_options": {
|
|
"browserfields": {
|
|
"exclouded": ["tenant_id", "owner_id", "params"],
|
|
"cwidths": {
|
|
"id": 16,
|
|
"title": 22,
|
|
"pipeline_id": 8,
|
|
"state": 7,
|
|
"current_version": 5,
|
|
"created_at": 10
|
|
},
|
|
"alters": {
|
|
"state": {
|
|
"uitype": "code",
|
|
"data": [
|
|
{"value": "submitted", "text": "已提交"},
|
|
{"value": "running", "text": "运行中"},
|
|
{"value": "waiting", "text": "⚠等待"},
|
|
{"value": "completed", "text": "已完成"},
|
|
{"value": "failed", "text": "失败"},
|
|
{"value": "paused", "text": "已暂停"},
|
|
{"value": "cancelled", "text": "已取消"}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"fields": [
|
|
{"name": "id", "type": "str", "length": 32, "cwidth": 16, "uitype": "str", "label": "任务ID"},
|
|
{"name": "title", "type": "str", "length": 255, "cwidth": 22, "uitype": "str", "label": "标题"},
|
|
{"name": "pipeline_id", "type": "str", "length": 32, "cwidth": 8, "uitype": "str", "label": "产线"},
|
|
{"name": "state", "type": "str", "length": 20, "cwidth": 7, "uitype": "code", "label": "状态"},
|
|
{"name": "current_version", "type": "int", "cwidth": 5, "uitype": "int", "label": "版本"},
|
|
{"name": "created_at", "type": "datetime", "cwidth": 10, "uitype": "str", "label": "创建时间"}
|
|
]
|
|
}
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "refresh",
|
|
"actiontype": "method",
|
|
"target": "self",
|
|
"method": "render"
|
|
},
|
|
{
|
|
"wid": "self",
|
|
"event": "view",
|
|
"actiontype": "urlwidget",
|
|
"target": "app.pipeline_task_content",
|
|
"mode": "replace",
|
|
"options": {
|
|
"url": "{{entire_url('task_detail.ui')}}",
|
|
"params": {"task_id": "${id}$"}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {"width": "40%", "height": "100%", "gap": "4px"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {"width": "100%", "alignItems": "center"},
|
|
"subwidgets": [
|
|
{"widgettype": "Text", "options": {"text": "我的Bug", "cfontsize": 14}},
|
|
{"widgettype": "Filler"},
|
|
{"widgettype": "Text", "id": "bug_count", "options": {"text": "", "color": "#888", "cfontsize": 11}}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "Tabular",
|
|
"id": "bug_table",
|
|
"options": {
|
|
"width": "100%",
|
|
"height": "100%",
|
|
"css": "card",
|
|
"title": "",
|
|
"data_url": "{{entire_url('api/my_bugs.dspy')}}",
|
|
"data_method": "GET",
|
|
"page_rows": 15,
|
|
"row_options": {
|
|
"browserfields": {
|
|
"cwidths": {
|
|
"title": 24,
|
|
"status": 7,
|
|
"severity": 6,
|
|
"reporter_type": 6,
|
|
"created_at": 9
|
|
}
|
|
},
|
|
"fields": [
|
|
{"name": "title", "type": "str", "length": 300, "cwidth": 24, "uitype": "str", "label": "标题"},
|
|
{"name": "status", "type": "str", "length": 20, "cwidth": 7, "uitype": "str", "label": "状态"},
|
|
{"name": "severity", "type": "str", "length": 10, "cwidth": 6, "uitype": "str", "label": "严重度"},
|
|
{"name": "reporter_type", "type": "str", "length": 10, "cwidth": 6, "uitype": "str", "label": "来源"},
|
|
{"name": "created_at", "type": "str", "length": 20, "cwidth": 9, "uitype": "str", "label": "时间"},
|
|
{"name": "id", "type": "str", "length": 32, "uitype": "str", "label": "ID"}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|