32 lines
2.2 KiB
XML
32 lines
2.2 KiB
XML
{
|
||
"widgettype": "VBox",
|
||
"options": {"width": "100%", "height": "100%", "padding": "20px"},
|
||
"subwidgets": [
|
||
{"widgettype": "Text", "options": {"label": "脚本执行 / 校验", "fontSize": "20px"}},
|
||
{"widgettype": "HBox", "options": {"width": "100%", "gap": "16px"}, "subwidgets": [
|
||
{"widgettype": "VBox", "options": {"backgroundColor": "#FFFFFF", "padding": "16px", "flex": "1"}, "subwidgets": [
|
||
{"widgettype": "Text", "options": {"label": "脚本类型"}},
|
||
{"widgettype": "Select", "id": "script_type", "options": {
|
||
"data": [{"value": "0", "text": "Python"}, {"value": "1", "text": "SQL"}],
|
||
"value": "0"}},
|
||
{"widgettype": "Text", "options": {"label": "脚本内容"}},
|
||
{"widgettype": "Textarea", "id": "script_content", "options": {"width": "100%", "height": "220px", "placeholder": "Python: 设置 result 变量输出;SQL: 只读单条 SELECT/SHOW/DESCRIBE/EXPLAIN"}},
|
||
{"widgettype": "HBox", "options": {"gap": "12px"}, "subwidgets": [
|
||
{"widgettype": "Button", "id": "btn_validate", "options": {"label": "校验"},
|
||
"binds": [{"wid": "btn_validate", "event": "click", "actiontype": "urlwidget", "target": "script_result",
|
||
"options": {"method": "POST", "url": "{{entire_url('api/script_validate.dspy')}}",
|
||
"params": {"script_type": "{{params_kw.script_type}}", "content": "{{params_kw.script_content}}"}}}]},
|
||
{"widgettype": "Button", "id": "btn_execute", "options": {"label": "执行"},
|
||
"binds": [{"wid": "btn_execute", "event": "click", "actiontype": "urlwidget", "target": "script_result",
|
||
"options": {"method": "POST", "url": "{{entire_url('api/script_execute.dspy')}}",
|
||
"params": {"script_type": "{{params_kw.script_type}}", "content": "{{params_kw.script_content}}"}}}]}
|
||
]}
|
||
]},
|
||
{"widgettype": "VBox", "options": {"backgroundColor": "#FFFFFF", "padding": "16px", "flex": "1"}, "subwidgets": [
|
||
{"widgettype": "Text", "options": {"label": "执行结果"}},
|
||
{"widgettype": "VBox", "id": "script_result", "options": {"width": "100%", "minHeight": "260px", "backgroundColor": "#F7F7F7"}}
|
||
]}
|
||
]}
|
||
]
|
||
}
|