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.
master
Alejandro Sirgo Rica 2024-06-06 15:18:53 +02:00
parent b0858a7a62
commit 26785aa88b
1 changed files with 18 additions and 0 deletions

View File

@ -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 %}