commit 3e426f8: [WebUI] Add uptime and version to servers table

moisseev moiseev at mezonplus.ru
Sun Aug 9 18:28:05 UTC 2020


Author: moisseev
Date: 2020-08-08 15:59:17 +0300
URL: https://github.com/rspamd/rspamd/commit/3e426f8515a7201a32b0810c9f85ef8d8a0fc3ab

[WebUI] Add uptime and version to servers table

---
 interface/index.html      | 2 ++
 interface/js/app/stats.js | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/interface/index.html b/interface/index.html
index a57033376..480fa79ad 100644
--- a/interface/index.html
+++ b/interface/index.html
@@ -114,6 +114,8 @@
 												<th>Server name</th>
 												<th>Host</th>
 												<th class="w-1">Status</th>
+												<th class="w-1">Uptime</th>
+												<th class="w-1">Version</th>
 												<th>Configuration ID</th>
 											</tr>
 										</thead>
diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js
index e2724af47..ebc37ef02 100644
--- a/interface/js/app/stats.js
+++ b/interface/js/app/stats.js
@@ -111,6 +111,8 @@ define(["jquery", "d3pie"],
             $.each(servers, function (key, val) {
                 var row_class = "danger";
                 var glyph_status = "fas fa-times";
+                var version = "???";
+                var uptime = "???";
                 var short_id = "???";
                 if (!("config_id" in val.data)) {
                     val.data.config_id = "";
@@ -118,6 +120,8 @@ define(["jquery", "d3pie"],
                 if (val.status) {
                     row_class = "success";
                     glyph_status = "fas fa-check";
+                    uptime = msToTime(val.data.uptime);
+                    version = val.data.version;
                     short_id = val.data.config_id.substring(0, 8);
                 }
 
@@ -126,6 +130,8 @@ define(["jquery", "d3pie"],
                 "<td>" + key + "</td>" +
                 "<td>" + val.host + "</td>" +
                 "<td class=\"text-center\"><span class=\"icon\"><i class=\"" + glyph_status + "\"></i></span></td>" +
+                '<td class="text-right">' + uptime + "</td>" +
+                "<td>" + version + "</td>" +
                 "<td>" + short_id + "</td></tr>");
 
                 $("#selSrv").append($("<option value=\"" + key + "\">" + key + "</option>"));


More information about the Commits mailing list