mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 19:47:49 +01:00
Made session overview update again on load
This commit is contained in:
parent
b8ec15e381
commit
c6817e0e28
@ -79,6 +79,18 @@ public class JSONFileStorage implements JSONStorage {
|
|||||||
jsonDirectory = files.getJSONStorageDirectory();
|
jsonDirectory = files.getJSONStorageDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for testing
|
||||||
|
JSONFileStorage(
|
||||||
|
PlanFiles files, Formatter<Long> dateFormatter, PluginLogger logger
|
||||||
|
) {
|
||||||
|
this.logger = logger;
|
||||||
|
debugLogger = logger.getDebugLogger();
|
||||||
|
|
||||||
|
this.dateFormatter = dateFormatter;
|
||||||
|
|
||||||
|
jsonDirectory = files.getJSONStorageDirectory();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StoredJSON storeJson(String identifier, String json, long timestamp) {
|
public StoredJSON storeJson(String identifier, String json, long timestamp) {
|
||||||
Path writingTo = jsonDirectory.resolve(identifier + '-' + timestamp + JSON_FILE_EXTENSION);
|
Path writingTo = jsonDirectory.resolve(identifier + '-' + timestamp + JSON_FILE_EXTENSION);
|
||||||
|
@ -532,7 +532,12 @@
|
|||||||
<!-- Page Heading -->
|
<!-- Page Heading -->
|
||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· Sessions</h1>
|
· Sessions
|
||||||
|
<span class="refresh-element">
|
||||||
|
<i class="fa fa-fw fa-sync"></i> <span class="refresh-time"></span>
|
||||||
|
<span class="refresh-notice"><i class="fa fa-fw fa-cog fa-spin"></i> Updating..</span>
|
||||||
|
</span>
|
||||||
|
</h1>
|
||||||
${backButton}
|
${backButton}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1303,7 +1308,7 @@
|
|||||||
setLoadingText('Calculating values..');
|
setLoadingText('Calculating values..');
|
||||||
refreshingJsonRequest("../v1/serverOverview?server=${serverUUID}", loadserverOverviewValues, 'server-overview');
|
refreshingJsonRequest("../v1/serverOverview?server=${serverUUID}", loadserverOverviewValues, 'server-overview');
|
||||||
refreshingJsonRequest("../v1/onlineOverview?server=${serverUUID}", loadOnlineActivityOverviewValues, 'online-activity-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/playerVersus?server=${serverUUID}", loadPvPPvEValues);
|
||||||
jsonRequest("../v1/playerbaseOverview?server=${serverUUID}", loadPlayerbaseOverviewValues);
|
jsonRequest("../v1/playerbaseOverview?server=${serverUUID}", loadPlayerbaseOverviewValues);
|
||||||
jsonRequest("../v1/performanceOverview?server=${serverUUID}", loadPerformanceValues);
|
jsonRequest("../v1/performanceOverview?server=${serverUUID}", loadPerformanceValues);
|
||||||
|
@ -49,7 +49,7 @@ class JSONStorageTest {
|
|||||||
this.tempDir = tempDir;
|
this.tempDir = tempDir;
|
||||||
when(files.getJSONStorageDirectory()).thenReturn(this.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<File> findTheFile() {
|
private Optional<File> findTheFile() {
|
||||||
|
Loading…
Reference in New Issue
Block a user