diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-07-04 17:10:41 +0200 |
---|---|---|
committer | lupoDharkael <izhe@hotmail.es> | 2024-07-09 09:52:21 +0200 |
commit | f85f0771cd0acaa44fe812f36d08af141e0e663a (patch) | |
tree | 0411e82625dcbffa878007ac149add892293914b /ogcp/templates | |
parent | d582beef47b247611e4eeadf7bdca7f69c729335 (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')
-rw-r--r-- | ogcp/templates/base.html | 2 | ||||
-rw-r--r-- | ogcp/templates/macros.html | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index 7be19b4..3ad3b05 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -108,7 +108,7 @@ <!-- ChartJS --> <script src="{{ url_for('static', filename='AdminLTE/plugins/chart.js/Chart.min.js') }}"></script> - <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=10"></script> + <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=11"></script> <script> // error messages 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 |