Added messages count to admin messages list.

This patch adds a simple count of packets shown in the
messages list on the admin ui.
This commit is contained in:
Hemna 2021-07-14 10:29:12 -04:00
parent ccaab72124
commit 5afc7fb664
2 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,8 @@ window.chartColors = {
black: 'rgb(0, 0, 0)'
};
function size_dict(d){c=0; for (i in d) ++c; return c}
function start_charts() {
Chart.scaleService.updateScaleDefaults('linear', {
ticks: {
@ -221,6 +223,10 @@ function update_packets( data ) {
$('.ui.accordion').accordion('refresh');
// Update the count of messages shown
cnt = size_dict(packet_list);
console.log("packets list " + cnt)
$('#packets_count').html(cnt);
const html_pretty = Prism.highlight(JSON.stringify(data, null, '\t'), Prism.languages.json, 'json');
$("#packetsjson").html(html_pretty);

View File

@ -80,7 +80,7 @@
</div>
<div class="ui tab" data-tab="msgs-tab">
<h3>Messages</h3>
<h3>Messages (<span id="packets_count">0</span>)</h3>
<div class="ui styled fluid accordion" id="accordion">
<div id="packetsDiv">
</div>