From 904989b175bda9c68cb9f5750ed5883b9113d834 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Fri, 23 Oct 2020 15:10:29 +0200 Subject: Add image restore action This action provides the image restoring functionality on a specific client. --- ogcp/forms/action_forms.py | 8 +++++++ ogcp/templates/scopes.html | 2 ++ ogcp/views.py | 57 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 66 insertions(+), 1 deletion(-) (limited to 'ogcp') diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 4dfaa21..eb8d309 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -38,6 +38,14 @@ class SessionForm(FlaskForm): os = RadioField(label=_('Session'), choices=[]) run = SubmitField(label=_('Run')) +class ImageRestoreForm(FlaskForm): + ips = HiddenField() + partition = SelectField(label=_('Partition'), choices=[]) + image = SelectField(label=_('Image'), choices=[]) + method = SelectField(label=_('Method'), + choices=[('UNICAST', 'Unicast')]) + restore = SubmitField(label=_('Restore')) + class ClientDetailsForm(FlaskForm): name = StringField(label=_('Name')) ip = StringField(label=_('IP')) diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html index 27524e9..ba9d27a 100644 --- a/ogcp/templates/scopes.html +++ b/ogcp/templates/scopes.html @@ -44,6 +44,8 @@ formaction="{{ url_for('action_hardware') }}" formmethod="get"> +