From f10372b320ce5ce8403cee849b769ece6f9d4617 Mon Sep 17 00:00:00 2001 From: Hemna Date: Fri, 26 Mar 2021 11:13:32 -0400 Subject: [PATCH] Added acks with messages graphs --- aprsd/web/templates/index.html | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/aprsd/web/templates/index.html b/aprsd/web/templates/index.html index 68cc58b..aba197d 100644 --- a/aprsd/web/templates/index.html +++ b/aprsd/web/templates/index.html @@ -23,7 +23,8 @@ green: 'rgb(26, 181, 77)', blue: 'rgb(54, 162, 235)', purple: 'rgb(153, 102, 255)', - grey: 'rgb(201, 203, 207)' + grey: 'rgb(201, 203, 207)', + black: 'rgb(0, 0, 0)' }; function start_charts() { @@ -77,6 +78,16 @@ label: 'Messages Recieved', borderColor: window.chartColors.yellow, data: [], + }, + { + label: 'Ack Sent', + borderColor: window.chartColors.purple, + data: [], + }, + { + label: 'Ack Recieved', + borderColor: window.chartColors.black, + data: [], }], }, options: { @@ -116,6 +127,14 @@ chart.data.datasets[1].data.push(second); chart.update(); } + function updateQuadData(chart, label, first, second, third, fourth) { + chart.data.labels.push(label); + chart.data.datasets[0].data.push(first); + chart.data.datasets[1].data.push(second); + chart.data.datasets[2].data.push(third); + chart.data.datasets[3].data.push(fourth); + chart.update(); + } function update_stats( data ) { $("#version").text( data["version"] ); @@ -125,7 +144,7 @@ //$("#jsonstats").effect("highlight", {color: "#333333"}, 800); //console.log(data); updateDualData(memory_chart, data["time"], data["memory_peak"], data["memory_current"]); - updateDualData(message_chart, data["time"], data["stats"]["messages"]["sent"], data["stats"]["messages"]["recieved"]); + updateQuadData(message_chart, data["time"], data["stats"]["messages"]["sent"], data["stats"]["messages"]["recieved"], data["stats"]["messages"]["ack_sent"], data["stats"]["messages"]["ack_recieved"]); } function start_update() {