From 1b7e91b87b306db4b15672c64360319992f5599f Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Fri, 12 Feb 2021 10:32:42 +0200 Subject: [PATCH] Made server calendar refreshable --- .../src/main/resources/assets/plan/web/js/server-values.js | 1 + Plan/common/src/main/resources/assets/plan/web/server.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Plan/common/src/main/resources/assets/plan/web/js/server-values.js b/Plan/common/src/main/resources/assets/plan/web/js/server-values.js index 94c9ceb7e..ba9902b66 100644 --- a/Plan/common/src/main/resources/assets/plan/web/js/server-values.js +++ b/Plan/common/src/main/resources/assets/plan/web/js/server-values.js @@ -553,6 +553,7 @@ function loadHourlyUniqueAndNewGraph(json, error) { function loadServerCalendar(json, error) { if (json) { document.getElementById('calendar').innerText = ''; + if (window.calendars.online_activity) window.calendars.online_activity.destroy(); onlineActivityCalendar('#calendar', json.data, json.firstDay); document.getElementById('online-calendar-tab').addEventListener('click', function () { // Wrapping this in a 0ms setTimeout waits for all other event handlers 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 713aea29b..cce3bea6e 100644 --- a/Plan/common/src/main/resources/assets/plan/web/server.html +++ b/Plan/common/src/main/resources/assets/plan/web/server.html @@ -1379,7 +1379,7 @@ refreshingJsonRequest("../v1/graph?type=geolocation&server=${serverUUID}", loadGeolocationGraph, 'geolocations'); refreshingJsonRequest("../v1/graph?type=uniqueAndNew&server=${serverUUID}", loadUniqueAndNewGraph, 'online-activity-overview'); refreshingJsonRequest("../v1/graph?type=hourlyUniqueAndNew&server=${serverUUID}", loadHourlyUniqueAndNewGraph, 'online-activity-overview'); - jsonRequest("../v1/graph?type=serverCalendar&server=${serverUUID}", loadServerCalendar, 'online-activity-overview'); + refreshingJsonRequest("../v1/graph?type=serverCalendar&server=${serverUUID}", loadServerCalendar, 'online-activity-overview', true); refreshingJsonRequest("../v1/graph?type=punchCard&server=${serverUUID}", loadPunchCard, 'online-activity-overview'); setLoadingText('Sorting players table..');