summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-09-02 14:37:56 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-09-02 14:37:56 +0200
commita4957f2284014186eb242470ce2336f0247796cb (patch)
tree292d33c4a40da8eaf548ead27ea682fdd5a5430c /ogcp
parent3fe6ad6ac699471c127cc926dc89ad0168fdf454 (diff)
Add scopes.html template
This template shows information about scopes and its states as well as a tool to apply actions on them. Style improvements are still necessary.
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/templates/scopes.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html
new file mode 100644
index 0000000..7abba81
--- /dev/null
+++ b/ogcp/templates/scopes.html
@@ -0,0 +1,40 @@
+{% extends 'base.html' %}
+
+{% macro print_scopes_tree(scopes) -%}
+
+ <ul class="list-group">
+ {% for scope in scopes %}
+ <li class="list-group-item">
+ <input class="form-check-input" type="checkbox"
+ value="{{ " ".join(scope["ip"]) }}"
+ name="{{ scope["name"] }}_{{ scope["id"] }}">
+ {{ scope["name"] }}
+ {% if "state" in scope %}
+ -- STATE: {{ scope["state"] }}
+ {% endif %}
+ {{ print_scopes_tree(scope["scope"]) }}
+ </li>
+ {% endfor %}
+ </ul>
+
+{% endmacro %}
+
+{% block content %}
+
+<form method="post">
+ {{ print_scopes_tree(scopes["scope"]) }}
+
+ <div class="dropdown">
+ <button class="btn btn-primary dropdown-toggle" type="button"
+ id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
+ aria-expanded="false">
+ {{ _('Actions') }}
+ </button>
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <input class="dropdown-item" type="submit" value="{{ _('Poweroff') }}"
+ formaction="{{ url_for('action_poweroff') }}">
+ </div>
+ </div>
+</form>
+
+{% endblock %}