From 2ad382b5ed0e927121308f83a51d8f3a89d41e50 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Wed, 24 Mar 2021 14:32:16 +0100 Subject: Add cosmetic improvements * Adds label for each action page. * Adds a colored state for opengnsys connected clients * Fix nav active item * Rename some actions * Adds DISK to partition and format form --- ogcp/forms/action_forms.py | 1 + ogcp/static/css/soleta.css | 3 +++ ogcp/templates/actions/client_details.html | 5 ++++- ogcp/templates/actions/hardware.html | 4 ++++ ogcp/templates/actions/image_create.html | 13 ++++++++++++- ogcp/templates/actions/image_restore.html | 10 ++++++++++ ogcp/templates/actions/mode.html | 10 ++++++++++ ogcp/templates/actions/session.html | 5 ++++- ogcp/templates/actions/setup.html | 6 ++++-- ogcp/templates/actions/software.html | 5 ++++- ogcp/templates/actions/wol.html | 10 ++++++++++ ogcp/templates/base.html | 3 ++- ogcp/templates/dashboard.html | 12 ++++++++++++ ogcp/templates/nav.html | 4 ++-- ogcp/templates/scopes.html | 13 +++++++------ ogcp/views.py | 16 +++++++++++++++- 16 files changed, 104 insertions(+), 16 deletions(-) create mode 100644 ogcp/static/css/soleta.css create mode 100644 ogcp/templates/dashboard.html (limited to 'ogcp') diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 44e2d58..d1633e2 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -24,6 +24,7 @@ class PartitionForm(FlaskForm): fs = SelectField(label=_('Filesystem'), choices=[('EXT4', 'EXT4'), ('NTFS', 'NTFS'), + ('DISK', 'Disk'), ('EMPTY', 'Empty')]) size = IntegerField(label=_('Size (KB)')) format_partition = BooleanField(label=_('Format')) diff --git a/ogcp/static/css/soleta.css b/ogcp/static/css/soleta.css new file mode 100644 index 0000000..d9a775b --- /dev/null +++ b/ogcp/static/css/soleta.css @@ -0,0 +1,3 @@ +.state--opg { + background-color: rgb(252, 222, 66); +} diff --git a/ogcp/templates/actions/client_details.html b/ogcp/templates/actions/client_details.html index 3ef13a6..39963bd 100644 --- a/ogcp/templates/actions/client_details.html +++ b/ogcp/templates/actions/client_details.html @@ -3,8 +3,11 @@ {% block content %} +

{{_('Client details')}}

+ {{ wtf.quick_form(form, method='post', - button_map={'create': 'primary'}) }} + button_map={'create': 'primary'}, + extra_classes="mx-5") }} {% endblock %} diff --git a/ogcp/templates/actions/hardware.html b/ogcp/templates/actions/hardware.html index 31f4d81..c447c57 100644 --- a/ogcp/templates/actions/hardware.html +++ b/ogcp/templates/actions/hardware.html @@ -3,6 +3,10 @@ {% block content %} +

{{_('Hardware inventory')}}

+ +

Selected client: {{ form.ips.data }}

+ diff --git a/ogcp/templates/actions/image_create.html b/ogcp/templates/actions/image_create.html index 2e2b4f9..3542cd2 100644 --- a/ogcp/templates/actions/image_create.html +++ b/ogcp/templates/actions/image_create.html @@ -3,9 +3,20 @@ {% block content %} +

{{_('Create a partition image')}}

+ +

Selected client: {{ form.ip.data }}

+ + + {{ wtf.quick_form(form, action=url_for('action_image_create'), method='post', - button_map={'create': 'primary'}) }} + button_map={'create': 'primary'}, + extra_classes='mx-5') }} {% endblock %} diff --git a/ogcp/templates/actions/image_restore.html b/ogcp/templates/actions/image_restore.html index cf50b43..9742bbd 100644 --- a/ogcp/templates/actions/image_restore.html +++ b/ogcp/templates/actions/image_restore.html @@ -3,6 +3,16 @@ {% block content %} +{% set ip_list = form.ips.data.split(' ') %} +{% set ip_count = ip_list | length %} +

Restore partition image to {{ip_count}} {%if ip_count > 1%}computers{% else %}computer{% endif %}

+ + + {{ wtf.quick_form(form, action=url_for('action_image_restore'), method='post', diff --git a/ogcp/templates/actions/mode.html b/ogcp/templates/actions/mode.html index d93e8a7..0fd3266 100644 --- a/ogcp/templates/actions/mode.html +++ b/ogcp/templates/actions/mode.html @@ -3,6 +3,16 @@ {% block content %} +{% set ip_list = form.ips.data.split(' ') %} +{% set ip_count = ip_list | length %} +

Changing boot mode of {{ip_count}} {%if ip_count > 1%}computers{% else %}computer{% endif %}

+ + + {{ wtf.quick_form(form, action=url_for('action_mode'), method='post', diff --git a/ogcp/templates/actions/session.html b/ogcp/templates/actions/session.html index 3023a57..528c928 100644 --- a/ogcp/templates/actions/session.html +++ b/ogcp/templates/actions/session.html @@ -3,9 +3,12 @@ {% block content %} +

{{_('Start session')}}

+ {{ wtf.quick_form(form, action=url_for('action_session'), method='post', - button_map={'run': 'primary'}) }} + button_map={'run': 'primary'}, + extra_classes='mx-5') }} {% endblock %} diff --git a/ogcp/templates/actions/setup.html b/ogcp/templates/actions/setup.html index cc26804..f105dd2 100644 --- a/ogcp/templates/actions/setup.html +++ b/ogcp/templates/actions/setup.html @@ -3,12 +3,14 @@ {% block content %} +

{{_('Partition and Format')}}

+ {% for form in forms %} {{ wtf.quick_form(form, method='post', - form_type='inline', - extra_classes='m-2 p-2', + form_type='inline', + extra_classes='mx-5 pb-3', button_map={'modify': 'primary', 'delete': 'danger'}) }} diff --git a/ogcp/templates/actions/software.html b/ogcp/templates/actions/software.html index 713f89b..71dc0ae 100644 --- a/ogcp/templates/actions/software.html +++ b/ogcp/templates/actions/software.html @@ -3,9 +3,12 @@ {% block content %} +

{{_('Software Inventory')}}

+ {{ wtf.quick_form(form, action=url_for('action_software'), method='post', - button_map={'view': 'primary', 'update': 'primary'}) }} + button_map={'view': 'primary', 'update': 'primary'}, + extra_classes="mx-5")}} {% endblock %} diff --git a/ogcp/templates/actions/wol.html b/ogcp/templates/actions/wol.html index 61494f9..0692589 100644 --- a/ogcp/templates/actions/wol.html +++ b/ogcp/templates/actions/wol.html @@ -3,6 +3,16 @@ {% block content %} +{% set ip_list = form.ips.data.split(' ') %} +{% set ip_count = ip_list | length %} +

Powering on {{ip_count}} {%if ip_count > 1%}computers{% else %}computer{% endif %}

+ + + {{ wtf.quick_form(form, action=url_for('action_wol'), method='post', diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index 3f55555..e70e3fd 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -4,6 +4,7 @@ {% block head %} + {% block title %}{% endblock %} - OpenGnsys {% endblock %} @@ -32,7 +33,7 @@ {% block footer %}