From 99ab72ec988ed0398cba282d661dee13658ab8cf Mon Sep 17 00:00:00 2001 From: Carlos <28845529+mesacarlos@users.noreply.github.com> Date: Sat, 17 Aug 2019 12:56:18 +0200 Subject: [PATCH] Minor patch --- client/index.html | 2 +- client/scripts/WebConsole.js | 2 +- src/com/mesacarlos/webconsole/command/RamUsageCommand.java | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/index.html b/client/index.html index be4c413..4ea3d6f 100644 --- a/client/index.html +++ b/client/index.html @@ -124,7 +124,7 @@
- +
diff --git a/client/scripts/WebConsole.js b/client/scripts/WebConsole.js index e7d9f7f..8f2adcd 100644 --- a/client/scripts/WebConsole.js +++ b/client/scripts/WebConsole.js @@ -85,7 +85,7 @@ function onWebSocketsMessage(message){ console.log(message); //Add interval for Players, CPU and RAM info, if not set - if(statusCommandsInterval == -1){ + if(statusCommandsInterval == -1 && message.status !== 401){ statusCommandsInterval = setInterval(function(){ connectionManager.askForInfo(); }, 2500); diff --git a/src/com/mesacarlos/webconsole/command/RamUsageCommand.java b/src/com/mesacarlos/webconsole/command/RamUsageCommand.java index 6b5cadf..f29fcd7 100644 --- a/src/com/mesacarlos/webconsole/command/RamUsageCommand.java +++ b/src/com/mesacarlos/webconsole/command/RamUsageCommand.java @@ -11,11 +11,12 @@ public class RamUsageCommand implements WSCommand { public void execute(WSServer wsServer, WebSocket conn, String params) { Runtime r = Runtime.getRuntime(); - int free = (int) r.freeMemory()/1024/1024; - int max = (int) r.maxMemory()/1024/1024; + int free = (int) r.freeMemory() / 1024 / 1024; + int max = (int) r.maxMemory() / 1024 / 1024; int used = max - free; - wsServer.sendToClient(conn, new RamUsage(free + " free, " + used + " used, " + max + " maximum memmory", free, used, max)); + wsServer.sendToClient(conn, + new RamUsage(free + " free, " + used + " used, " + max + " maximum memory", free, used, max)); } } \ No newline at end of file