From 0fc5f7cf03bab91c6591d730550998a8d962f148 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 2 Jul 2019 18:00:42 +0200 Subject: Fix client/server count --- src/main/java/org/openslx/dnbd3/status/StatisticsGenerator.java | 4 ++++ static/table.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3-55-g7522