Made server calendar refreshable

This commit is contained in:
Risto Lahtela 2021-02-12 10:32:42 +02:00
parent 1118b80f61
commit 1b7e91b87b
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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..');