From c5a4ccff550ad69c72f4f8aedba4c4a8457e1dfc Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Thu, 22 Oct 2020 11:04:57 +0200 Subject: Add session action This action provides the functionality to run one of the installed OSs in a client. --- ogcp/forms/action_forms.py | 7 ++++++- ogcp/templates/scopes.html | 2 ++ ogcp/views.py | 25 ++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'ogcp') diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 39dae81..4dfaa21 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -1,6 +1,6 @@ from wtforms import ( Form, SubmitField, HiddenField, SelectField, BooleanField, IntegerField, - StringField + StringField, RadioField ) from flask_wtf import FlaskForm from flask_babel import _ @@ -33,6 +33,11 @@ class HardwareForm(FlaskForm): ips = HiddenField() refresh = SubmitField(label=_('Refresh')) +class SessionForm(FlaskForm): + ips = HiddenField() + os = RadioField(label=_('Session'), choices=[]) + run = SubmitField(label=_('Run')) + class ClientDetailsForm(FlaskForm): name = StringField(label=_('Name')) ip = StringField(label=_('IP')) diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html index 460fc3e..27524e9 100644 --- a/ogcp/templates/scopes.html +++ b/ogcp/templates/scopes.html @@ -42,6 +42,8 @@ formaction="{{ url_for('action_refresh') }}" formmethod="post"> +