{ "widgettype": "VBox", "options": { "width": "100%", "height": "100%", "style": { "padding": "20px" } }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "Hermes Services", "fontSize": "24px", "fontWeight": "bold", "style": { "marginBottom": "24px", "color": "#F8FAFC" } } }, { "widgettype": "DataViewer", "options": { "data_url": "/hermes-web-cli/services", "page_rows": 20, "row_options": { "fields": [ { "name": "name", "label": "Service Name", "uitype": "str" }, { "name": "service_url", "label": "Service URL", "uitype": "str" }, { "name": "description", "label": "Description", "uitype": "str" }, { "name": "status", "label": "Status", "uitype": "str" }, { "name": "created_at", "label": "Created At", "uitype": "date" } ] }, "editable": { "add_icon": "fa fa-plus", "update_icon": "fa fa-edit", "delete_icon": "fa fa-trash", "new_data_url": "/hermes-web-cli/services", "update_data_url": "/hermes-web-cli/services/{id}", "delete_data_url": "/hermes-web-cli/services/{id}" }, "toolbar": { "tools": [ { "name": "test_connection", "text": "Test Connection", "icon": "fa fa-plug" }, { "name": "view_sessions", "text": "View Sessions", "icon": "fa fa-list" } ] } }, "binds": [ { "wid": "self", "event": "test_connection", "actiontype": "script", "script": "const selectedRow = event.params; if (selectedRow) { fetch(`/hermes-web-cli/services/${selectedRow.id}/test`).then(resp => resp.json()).then(data => { if (data.success) { bricks.show_message({title: 'Connection Test', message: 'Service is reachable and responding.'}); } else { bricks.show_error({title: 'Connection Failed', message: data.message || 'Unable to connect to service.'}); } }); }" }, { "wid": "self", "event": "view_sessions", "actiontype": "script", "script": "const selectedRow = event.params; if (selectedRow) { const url = `{{entire_url('service_sessions.ui')}}?service_id=${selectedRow.id}`; bricks.app.load_widget(url, 'main-content', 'replace'); }" } ] } ] }