summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-06 15:18:53 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-07 14:35:41 +0200
commit26785aa88b52b813ccb83e12316b6ce65e423362 (patch)
treebdcbd320611320c312773aa36ab36810487c616d /ogcp/templates
parentb0858a7a62845eb7beda0df369a0d6d7145e9d5f (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.html18
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 %}