]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Add uptime and version to servers table
authormoisseev <moiseev@mezonplus.ru>
Sat, 8 Aug 2020 12:59:17 +0000 (15:59 +0300)
committermoisseev <moiseev@mezonplus.ru>
Sat, 8 Aug 2020 12:59:17 +0000 (15:59 +0300)
interface/index.html
interface/js/app/stats.js

index a57033376f08798c21aca57d4e382f3e393f69b1..480fa79ad7ba34b5a80d95b83181e03ed48dd86c 100644 (file)
                                                                                                <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>
index e2724af4756009bae535a350792e0b31071a0c33..ebc37ef02ac2f953e42a20f44729924735f4b564 100644 (file)
@@ -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>"));