Обновление веб-интерфейса
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
// Обработка ответа от сервера
|
||||
|
||||
Reference in New Issue
Block a user