summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ogcp/static/js/ogcp.js4
-rw-r--r--ogcp/templates/macros.html4
2 files changed, 4 insertions, 4 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js
index 0f3a648..ac31c65 100644
--- a/ogcp/static/js/ogcp.js
+++ b/ogcp/static/js/ogcp.js
@@ -4,7 +4,7 @@ let updateTimeoutId = null;
function showSelectedClient(client_checkbox) {
const container = $('#selected-clients');
- const pill_id = 'pill-' + client_checkbox.name.replaceAll('.', '_');
+ const pill_id = 'pill-' + client_checkbox.name.replaceAll(/[.]|[ ]/g, '_');
if (client_checkbox.checked) {
if (!($('#' + pill_id).length))
@@ -124,7 +124,7 @@ function updatePillStatus(state, pill) {
function updateScopes(scopes) {
scopes.forEach((scope) => {
if (scope.state) {
- const scopeId = `${scope.name}_${scope.id}`.replaceAll('.', '_');
+ const scopeId = `${scope.name}_${scope.id}`.replaceAll(/[.]|[ ]/g, '_');
const iconEl = document.querySelector(`#${scopeId} .nav-icon`);
const iconCls = ['fas', 'far', 'text-danger', 'text-success',
'text-warning', 'text-wol'];
diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html
index fed48a6..96561db 100644
--- a/ogcp/templates/macros.html
+++ b/ogcp/templates/macros.html
@@ -21,7 +21,7 @@
{% macro scopes_tree_collapse_level(scopes, i, parent_id, state) -%}
{% for scope in scopes %}
- <li id="{{ scope["name"]|replace(".", "_") }}_{{ scope["id"] }}" class="nav-item">
+ <li id="{{ scope["name"]|replace(".", "_")|replace(" ", "_") }}_{{ scope["id"] }}" class="nav-item">
{% if " ".join(scope["ip"]) %}
<input class="form-check-input" type="checkbox" form="scopesForm"
value="{{ " ".join(scope["ip"]) }}" {{ state }}
@@ -58,7 +58,7 @@
<div class="d-flex flex-wrap justify-content-center">
{% set max_clients = 50 %}
{% for name_id, ip in selected_clients[:max_clients] %}
- <div id="pill-{{ name_id|replace(".", "_") }}" class="badge badge-pill og-pill badge-light">
+ <div id="pill-{{ name_id|replace(".", "_")|replace(" ", "_") }}" class="badge badge-pill og-pill badge-light">
{{ name_id }}<br>{{ ip }}
</div>
{% if loop.last and (selected_clients|length > max_clients) %}