diff --git a/Plan/common/src/main/java/com/djrapitops/plan/storage/json/JSONFileStorage.java b/Plan/common/src/main/java/com/djrapitops/plan/storage/json/JSONFileStorage.java index cd3e15eeb..41c655bee 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/storage/json/JSONFileStorage.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/storage/json/JSONFileStorage.java @@ -79,6 +79,18 @@ public class JSONFileStorage implements JSONStorage { jsonDirectory = files.getJSONStorageDirectory(); } + // for testing + JSONFileStorage( + PlanFiles files, Formatter dateFormatter, PluginLogger logger + ) { + this.logger = logger; + debugLogger = logger.getDebugLogger(); + + this.dateFormatter = dateFormatter; + + jsonDirectory = files.getJSONStorageDirectory(); + } + @Override public StoredJSON storeJson(String identifier, String json, long timestamp) { Path writingTo = jsonDirectory.resolve(identifier + '-' + timestamp + JSON_FILE_EXTENSION); diff --git a/Plan/common/src/main/resources/assets/plan/web/server.html b/Plan/common/src/main/resources/assets/plan/web/server.html index 4620c57ae..a86599046 100644 --- a/Plan/common/src/main/resources/assets/plan/web/server.html +++ b/Plan/common/src/main/resources/assets/plan/web/server.html @@ -532,7 +532,12 @@

${serverDisplayName} - · Sessions

+ · Sessions + + + Updating.. + + ${backButton}
@@ -1303,7 +1308,7 @@ setLoadingText('Calculating values..'); refreshingJsonRequest("../v1/serverOverview?server=${serverUUID}", loadserverOverviewValues, 'server-overview'); refreshingJsonRequest("../v1/onlineOverview?server=${serverUUID}", loadOnlineActivityOverviewValues, 'online-activity-overview'); - jsonRequest("../v1/sessionsOverview?server=${serverUUID}", loadSessionValues); + refreshingJsonRequest("../v1/sessionsOverview?server=${serverUUID}", loadSessionValues, 'sessions-overview'); jsonRequest("../v1/playerVersus?server=${serverUUID}", loadPvPPvEValues); jsonRequest("../v1/playerbaseOverview?server=${serverUUID}", loadPlayerbaseOverviewValues); jsonRequest("../v1/performanceOverview?server=${serverUUID}", loadPerformanceValues); diff --git a/Plan/common/src/test/java/com/djrapitops/plan/storage/json/JSONStorageTest.java b/Plan/common/src/test/java/com/djrapitops/plan/storage/json/JSONStorageTest.java index 2d0cec4f7..4f6bbdcd5 100644 --- a/Plan/common/src/test/java/com/djrapitops/plan/storage/json/JSONStorageTest.java +++ b/Plan/common/src/test/java/com/djrapitops/plan/storage/json/JSONStorageTest.java @@ -49,7 +49,7 @@ class JSONStorageTest { this.tempDir = tempDir; when(files.getJSONStorageDirectory()).thenReturn(this.tempDir); - UNDER_TEST = new JSONFileStorage(files, new TestPluginLogger()); + UNDER_TEST = new JSONFileStorage(files, value -> Long.toString(value), new TestPluginLogger()); } private Optional findTheFile() {