From 76fe1b775a2fdad4ee7b8d04f2a71778f693d8e4 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Tue, 26 Nov 2024 11:26:22 +0100 Subject: views: add direct cmd execution view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reorganize "Run" section of Commands view as follows: Commands └── Run ├── Script: run script from folder ├── Cmd: direct command execution └── Display output: results of last execution Adapt API REST call to the new interface. Remove strange legacy ;|\n\r terminator. Remove "echo" field and add "inline" field. --- ogcp/forms/action_forms.py | 5 +++++ ogcp/templates/commands.html | 6 ++++-- ogcp/views.py | 42 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 49c9f60..24424a1 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -172,6 +172,11 @@ class RunScriptForm(FlaskForm): arguments = StringField(label=_l('Arguments')) submit = SubmitField(label=_l('Submit')) +class RunCmdForm(FlaskForm): + ips = HiddenField() + command = StringField(label=_l('Command')) + submit = SubmitField(label=_l('Submit')) + class ImportClientsForm(FlaskForm): server = HiddenField() room = SelectField(label=_l('Room')) diff --git a/ogcp/templates/commands.html b/ogcp/templates/commands.html index 41a0917..c909ea3 100644 --- a/ogcp/templates/commands.html +++ b/ogcp/templates/commands.html @@ -97,11 +97,13 @@