From 0ed9ecdae9a7e4c7fbb30af30ef4310cd45f2143 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Fri, 21 Jun 2024 13:14:51 +0200 Subject: ogcp: add support to view script output Add view at /action/script/output to visualize the result of /shell/run for multiple clients. Use shell/output to request the execution data of the selected clients. Each client element has execution timestamip (UTC), client ip, cmd, return code and stdout of the executed command. --- ogcp/templates/actions/script_output.html | 74 +++++++++++++++++++++++++++++++ ogcp/templates/commands.html | 2 + ogcp/views.py | 42 ++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 ogcp/templates/actions/script_output.html (limited to 'ogcp') diff --git a/ogcp/templates/actions/script_output.html b/ogcp/templates/actions/script_output.html new file mode 100644 index 0000000..c7ffdcb --- /dev/null +++ b/ogcp/templates/actions/script_output.html @@ -0,0 +1,74 @@ +{% extends 'commands.html' %} +{% import "bootstrap/wtf.html" as wtf %} +{% import "macros.html" as macros %} + +{% set sidebar_state = 'disabled' %} +{% set btn_back = true %} + +{% block nav_client %} active {% endblock %} +{% block nav_script_output %} active {% endblock %} +{% block content %} + +

+ {{ _('Script output') }} +

+ +{{ macros.cmd_selected_clients(selected_clients) }} + +
+ + + +
+ {% for client in client_data %} +
+
+

+ +

+
+
+
+

{{ client['output'] }}

+
+
+
+ {% endfor %} +
+ +{% endblock %} diff --git a/ogcp/templates/commands.html b/ogcp/templates/commands.html index eab9f29..7a63c38 100644 --- a/ogcp/templates/commands.html +++ b/ogcp/templates/commands.html @@ -94,6 +94,8 @@