diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-06-06 15:18:53 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-06-07 14:35:41 +0200 |
commit | 26785aa88b52b813ccb83e12316b6ce65e423362 (patch) | |
tree | bdcbd320611320c312773aa36ab36810487c616d /ogcp/templates | |
parent | b0858a7a62845eb7beda0df369a0d6d7145e9d5f (diff) |
templates: show boot mode in client pills
Add boot mode to each client pill in action/mode using js.
This makes easier to have a global perspective of the client's
configuration.
Diffstat (limited to 'ogcp/templates')
-rw-r--r-- | ogcp/templates/actions/mode.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ogcp/templates/actions/mode.html b/ogcp/templates/actions/mode.html index d89f536..c765f4b 100644 --- a/ogcp/templates/actions/mode.html +++ b/ogcp/templates/actions/mode.html @@ -49,4 +49,22 @@ button_map={'ok': 'primary'}, extra_classes="m-5") }} +<!-- jQuery --> +<script src="{{ url_for('static', filename='AdminLTE/plugins/jquery/jquery.min.js') }}"></script> +<script> + var modesSet = {{ modes_set|tojson|safe }}; + // Update pill data + $('.badge-pill').each(function(index) { + for (const mode in modesSet) { + for (const clientName of modesSet[mode]) { + console.log(mode, clientName, $(this).html()) + if ($(this).html().includes(clientName)) { + $(this).html($(this).html() + '<br>mode: ' + mode); + break; + } + } + } + }); +</script> + {% endblock %} |