summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/macros.html
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-07-04 17:10:41 +0200
committerlupoDharkael <izhe@hotmail.es>2024-07-09 09:52:21 +0200
commitf85f0771cd0acaa44fe812f36d08af141e0e663a (patch)
tree0411e82625dcbffa878007ac149add892293914b /ogcp/templates/macros.html
parentd582beef47b247611e4eeadf7bdca7f69c729335 (diff)
ogcp: show an indicator in each sidebar branch with live children
Add visual indicator to the disclosure widget when its branch has any clients in live mode. Ease the search of systems in ogLive in need of being booted or turned off. Add id= to the HTML component containing the disclosure widget. Set the id to the value scope_type-scope_name for type='server' and scope_type-scope_id for the rest. Add the CSS class 'live-report' to the HTML components with live children. Assign the class field in the js function updateScopes.
Diffstat (limited to 'ogcp/templates/macros.html')
-rw-r--r--ogcp/templates/macros.html9
1 files changed, 6 insertions, 3 deletions
diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html
index eda57ed..077bad5 100644
--- a/ogcp/templates/macros.html
+++ b/ogcp/templates/macros.html
@@ -28,7 +28,8 @@
{% macro scopes_tree_collapse_level(scopes, parent_room, parent_id, state, selection_mode) -%}
{% for scope in scopes %}
- <li id="{{ scope["name"]|replace(".", "_")|replace(" ", "_") }}_{{ scope["id"] }}" class="nav-item">
+ {% set scope_name = scope["name"]|replace(".", "_")|replace(" ", "_") %}
+ <li id="{{ scope_name }}_{{ scope["id"] }}" class="nav-item">
{% set input_id = "input" ~ parent_id ~ "-" ~ loop.index %}
{% if scope["type"] == "server" %}
<input id="{{ input_id }}" class="form-check-input" type="checkbox" form="scopesForm"
@@ -62,8 +63,10 @@
{% if scope.get("selected", False) %}checked{% endif %}
name="{{ scope["name"] }}_{{ scope["id"] }}" />
{% endif %}
- <a class="nav-link {% if not scope["scope"] %}disabled{% endif %}" href="#scope{{parent_id ~ "-" ~ loop.index}}"
- {% if scope["scope"] %}data-toggle="collapse"{% endif %}>
+ <a class="nav-link {% if not scope["scope"] %}disabled{% endif %}"
+ id="{{ scope["type"] }}-{{ scope.get('id', scope_name) }}"
+ href="#scope{{parent_id ~ "-" ~ loop.index}}"
+ {% if scope["scope"] %}data-toggle="collapse"{% endif %}>
{% if "state" in scope %}
<i class="nav-icon fa-circle
{% if scope['state'] == 'OPG' %}fas text-warning