Обновление веб-интерфейса

This commit is contained in:
2024-02-21 11:45:53 +03:00
parent 4043250ca5
commit 20b3cea0b0
7 changed files with 61 additions and 52 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ function InitStatisticsChart(labels, colors) {
return chart;
}
function InitStatistics() {
window.statistics = new Statistics();
function InitStatistics(url) {
window.statistics = new Statistics(url);
window.total_logs_amount = document.getElementById("total-logs-amount");
}
+5 -4
View File
@@ -1,6 +1,8 @@
class Statistics {
class Statistics extends ControllerBase {
// Конструктор
constructor() {
constructor(url) {
super(url, "statistics/get");
this.labels = [ "Аномальные", "Не аномальные" ];
this.colors = [ "#E96479", "#7DB9B6" ];
this.keys = [ "anomaly", "not anomaly" ];
@@ -20,11 +22,10 @@ class Statistics {
// Отправка запроса на сервер
SendRequest() {
var request = {};
request.command = 'statistics';
request.parameters = {};
let request_data = JSON.stringify(request);
socket.send(request_data);
super.SendRequestImpl(request_data);
}
// Обработка ответа от сервера