diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2022-02-22 17:01:27 +0100 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2022-02-22 17:01:27 +0100 |
commit | a32611993731e575b04b50c9d4f4fcd80bd28dc9 (patch) | |
tree | dadcea4f9a58ce5dc33a38cb10678bd79c73e182 /ogcp | |
parent | ba5063871cbf67a5749b1b61fe70e57265e64a0c (diff) |
Hardware inventory template extends from command.html
Extending from command.html is required for action views to mantain
the scope context on the left side column.
Enables setting dropdown button and action button as active when loading
the hardware inventory view.
Diffstat (limited to 'ogcp')
-rw-r--r-- | ogcp/templates/actions/hardware.html | 4 | ||||
-rw-r--r-- | ogcp/views.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ogcp/templates/actions/hardware.html b/ogcp/templates/actions/hardware.html index c447c57..70a24de 100644 --- a/ogcp/templates/actions/hardware.html +++ b/ogcp/templates/actions/hardware.html @@ -1,6 +1,8 @@ -{% extends 'base.html' %} +{% extends 'commands.html' %} {% import "bootstrap/wtf.html" as wtf %} +{% block nav_inventory %} active{% endblock %} +{% block nav_inventory_hardware %} active{% endblock %} {% block content %} <h1 class="m-5">{{_('Hardware inventory')}}</h1> diff --git a/ogcp/views.py b/ogcp/views.py index a5e9573..a5b04a1 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -477,6 +477,7 @@ def action_hardware(): return make_response("400 Bad Request", 400) else: ips = parse_elements(request.args.to_dict()) + scopes, _clients = get_scopes(ips) if not validate_elements(ips, max_len=1): return redirect(url_for('commands')) @@ -484,7 +485,7 @@ def action_hardware(): r = g.server.get('/hardware', payload={'client': list(ips)}) hardware = r.json()['hardware'] return render_template('actions/hardware.html', form=form, - hardware=hardware) + hardware=hardware, scopes=scopes) @app.route('/action/software', methods=['GET', 'POST']) @login_required |