From 7993ac00773c59dad12b392cec7fdf71b6838888 Mon Sep 17 00:00:00 2001 From: Nick Krecklow Date: Fri, 8 May 2020 01:25:38 -0500 Subject: [PATCH] do not append serverId in getPingHistory entries --- assets/js/app.js | 4 ++-- assets/js/socket.js | 4 ++-- config.json | 4 ++-- lib/servers.js | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 8458157..5804a20 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -102,13 +102,13 @@ export class App { .reduce((sum, current) => sum + current, 0) } - addServer = (pings, timestampPoints) => { + addServer = (serverId, pings, timestampPoints) => { // Even if the backend has never pinged the server, the frontend is promised a placeholder object. // result = undefined // error = defined with "Waiting" description // info = safely defined with configured data const latestPing = pings[pings.length - 1] - const serverRegistration = this.serverRegistry.createServerRegistration(latestPing.serverId) + const serverRegistration = this.serverRegistry.createServerRegistration(serverId) serverRegistration.initServerStatus(latestPing) diff --git a/assets/js/socket.js b/assets/js/socket.js index 5abd849..be79817 100644 --- a/assets/js/socket.js +++ b/assets/js/socket.js @@ -67,8 +67,8 @@ export class SocketManager { } } - payload.servers.forEach(server => { - this._app.addServer(server, payload.timestampPoints) + payload.servers.forEach((pings, serverId) => { + this._app.addServer(serverId, pings, payload.timestampPoints) }) if (payload.mojangServices) { diff --git a/config.json b/config.json index 6a4f90a..33ac9bf 100644 --- a/config.json +++ b/config.json @@ -10,8 +10,8 @@ "connectTimeout": 2500 }, "performance": { - "skipUnfurlSrv": false + "skipUnfurlSrv": true }, - "logToDatabase": false, + "logToDatabase": true, "graphDuration": 86400000 } diff --git a/lib/servers.js b/lib/servers.js index 64feaa2..d0ffd90 100644 --- a/lib/servers.js +++ b/lib/servers.js @@ -124,7 +124,6 @@ class ServerRegistration { const lastPing = this._pingHistory[this._pingHistory.length - 1] const payload = { - serverId: this.serverId, versions: this.versions, recordData: this.recordData, favicon: this.lastFavicon @@ -153,7 +152,6 @@ class ServerRegistration { } return [{ - serverId: this.serverId, error: { message: 'Waiting...', placeholder: true