summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-07-02 18:00:42 +0200
committerSimon Rettberg2019-07-02 18:00:42 +0200
commit0fc5f7cf03bab91c6591d730550998a8d962f148 (patch)
treec21f6d473451973aaddd1d4916104c0c82289b11
parentFix export of serverCount via data2.json (diff)
downloaddnbd3-status-0fc5f7cf03bab91c6591d730550998a8d962f148.tar.gz
dnbd3-status-0fc5f7cf03bab91c6591d730550998a8d962f148.tar.xz
dnbd3-status-0fc5f7cf03bab91c6591d730550998a8d962f148.zip
Fix client/server count
-rw-r--r--src/main/java/org/openslx/dnbd3/status/StatisticsGenerator.java4
-rw-r--r--static/table.html2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/dnbd3/status/StatisticsGenerator.java b/src/main/java/org/openslx/dnbd3/status/StatisticsGenerator.java
index ba0440c..c9e50e4 100644
--- a/src/main/java/org/openslx/dnbd3/status/StatisticsGenerator.java
+++ b/src/main/java/org/openslx/dnbd3/status/StatisticsGenerator.java
@@ -104,6 +104,10 @@ public class StatisticsGenerator
srv = srv.clone();
srv.images = status.getImages();
srv.clients = status.getClients();
+ if (srv.clientCount == 0 && srv.serverCount == 0) {
+ // For older dnbd3-server
+ srv.clientCount = srv.clients.size();
+ }
newOutput.servers.add( srv );
}
newOutput.timestamp = output.timestamp = System.currentTimeMillis();
diff --git a/static/table.html b/static/table.html
index 84dc81d..5f1b074 100644
--- a/static/table.html
+++ b/static/table.html
@@ -115,7 +115,7 @@ var app = new Vue({
const servers = Object.values(this.serverMap)
servers.sort(this.compareObjectIps)
servers.forEach(server => {
- if (this.rawData.timestamp - server.timestamp > 6000) server.offline = true
+ server.offline = (this.rawData.timestamp - server.timestamp) > 6000
const clients = Object.values(server.clientMap)
if (this.peak) {
server.clients = clients.filter(client => client.peakUploadSpeed > 0)