From c08aca92196cdd8df4c8d81da71e248b407f5bb2 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Thu, 29 Oct 2020 14:59:13 +0100 Subject: [PATCH] Add software action This action lists every piece of software installed in an OS from a client. This action can handle listing the software from the DB as well as updating that DB with the latest client information. --- ogcp/forms/action_forms.py | 6 +++++ ogcp/templates/actions/software.html | 11 ++++++++ ogcp/templates/scopes.html | 2 ++ ogcp/views.py | 40 +++++++++++++++++++++++++++- 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 ogcp/templates/actions/software.html diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 154e9f0..bc0915a 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -33,6 +33,12 @@ class HardwareForm(FlaskForm): ips = HiddenField() refresh = SubmitField(label=_('Refresh')) +class SoftwareForm(FlaskForm): + ips = HiddenField() + os = SelectField(label=_('Partition'), choices=[]) + view = SubmitField(label=_('View')) + update = SubmitField(label=_('Update')) + class SessionForm(FlaskForm): ips = HiddenField() os = RadioField(label=_('Session'), choices=[]) diff --git a/ogcp/templates/actions/software.html b/ogcp/templates/actions/software.html new file mode 100644 index 0000000..713f89b --- /dev/null +++ b/ogcp/templates/actions/software.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} +{% import "bootstrap/wtf.html" as wtf %} + +{% block content %} + +{{ wtf.quick_form(form, + action=url_for('action_software'), + method='post', + button_map={'view': 'primary', 'update': 'primary'}) }} + +{% endblock %} diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html index 19ce9d8..d810b2a 100644 --- a/ogcp/templates/scopes.html +++ b/ogcp/templates/scopes.html @@ -42,6 +42,8 @@ formaction="{{ url_for('action_refresh') }}" formmethod="post"> +