templates: show oglive in client pills

Add oglive to each client pill in action/oglive using js.
This makes easier to have a global perspective of the client's
configuration.
master
Alejandro Sirgo Rica 2024-06-17 09:27:54 +02:00
parent c26b96e0b0
commit a637a958b0
1 changed files with 19 additions and 0 deletions

View File

@ -48,4 +48,23 @@
button_map={'ok': 'primary'},
extra_classes="m-5") }}
<!-- jQuery -->
<script src="{{ url_for('static', filename='AdminLTE/plugins/jquery/jquery.min.js') }}"></script>
<script>
var ogLivesSet = {{ oglives_set|tojson|safe }};
// Update pill data
$('.badge-pill').each(function(index) {
for (const ogLive in ogLivesSet) {
for (const clientName of ogLivesSet[ogLive]) {
if ($(this).html().includes(clientName)) {
$(this).html($(this).html() + '<br>' + ogLive);
break;
}
}
}
});
</script>
{% endblock %}