aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/app/stats.js
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2023-11-16 17:07:27 +0300
committermoisseev <moiseev@mezonplus.ru>2023-11-16 17:07:27 +0300
commit57dac6a925c55f79687fe82c8b5ac7a6e244b8f5 (patch)
treef29428bae5d1e2f9bf85b9b9715302244579fe5b /interface/js/app/stats.js
parent4bc813111e219f8473c9b97e096e5936534179dd (diff)
downloadrspamd-57dac6a925c55f79687fe82c8b5ac7a6e244b8f5.tar.gz
rspamd-57dac6a925c55f79687fe82c8b5ac7a6e244b8f5.zip
[WebUI] Load modules dynamically
Diffstat (limited to 'interface/js/app/stats.js')
-rw-r--r--interface/js/app/stats.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js
index d023f955e..f2460c816 100644
--- a/interface/js/app/stats.js
+++ b/interface/js/app/stats.js
@@ -22,10 +22,8 @@
THE SOFTWARE.
*/
-/* global d3 */
-
-define(["jquery", "d3pie"],
- function ($, D3Pie) {
+define(["jquery", "app/rspamd", "d3pie", "d3"],
+ function ($, rspamd, D3Pie, d3) {
"use strict";
// @ ms to date
function msToTime(seconds) {
@@ -222,7 +220,7 @@ define(["jquery", "d3pie"],
}
}
- function getChart(rspamd, graphs, checked_server) {
+ function getChart(graphs, checked_server) {
if (!graphs.chart) {
graphs.chart = new D3Pie("chart", {
labels: {
@@ -264,7 +262,7 @@ define(["jquery", "d3pie"],
// Public API
var ui = {
- statWidgets: function (rspamd, graphs, checked_server) {
+ statWidgets: function (graphs, checked_server) {
rspamd.query("stat", {
success: function (neighbours_status) {
var neighbours_sum = {
@@ -354,7 +352,7 @@ define(["jquery", "d3pie"],
to_Credentials["All SERVERS"].data = neighbours_sum;
sessionStorage.setItem("Credentials", JSON.stringify(to_Credentials));
displayStatWidgets(checked_server);
- getChart(rspamd, graphs, checked_server);
+ getChart(graphs, checked_server);
});
}, promises.length ? 100 : 0);
},