hermes_agent/wwwroot/remote_skills.ui
2026-04-16 08:08:28 +08:00

218 lines
7.4 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "Toolbar",
"options": {
"items": [
{
"text": "Remote Skills Management",
"icon": "cloud-upload",
"disabled": true
}
]
}
},
{
"widgettype": "HBox",
"options": {
"height": "100%"
},
"subwidgets": [
{
"widgettype": "Grid",
"id": "remote_skills_grid",
"options": {
"url": "/hermes_agent/remote_skills",
"fields": [
{"name": "name", "label": "Name", "width": "150px"},
{"name": "host", "label": "Host", "width": "120px"},
{"name": "username", "label": "Username", "width": "100px"},
{"name": "enabled", "label": "Enabled", "width": "80px", "type": "bool"},
{"name": "last_deployed", "label": "Last Deployed", "width": "150px"},
{"name": "last_executed", "label": "Last Executed", "width": "150px"}
],
"page_size": 20,
"height": "100%"
},
"binds": [
{
"wid": "self",
"event": "row_selected",
"actiontype": "callfunction",
"fname": "hermes_manage_remote_skills",
"params": {
"action": "read",
"skill_id": "${id}$"
},
"target": "skill_detail_form",
"method": "load_data"
}
]
},
{
"widgettype": "VBox",
"options": {
"width": "400px",
"padding": "10px"
},
"subwidgets": [
{
"widgettype": "Form",
"id": "skill_detail_form",
"options": {
"fields": [
{"name": "id", "label": "ID", "readonly": true, "hidden": true},
{"name": "name", "label": "Skill Name", "required": true},
{"name": "host", "label": "SSH Host", "required": true},
{"name": "port", "label": "SSH Port", "type": "int", "default": 22},
{"name": "username", "label": "Username", "required": true},
{"name": "remote_path", "label": "Remote Path", "default": "~/.skills"},
{"name": "auth_method", "label": "Auth Method", "type": "select", "options": ["key", "password"], "default": "key"},
{"name": "ssh_key_path", "label": "SSH Key Path"},
{"name": "description", "label": "Description", "type": "textarea"},
{"name": "category", "label": "Category"},
{"name": "version", "label": "Version", "default": "1.0.0"},
{"name": "enabled", "label": "Enabled", "type": "bool", "default": true}
]
},
"binds": [
{
"wid": "save_button",
"event": "click",
"actiontype": "callfunction",
"fname": "hermes_manage_remote_skills",
"params": {
"action": "${id ? 'update' : 'create'}$",
"skill_id": "${id}$",
"name": "${name}$",
"host": "${host}$",
"port": "${port}$",
"username": "${username}$",
"remote_path": "${remote_path}$",
"auth_method": "${auth_method}$",
"ssh_key_path": "${ssh_key_path}$",
"description": "${description}$",
"category": "${category}$",
"version": "${version}$",
"enabled": "${enabled}$"
},
"target": "remote_skills_grid",
"method": "refresh"
},
{
"wid": "delete_button",
"event": "click",
"actiontype": "callfunction",
"fname": "hermes_manage_remote_skills",
"params": {
"action": "delete",
"skill_id": "${id}$"
},
"target": "remote_skills_grid",
"method": "refresh"
}
]
},
{
"widgettype": "ButtonBar",
"options": {
"buttons": [
{
"id": "save_button",
"text": "Save",
"icon": "save"
},
{
"id": "delete_button",
"text": "Delete",
"icon": "trash",
"confirm": "Are you sure you want to delete this remote skill?"
}
]
}
},
{
"widgettype": "HBox",
"options": {
"margin_top": "20px"
},
"subwidgets": [
{
"widgettype": "Button",
"id": "deploy_button",
"options": {
"text": "Deploy Skill",
"icon": "upload-cloud",
"disabled": "${!id || !enabled}$"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "popup",
"url": "{{entire_url('hermes_agent/deploy_skill.ui')}}?skill_id=${id}$"
}
]
},
{
"widgettype": "Button",
"id": "execute_button",
"options": {
"text": "Execute Skill",
"icon": "play",
"disabled": "${!id || !enabled}$"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "popup",
"url": "{{entire_url('hermes_agent/execute_remote_skill.ui')}}?skill_id=${id}$"
}
]
},
{
"widgettype": "Button",
"id": "list_button",
"options": {
"text": "List Remote",
"icon": "list",
"disabled": "${!id || !enabled}$"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "callfunction",
"fname": "hermes_manage_remote_skills",
"params": {
"action": "list_remote",
"skill_id": "${id}$"
},
"target": "remote_list_result",
"method": "set_text"
}
]
}
]
},
{
"widgettype": "Label",
"id": "remote_list_result",
"options": {
"text": "",
"height": "100px",
"overflow": "auto"
}
}
]
}
]
}
]
}