mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-10 05:39:19 +01:00
Disk-based cache feature (#1755)
Merges disk-based cache feature. Affects issues: - Close #1459 - Fixed #1606 Also contains styling for player datatables Affects issues: - Fixed #1615
This commit is contained in:
commit
8334b7b696
@ -19,8 +19,6 @@ package com.djrapitops.plan.gathering.listeners.bukkit;
|
||||
import com.djrapitops.plan.delivery.domain.Nickname;
|
||||
import com.djrapitops.plan.delivery.domain.keys.SessionKeys;
|
||||
import com.djrapitops.plan.delivery.export.Exporter;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.extension.CallEvents;
|
||||
import com.djrapitops.plan.extension.ExtensionSvc;
|
||||
import com.djrapitops.plan.gathering.cache.NicknameCache;
|
||||
@ -152,8 +150,6 @@ public class PlayerOnlineListener implements Listener {
|
||||
UUID playerUUID = player.getUniqueId();
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
long time = System.currentTimeMillis();
|
||||
JSONCache.invalidate(DataID.SERVER_OVERVIEW, serverUUID);
|
||||
JSONCache.invalidate(DataID.GRAPH_PERFORMANCE, serverUUID);
|
||||
|
||||
BukkitAFKListener.AFK_TRACKER.performedAction(playerUUID, time);
|
||||
|
||||
@ -215,9 +211,6 @@ public class PlayerOnlineListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
String playerName = player.getName();
|
||||
UUID playerUUID = player.getUniqueId();
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
JSONCache.invalidate(DataID.SERVER_OVERVIEW, serverUUID);
|
||||
JSONCache.invalidate(DataID.GRAPH_PERFORMANCE, serverUUID);
|
||||
|
||||
BukkitAFKListener.AFK_TRACKER.loggedOut(playerUUID, time);
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.djrapitops.plan.modules.bukkit;
|
||||
|
||||
import com.djrapitops.plan.TaskSystem;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONFileStorage;
|
||||
import com.djrapitops.plan.extension.ExtensionServerDataUpdater;
|
||||
import com.djrapitops.plan.gathering.ShutdownHook;
|
||||
import com.djrapitops.plan.gathering.timed.BukkitPingCounter;
|
||||
@ -58,10 +58,6 @@ public interface BukkitTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindDBCleanTask(DBCleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONCacheCleanTask(JSONCache.CleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindRamAndCpuTask(SystemUsageBuffer.RamAndCpuTask ramAndCpuTask);
|
||||
@ -74,4 +70,8 @@ public interface BukkitTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindShutdownHookRegistration(ShutdownHook.Registrar registrar);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONFileStorageCleanTask(JSONFileStorage.CleanTask cleanTask);
|
||||
|
||||
}
|
||||
|
@ -18,8 +18,6 @@ package com.djrapitops.plan.gathering.listeners.bungee;
|
||||
|
||||
import com.djrapitops.plan.delivery.domain.keys.SessionKeys;
|
||||
import com.djrapitops.plan.delivery.export.Exporter;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.extension.CallEvents;
|
||||
import com.djrapitops.plan.extension.ExtensionSvc;
|
||||
import com.djrapitops.plan.gathering.cache.SessionCache;
|
||||
@ -122,12 +120,6 @@ public class PlayerOnlineListener implements Listener {
|
||||
if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {
|
||||
processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));
|
||||
}
|
||||
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
JSONCache.invalidateMatching(DataID.SERVER_OVERVIEW);
|
||||
JSONCache.invalidate(DataID.GRAPH_ONLINE, serverUUID);
|
||||
JSONCache.invalidate(DataID.SERVERS);
|
||||
JSONCache.invalidate(DataID.SESSIONS);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
@ -156,23 +148,6 @@ public class PlayerOnlineListener implements Listener {
|
||||
if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {
|
||||
processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));
|
||||
}
|
||||
processing.submit(() -> {
|
||||
JSONCache.invalidateMatching(
|
||||
DataID.SERVER_OVERVIEW,
|
||||
DataID.SESSIONS,
|
||||
DataID.GRAPH_WORLD_PIE,
|
||||
DataID.GRAPH_PUNCHCARD,
|
||||
DataID.KILLS,
|
||||
DataID.ONLINE_OVERVIEW,
|
||||
DataID.SESSIONS_OVERVIEW,
|
||||
DataID.PVP_PVE,
|
||||
DataID.GRAPH_UNIQUE_NEW,
|
||||
DataID.GRAPH_CALENDAR
|
||||
);
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
JSONCache.invalidate(DataID.GRAPH_ONLINE, serverUUID);
|
||||
JSONCache.invalidate(DataID.SERVERS);
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@ -198,7 +173,5 @@ public class PlayerOnlineListener implements Listener {
|
||||
if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {
|
||||
processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));
|
||||
}
|
||||
|
||||
JSONCache.invalidate(DataID.SERVERS);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.djrapitops.plan.modules.bungee;
|
||||
|
||||
import com.djrapitops.plan.TaskSystem;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONFileStorage;
|
||||
import com.djrapitops.plan.extension.ExtensionServerDataUpdater;
|
||||
import com.djrapitops.plan.gathering.timed.BungeePingCounter;
|
||||
import com.djrapitops.plan.gathering.timed.ProxyTPSCounter;
|
||||
@ -56,10 +56,6 @@ public interface BungeeTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindDBCleanTask(DBCleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONCacheCleanTask(JSONCache.CleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindRamAndCpuTask(SystemUsageBuffer.RamAndCpuTask ramAndCpuTask);
|
||||
@ -68,4 +64,7 @@ public interface BungeeTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindDiskTask(SystemUsageBuffer.DiskTask diskTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONFileStorageCleanTask(JSONFileStorage.CleanTask cleanTask);
|
||||
}
|
||||
|
@ -30,5 +30,6 @@ public class DebugChannels {
|
||||
public static final String IMPORTING = "Importing";
|
||||
public static final String SQL = "SQL";
|
||||
public static final String DATA_EXTENSIONS = "DataExtensions";
|
||||
public static final String JSON_CACHE = "JSON Cache";
|
||||
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ public class NetworkPageExporter extends FileExporter {
|
||||
"network/playerbaseOverview",
|
||||
"graph?type=playersOnline&server=" + serverUUID,
|
||||
"graph?type=uniqueAndNew",
|
||||
"graph?type=hourlyUniqueAndNew",
|
||||
"graph?type=serverPie",
|
||||
"graph?type=activity",
|
||||
"graph?type=geolocation",
|
||||
@ -171,8 +172,8 @@ public class NetworkPageExporter extends FileExporter {
|
||||
"./css/style.css",
|
||||
"./vendor/jquery/jquery.min.js",
|
||||
"./vendor/bootstrap/js/bootstrap.bundle.min.js",
|
||||
"./vendor/datatables/jquery.dataTables.min.js",
|
||||
"./vendor/datatables/dataTables.bootstrap4.min.js",
|
||||
"./vendor/datatables/datatables.min.js",
|
||||
"./vendor/datatables/datatables.min.css",
|
||||
"./vendor/highcharts/highstock.js",
|
||||
"./vendor/highcharts/map.js",
|
||||
"./vendor/highcharts/world.js",
|
||||
@ -192,6 +193,7 @@ public class NetworkPageExporter extends FileExporter {
|
||||
"./vendor/fontawesome-free/webfonts/fa-solid-900.ttf",
|
||||
"./vendor/fontawesome-free/webfonts/fa-solid-900.woff",
|
||||
"./vendor/fontawesome-free/webfonts/fa-solid-900.woff2",
|
||||
"./js/domUtils.js",
|
||||
"./js/sb-admin-2.js",
|
||||
"./js/xmlhttprequests.js",
|
||||
"./js/color-selector.js",
|
||||
|
@ -145,8 +145,8 @@ public class PlayerPageExporter extends FileExporter {
|
||||
"../css/style.css",
|
||||
"../vendor/jquery/jquery.min.js",
|
||||
"../vendor/bootstrap/js/bootstrap.bundle.min.js",
|
||||
"../vendor/datatables/jquery.dataTables.min.js",
|
||||
"../vendor/datatables/dataTables.bootstrap4.min.js",
|
||||
"../vendor/datatables/datatables.min.js",
|
||||
"../vendor/datatables/datatables.min.css",
|
||||
"../vendor/highcharts/highstock.js",
|
||||
"../vendor/highcharts/map.js",
|
||||
"../vendor/highcharts/world.js",
|
||||
|
@ -132,8 +132,8 @@ public class PlayersPageExporter extends FileExporter {
|
||||
"css/style.css",
|
||||
"vendor/jquery/jquery.min.js",
|
||||
"vendor/bootstrap/js/bootstrap.bundle.min.js",
|
||||
"vendor/datatables/jquery.dataTables.min.js",
|
||||
"vendor/datatables/dataTables.bootstrap4.min.js",
|
||||
"vendor/datatables/datatables.min.js",
|
||||
"vendor/datatables/datatables.min.css",
|
||||
"vendor/fontawesome-free/css/all.min.css",
|
||||
"vendor/fontawesome-free/webfonts/fa-brands-400.eot",
|
||||
"vendor/fontawesome-free/webfonts/fa-brands-400.ttf",
|
||||
|
@ -126,12 +126,13 @@ public class ServerPageExporter extends FileExporter {
|
||||
"playerVersus?server=" + serverUUID,
|
||||
"playerbaseOverview?server=" + serverUUID,
|
||||
"performanceOverview?server=" + serverUUID,
|
||||
"graph?type=performance&server=" + serverUUID,
|
||||
"graph?type=optimizedPerformance&server=" + serverUUID,
|
||||
"graph?type=aggregatedPing&server=" + serverUUID,
|
||||
"graph?type=worldPie&server=" + serverUUID,
|
||||
"graph?type=activity&server=" + serverUUID,
|
||||
"graph?type=geolocation&server=" + serverUUID,
|
||||
"graph?type=uniqueAndNew&server=" + serverUUID,
|
||||
"graph?type=hourlyUniqueAndNew&server=" + serverUUID,
|
||||
"graph?type=serverCalendar&server=" + serverUUID,
|
||||
"graph?type=punchCard&server=" + serverUUID,
|
||||
"players?server=" + serverUUID,
|
||||
@ -187,8 +188,8 @@ public class ServerPageExporter extends FileExporter {
|
||||
"../css/style.css",
|
||||
"../vendor/jquery/jquery.min.js",
|
||||
"../vendor/bootstrap/js/bootstrap.bundle.min.js",
|
||||
"../vendor/datatables/jquery.dataTables.min.js",
|
||||
"../vendor/datatables/dataTables.bootstrap4.min.js",
|
||||
"../vendor/datatables/datatables.min.js",
|
||||
"../vendor/datatables/datatables.min.css",
|
||||
"../vendor/highcharts/highstock.js",
|
||||
"../vendor/highcharts/map.js",
|
||||
"../vendor/highcharts/world.js",
|
||||
@ -211,6 +212,7 @@ public class ServerPageExporter extends FileExporter {
|
||||
"../vendor/fontawesome-free/webfonts/fa-solid-900.ttf",
|
||||
"../vendor/fontawesome-free/webfonts/fa-solid-900.woff",
|
||||
"../vendor/fontawesome-free/webfonts/fa-solid-900.woff2",
|
||||
"../js/domUtils.js",
|
||||
"../js/sb-admin-2.js",
|
||||
"../js/xmlhttprequests.js",
|
||||
"../js/color-selector.js",
|
||||
|
@ -44,6 +44,7 @@ import com.djrapitops.plan.storage.database.queries.objects.*;
|
||||
import com.djrapitops.plan.storage.database.queries.objects.playertable.NetworkTablePlayersQuery;
|
||||
import com.djrapitops.plan.storage.database.queries.objects.playertable.ServerTablePlayersQuery;
|
||||
import com.djrapitops.plan.utilities.comparators.SessionStartComparator;
|
||||
import com.djrapitops.plan.utilities.java.Maps;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
@ -222,14 +223,18 @@ public class JSONFactory {
|
||||
return servers;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> pingPerGeolocation(UUID serverUUID) {
|
||||
public Map<String, Object> pingPerGeolocation(UUID serverUUID) {
|
||||
Map<String, Ping> pingByGeolocation = dbSystem.getDatabase().query(PingQueries.fetchPingDataOfServerByGeolocation(serverUUID));
|
||||
return turnToTableEntries(pingByGeolocation);
|
||||
return Maps.builder(String.class, Object.class)
|
||||
.put("table", turnToTableEntries(pingByGeolocation))
|
||||
.build();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> pingPerGeolocation() {
|
||||
public Map<String, Object> pingPerGeolocation() {
|
||||
Map<String, Ping> pingByGeolocation = dbSystem.getDatabase().query(PingQueries.fetchPingDataOfNetworkByGeolocation());
|
||||
return turnToTableEntries(pingByGeolocation);
|
||||
return Maps.builder(String.class, Object.class)
|
||||
.put("table", turnToTableEntries(pingByGeolocation))
|
||||
.build();
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> turnToTableEntries(Map<String, Ping> pingByGeolocation) {
|
||||
@ -238,12 +243,12 @@ public class JSONFactory {
|
||||
String geolocation = entry.getKey();
|
||||
Ping ping = entry.getValue();
|
||||
|
||||
Map<String, Object> tableEntry = new HashMap<>();
|
||||
tableEntry.put("country", geolocation);
|
||||
tableEntry.put("avg_ping", formatters.decimals().apply(ping.getAverage()) + " ms");
|
||||
tableEntry.put("min_ping", ping.getMin() + " ms");
|
||||
tableEntry.put("max_ping", ping.getMax() + " ms");
|
||||
tableEntries.add(tableEntry);
|
||||
tableEntries.add(Maps.builder(String.class, Object.class)
|
||||
.put("country", geolocation)
|
||||
.put("avg_ping", formatters.decimals().apply(ping.getAverage()) + " ms")
|
||||
.put("min_ping", ping.getMin() + " ms")
|
||||
.put("max_ping", ping.getMax() + " ms")
|
||||
.build());
|
||||
}
|
||||
return tableEntries;
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import com.djrapitops.plan.delivery.rendering.html.Contributors;
|
||||
import com.djrapitops.plan.delivery.rendering.html.Html;
|
||||
import com.djrapitops.plan.delivery.rendering.html.icon.Icon;
|
||||
import com.djrapitops.plan.delivery.rendering.html.structure.TabsElement;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.gathering.cache.SessionCache;
|
||||
import com.djrapitops.plan.gathering.domain.Session;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
@ -119,7 +118,6 @@ public class DebugPage implements Page {
|
||||
private String createCacheContent() {
|
||||
StringBuilder content = new StringBuilder();
|
||||
appendResourceCache(content);
|
||||
appendJSONCache(content);
|
||||
appendSessionCache(content);
|
||||
return content.toString();
|
||||
}
|
||||
@ -140,22 +138,6 @@ public class DebugPage implements Page {
|
||||
}
|
||||
}
|
||||
|
||||
private void appendJSONCache(StringBuilder content) {
|
||||
try {
|
||||
content.append("<pre>### Cached JSON:<br><br>");
|
||||
List<String> cacheKeys = JSONCache.getCachedIDs();
|
||||
if (cacheKeys.isEmpty()) {
|
||||
content.append("Empty");
|
||||
}
|
||||
for (String cacheKey : cacheKeys) {
|
||||
content.append("- ").append(cacheKey).append("<br>");
|
||||
}
|
||||
content.append("</pre>");
|
||||
} catch (Exception e) {
|
||||
errorLogger.log(L.WARN, e, ErrorContext.builder().related("/debug page access, JSON cache").build());
|
||||
}
|
||||
}
|
||||
|
||||
private void appendSessionCache(StringBuilder content) {
|
||||
try {
|
||||
content.append("<pre>### Session Cache:<br><br>");
|
||||
|
@ -21,12 +21,13 @@ import com.djrapitops.plan.delivery.formatting.Formatters;
|
||||
import com.djrapitops.plan.delivery.formatting.PlaceholderReplacer;
|
||||
import com.djrapitops.plan.delivery.rendering.html.Contributors;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.extension.implementation.results.ExtensionData;
|
||||
import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerDataQuery;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.config.paths.ProxySettings;
|
||||
import com.djrapitops.plan.settings.config.paths.WebserverSettings;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
import com.djrapitops.plan.settings.theme.Theme;
|
||||
import com.djrapitops.plan.settings.theme.ThemeVal;
|
||||
@ -53,6 +54,7 @@ public class NetworkPage implements Page {
|
||||
private final Theme theme;
|
||||
private final Locale locale;
|
||||
private final ServerInfo serverInfo;
|
||||
private final JSONStorage jsonStorage;
|
||||
private final Formatters formatters;
|
||||
|
||||
NetworkPage(
|
||||
@ -64,6 +66,7 @@ public class NetworkPage implements Page {
|
||||
Theme theme,
|
||||
Locale locale,
|
||||
ServerInfo serverInfo,
|
||||
JSONStorage jsonStorage,
|
||||
Formatters formatters
|
||||
) {
|
||||
this.templateHtml = templateHtml;
|
||||
@ -73,6 +76,7 @@ public class NetworkPage implements Page {
|
||||
this.theme = theme;
|
||||
this.locale = locale;
|
||||
this.serverInfo = serverInfo;
|
||||
this.jsonStorage = jsonStorage;
|
||||
this.formatters = formatters;
|
||||
}
|
||||
|
||||
@ -84,6 +88,7 @@ public class NetworkPage implements Page {
|
||||
placeholders.put("networkDisplayName", config.get(ProxySettings.NETWORK_NAME));
|
||||
placeholders.put("serverName", config.get(ProxySettings.NETWORK_NAME));
|
||||
placeholders.put("serverUUID", serverUUID.toString());
|
||||
placeholders.put("refreshBarrier", config.get(WebserverSettings.REDUCED_REFRESH_BARRIER));
|
||||
|
||||
placeholders.put("gmPieColors", theme.getValue(ThemeVal.GRAPH_GM_PIE));
|
||||
placeholders.put("playersGraphColor", theme.getValue(ThemeVal.GRAPH_PLAYERS_ONLINE));
|
||||
@ -103,8 +108,17 @@ public class NetworkPage implements Page {
|
||||
return new ServerPluginTabs(extensionData, formatters);
|
||||
});
|
||||
|
||||
String nav = JSONCache.getOrCacheString(DataID.EXTENSION_NAV, serverUUID, () -> pluginTabs.get().getNav());
|
||||
String tabs = JSONCache.getOrCacheString(DataID.EXTENSION_TABS, serverUUID, () -> pluginTabs.get().getTabs());
|
||||
long after = System.currentTimeMillis() - config.get(WebserverSettings.REDUCED_REFRESH_BARRIER);
|
||||
String navIdentifier = DataID.EXTENSION_NAV.of(serverUUID);
|
||||
String tabIdentifier = DataID.EXTENSION_TABS.of(serverUUID);
|
||||
String nav = jsonStorage.fetchJsonMadeAfter(navIdentifier, after).orElseGet(() -> {
|
||||
jsonStorage.invalidateOlder(navIdentifier, after);
|
||||
return jsonStorage.storeJson(navIdentifier, pluginTabs.get().getNav());
|
||||
}).json;
|
||||
String tabs = jsonStorage.fetchJsonMadeAfter(tabIdentifier, after).orElseGet(() -> {
|
||||
jsonStorage.invalidateOlder(tabIdentifier, after);
|
||||
return jsonStorage.storeJson(tabIdentifier, pluginTabs.get().getTabs());
|
||||
}).json;
|
||||
|
||||
PlaceholderReplacer pluginPlaceholders = new PlaceholderReplacer();
|
||||
pluginPlaceholders.put("networkDisplayName", config.get(ProxySettings.NETWORK_NAME));
|
||||
|
@ -21,6 +21,7 @@ import com.djrapitops.plan.delivery.formatting.Formatters;
|
||||
import com.djrapitops.plan.delivery.rendering.html.icon.Icon;
|
||||
import com.djrapitops.plan.delivery.web.ResourceService;
|
||||
import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.extension.implementation.results.ExtensionData;
|
||||
import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionPlayerDataQuery;
|
||||
import com.djrapitops.plan.identification.Server;
|
||||
@ -60,6 +61,7 @@ public class PageFactory {
|
||||
private final Lazy<Theme> theme;
|
||||
private final Lazy<DBSystem> dbSystem;
|
||||
private final Lazy<ServerInfo> serverInfo;
|
||||
private final Lazy<JSONStorage> jsonStorage;
|
||||
private final Lazy<Formatters> formatters;
|
||||
private final Lazy<DebugLogger> debugLogger;
|
||||
private final Lazy<Timings> timings;
|
||||
@ -74,6 +76,7 @@ public class PageFactory {
|
||||
Lazy<Theme> theme,
|
||||
Lazy<DBSystem> dbSystem,
|
||||
Lazy<ServerInfo> serverInfo,
|
||||
Lazy<JSONStorage> jsonStorage,
|
||||
Lazy<Formatters> formatters,
|
||||
Lazy<DebugLogger> debugLogger,
|
||||
Lazy<Timings> timings,
|
||||
@ -86,6 +89,7 @@ public class PageFactory {
|
||||
this.theme = theme;
|
||||
this.dbSystem = dbSystem;
|
||||
this.serverInfo = serverInfo;
|
||||
this.jsonStorage = jsonStorage;
|
||||
this.formatters = formatters;
|
||||
this.debugLogger = debugLogger;
|
||||
this.timings = timings;
|
||||
@ -125,6 +129,7 @@ public class PageFactory {
|
||||
versionChecker.get(),
|
||||
dbSystem.get(),
|
||||
serverInfo.get(),
|
||||
jsonStorage.get(),
|
||||
formatters.get()
|
||||
);
|
||||
}
|
||||
@ -178,7 +183,9 @@ public class PageFactory {
|
||||
dbSystem.get(),
|
||||
versionChecker.get(),
|
||||
config.get(), theme.get(), locale.get(),
|
||||
serverInfo.get(), formatters.get());
|
||||
serverInfo.get(),
|
||||
jsonStorage.get(),
|
||||
formatters.get());
|
||||
}
|
||||
|
||||
public Page internalErrorPage(String message, Throwable error) {
|
||||
|
@ -22,6 +22,7 @@ import com.djrapitops.plan.identification.ServerInfo;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.config.paths.PluginSettings;
|
||||
import com.djrapitops.plan.settings.config.paths.ProxySettings;
|
||||
import com.djrapitops.plan.settings.config.paths.WebserverSettings;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
import com.djrapitops.plan.settings.theme.Theme;
|
||||
import com.djrapitops.plan.version.VersionChecker;
|
||||
@ -60,6 +61,7 @@ public class PlayersPage implements Page {
|
||||
public String toHtml() {
|
||||
PlaceholderReplacer placeholders = new PlaceholderReplacer();
|
||||
|
||||
placeholders.put("refreshBarrier", config.get(WebserverSettings.REDUCED_REFRESH_BARRIER));
|
||||
placeholders.put("version", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
|
||||
placeholders.put("updateModal", versionChecker.getUpdateModal());
|
||||
placeholders.put("contributors", Contributors.generateContributorHtml());
|
||||
|
@ -22,12 +22,13 @@ import com.djrapitops.plan.delivery.formatting.PlaceholderReplacer;
|
||||
import com.djrapitops.plan.delivery.rendering.html.Contributors;
|
||||
import com.djrapitops.plan.delivery.rendering.html.Html;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.extension.implementation.results.ExtensionData;
|
||||
import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerDataQuery;
|
||||
import com.djrapitops.plan.identification.Server;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.config.paths.WebserverSettings;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
import com.djrapitops.plan.settings.theme.Theme;
|
||||
import com.djrapitops.plan.settings.theme.ThemeVal;
|
||||
@ -53,6 +54,7 @@ public class ServerPage implements Page {
|
||||
private final VersionChecker versionChecker;
|
||||
private final DBSystem dbSystem;
|
||||
private final ServerInfo serverInfo;
|
||||
private final JSONStorage jsonStorage;
|
||||
private final Formatters formatters;
|
||||
|
||||
ServerPage(
|
||||
@ -63,6 +65,7 @@ public class ServerPage implements Page {
|
||||
VersionChecker versionChecker,
|
||||
DBSystem dbSystem,
|
||||
ServerInfo serverInfo,
|
||||
JSONStorage jsonStorage,
|
||||
Formatters formatters
|
||||
) {
|
||||
this.templateHtml = templateHtml;
|
||||
@ -73,6 +76,7 @@ public class ServerPage implements Page {
|
||||
this.versionChecker = versionChecker;
|
||||
this.dbSystem = dbSystem;
|
||||
this.serverInfo = serverInfo;
|
||||
this.jsonStorage = jsonStorage;
|
||||
this.formatters = formatters;
|
||||
}
|
||||
|
||||
@ -84,6 +88,7 @@ public class ServerPage implements Page {
|
||||
placeholders.put("serverUUID", serverUUID.toString());
|
||||
placeholders.put("serverName", server.getIdentifiableName());
|
||||
placeholders.put("serverDisplayName", server.getName());
|
||||
placeholders.put("refreshBarrier", config.get(WebserverSettings.REDUCED_REFRESH_BARRIER));
|
||||
|
||||
placeholders.put("timeZone", config.getTimeZoneOffsetHours());
|
||||
placeholders.put("gmPieColors", theme.getValue(ThemeVal.GRAPH_GM_PIE));
|
||||
@ -97,8 +102,17 @@ public class ServerPage implements Page {
|
||||
return new ServerPluginTabs(extensionData, formatters);
|
||||
});
|
||||
|
||||
String nav = JSONCache.getOrCacheString(DataID.EXTENSION_NAV, serverUUID, () -> pluginTabs.get().getNav());
|
||||
String tabs = JSONCache.getOrCacheString(DataID.EXTENSION_TABS, serverUUID, () -> pluginTabs.get().getTabs());
|
||||
long after = System.currentTimeMillis() - config.get(WebserverSettings.REDUCED_REFRESH_BARRIER);
|
||||
String navIdentifier = DataID.EXTENSION_NAV.of(serverUUID);
|
||||
String tabIdentifier = DataID.EXTENSION_TABS.of(serverUUID);
|
||||
String nav = jsonStorage.fetchJsonMadeAfter(navIdentifier, after).orElseGet(() -> {
|
||||
jsonStorage.invalidateOlder(navIdentifier, after);
|
||||
return jsonStorage.storeJson(navIdentifier, pluginTabs.get().getNav());
|
||||
}).json;
|
||||
String tabs = jsonStorage.fetchJsonMadeAfter(tabIdentifier, after).orElseGet(() -> {
|
||||
jsonStorage.invalidateOlder(tabIdentifier, after);
|
||||
return jsonStorage.storeJson(tabIdentifier, pluginTabs.get().getTabs());
|
||||
}).json;
|
||||
|
||||
PlaceholderReplacer pluginPlaceholders = new PlaceholderReplacer();
|
||||
pluginPlaceholders.put("serverUUID", serverUUID.toString());
|
||||
|
@ -89,7 +89,7 @@ public class ServerPluginTabs {
|
||||
if (serverData.isEmpty()) {
|
||||
nav = new StringBuilder(NavLink.main(Icon.called("cubes").build(), tabID, "Overview (No Data)").toHtml());
|
||||
tab = wrapInWideColumnTab(
|
||||
"overview", "<div class=\"card\"><div class=\"card-body\"><p>No Extension Data</p></div></div>"
|
||||
"Overview", "<div class=\"card\"><div class=\"card-body\"><p>No Extension Data</p></div></div>"
|
||||
);
|
||||
} else {
|
||||
nav = new StringBuilder(NavLink.main(Icon.called("cubes").build(), tabID, "Overview").toHtml());
|
||||
|
@ -54,7 +54,7 @@ import java.util.regex.Pattern;
|
||||
public class ResponseResolver {
|
||||
|
||||
private final DebugPageResolver debugPageResolver;
|
||||
private QueryPageResolver queryPageResolver;
|
||||
private final QueryPageResolver queryPageResolver;
|
||||
private final PlayersPageResolver playersPageResolver;
|
||||
private final PlayerPageResolver playerPageResolver;
|
||||
private final ServerPageResolver serverPageResolver;
|
||||
|
@ -18,7 +18,6 @@ package com.djrapitops.plan.delivery.webserver;
|
||||
|
||||
import com.djrapitops.plan.SubSystem;
|
||||
import com.djrapitops.plan.delivery.web.ResourceService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
@ -63,8 +62,6 @@ public class WebServerSystem implements SubSystem {
|
||||
@Override
|
||||
public void disable() {
|
||||
webServer.disable();
|
||||
JSONCache.invalidateAll();
|
||||
JSONCache.cleanUp();
|
||||
}
|
||||
|
||||
public WebServer getWebServer() {
|
||||
|
152
Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/cache/AsyncJSONResolverService.java
vendored
Normal file
152
Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/cache/AsyncJSONResolverService.java
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
/*
|
||||
* This file is part of Player Analytics (Plan).
|
||||
*
|
||||
* Plan is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License v3 as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Plan is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.webserver.cache;
|
||||
|
||||
import com.djrapitops.plan.processing.Processing;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.config.paths.WebserverSettings;
|
||||
import com.djrapitops.plan.utilities.UnitSemaphoreAccessLock;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Service for resolving json asynchronously in order to move database queries off server thread.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class AsyncJSONResolverService {
|
||||
|
||||
private final PlanConfig config;
|
||||
private final Processing processing;
|
||||
private final JSONStorage jsonStorage;
|
||||
private final Map<String, Future<JSONStorage.StoredJSON>> currentlyProcessing;
|
||||
private final Map<String, Long> previousUpdates;
|
||||
private final UnitSemaphoreAccessLock accessLock; // Access lock prevents double processing same resource
|
||||
|
||||
@Inject
|
||||
public AsyncJSONResolverService(
|
||||
PlanConfig config,
|
||||
Processing processing,
|
||||
JSONStorage jsonStorage
|
||||
) {
|
||||
this.config = config;
|
||||
this.processing = processing;
|
||||
this.jsonStorage = jsonStorage;
|
||||
|
||||
currentlyProcessing = new ConcurrentHashMap<>();
|
||||
previousUpdates = new ConcurrentHashMap<>();
|
||||
accessLock = new UnitSemaphoreAccessLock();
|
||||
}
|
||||
|
||||
public <T> JSONStorage.StoredJSON resolve(
|
||||
long newerThanTimestamp, DataID dataID, UUID serverUUID, Function<UUID, T> creator
|
||||
) {
|
||||
String identifier = dataID.of(serverUUID);
|
||||
Supplier<T> jsonCreator = () -> creator.apply(serverUUID);
|
||||
return getStoredOrCreateJSON(newerThanTimestamp, identifier, jsonCreator);
|
||||
}
|
||||
|
||||
|
||||
public <T> JSONStorage.StoredJSON resolve(
|
||||
long newerThanTimestamp, DataID dataID, Supplier<T> jsonCreator
|
||||
) {
|
||||
String identifier = dataID.name();
|
||||
return getStoredOrCreateJSON(newerThanTimestamp, identifier, jsonCreator);
|
||||
}
|
||||
|
||||
private <T> JSONStorage.StoredJSON getStoredOrCreateJSON(
|
||||
long timestamp, String identifier, Supplier<T> jsonCreator
|
||||
) {
|
||||
JSONStorage.StoredJSON storedJSON = getNewFromCache(timestamp, identifier);
|
||||
if (storedJSON != null) return storedJSON;
|
||||
|
||||
// No new enough version, let's refresh and send old version of the file
|
||||
Future<JSONStorage.StoredJSON> updatedJSON = scheduleJSONForUpdate(timestamp, identifier, jsonCreator);
|
||||
|
||||
storedJSON = getOldFromCache(timestamp, identifier);
|
||||
if (storedJSON != null) {
|
||||
return storedJSON;
|
||||
} else {
|
||||
// Update not performed if the last update was recent and the file is deleted before next update
|
||||
// Fall back to waiting for the updated file if old version of the file doesn't exist.
|
||||
if (updatedJSON == null) {
|
||||
updatedJSON = submitToProcessing(identifier, jsonCreator);
|
||||
}
|
||||
return waitAndGetUpdated(updatedJSON);
|
||||
}
|
||||
}
|
||||
|
||||
private JSONStorage.StoredJSON waitAndGetUpdated(Future<JSONStorage.StoredJSON> updatedJSON) {
|
||||
// If there is no version available, block thread until the new finishes being generated.
|
||||
try {
|
||||
return updatedJSON.get();
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
return null;
|
||||
} catch (ExecutionException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private JSONStorage.StoredJSON getOldFromCache(long newerThanTimestamp, String identifier) {
|
||||
return jsonStorage.fetchJsonMadeBefore(identifier, newerThanTimestamp).orElse(null);
|
||||
}
|
||||
|
||||
private JSONStorage.StoredJSON getNewFromCache(long newerThanTimestamp, String identifier) {
|
||||
return jsonStorage.fetchExactJson(identifier, newerThanTimestamp)
|
||||
.orElseGet(() -> jsonStorage.fetchJsonMadeAfter(identifier, newerThanTimestamp)
|
||||
.orElse(null));
|
||||
}
|
||||
|
||||
private <T> Future<JSONStorage.StoredJSON> scheduleJSONForUpdate(long newerThanTimestamp, String identifier, Supplier<T> jsonCreator) {
|
||||
long updateThreshold = config.get(WebserverSettings.REDUCED_REFRESH_BARRIER);
|
||||
|
||||
Future<JSONStorage.StoredJSON> updatedJSON;
|
||||
accessLock.enter();
|
||||
try {
|
||||
// Check if the json is already being created
|
||||
updatedJSON = currentlyProcessing.get(identifier);
|
||||
if (updatedJSON == null && previousUpdates.getOrDefault(identifier, 0L) < newerThanTimestamp - updateThreshold) {
|
||||
// Submit a task to refresh the data if the json is old
|
||||
updatedJSON = submitToProcessing(identifier, jsonCreator);
|
||||
currentlyProcessing.put(identifier, updatedJSON);
|
||||
}
|
||||
} finally {
|
||||
accessLock.exit();
|
||||
}
|
||||
return updatedJSON;
|
||||
}
|
||||
|
||||
private <T> Future<JSONStorage.StoredJSON> submitToProcessing(String identifier, Supplier<T> jsonCreator) {
|
||||
return processing.submitNonCritical(() -> {
|
||||
JSONStorage.StoredJSON created = jsonStorage.storeJson(identifier, jsonCreator.get());
|
||||
currentlyProcessing.remove(identifier);
|
||||
jsonStorage.invalidateOlder(identifier, created.timestamp);
|
||||
previousUpdates.put(identifier, created.timestamp);
|
||||
return created;
|
||||
});
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ package com.djrapitops.plan.delivery.webserver.cache;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Enum for different JSON data entries that can be stored in {@link JSONCache}.
|
||||
* Enum for different JSON data entries that can be stored in cache.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
|
@ -1,165 +0,0 @@
|
||||
/*
|
||||
* This file is part of Player Analytics (Plan).
|
||||
*
|
||||
* Plan is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License v3 as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Plan is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.webserver.cache;
|
||||
|
||||
import com.djrapitops.plan.TaskSystem;
|
||||
import com.djrapitops.plan.delivery.web.resolver.MimeType;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Response;
|
||||
import com.djrapitops.plan.delivery.webserver.resolver.json.RootJSONResolver;
|
||||
import com.djrapitops.plan.storage.file.ResourceCache;
|
||||
import com.djrapitops.plugin.api.TimeAmount;
|
||||
import com.djrapitops.plugin.task.RunnableFactory;
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Cache for any JSON data sent via {@link RootJSONResolver}.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class JSONCache {
|
||||
|
||||
private static final Cache<String, byte[]> cache = Caffeine.newBuilder()
|
||||
.expireAfterAccess(2, TimeUnit.MINUTES)
|
||||
.build();
|
||||
|
||||
private JSONCache() {
|
||||
// Static class
|
||||
}
|
||||
|
||||
public static Response getOrCache(String identifier, Supplier<Response> jsonResponseSupplier) {
|
||||
byte[] found = cache.getIfPresent(identifier);
|
||||
if (found == null) {
|
||||
Response response = jsonResponseSupplier.get();
|
||||
cache.put(identifier, response.getBytes());
|
||||
return response;
|
||||
}
|
||||
return Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setContent(found)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static String getOrCacheString(DataID dataID, UUID serverUUID, Supplier<String> stringSupplier) {
|
||||
String identifier = dataID.of(serverUUID);
|
||||
byte[] found = cache.getIfPresent(identifier);
|
||||
if (found == null) {
|
||||
String result = stringSupplier.get();
|
||||
cache.put(identifier, result.getBytes(StandardCharsets.UTF_8));
|
||||
return result;
|
||||
}
|
||||
return new String(found, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public static <T> Response getOrCache(DataID dataID, Supplier<T> objectSupplier) {
|
||||
return getOrCache(dataID.name(), () -> Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setJSONContent(objectSupplier.get())
|
||||
.build());
|
||||
}
|
||||
|
||||
public static <T> Response getOrCache(DataID dataID, UUID serverUUID, Supplier<T> objectSupplier) {
|
||||
return getOrCache(dataID.of(serverUUID), () -> Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setJSONContent(objectSupplier.get())
|
||||
.build());
|
||||
}
|
||||
|
||||
public static void invalidate(String identifier) {
|
||||
cache.invalidate(identifier);
|
||||
}
|
||||
|
||||
public static void invalidate(DataID dataID) {
|
||||
invalidate(dataID.name());
|
||||
}
|
||||
|
||||
public static void invalidate(UUID serverUUID, DataID... dataIDs) {
|
||||
for (DataID dataID : dataIDs) {
|
||||
invalidate(dataID.of(serverUUID));
|
||||
}
|
||||
}
|
||||
|
||||
public static void invalidate(DataID dataID, UUID serverUUID) {
|
||||
invalidate(dataID.of(serverUUID));
|
||||
}
|
||||
|
||||
public static void invalidateMatching(DataID... dataIDs) {
|
||||
Set<String> toInvalidate = Arrays.stream(dataIDs)
|
||||
.map(DataID::name)
|
||||
.collect(Collectors.toSet());
|
||||
for (String identifier : cache.asMap().keySet()) {
|
||||
for (String identifierToInvalidate : toInvalidate) {
|
||||
if (StringUtils.startsWith(identifier, identifierToInvalidate)) {
|
||||
invalidate(identifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void invalidateMatching(DataID dataID) {
|
||||
String toInvalidate = dataID.name();
|
||||
for (String identifier : cache.asMap().keySet()) {
|
||||
if (StringUtils.startsWith(identifier, toInvalidate)) {
|
||||
invalidate(identifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void invalidateAll() {
|
||||
cache.invalidateAll();
|
||||
}
|
||||
|
||||
public static void cleanUp() {
|
||||
cache.cleanUp();
|
||||
}
|
||||
|
||||
public static List<String> getCachedIDs() {
|
||||
List<String> identifiers = new ArrayList<>(cache.asMap().keySet());
|
||||
Collections.sort(identifiers);
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
@Singleton
|
||||
public static class CleanTask extends TaskSystem.Task {
|
||||
|
||||
@Inject
|
||||
public CleanTask() {
|
||||
// Dagger requires inject constructor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
cleanUp();
|
||||
ResourceCache.cleanUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(RunnableFactory runnableFactory) {
|
||||
long minute = TimeAmount.toTicks(1, TimeUnit.MINUTES);
|
||||
runnableFactory.create(null, this).runTaskTimerAsynchronously(minute, minute);
|
||||
}
|
||||
}
|
||||
}
|
307
Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/cache/JSONFileStorage.java
vendored
Normal file
307
Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/cache/JSONFileStorage.java
vendored
Normal file
@ -0,0 +1,307 @@
|
||||
/*
|
||||
* This file is part of Player Analytics (Plan).
|
||||
*
|
||||
* Plan is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License v3 as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Plan is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.webserver.cache;
|
||||
|
||||
import com.djrapitops.plan.DebugChannels;
|
||||
import com.djrapitops.plan.TaskSystem;
|
||||
import com.djrapitops.plan.delivery.formatting.Formatter;
|
||||
import com.djrapitops.plan.delivery.formatting.Formatters;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.config.paths.WebserverSettings;
|
||||
import com.djrapitops.plan.storage.file.PlanFiles;
|
||||
import com.djrapitops.plugin.api.TimeAmount;
|
||||
import com.djrapitops.plugin.logging.console.PluginLogger;
|
||||
import com.djrapitops.plugin.logging.debug.DebugLogger;
|
||||
import com.djrapitops.plugin.task.RunnableFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* In charge of storing json files on disk for later retrieval.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class JSONFileStorage implements JSONStorage {
|
||||
|
||||
private final PluginLogger logger;
|
||||
|
||||
private final Path jsonDirectory;
|
||||
|
||||
private final Pattern timestampRegex = Pattern.compile(".*-([0-9]*).json");
|
||||
private static final String JSON_FILE_EXTENSION = ".json";
|
||||
private final DebugLogger debugLogger;
|
||||
|
||||
private final Formatter<Long> dateFormatter;
|
||||
|
||||
@Inject
|
||||
public JSONFileStorage(
|
||||
PlanFiles files,
|
||||
Formatters formatters,
|
||||
PluginLogger logger
|
||||
) {
|
||||
this.logger = logger;
|
||||
debugLogger = logger.getDebugLogger();
|
||||
|
||||
dateFormatter = formatters.yearLong();
|
||||
|
||||
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
|
||||
public StoredJSON storeJson(String identifier, String json, long timestamp) {
|
||||
Path writingTo = jsonDirectory.resolve(identifier + '-' + timestamp + JSON_FILE_EXTENSION);
|
||||
String jsonToWrite = addMissingTimestamp(json, timestamp);
|
||||
try {
|
||||
Files.createDirectories(jsonDirectory);
|
||||
Files.write(writingTo, jsonToWrite.getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE);
|
||||
} catch (IOException e) {
|
||||
logger.warn("Could not write a file to " + writingTo.toFile().getAbsolutePath() + ": " + e.getMessage());
|
||||
}
|
||||
return new StoredJSON(jsonToWrite, timestamp);
|
||||
}
|
||||
|
||||
private String addMissingTimestamp(String json, long timestamp) {
|
||||
String writtenJSON;
|
||||
if (!json.startsWith("{\"") || json.contains("timestamp")) {
|
||||
if (!json.contains("timestamp_f")) {
|
||||
writtenJSON = StringUtils.replaceOnce(json,
|
||||
"\"timestamp\"",
|
||||
"\"timestamp_f\":\"" + dateFormatter.apply(timestamp) + "\",\"timestamp\""
|
||||
);
|
||||
} else {
|
||||
writtenJSON = json;
|
||||
}
|
||||
} else {
|
||||
writtenJSON = "{\"timestamp\": " + timestamp +
|
||||
",\"timestamp_f\":\"" + dateFormatter.apply(timestamp) +
|
||||
"\",\"" + json.substring(2);
|
||||
}
|
||||
return writtenJSON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJSON(String identifier) {
|
||||
File[] stored = jsonDirectory.toFile().listFiles();
|
||||
if (stored == null) return Optional.empty();
|
||||
for (File file : stored) {
|
||||
String fileName = file.getName();
|
||||
if (fileName.endsWith(JSON_FILE_EXTENSION) && fileName.startsWith(identifier)) {
|
||||
return Optional.ofNullable(readStoredJSON(file));
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
private StoredJSON readStoredJSON(File from) {
|
||||
Matcher timestampMatch = timestampRegex.matcher(from.getName());
|
||||
if (timestampMatch.find()) {
|
||||
try (Stream<String> lines = Files.lines(from.toPath())) {
|
||||
long timestamp = Long.parseLong(timestampMatch.group(1));
|
||||
StringBuilder json = new StringBuilder();
|
||||
lines.forEach(json::append);
|
||||
return new StoredJSON(json.toString(), timestamp);
|
||||
} catch (IOException e) {
|
||||
logger.warn(jsonDirectory.toFile().getAbsolutePath() + " file '" + from.getName() + "' could not be read: " + e.getMessage());
|
||||
} catch (NumberFormatException e) {
|
||||
logger.warn(jsonDirectory.toFile().getAbsolutePath() + " contained a file '" + from.getName() + "' with improperly formatted -timestamp (could not parse number). This file was not placed there by Plan!");
|
||||
}
|
||||
} else {
|
||||
logger.warn(jsonDirectory.toFile().getAbsolutePath() + " contained a file '" + from.getName() + "' that has no -timestamp. This file was not placed there by Plan!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchExactJson(String identifier, long timestamp) {
|
||||
File found = jsonDirectory.resolve(identifier + "-" + timestamp + JSON_FILE_EXTENSION).toFile();
|
||||
if (!found.exists()) return Optional.empty();
|
||||
return Optional.ofNullable(readStoredJSON(found));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJsonMadeBefore(String identifier, long timestamp) {
|
||||
return fetchJSONWithTimestamp(identifier, timestamp, (timestampMatch, time) -> Long.parseLong(timestampMatch.group(1)) < time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJsonMadeAfter(String identifier, long timestamp) {
|
||||
return fetchJSONWithTimestamp(identifier, timestamp, (timestampMatch, time) -> Long.parseLong(timestampMatch.group(1)) > time);
|
||||
}
|
||||
|
||||
private Optional<StoredJSON> fetchJSONWithTimestamp(String identifier, long timestamp, BiPredicate<Matcher, Long> timestampComparator) {
|
||||
File[] stored = jsonDirectory.toFile().listFiles();
|
||||
if (stored == null) return Optional.empty();
|
||||
for (File file : stored) {
|
||||
try {
|
||||
String fileName = file.getName();
|
||||
if (fileName.endsWith(JSON_FILE_EXTENSION) && fileName.startsWith(identifier)) {
|
||||
Matcher timestampMatch = timestampRegex.matcher(fileName);
|
||||
if (timestampMatch.find() && timestampComparator.test(timestampMatch, timestamp)) {
|
||||
return Optional.ofNullable(readStoredJSON(file));
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// Ignore this file, malformed timestamp
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateOlder(String identifier, long timestamp) {
|
||||
File[] stored = jsonDirectory.toFile().listFiles();
|
||||
if (stored == null) return;
|
||||
|
||||
List<File> toDelete = new ArrayList<>();
|
||||
for (File file : stored) {
|
||||
if (shouldDeleteFile(identifier, timestamp, file)) {
|
||||
toDelete.add(file);
|
||||
}
|
||||
}
|
||||
deleteFiles(toDelete);
|
||||
}
|
||||
|
||||
private boolean shouldDeleteFile(String identifier, long timestamp, File file) {
|
||||
try {
|
||||
String fileName = file.getName();
|
||||
if (fileName.endsWith(JSON_FILE_EXTENSION) && fileName.startsWith(identifier)) {
|
||||
Matcher timestampMatch = timestampRegex.matcher(fileName);
|
||||
if (timestampMatch.find() && Long.parseLong(timestampMatch.group(1)) < timestamp) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// Ignore this file, malformed timestamp
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void invalidateOlderButIgnore(long timestamp, String... ignoredIdentifiers) {
|
||||
File[] stored = jsonDirectory.toFile().listFiles();
|
||||
if (stored == null) return;
|
||||
|
||||
List<File> toDelete = new ArrayList<>();
|
||||
for (File file : stored) {
|
||||
if (shouldDeleteFile(timestamp, file, ignoredIdentifiers)) {
|
||||
toDelete.add(file);
|
||||
}
|
||||
}
|
||||
|
||||
deleteFiles(toDelete);
|
||||
}
|
||||
|
||||
private boolean shouldDeleteFile(long timestamp, File file, String[] ignoredIdentifiers) {
|
||||
try {
|
||||
String fileName = file.getName();
|
||||
if (fileName.endsWith(JSON_FILE_EXTENSION)) {
|
||||
Matcher timestampMatch = timestampRegex.matcher(fileName);
|
||||
boolean isOlder = timestampMatch.find() && Long.parseLong(timestampMatch.group(1)) < timestamp;
|
||||
if (isOlder) {
|
||||
for (String ignoredIdentifier : ignoredIdentifiers) {
|
||||
if (fileName.startsWith(ignoredIdentifier)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// Ignore this file, malformed timestamp
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void deleteFiles(List<File> toDelete) {
|
||||
for (File fileToDelete : toDelete) {
|
||||
try {
|
||||
debugLogger.logOn(DebugChannels.JSON_CACHE, "Deleting " + fileToDelete.getAbsolutePath());
|
||||
Files.delete(fileToDelete.toPath());
|
||||
} catch (IOException e) {
|
||||
// Failed to delete, set for deletion on next server shutdown.
|
||||
fileToDelete.deleteOnExit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Singleton
|
||||
public static class CleanTask extends TaskSystem.Task {
|
||||
private final PlanConfig config;
|
||||
private final JSONFileStorage jsonFileStorage;
|
||||
private final DebugLogger debugLogger;
|
||||
|
||||
@Inject
|
||||
public CleanTask(
|
||||
PlanConfig config,
|
||||
JSONFileStorage jsonFileStorage,
|
||||
DebugLogger debugLogger
|
||||
) {
|
||||
this.config = config;
|
||||
this.jsonFileStorage = jsonFileStorage;
|
||||
this.debugLogger = debugLogger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(RunnableFactory runnableFactory) {
|
||||
long delay = TimeAmount.toTicks(ThreadLocalRandom.current().nextInt(60), TimeUnit.SECONDS);
|
||||
long period = TimeAmount.toTicks(1, TimeUnit.HOURS);
|
||||
runnableFactory.create(null, this).runTaskTimerAsynchronously(delay, period);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long now = System.currentTimeMillis();
|
||||
long invalidateDiskCacheAfterMs = config.get(WebserverSettings.INVALIDATE_DISK_CACHE);
|
||||
long invalidateQueriesAfterMs = config.get(WebserverSettings.INVALIDATE_QUERY_RESULTS);
|
||||
debugLogger.logOn(DebugChannels.JSON_CACHE, "Running clean task..");
|
||||
|
||||
jsonFileStorage.invalidateOlder("query", now - invalidateQueriesAfterMs);
|
||||
jsonFileStorage.invalidateOlderButIgnore(now - invalidateDiskCacheAfterMs, "query");
|
||||
}
|
||||
|
||||
public DebugLogger getDebugLogger() {
|
||||
return debugLogger;
|
||||
}
|
||||
}
|
||||
}
|
140
Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/cache/JSONMemoryStorageShim.java
vendored
Normal file
140
Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/cache/JSONMemoryStorageShim.java
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* This file is part of Player Analytics (Plan).
|
||||
*
|
||||
* Plan is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License v3 as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Plan is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.webserver.cache;
|
||||
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.config.paths.WebserverSettings;
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class JSONMemoryStorageShim implements JSONStorage {
|
||||
|
||||
private final PlanConfig config;
|
||||
private final JSONStorage underlyingStorage;
|
||||
|
||||
private Cache<TimestampedIdentifier, StoredJSON> cache;
|
||||
|
||||
public JSONMemoryStorageShim(
|
||||
PlanConfig config,
|
||||
JSONStorage underlyingStorage
|
||||
) {
|
||||
this.config = config;
|
||||
this.underlyingStorage = underlyingStorage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enable() {
|
||||
cache = Caffeine.newBuilder()
|
||||
.expireAfterWrite(config.get(WebserverSettings.INVALIDATE_MEMORY_CACHE), TimeUnit.MILLISECONDS)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoredJSON storeJson(String identifier, String json, long timestamp) {
|
||||
StoredJSON storedJSON = underlyingStorage.storeJson(identifier, json, timestamp);
|
||||
cache.put(new TimestampedIdentifier(identifier, timestamp), storedJSON);
|
||||
return storedJSON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJSON(String identifier) {
|
||||
for (Map.Entry<TimestampedIdentifier, StoredJSON> entry : cache.asMap().entrySet()) {
|
||||
if (entry.getKey().identifier.equalsIgnoreCase(identifier)) {
|
||||
return Optional.of(entry.getValue());
|
||||
}
|
||||
}
|
||||
Optional<StoredJSON> found = underlyingStorage.fetchJSON(identifier);
|
||||
found.ifPresent(storedJSON -> cache.put(new TimestampedIdentifier(identifier, storedJSON.timestamp), storedJSON));
|
||||
return found;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchExactJson(String identifier, long timestamp) {
|
||||
StoredJSON cached = cache.getIfPresent(new TimestampedIdentifier(identifier, timestamp));
|
||||
if (cached != null) return Optional.of(cached);
|
||||
|
||||
Optional<StoredJSON> found = underlyingStorage.fetchExactJson(identifier, timestamp);
|
||||
found.ifPresent(storedJSON -> cache.put(new TimestampedIdentifier(identifier, timestamp), storedJSON));
|
||||
return found;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJsonMadeBefore(String identifier, long timestamp) {
|
||||
for (Map.Entry<TimestampedIdentifier, StoredJSON> entry : cache.asMap().entrySet()) {
|
||||
TimestampedIdentifier key = entry.getKey();
|
||||
if (key.timestamp < timestamp && key.identifier.equalsIgnoreCase(identifier)) {
|
||||
return Optional.of(entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
Optional<StoredJSON> found = underlyingStorage.fetchJsonMadeBefore(identifier, timestamp);
|
||||
found.ifPresent(storedJSON -> cache.put(new TimestampedIdentifier(identifier, storedJSON.timestamp), storedJSON));
|
||||
return found;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJsonMadeAfter(String identifier, long timestamp) {
|
||||
for (Map.Entry<TimestampedIdentifier, StoredJSON> entry : cache.asMap().entrySet()) {
|
||||
TimestampedIdentifier key = entry.getKey();
|
||||
if (key.timestamp > timestamp && key.identifier.equalsIgnoreCase(identifier)) {
|
||||
return Optional.of(entry.getValue());
|
||||
}
|
||||
}
|
||||
Optional<StoredJSON> found = underlyingStorage.fetchJsonMadeAfter(identifier, timestamp);
|
||||
found.ifPresent(storedJSON -> cache.put(new TimestampedIdentifier(identifier, storedJSON.timestamp), storedJSON));
|
||||
return found;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateOlder(String identifier, long timestamp) {
|
||||
Set<TimestampedIdentifier> toInvalidate = new HashSet<>();
|
||||
for (TimestampedIdentifier key : cache.asMap().keySet()) {
|
||||
if (key.timestamp < timestamp && key.identifier.equalsIgnoreCase(identifier)) {
|
||||
toInvalidate.add(key);
|
||||
}
|
||||
}
|
||||
toInvalidate.forEach(cache::invalidate);
|
||||
|
||||
underlyingStorage.invalidateOlder(identifier, timestamp);
|
||||
}
|
||||
|
||||
static class TimestampedIdentifier {
|
||||
private final String identifier;
|
||||
private final long timestamp;
|
||||
|
||||
public TimestampedIdentifier(String identifier, long timestamp) {
|
||||
this.identifier = identifier;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
TimestampedIdentifier that = (TimestampedIdentifier) o;
|
||||
return timestamp == that.timestamp && identifier.equals(that.identifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(identifier, timestamp);
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.storage.json;
|
||||
package com.djrapitops.plan.delivery.webserver.cache;
|
||||
|
||||
import com.djrapitops.plan.SubSystem;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.util.Objects;
|
||||
@ -26,19 +27,29 @@ import java.util.Optional;
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public interface JSONStorage {
|
||||
public interface JSONStorage extends SubSystem {
|
||||
|
||||
@Override
|
||||
default void enable() {
|
||||
}
|
||||
|
||||
@Override
|
||||
default void disable() {
|
||||
}
|
||||
|
||||
default StoredJSON storeJson(String identifier, String json) {
|
||||
return storeJson(identifier, json, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
default StoredJSON storeJson(String identifier, Object json) {
|
||||
if (json instanceof String) return storeJson(identifier, (String) json);
|
||||
return storeJson(identifier, new Gson().toJson(json));
|
||||
}
|
||||
|
||||
StoredJSON storeJson(String identifier, String json, long timestamp);
|
||||
|
||||
default StoredJSON storeJson(String identifier, Object json, long timestamp) {
|
||||
if (json instanceof String) return storeJson(identifier, (String) json, timestamp);
|
||||
return storeJson(identifier, new Gson().toJson(json), timestamp);
|
||||
}
|
||||
|
||||
@ -50,6 +61,8 @@ public interface JSONStorage {
|
||||
|
||||
Optional<StoredJSON> fetchJsonMadeAfter(String identifier, long timestamp);
|
||||
|
||||
void invalidateOlder(String identifier, long timestamp);
|
||||
|
||||
final class StoredJSON {
|
||||
public final String json;
|
||||
public final long timestamp;
|
@ -17,13 +17,15 @@
|
||||
package com.djrapitops.plan.delivery.webserver.resolver.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.graphs.GraphJSONCreator;
|
||||
import com.djrapitops.plan.delivery.web.resolver.MimeType;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Resolver;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Response;
|
||||
import com.djrapitops.plan.delivery.web.resolver.exception.BadRequestException;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.Request;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.WebUser;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.AsyncJSONResolverService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.identification.Identifiers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -41,14 +43,16 @@ import java.util.UUID;
|
||||
public class GraphsJSONResolver implements Resolver {
|
||||
|
||||
private final Identifiers identifiers;
|
||||
private final AsyncJSONResolverService jsonResolverService;
|
||||
private final GraphJSONCreator graphJSON;
|
||||
|
||||
@Inject
|
||||
public GraphsJSONResolver(
|
||||
Identifiers identifiers,
|
||||
GraphJSONCreator graphJSON
|
||||
AsyncJSONResolverService jsonResolverService, GraphJSONCreator graphJSON
|
||||
) {
|
||||
this.identifiers = identifiers;
|
||||
this.jsonResolverService = jsonResolverService;
|
||||
this.graphJSON = graphJSON;
|
||||
}
|
||||
|
||||
@ -76,12 +80,29 @@ public class GraphsJSONResolver implements Resolver {
|
||||
|
||||
DataID dataID = getDataID(type);
|
||||
|
||||
return Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setJSONContent(getGraphJSON(request, dataID).json)
|
||||
.build();
|
||||
}
|
||||
|
||||
private JSONStorage.StoredJSON getGraphJSON(Request request, DataID dataID) {
|
||||
long timestamp = Identifiers.getTimestamp(request);
|
||||
|
||||
JSONStorage.StoredJSON storedJSON;
|
||||
if (request.getQuery().get("server").isPresent()) {
|
||||
UUID serverUUID = identifiers.getServerUUID(request); // Can throw BadRequestException
|
||||
return JSONCache.getOrCache(dataID, serverUUID, () -> generateGraphDataJSONOfType(dataID, serverUUID));
|
||||
storedJSON = jsonResolverService.resolve(
|
||||
timestamp, dataID, serverUUID,
|
||||
theServerUUID -> generateGraphDataJSONOfType(dataID, theServerUUID)
|
||||
);
|
||||
} else {
|
||||
// Assume network
|
||||
storedJSON = jsonResolverService.resolve(
|
||||
timestamp, dataID, () -> generateGraphDataJSONOfType(dataID)
|
||||
);
|
||||
}
|
||||
// Assume network
|
||||
return JSONCache.getOrCache(dataID, () -> generateGraphDataJSONOfType(dataID));
|
||||
return storedJSON;
|
||||
}
|
||||
|
||||
private DataID getDataID(String type) {
|
||||
|
@ -22,6 +22,7 @@ import com.djrapitops.plan.delivery.rendering.json.network.NetworkPlayerBaseOver
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkSessionsOverviewJSONCreator;
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkTabJSONCreator;
|
||||
import com.djrapitops.plan.delivery.web.resolver.CompositeResolver;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.AsyncJSONResolverService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -35,15 +36,17 @@ import javax.inject.Singleton;
|
||||
@Singleton
|
||||
public class NetworkJSONResolver {
|
||||
|
||||
private final AsyncJSONResolverService asyncJSONResolverService;
|
||||
private final CompositeResolver resolver;
|
||||
|
||||
@Inject
|
||||
public NetworkJSONResolver(
|
||||
JSONFactory jsonFactory,
|
||||
AsyncJSONResolverService asyncJSONResolverService, JSONFactory jsonFactory,
|
||||
NetworkOverviewJSONCreator networkOverviewJSONCreator,
|
||||
NetworkPlayerBaseOverviewJSONCreator networkPlayerBaseOverviewJSONCreator,
|
||||
NetworkSessionsOverviewJSONCreator networkSessionsOverviewJSONCreator
|
||||
) {
|
||||
this.asyncJSONResolverService = asyncJSONResolverService;
|
||||
resolver = CompositeResolver.builder()
|
||||
.add("overview", forJSON(DataID.SERVER_OVERVIEW, networkOverviewJSONCreator))
|
||||
.add("playerbaseOverview", forJSON(DataID.PLAYERBASE_OVERVIEW, networkPlayerBaseOverviewJSONCreator))
|
||||
@ -54,7 +57,7 @@ public class NetworkJSONResolver {
|
||||
}
|
||||
|
||||
private <T> NetworkTabJSONResolver<T> forJSON(DataID dataID, NetworkTabJSONCreator<T> tabJSONCreator) {
|
||||
return new NetworkTabJSONResolver<>(dataID, tabJSONCreator);
|
||||
return new NetworkTabJSONResolver<>(dataID, tabJSONCreator, asyncJSONResolverService);
|
||||
}
|
||||
|
||||
public CompositeResolver getResolver() {
|
||||
|
@ -17,12 +17,14 @@
|
||||
package com.djrapitops.plan.delivery.webserver.resolver.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.network.NetworkTabJSONCreator;
|
||||
import com.djrapitops.plan.delivery.web.resolver.MimeType;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Resolver;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Response;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.Request;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.WebUser;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.AsyncJSONResolverService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.identification.Identifiers;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Supplier;
|
||||
@ -36,10 +38,15 @@ public class NetworkTabJSONResolver<T> implements Resolver {
|
||||
|
||||
private final DataID dataID;
|
||||
private final Supplier<T> jsonCreator;
|
||||
private final AsyncJSONResolverService asyncJSONResolverService;
|
||||
|
||||
public NetworkTabJSONResolver(DataID dataID, NetworkTabJSONCreator<T> jsonCreator) {
|
||||
public NetworkTabJSONResolver(
|
||||
DataID dataID, NetworkTabJSONCreator<T> jsonCreator,
|
||||
AsyncJSONResolverService asyncJSONResolverService
|
||||
) {
|
||||
this.dataID = dataID;
|
||||
this.jsonCreator = jsonCreator;
|
||||
this.asyncJSONResolverService = asyncJSONResolverService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,11 +56,13 @@ public class NetworkTabJSONResolver<T> implements Resolver {
|
||||
|
||||
@Override
|
||||
public Optional<Response> resolve(Request request) {
|
||||
return Optional.of(getResponse());
|
||||
return Optional.of(getResponse(request));
|
||||
}
|
||||
|
||||
private Response getResponse() {
|
||||
return JSONCache.getOrCache(dataID, jsonCreator);
|
||||
private Response getResponse(Request request) {
|
||||
return Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setJSONContent(asyncJSONResolverService.resolve(Identifiers.getTimestamp(request), dataID, jsonCreator).json)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
@ -17,12 +17,14 @@
|
||||
package com.djrapitops.plan.delivery.webserver.resolver.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.JSONFactory;
|
||||
import com.djrapitops.plan.delivery.web.resolver.MimeType;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Resolver;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Response;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.Request;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.WebUser;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.AsyncJSONResolverService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.identification.Identifiers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -40,14 +42,17 @@ import java.util.UUID;
|
||||
public class PlayerKillsJSONResolver implements Resolver {
|
||||
|
||||
private final Identifiers identifiers;
|
||||
private final AsyncJSONResolverService jsonResolverService;
|
||||
private final JSONFactory jsonFactory;
|
||||
|
||||
@Inject
|
||||
public PlayerKillsJSONResolver(
|
||||
Identifiers identifiers,
|
||||
AsyncJSONResolverService jsonResolverService,
|
||||
JSONFactory jsonFactory
|
||||
) {
|
||||
this.identifiers = identifiers;
|
||||
this.jsonResolverService = jsonResolverService;
|
||||
this.jsonFactory = jsonFactory;
|
||||
}
|
||||
|
||||
@ -63,6 +68,13 @@ public class PlayerKillsJSONResolver implements Resolver {
|
||||
|
||||
private Response getResponse(Request request) {
|
||||
UUID serverUUID = identifiers.getServerUUID(request);
|
||||
return JSONCache.getOrCache(DataID.KILLS, serverUUID, () -> Collections.singletonMap("player_kills", jsonFactory.serverPlayerKillsAsJSONMap(serverUUID)));
|
||||
long timestamp = Identifiers.getTimestamp(request);
|
||||
JSONStorage.StoredJSON storedJSON = jsonResolverService.resolve(timestamp, DataID.KILLS, serverUUID,
|
||||
theUUID -> Collections.singletonMap("player_kills", jsonFactory.serverPlayerKillsAsJSONMap(theUUID))
|
||||
);
|
||||
return Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setJSONContent(storedJSON.json)
|
||||
.build();
|
||||
}
|
||||
}
|
@ -17,12 +17,14 @@
|
||||
package com.djrapitops.plan.delivery.webserver.resolver.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.JSONFactory;
|
||||
import com.djrapitops.plan.delivery.web.resolver.MimeType;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Resolver;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Response;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.Request;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.WebUser;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.AsyncJSONResolverService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.identification.Identifiers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -39,14 +41,17 @@ import java.util.UUID;
|
||||
public class PlayersTableJSONResolver implements Resolver {
|
||||
|
||||
private final Identifiers identifiers;
|
||||
private final AsyncJSONResolverService jsonResolverService;
|
||||
private final JSONFactory jsonFactory;
|
||||
|
||||
@Inject
|
||||
public PlayersTableJSONResolver(
|
||||
Identifiers identifiers,
|
||||
AsyncJSONResolverService jsonResolverService,
|
||||
JSONFactory jsonFactory
|
||||
) {
|
||||
this.identifiers = identifiers;
|
||||
this.jsonResolverService = jsonResolverService;
|
||||
this.jsonFactory = jsonFactory;
|
||||
}
|
||||
|
||||
@ -66,11 +71,22 @@ public class PlayersTableJSONResolver implements Resolver {
|
||||
}
|
||||
|
||||
private Response getResponse(Request request) {
|
||||
return Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setJSONContent(getStoredJSON(request).json)
|
||||
.build();
|
||||
}
|
||||
|
||||
private JSONStorage.StoredJSON getStoredJSON(Request request) {
|
||||
long timestamp = Identifiers.getTimestamp(request);
|
||||
JSONStorage.StoredJSON storedJSON;
|
||||
if (request.getQuery().get("server").isPresent()) {
|
||||
UUID serverUUID = identifiers.getServerUUID(request); // Can throw BadRequestException
|
||||
return JSONCache.getOrCache(DataID.PLAYERS, serverUUID, () -> jsonFactory.serverPlayersTableJSON(serverUUID));
|
||||
storedJSON = jsonResolverService.resolve(timestamp, DataID.PLAYERS, serverUUID, jsonFactory::serverPlayersTableJSON);
|
||||
} else {
|
||||
// Assume players page
|
||||
storedJSON = jsonResolverService.resolve(timestamp, DataID.PLAYERS, jsonFactory::networkPlayersTableJSON);
|
||||
}
|
||||
// Assume players page
|
||||
return JSONCache.getOrCache(DataID.PLAYERS, jsonFactory::networkPlayersTableJSON);
|
||||
return storedJSON;
|
||||
}
|
||||
}
|
@ -27,6 +27,7 @@ import com.djrapitops.plan.delivery.web.resolver.Response;
|
||||
import com.djrapitops.plan.delivery.web.resolver.exception.BadRequestException;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.Request;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.WebUser;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionQueryResultTableDataQuery;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
@ -42,7 +43,6 @@ import com.djrapitops.plan.storage.database.queries.filter.SpecifiedFilterInform
|
||||
import com.djrapitops.plan.storage.database.queries.objects.GeoInfoQueries;
|
||||
import com.djrapitops.plan.storage.database.queries.objects.SessionQueries;
|
||||
import com.djrapitops.plan.storage.database.queries.objects.playertable.QueryTablePlayersQuery;
|
||||
import com.djrapitops.plan.storage.json.JSONStorage;
|
||||
import com.djrapitops.plan.utilities.java.Maps;
|
||||
import com.djrapitops.plugin.api.TimeAmount;
|
||||
import com.google.gson.Gson;
|
||||
|
@ -18,6 +18,7 @@ package com.djrapitops.plan.delivery.webserver.resolver.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.*;
|
||||
import com.djrapitops.plan.delivery.web.resolver.CompositeResolver;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.AsyncJSONResolverService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.identification.Identifiers;
|
||||
|
||||
@ -33,11 +34,13 @@ import javax.inject.Singleton;
|
||||
public class RootJSONResolver {
|
||||
|
||||
private final Identifiers identifiers;
|
||||
private final AsyncJSONResolverService asyncJSONResolverService;
|
||||
private final CompositeResolver resolver;
|
||||
|
||||
@Inject
|
||||
public RootJSONResolver(
|
||||
Identifiers identifiers,
|
||||
AsyncJSONResolverService asyncJSONResolverService,
|
||||
JSONFactory jsonFactory,
|
||||
|
||||
GraphsJSONResolver graphsJSONResolver,
|
||||
@ -57,6 +60,7 @@ public class RootJSONResolver {
|
||||
QueryJSONResolver queryJSONResolver
|
||||
) {
|
||||
this.identifiers = identifiers;
|
||||
this.asyncJSONResolverService = asyncJSONResolverService;
|
||||
|
||||
resolver = CompositeResolver.builder()
|
||||
.add("players", playersTableJSONResolver)
|
||||
@ -78,7 +82,7 @@ public class RootJSONResolver {
|
||||
}
|
||||
|
||||
private <T> ServerTabJSONResolver<T> forJSON(DataID dataID, ServerTabJSONCreator<T> tabJSONCreator) {
|
||||
return new ServerTabJSONResolver<>(dataID, identifiers, tabJSONCreator);
|
||||
return new ServerTabJSONResolver<>(dataID, identifiers, tabJSONCreator, asyncJSONResolverService);
|
||||
}
|
||||
|
||||
public CompositeResolver getResolver() {
|
||||
|
@ -17,12 +17,13 @@
|
||||
package com.djrapitops.plan.delivery.webserver.resolver.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.ServerTabJSONCreator;
|
||||
import com.djrapitops.plan.delivery.web.resolver.MimeType;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Resolver;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Response;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.Request;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.WebUser;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.AsyncJSONResolverService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.identification.Identifiers;
|
||||
|
||||
import java.util.Optional;
|
||||
@ -39,15 +40,16 @@ public class ServerTabJSONResolver<T> implements Resolver {
|
||||
private final DataID dataID;
|
||||
private final Identifiers identifiers;
|
||||
private final Function<UUID, T> jsonCreator;
|
||||
private final AsyncJSONResolverService asyncJSONResolverService;
|
||||
|
||||
public ServerTabJSONResolver(
|
||||
DataID dataID,
|
||||
Identifiers identifiers,
|
||||
ServerTabJSONCreator<T> jsonCreator
|
||||
DataID dataID, Identifiers identifiers, ServerTabJSONCreator<T> jsonCreator,
|
||||
AsyncJSONResolverService asyncJSONResolverService
|
||||
) {
|
||||
this.dataID = dataID;
|
||||
this.identifiers = identifiers;
|
||||
this.jsonCreator = jsonCreator;
|
||||
this.asyncJSONResolverService = asyncJSONResolverService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -57,8 +59,14 @@ public class ServerTabJSONResolver<T> implements Resolver {
|
||||
|
||||
@Override
|
||||
public Optional<Response> resolve(Request request) {
|
||||
UUID serverUUID = identifiers.getServerUUID(request); // Can throw BadRequestException
|
||||
return Optional.of(JSONCache.getOrCache(dataID, serverUUID, () -> jsonCreator.apply(serverUUID)));
|
||||
return Optional.of(getResponse(request));
|
||||
}
|
||||
|
||||
private Response getResponse(Request request) {
|
||||
UUID serverUUID = identifiers.getServerUUID(request); // Can throw BadRequestException
|
||||
return Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setJSONContent(asyncJSONResolverService.resolve(Identifiers.getTimestamp(request), dataID, serverUUID, jsonCreator).json)
|
||||
.build();
|
||||
}
|
||||
}
|
@ -17,12 +17,14 @@
|
||||
package com.djrapitops.plan.delivery.webserver.resolver.json;
|
||||
|
||||
import com.djrapitops.plan.delivery.rendering.json.JSONFactory;
|
||||
import com.djrapitops.plan.delivery.web.resolver.MimeType;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Resolver;
|
||||
import com.djrapitops.plan.delivery.web.resolver.Response;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.Request;
|
||||
import com.djrapitops.plan.delivery.web.resolver.request.WebUser;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.AsyncJSONResolverService;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.identification.Identifiers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -40,14 +42,17 @@ import java.util.UUID;
|
||||
public class SessionsJSONResolver implements Resolver {
|
||||
|
||||
private final Identifiers identifiers;
|
||||
private final AsyncJSONResolverService jsonResolverService;
|
||||
private final JSONFactory jsonFactory;
|
||||
|
||||
@Inject
|
||||
public SessionsJSONResolver(
|
||||
Identifiers identifiers,
|
||||
AsyncJSONResolverService jsonResolverService,
|
||||
JSONFactory jsonFactory
|
||||
) {
|
||||
this.identifiers = identifiers;
|
||||
this.jsonResolverService = jsonResolverService;
|
||||
this.jsonFactory = jsonFactory;
|
||||
}
|
||||
|
||||
@ -62,11 +67,23 @@ public class SessionsJSONResolver implements Resolver {
|
||||
}
|
||||
|
||||
private Response getResponse(Request request) {
|
||||
return Response.builder()
|
||||
.setMimeType(MimeType.JSON)
|
||||
.setJSONContent(getStoredJSON(request).json)
|
||||
.build();
|
||||
}
|
||||
|
||||
private JSONStorage.StoredJSON getStoredJSON(Request request) {
|
||||
long timestamp = Identifiers.getTimestamp(request);
|
||||
if (request.getQuery().get("server").isPresent()) {
|
||||
UUID serverUUID = identifiers.getServerUUID(request);
|
||||
return JSONCache.getOrCache(DataID.SESSIONS, serverUUID, () -> Collections.singletonMap("sessions", jsonFactory.serverSessionsAsJSONMap(serverUUID)));
|
||||
return jsonResolverService.resolve(timestamp, DataID.SESSIONS, serverUUID,
|
||||
theUUID -> Collections.singletonMap("sessions", jsonFactory.serverSessionsAsJSONMap(theUUID))
|
||||
);
|
||||
}
|
||||
// Assume network
|
||||
return JSONCache.getOrCache(DataID.SESSIONS, () -> Collections.singletonMap("sessions", jsonFactory.networkSessionsAsJSONMap()));
|
||||
return jsonResolverService.resolve(timestamp, DataID.SESSIONS,
|
||||
() -> Collections.singletonMap("sessions", jsonFactory.networkSessionsAsJSONMap())
|
||||
);
|
||||
}
|
||||
}
|
@ -17,8 +17,6 @@
|
||||
package com.djrapitops.plan.extension;
|
||||
|
||||
import com.djrapitops.plan.DebugChannels;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.exceptions.DataExtensionMethodCallException;
|
||||
import com.djrapitops.plan.extension.implementation.CallerImplementation;
|
||||
import com.djrapitops.plan.extension.implementation.ExtensionRegister;
|
||||
@ -196,9 +194,6 @@ public class ExtensionSvc implements ExtensionService {
|
||||
for (ProviderValueGatherer gatherer : extensionGatherers.values()) {
|
||||
updateServerValues(gatherer, event);
|
||||
}
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
JSONCache.invalidate(DataID.EXTENSION_NAV, serverUUID);
|
||||
JSONCache.invalidate(DataID.EXTENSION_TABS, serverUUID);
|
||||
}
|
||||
|
||||
public void updateServerValues(ProviderValueGatherer gatherer, CallEvents event) {
|
||||
|
@ -18,6 +18,7 @@ package com.djrapitops.plan.gathering.cache;
|
||||
|
||||
import com.djrapitops.plan.SubSystem;
|
||||
import com.djrapitops.plan.commands.TabCompleteCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.gathering.geolocation.GeolocationCache;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -35,18 +36,21 @@ public class CacheSystem implements SubSystem {
|
||||
private final SessionCache sessionCache;
|
||||
private final NicknameCache nicknameCache;
|
||||
private final GeolocationCache geolocationCache;
|
||||
private final JSONStorage jsonStorage;
|
||||
|
||||
@Inject
|
||||
public CacheSystem(
|
||||
TabCompleteCache tabCompleteCache,
|
||||
SessionCache sessionCache,
|
||||
NicknameCache nicknameCache,
|
||||
GeolocationCache geolocationCache
|
||||
GeolocationCache geolocationCache,
|
||||
JSONStorage jsonStorage
|
||||
) {
|
||||
this.tabCompleteCache = tabCompleteCache;
|
||||
this.sessionCache = sessionCache;
|
||||
this.nicknameCache = nicknameCache;
|
||||
this.geolocationCache = geolocationCache;
|
||||
this.jsonStorage = jsonStorage;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -54,6 +58,7 @@ public class CacheSystem implements SubSystem {
|
||||
nicknameCache.enable();
|
||||
geolocationCache.enable();
|
||||
tabCompleteCache.enable();
|
||||
jsonStorage.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,6 +26,7 @@ import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Utility for getting server identifier from different sources.
|
||||
@ -103,4 +104,19 @@ public class Identifiers {
|
||||
public UUID getPlayerUUID(String name) {
|
||||
return uuidUtility.getUUIDOf(name);
|
||||
}
|
||||
|
||||
public static long getTimestamp(Request request) {
|
||||
try {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
long timestamp = request.getQuery().get("timestamp")
|
||||
.map(Long::parseLong)
|
||||
.orElse(currentTime);
|
||||
if (currentTime + TimeUnit.SECONDS.toMillis(10L) < timestamp) {
|
||||
throw new BadRequestException("Attempt to get data from the future! " + timestamp + " > " + currentTime);
|
||||
}
|
||||
return timestamp;
|
||||
} catch (NumberFormatException nonNumberTimestamp) {
|
||||
throw new BadRequestException("'timestamp' was not a number: " + nonNumberTimestamp.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -19,14 +19,15 @@ package com.djrapitops.plan.modules;
|
||||
import com.djrapitops.plan.DataService;
|
||||
import com.djrapitops.plan.DataSvc;
|
||||
import com.djrapitops.plan.PlanPlugin;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONFileStorage;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONMemoryStorageShim;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.gathering.importing.importers.Importer;
|
||||
import com.djrapitops.plan.settings.config.ExtensionSettings;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
import com.djrapitops.plan.settings.locale.LocaleSystem;
|
||||
import com.djrapitops.plan.storage.file.JarResource;
|
||||
import com.djrapitops.plan.storage.json.JSONFileStorage;
|
||||
import com.djrapitops.plan.storage.json.JSONStorage;
|
||||
import com.djrapitops.plan.utilities.logging.ErrorLogger;
|
||||
import com.djrapitops.plan.utilities.logging.PluginErrorLogger;
|
||||
import dagger.Module;
|
||||
@ -100,8 +101,11 @@ public class SystemObjectProvidingModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
JSONStorage provideJSONStorage(JSONFileStorage jsonFileStorage) {
|
||||
return jsonFileStorage;
|
||||
JSONStorage provideJSONStorage(
|
||||
PlanConfig config,
|
||||
JSONFileStorage jsonFileStorage
|
||||
) {
|
||||
return new JSONMemoryStorageShim(config, jsonFileStorage);
|
||||
}
|
||||
|
||||
}
|
@ -43,6 +43,11 @@ public class WebserverSettings {
|
||||
public static final Setting<Boolean> DISABLED_AUTHENTICATION = new BooleanSetting("Webserver.Security.Disable_authentication");
|
||||
public static final Setting<String> EXTERNAL_LINK = new StringSetting("Webserver.External_Webserver_address");
|
||||
|
||||
public static final Setting<Long> REDUCED_REFRESH_BARRIER = new TimeSetting("Webserver.Cache.Reduced_refresh_barrier");
|
||||
public static final Setting<Long> INVALIDATE_QUERY_RESULTS = new TimeSetting("Webserver.Cache.Invalidate_query_results_on_disk_after");
|
||||
public static final Setting<Long> INVALIDATE_DISK_CACHE = new TimeSetting("Webserver.Cache.Invalidate_disk_cache_after");
|
||||
public static final Setting<Long> INVALIDATE_MEMORY_CACHE = new TimeSetting("Webserver.Cache.Invalidate_memory_cache_after");
|
||||
|
||||
private WebserverSettings() {
|
||||
/* static variable class */
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public enum HtmlLang implements Lang {
|
||||
TITLE_PLAYER("Player"),
|
||||
TITLE_SESSION_START("Session Started"),
|
||||
TITLE_LENGTH(" Length"),
|
||||
TITLE_SERVER("Server"), // Can cause issue with jquery.dataTables.js
|
||||
TITLE_SERVER("Server"), // Can cause issue with datatables.js
|
||||
TITLE_MOST_PLAYED_WORLD("Most played World"),
|
||||
TEXT_CLICK_TO_EXPAND("Click to expand"),
|
||||
TITLE_SERVER_PLAYTIME_30("Server Playtime for 30 days"),
|
||||
@ -131,6 +131,7 @@ public enum HtmlLang implements Lang {
|
||||
SIDE_PVP_PVE("PvP & PvE"),
|
||||
SIDE_PERFORMANCE("Performance"),
|
||||
LABEL_RETENTION("New Player Retention"),
|
||||
DESCRIBE_RETENTION_PREDICTION("This value is a prediction based on previous players."),
|
||||
TITLE_SERVER_AS_NUMBERS("Server as Numbers"),
|
||||
TITLE_ONLINE_ACTIVITY_AS_NUMBERS("Online Activity as Numbers"),
|
||||
COMPARING_15_DAYS("Comparing 15 days"),
|
||||
|
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.djrapitops.plan.storage.database.transactions.events;
|
||||
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.exceptions.database.DBOpException;
|
||||
import com.djrapitops.plan.gathering.cache.SessionCache;
|
||||
import com.djrapitops.plan.storage.database.queries.DataStoreQueries;
|
||||
@ -57,8 +55,6 @@ public class PlayerRegisterTransaction extends Transaction {
|
||||
SessionCache.getCachedSession(playerUUID).ifPresent(session -> session.setAsFirstSessionIfMatches(registerDate));
|
||||
}
|
||||
execute(DataStoreQueries.updatePlayerName(playerUUID, playerName));
|
||||
|
||||
JSONCache.invalidateMatching(DataID.PLAYERS);
|
||||
}
|
||||
|
||||
private void insertUser(long registerDate) {
|
||||
|
@ -16,9 +16,6 @@
|
||||
*/
|
||||
package com.djrapitops.plan.storage.database.transactions.events;
|
||||
|
||||
import com.djrapitops.plan.delivery.domain.keys.SessionKeys;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.gathering.domain.Session;
|
||||
import com.djrapitops.plan.storage.database.queries.DataStoreQueries;
|
||||
import com.djrapitops.plan.storage.database.transactions.Transaction;
|
||||
@ -39,19 +36,5 @@ public class SessionEndTransaction extends Transaction {
|
||||
@Override
|
||||
protected void performOperations() {
|
||||
execute(DataStoreQueries.storeSession(session));
|
||||
|
||||
session.getValue(SessionKeys.SERVER_UUID)
|
||||
.ifPresent(serverUUID -> JSONCache.invalidate(
|
||||
serverUUID,
|
||||
DataID.SESSIONS,
|
||||
DataID.GRAPH_WORLD_PIE,
|
||||
DataID.GRAPH_PUNCHCARD,
|
||||
DataID.KILLS,
|
||||
DataID.ONLINE_OVERVIEW,
|
||||
DataID.SESSIONS_OVERVIEW,
|
||||
DataID.PVP_PVE,
|
||||
DataID.GRAPH_UNIQUE_NEW,
|
||||
DataID.GRAPH_CALENDAR
|
||||
));
|
||||
}
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
/*
|
||||
* This file is part of Player Analytics (Plan).
|
||||
*
|
||||
* Plan is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License v3 as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Plan is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.storage.json;
|
||||
|
||||
import com.djrapitops.plan.storage.file.PlanFiles;
|
||||
import com.djrapitops.plugin.logging.console.PluginLogger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* In charge of storing json files on disk for later retrieval.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
@Singleton
|
||||
public class JSONFileStorage implements JSONStorage {
|
||||
|
||||
private final PluginLogger logger;
|
||||
|
||||
private final Path jsonDirectory;
|
||||
|
||||
private final Pattern timestampRegex = Pattern.compile(".*-([0-9]*).json");
|
||||
private static final String JSON_FILE_EXTENSION = ".json";
|
||||
|
||||
@Inject
|
||||
public JSONFileStorage(PlanFiles files, PluginLogger logger) {
|
||||
this.logger = logger;
|
||||
|
||||
jsonDirectory = files.getJSONStorageDirectory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoredJSON storeJson(String identifier, String json, long timestamp) {
|
||||
Path writingTo = jsonDirectory.resolve(identifier + '-' + timestamp + JSON_FILE_EXTENSION);
|
||||
try {
|
||||
Files.createDirectories(jsonDirectory);
|
||||
Files.write(writingTo, json.getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE);
|
||||
} catch (IOException e) {
|
||||
logger.warn("Could not write a file to " + writingTo.toFile().getAbsolutePath() + ": " + e.getMessage());
|
||||
}
|
||||
return new StoredJSON(json, timestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJSON(String identifier) {
|
||||
File[] stored = jsonDirectory.toFile().listFiles();
|
||||
if (stored == null) return Optional.empty();
|
||||
for (File file : stored) {
|
||||
String fileName = file.getName();
|
||||
if (fileName.endsWith(JSON_FILE_EXTENSION) && fileName.startsWith(identifier)) {
|
||||
return Optional.ofNullable(readStoredJSON(file));
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
private StoredJSON readStoredJSON(File from) {
|
||||
Matcher timestampMatch = timestampRegex.matcher(from.getName());
|
||||
if (timestampMatch.find()) {
|
||||
try (Stream<String> lines = Files.lines(from.toPath())) {
|
||||
long timestamp = Long.parseLong(timestampMatch.group(1));
|
||||
StringBuilder json = new StringBuilder();
|
||||
lines.forEach(json::append);
|
||||
return new StoredJSON(json.toString(), timestamp);
|
||||
} catch (IOException e) {
|
||||
logger.warn(jsonDirectory.toFile().getAbsolutePath() + " file '" + from.getName() + "' could not be read: " + e.getMessage());
|
||||
} catch (NumberFormatException e) {
|
||||
logger.warn(jsonDirectory.toFile().getAbsolutePath() + " contained a file '" + from.getName() + "' with improperly formatted -timestamp (could not parse number). This file was not placed there by Plan!");
|
||||
}
|
||||
} else {
|
||||
logger.warn(jsonDirectory.toFile().getAbsolutePath() + " contained a file '" + from.getName() + "' that has no -timestamp. This file was not placed there by Plan!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchExactJson(String identifier, long timestamp) {
|
||||
File found = jsonDirectory.resolve(identifier + "-" + timestamp + JSON_FILE_EXTENSION).toFile();
|
||||
if (!found.exists()) return Optional.empty();
|
||||
return Optional.ofNullable(readStoredJSON(found));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJsonMadeBefore(String identifier, long timestamp) {
|
||||
return fetchJSONWithTimestamp(identifier, timestamp, (timestampMatch, time) -> Long.parseLong(timestampMatch.group(1)) < time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<StoredJSON> fetchJsonMadeAfter(String identifier, long timestamp) {
|
||||
return fetchJSONWithTimestamp(identifier, timestamp, (timestampMatch, time) -> Long.parseLong(timestampMatch.group(1)) > time);
|
||||
}
|
||||
|
||||
private Optional<StoredJSON> fetchJSONWithTimestamp(String identifier, long timestamp, BiPredicate<Matcher, Long> timestampComparator) {
|
||||
File[] stored = jsonDirectory.toFile().listFiles();
|
||||
if (stored == null) return Optional.empty();
|
||||
for (File file : stored) {
|
||||
try {
|
||||
String fileName = file.getName();
|
||||
if (fileName.endsWith(JSON_FILE_EXTENSION) && fileName.startsWith(identifier)) {
|
||||
Matcher timestampMatch = timestampRegex.matcher(fileName);
|
||||
if (timestampMatch.find() && timestampComparator.test(timestampMatch, timestamp)) {
|
||||
return Optional.ofNullable(readStoredJSON(file));
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// Ignore this file, malformed timestamp
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* This file is part of Player Analytics (Plan).
|
||||
*
|
||||
* Plan is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License v3 as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Plan is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.utilities;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* Synchronizes a critical section of code so that only a single thread can access it at a time.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class UnitSemaphoreAccessLock {
|
||||
|
||||
private final AtomicBoolean accessing;
|
||||
private final Object lockObject;
|
||||
|
||||
public UnitSemaphoreAccessLock() {
|
||||
accessing = new AtomicBoolean(false);
|
||||
lockObject = new Object();
|
||||
}
|
||||
|
||||
public void enter() {
|
||||
try {
|
||||
synchronized (lockObject) {
|
||||
while (accessing.get()) {
|
||||
lockObject.wait();
|
||||
}
|
||||
accessing.set(true);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
public void exit() {
|
||||
synchronized (lockObject) {
|
||||
accessing.set(false);
|
||||
lockObject.notify();
|
||||
}
|
||||
}
|
||||
}
|
@ -44,6 +44,15 @@ Webserver:
|
||||
# InternalIP usually does not need to be changed, only change it if you know what you're doing!
|
||||
# 0.0.0.0 allocates Internal (local) IP automatically for the WebServer.
|
||||
Internal_IP: 0.0.0.0
|
||||
Cache:
|
||||
Reduced_refresh_barrier: 15
|
||||
Unit: SECONDS
|
||||
Invalidate_query_results_on_disk_after: 7
|
||||
Unit: DAYS
|
||||
Invalidate_disk_cache_after: 2
|
||||
Unit: DAYS
|
||||
Invalidate_memory_cache_after: 5
|
||||
Unit: MINUTES
|
||||
Security:
|
||||
SSL_certificate:
|
||||
KeyStore_path: Cert.jks
|
||||
|
@ -49,6 +49,15 @@ Webserver:
|
||||
# InternalIP usually does not need to be changed, only change it if you know what you're doing!
|
||||
# 0.0.0.0 allocates Internal (local) IP automatically for the WebServer.
|
||||
Internal_IP: 0.0.0.0
|
||||
Cache:
|
||||
Reduced_refresh_barrier: 15
|
||||
Unit: SECONDS
|
||||
Invalidate_query_results_on_disk_after: 7
|
||||
Unit: DAYS
|
||||
Invalidate_disk_cache_after: 2
|
||||
Unit: DAYS
|
||||
Invalidate_memory_cache_after: 5
|
||||
Unit: MINUTES
|
||||
Security:
|
||||
SSL_certificate:
|
||||
KeyStore_path: Cert.jks
|
||||
|
@ -1252,4 +1252,37 @@ body.sidebar-hidden .navbar-nav {
|
||||
#filter-dropdown {
|
||||
max-height: 18rem;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.refresh-element {
|
||||
font-size: 1rem;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
.refresh-element > i {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sorting, .sorting_desc, .sorting_asc {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dataTables_length {
|
||||
padding-top: 0.5rem;
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
padding-top: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
|
||||
.dataTables_info {
|
||||
padding-bottom: 0.5rem;
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
.dataTables_paginate {
|
||||
padding-bottom: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
}
|
@ -18,23 +18,28 @@
|
||||
if (selectedColor === null) {
|
||||
window.localStorage.setItem('themeColor', currentColor);
|
||||
}
|
||||
$('body').removeClass('theme-' + currentColor).addClass('theme-' + nextColor);
|
||||
const bodyElement = document.querySelector('body');
|
||||
bodyElement.classList.remove(`theme-${currentColor}`);
|
||||
bodyElement.classList.add(`theme-${nextColor}`);
|
||||
|
||||
if (!nextColor || nextColor == currentColor) {
|
||||
return;
|
||||
}
|
||||
|
||||
let bgElementSelector = '';
|
||||
bgElements.map(element => element + '.bg-' + currentColor + ":not(.color-chooser)")
|
||||
.forEach(selector => bgElementSelector += selector + ',');
|
||||
$(bgElementSelector.substr(0, bgElementSelector.length - 1))
|
||||
.removeClass('bg-' + currentColor)
|
||||
.addClass('bg-' + nextColor);
|
||||
let textElementSelector = '';
|
||||
.forEach(selector => {
|
||||
document.querySelectorAll(selector).forEach(element => {
|
||||
element.classList.remove(`bg-${currentColor}`);
|
||||
element.classList.add(`bg-${nextColor}`);
|
||||
});
|
||||
});
|
||||
textElements.map(element => element + '.col-' + currentColor)
|
||||
.forEach(selector => textElementSelector += selector + ',');
|
||||
$(textElementSelector.substr(0, textElementSelector.length - 1))
|
||||
.removeClass('col-' + currentColor)
|
||||
.addClass('col-' + nextColor);
|
||||
.forEach(selector => {
|
||||
document.querySelectorAll(selector).forEach(element => {
|
||||
element.classList.remove(`col-${currentColor}`);
|
||||
element.classList.add(`col-${nextColor}`);
|
||||
});
|
||||
});
|
||||
if (nextColor != 'night') {
|
||||
window.localStorage.setItem('themeColor', nextColor);
|
||||
}
|
||||
@ -43,27 +48,22 @@
|
||||
|
||||
// Set the color changing function for all color change buttons
|
||||
function enableColorSetters() {
|
||||
function colorSetter(i) {
|
||||
return function () {
|
||||
setColor(colors[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i in colors) {
|
||||
const color = colors[i];
|
||||
const func = colorSetter(i);
|
||||
$('#choose-' + color)
|
||||
.on('click', func)
|
||||
.addClass('bg-' + color);
|
||||
for (const color of colors) {
|
||||
const selector = document.getElementById(`choose-${color}`);
|
||||
selector.removeAttribute('disabled');
|
||||
selector.classList.remove('disabled');
|
||||
selector.classList.add(`bg-${color}`);
|
||||
selector.addEventListener('click', () => setColor(color));
|
||||
}
|
||||
}
|
||||
|
||||
enableColorSetters();
|
||||
|
||||
function disableColorSetters() {
|
||||
for (i in colors) {
|
||||
const color = colors[i];
|
||||
$('#choose-' + color).addClass('disabled').unbind('click');
|
||||
for (const color of colors) {
|
||||
const selector = document.getElementById(`choose-${color}`);
|
||||
selector.classList.add('disabled');
|
||||
selector.setAttribute('disabled', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
@ -232,7 +232,6 @@
|
||||
// Turn dark tables bright again
|
||||
$('.table').removeClass('table-dark');
|
||||
// Sidebar is colorful
|
||||
$('.color-chooser').removeClass('disabled');
|
||||
enableColorSetters();
|
||||
setColor(window.localStorage.getItem('themeColor'));
|
||||
}
|
||||
|
@ -1,5 +1,19 @@
|
||||
function insertElementBefore(elementSelector, createElementFunction) {
|
||||
const placeBefore = document.querySelector(elementSelector);
|
||||
insertElementBeforeElement(placeBefore, createElementFunction);
|
||||
}
|
||||
|
||||
function insertElementBeforeElement(placeBefore, createElementFunction) {
|
||||
const element = createElementFunction();
|
||||
placeBefore.insertAdjacentElement('beforebegin', element);
|
||||
}
|
||||
|
||||
function insertElementAfter(elementSelector, createElementFunction) {
|
||||
const placeBefore = document.querySelector(elementSelector);
|
||||
insertElementAfterElement(placeBefore, createElementFunction)
|
||||
}
|
||||
|
||||
function insertElementAfterElement(placeBefore, createElementFunction) {
|
||||
const element = createElementFunction();
|
||||
placeBefore.insertAdjacentElement('afterend', element);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
var linegraphButtons = [{
|
||||
const linegraphButtons = [{
|
||||
type: 'hour',
|
||||
count: 12,
|
||||
text: '12h'
|
||||
@ -19,7 +19,7 @@ var linegraphButtons = [{
|
||||
text: 'All'
|
||||
}];
|
||||
|
||||
var graphs = [];
|
||||
const graphs = [];
|
||||
window.calendars = {};
|
||||
|
||||
function activityPie(id, activitySeries) {
|
||||
@ -183,27 +183,40 @@ function onlineActivityCalendar(id, event_data, firstDay) {
|
||||
}
|
||||
|
||||
function mapToDataSeries(performanceData) {
|
||||
const dataSeries = {
|
||||
playersOnline: [],
|
||||
tps: [],
|
||||
cpu: [],
|
||||
ram: [],
|
||||
entities: [],
|
||||
chunks: [],
|
||||
disk: []
|
||||
};
|
||||
for (let i = 0; i < performanceData.length; i++) {
|
||||
const entry = performanceData[i];
|
||||
const date = entry[0];
|
||||
dataSeries.playersOnline[i] = [date, entry[1]];
|
||||
dataSeries.tps[i] = [date, entry[2]];
|
||||
dataSeries.cpu[i] = [date, entry[3]];
|
||||
dataSeries.ram[i] = [date, entry[4]];
|
||||
dataSeries.entities[i] = [date, entry[5]];
|
||||
dataSeries.chunks[i] = [date, entry[6]];
|
||||
dataSeries.disk[i] = [date, entry[7]];
|
||||
}
|
||||
return dataSeries;
|
||||
const playersOnline = [];
|
||||
const tps = [];
|
||||
const cpu = [];
|
||||
const ram = [];
|
||||
const entities = [];
|
||||
const chunks = [];
|
||||
const disk = [];
|
||||
|
||||
return new Promise((resolve => {
|
||||
let i = 0;
|
||||
const length = performanceData.length;
|
||||
|
||||
function processNextThousand() {
|
||||
const to = Math.min(i + 1000, length);
|
||||
for (i; i < to; i++) {
|
||||
const entry = performanceData[i];
|
||||
const date = entry[0];
|
||||
playersOnline[i] = [date, entry[1]];
|
||||
tps[i] = [date, entry[2]];
|
||||
cpu[i] = [date, entry[3]];
|
||||
ram[i] = [date, entry[4]];
|
||||
entities[i] = [date, entry[5]];
|
||||
chunks[i] = [date, entry[6]];
|
||||
disk[i] = [date, entry[7]];
|
||||
}
|
||||
if (i >= length) {
|
||||
resolve({playersOnline, tps, cpu, ram, entities, chunks, disk})
|
||||
} else {
|
||||
setTimeout(processNextThousand, 10);
|
||||
}
|
||||
}
|
||||
|
||||
processNextThousand();
|
||||
}))
|
||||
}
|
||||
|
||||
function performanceChart(id, playersOnlineSeries, tpsSeries, cpuSeries, ramSeries, entitySeries, chunkSeries) {
|
||||
@ -406,15 +419,15 @@ function serverPie(id, serverSeries) {
|
||||
}
|
||||
|
||||
function formatTimeAmount(ms) {
|
||||
var out = "";
|
||||
let out = "";
|
||||
|
||||
var seconds = Math.floor(ms / 1000);
|
||||
let seconds = Math.floor(ms / 1000);
|
||||
|
||||
var dd = Math.floor(seconds / 86400);
|
||||
const dd = Math.floor(seconds / 86400);
|
||||
seconds -= (dd * 86400);
|
||||
var dh = Math.floor(seconds / 3600);
|
||||
const dh = Math.floor(seconds / 3600);
|
||||
seconds -= (dh * 3600);
|
||||
var dm = Math.floor(seconds / 60);
|
||||
const dm = Math.floor(seconds / 60);
|
||||
seconds -= (dm * 60);
|
||||
seconds = Math.floor(seconds);
|
||||
if (dd !== 0) {
|
||||
@ -610,9 +623,9 @@ function worldMap(id, colorMin, colorMax, mapSeries) {
|
||||
}
|
||||
|
||||
function worldPie(id, worldSeries, gmSeries) {
|
||||
var defaultTitle = '';
|
||||
var defaultSubtitle = 'Click to expand';
|
||||
var chart = Highcharts.chart(id, {
|
||||
const defaultTitle = '';
|
||||
const defaultSubtitle = 'Click to expand';
|
||||
const chart = Highcharts.chart(id, {
|
||||
chart: {
|
||||
plotBackgroundColor: null,
|
||||
plotBorderWidth: null,
|
||||
|
@ -1,10 +1,10 @@
|
||||
var trend_up_good = "<span class=\"badge badge-success\"><i class=\"fa fa-caret-up\"></i> ";
|
||||
var trend_up_bad = "<span class=\"badge badge-danger\"><i class=\"fa fa-caret-up\"></i> ";
|
||||
var trend_down_bad = "<span class=\"badge badge-danger\"><i class=\"fa fa-caret-down\"></i> ";
|
||||
var trend_down_good = "<span class=\"badge badge-success\"><i class=\"fa fa-caret-down\"></i> ";
|
||||
var trend_same = "<span class=\"badge badge-warning\"><i class=\"fa fa-caret-right\"></i> ";
|
||||
const trend_up_good = "<span class=\"badge badge-success\"><i class=\"fa fa-caret-up\"></i> ";
|
||||
const trend_up_bad = "<span class=\"badge badge-danger\"><i class=\"fa fa-caret-up\"></i> ";
|
||||
const trend_down_bad = "<span class=\"badge badge-danger\"><i class=\"fa fa-caret-down\"></i> ";
|
||||
const trend_down_good = "<span class=\"badge badge-success\"><i class=\"fa fa-caret-down\"></i> ";
|
||||
const trend_same = "<span class=\"badge badge-warning\"><i class=\"fa fa-caret-right\"></i> ";
|
||||
|
||||
var trend_end = "</span>";
|
||||
const trend_end = "</span>";
|
||||
|
||||
function trend(trend) {
|
||||
if (!trend) {
|
||||
@ -27,257 +27,263 @@ function smallTrend(trend) {
|
||||
switch (trend.direction) {
|
||||
case '+':
|
||||
trend_color = trend.reversed ? 'text-danger' : 'text-success';
|
||||
return ' <i class="' + trend_color + ' fa fa-caret-up" title="' + trend.text + '"></i>';
|
||||
return ` <i class="${trend_color} fa fa-caret-up" title="${trend.text}"></i>`;
|
||||
case '-':
|
||||
trend_color = trend.reversed ? 'text-success' : 'text-danger';
|
||||
return ' <i class="' + trend_color + ' fa fa-caret-down" title="' + trend.text + '"></i>';
|
||||
return ` <i class="${trend_color} fa fa-caret-down" title="${trend.text}"></i>`;
|
||||
default:
|
||||
return ' <i class="text-warning fa fa-caret-right" title="' + trend.text + '"></i>';
|
||||
return ` <i class="text-warning fa fa-caret-right" title="${trend.text}"></i>`;
|
||||
}
|
||||
}
|
||||
|
||||
function displayError(element, error) {
|
||||
element.find('.d-sm-flex').after('<div class="alert alert-danger" role="alert">Failed to load values: ' + error + '</div>')
|
||||
insertElementAfterElement(element.querySelector('.d-sm-flex'), () => {
|
||||
const alert = document.createElement('div');
|
||||
alert.classList.add('alert', 'alert-danger');
|
||||
alert.setAttribute('role', 'alert');
|
||||
alert.innerText = `Failed to load values: ${error}`;
|
||||
return alert;
|
||||
})
|
||||
}
|
||||
|
||||
/* This function loads Network Overview tab */
|
||||
function loadNetworkOverviewValues(json, error) {
|
||||
tab = $('#network-overview');
|
||||
const tab = document.getElementById('network-overview');
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Last 7 days
|
||||
data = json.players;
|
||||
element = $(tab).find('#data_players');
|
||||
let data = json.players;
|
||||
let element = tab.querySelector('#data_players');
|
||||
|
||||
$(element).find('#data_unique_players_1d').text(data.unique_players_1d);
|
||||
$(element).find('#data_unique_players_7d').text(data.unique_players_7d);
|
||||
$(element).find('#data_unique_players_30d').text(data.unique_players_30d);
|
||||
$(element).find('#data_new_players_1d').text(data.new_players_1d);
|
||||
$(element).find('#data_new_players_7d').text(data.new_players_7d);
|
||||
$(element).find('#data_new_players_30d').text(data.new_players_30d);
|
||||
element.querySelector('#data_unique_players_1d').innerText = data.unique_players_1d;
|
||||
element.querySelector('#data_unique_players_7d').innerText = data.unique_players_7d;
|
||||
element.querySelector('#data_unique_players_30d').innerText = data.unique_players_30d;
|
||||
element.querySelector('#data_new_players_1d').innerText = data.new_players_1d;
|
||||
element.querySelector('#data_new_players_7d').innerText = data.new_players_7d;
|
||||
element.querySelector('#data_new_players_30d').innerText = data.new_players_30d;
|
||||
|
||||
// Server As Numbers
|
||||
data = json.numbers;
|
||||
element = $(tab).find('#data_numbers');
|
||||
element = tab.querySelector('#data_numbers');
|
||||
|
||||
$(element).find('#data_total').text(data.total_players);
|
||||
$(element).find('#data_regular').text(data.regular_players);
|
||||
$(element).find('#data_online').text(data.online_players);
|
||||
element.querySelector('#data_total').innerText = data.total_players;
|
||||
element.querySelector('#data_regular').innerText = data.regular_players;
|
||||
element.querySelector('#data_online').innerText = data.online_players;
|
||||
|
||||
$(element).find('#data_last_peak_date').text(data.last_peak_date);
|
||||
$(element).find('#data_last_peak_players').text(data.last_peak_players);
|
||||
$(element).find('#data_best_peak_date').text(data.best_peak_date);
|
||||
$(element).find('#data_best_peak_players').text(data.best_peak_players);
|
||||
element.querySelector('#data_last_peak_date').innerText = data.last_peak_date;
|
||||
element.querySelector('#data_last_peak_players').innerText = data.last_peak_players;
|
||||
element.querySelector('#data_best_peak_date').innerText = data.best_peak_date;
|
||||
element.querySelector('#data_best_peak_players').innerText = data.best_peak_players;
|
||||
|
||||
$(element).find('#data_playtime').text(data.playtime);
|
||||
$(element).find('#data_player_playtime').text(data.player_playtime);
|
||||
$(element).find('#data_session_length_avg').text(data.session_length_avg);
|
||||
$(element).find('#data_sessions').text(data.sessions);
|
||||
element.querySelector('#data_playtime').innerText = data.playtime;
|
||||
element.querySelector('#data_player_playtime').innerText = data.player_playtime;
|
||||
element.querySelector('#data_session_length_avg').innerText = data.session_length_avg;
|
||||
element.querySelector('#data_sessions').innerText = data.sessions;
|
||||
|
||||
// Week Comparison
|
||||
data = json.weeks;
|
||||
element = $(tab).find('#data_weeks');
|
||||
element = tab.querySelector('#data_weeks');
|
||||
|
||||
$(element).find('#data_start').text(data.start);
|
||||
$(element).find('#data_midpoint').text(data.midpoint);
|
||||
$(element).find('#data_midpoint2').text(data.midpoint);
|
||||
$(element).find('#data_end').text(data.end);
|
||||
element.querySelector('#data_start').innerText = data.start;
|
||||
element.querySelector('#data_midpoint').innerText = data.midpoint;
|
||||
element.querySelector('#data_midpoint2').innerText = data.midpoint;
|
||||
element.querySelector('#data_end').innerText = data.end;
|
||||
|
||||
$(element).find('#data_unique_before').text(data.unique_before);
|
||||
$(element).find('#data_unique_after').text(data.unique_after);
|
||||
$(element).find('#data_unique_trend').replaceWith(trend(data.unique_trend));
|
||||
$(element).find('#data_new_before').text(data.new_before);
|
||||
$(element).find('#data_new_after').text(data.new_after);
|
||||
$(element).find('#data_new_trend').replaceWith(trend(data.new_trend));
|
||||
$(element).find('#data_regular_before').text(data.regular_before);
|
||||
$(element).find('#data_regular_after').text(data.regular_after);
|
||||
$(element).find('#data_regular_trend').replaceWith(trend(data.regular_trend));
|
||||
element.querySelector('#data_unique_before').innerText = data.unique_before;
|
||||
element.querySelector('#data_unique_after').innerText = data.unique_after;
|
||||
element.querySelector('#data_unique_trend').innerHTML = trend(data.unique_trend);
|
||||
element.querySelector('#data_new_before').innerText = data.new_before;
|
||||
element.querySelector('#data_new_after').innerText = data.new_after;
|
||||
element.querySelector('#data_new_trend').innerHTML = trend(data.new_trend);
|
||||
element.querySelector('#data_regular_before').innerText = data.regular_before;
|
||||
element.querySelector('#data_regular_after').innerText = data.regular_after;
|
||||
element.querySelector('#data_regular_trend').innerHTML = trend(data.regular_trend);
|
||||
|
||||
$(element).find('#data_average_playtime_before').text(data.average_playtime_before);
|
||||
$(element).find('#data_average_playtime_after').text(data.average_playtime_after);
|
||||
$(element).find('#data_average_playtime_trend').replaceWith(trend(data.average_playtime_trend));
|
||||
$(element).find('#data_sessions_before').text(data.sessions_before);
|
||||
$(element).find('#data_sessions_after').text(data.sessions_after);
|
||||
$(element).find('#data_sessions_trend').replaceWith(trend(data.sessions_trend));
|
||||
$(element).find('#data_session_length_average_before').text(data.session_length_average_before);
|
||||
$(element).find('#data_session_length_average_after').text(data.session_length_average_after);
|
||||
$(element).find('#data_session_length_average_trend').replaceWith(trend(data.session_length_average_trend));
|
||||
element.querySelector('#data_average_playtime_before').innerText = data.average_playtime_before;
|
||||
element.querySelector('#data_average_playtime_after').innerText = data.average_playtime_after;
|
||||
element.querySelector('#data_average_playtime_trend').innerHTML = trend(data.average_playtime_trend);
|
||||
element.querySelector('#data_sessions_before').innerText = data.sessions_before;
|
||||
element.querySelector('#data_sessions_after').innerText = data.sessions_after;
|
||||
element.querySelector('#data_sessions_trend').innerHTML = trend(data.sessions_trend);
|
||||
element.querySelector('#data_session_length_average_before').innerText = data.session_length_average_before;
|
||||
element.querySelector('#data_session_length_average_after').innerText = data.session_length_average_after;
|
||||
element.querySelector('#data_session_length_average_trend').innerHTML = trend(data.session_length_average_trend);
|
||||
|
||||
}
|
||||
|
||||
/* This function loads Online Activity Overview tab */
|
||||
function loadOnlineActivityOverviewValues(json, error) {
|
||||
tab = $('#online-activity-overview');
|
||||
const tab = document.getElementById('online-activity-overview');
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Online Activity as Numbers
|
||||
data = json.numbers;
|
||||
element = $(tab).find('#data_numbers');
|
||||
let data = json.numbers;
|
||||
let element = tab.querySelector('#data_numbers');
|
||||
|
||||
$(element).find('#data_unique_players_30d').replaceWith('<td>' + data.unique_players_30d + smallTrend(data.unique_players_30d_trend) + '</td>');
|
||||
$(element).find('#data_unique_players_7d').text(data.unique_players_7d);
|
||||
$(element).find('#data_unique_players_24h').text(data.unique_players_24h);
|
||||
element.querySelector('#data_unique_players_30d').innerHTML = data.unique_players_30d + smallTrend(data.unique_players_30d_trend);
|
||||
element.querySelector('#data_unique_players_7d').innerText = data.unique_players_7d;
|
||||
element.querySelector('#data_unique_players_24h').innerText = data.unique_players_24h;
|
||||
|
||||
$(element).find('#data_unique_players_30d_avg').replaceWith('<td>' + data.unique_players_30d_avg + smallTrend(data.unique_players_30d_avg_trend) + '</td>');
|
||||
$(element).find('#data_unique_players_7d_avg').text(data.unique_players_7d_avg);
|
||||
$(element).find('#data_unique_players_24h_avg').text(data.unique_players_24h_avg);
|
||||
element.querySelector('#data_unique_players_30d_avg').innerHTML = data.unique_players_30d_avg + smallTrend(data.unique_players_30d_avg_trend);
|
||||
element.querySelector('#data_unique_players_7d_avg').innerText = data.unique_players_7d_avg;
|
||||
element.querySelector('#data_unique_players_24h_avg').innerText = data.unique_players_24h_avg;
|
||||
|
||||
$(element).find('#data_new_players_30d').replaceWith('<td>' + data.new_players_30d + smallTrend(data.new_players_30d_trend) + '</td>');
|
||||
$(element).find('#data_new_players_7d').text(data.new_players_7d);
|
||||
$(element).find('#data_new_players_24h').text(data.new_players_24h);
|
||||
element.querySelector('#data_new_players_30d').innerHTML = data.new_players_30d + smallTrend(data.new_players_30d_trend);
|
||||
element.querySelector('#data_new_players_7d').innerText = data.new_players_7d;
|
||||
element.querySelector('#data_new_players_24h').innerText = data.new_players_24h;
|
||||
|
||||
$(element).find('#data_new_players_30d_avg').replaceWith('<td>' + data.new_players_30d_avg + smallTrend(data.new_players_30d_avg_trend) + '</td>');
|
||||
$(element).find('#data_new_players_7d_avg').text(data.new_players_7d_avg);
|
||||
$(element).find('#data_new_players_24h_avg').text(data.new_players_24h_avg);
|
||||
element.querySelector('#data_new_players_30d_avg').innerHTML = data.new_players_30d_avg + smallTrend(data.new_players_30d_avg_trend);
|
||||
element.querySelector('#data_new_players_7d_avg').innerText = data.new_players_7d_avg;
|
||||
element.querySelector('#data_new_players_24h_avg').innerText = data.new_players_24h_avg;
|
||||
|
||||
$(element).find('#data_new_players_retention_30d').text('(' + data.new_players_retention_30d + '/' + data.new_players_30d + ') ' + data.new_players_retention_30d_perc);
|
||||
$(element).find('#data_new_players_retention_7d').text('(' + data.new_players_retention_7d + '/' + data.new_players_7d + ') ' + data.new_players_retention_7d_perc);
|
||||
$(element).find('#data_new_players_retention_24h').replaceWith(`<td title="This value is a prediction based on previous players.">(` + data.new_players_retention_24h + '/' + data.new_players_24h + ') ' + data.new_players_retention_24h_perc + ' <i class="far fa-fw fa-eye"></i></td>');
|
||||
element.querySelector('#data_new_players_retention_30d').innerText = '(' + data.new_players_retention_30d + '/' + data.new_players_30d + ') ' + data.new_players_retention_30d_perc;
|
||||
element.querySelector('#data_new_players_retention_7d').innerText = '(' + data.new_players_retention_7d + '/' + data.new_players_7d + ') ' + data.new_players_retention_7d_perc;
|
||||
element.querySelector('#data_new_players_retention_24h').innerHTML = '(' + data.new_players_retention_24h + '/' + data.new_players_24h + ') ' + data.new_players_retention_24h_perc + ' <i class="far fa-fw fa-eye"></i>';
|
||||
|
||||
$(element).find('#data_playtime_30d').replaceWith('<td>' + data.playtime_30d + smallTrend(data.playtime_30d_trend) + '</td>');
|
||||
$(element).find('#data_playtime_7d').text(data.playtime_7d);
|
||||
$(element).find('#data_playtime_24h').text(data.playtime_24h);
|
||||
element.querySelector('#data_playtime_30d').innerHTML = data.playtime_30d + smallTrend(data.playtime_30d_trend);
|
||||
element.querySelector('#data_playtime_7d').innerText = data.playtime_7d;
|
||||
element.querySelector('#data_playtime_24h').innerText = data.playtime_24h;
|
||||
|
||||
$(element).find('#data_playtime_30d_avg').replaceWith('<td>' + data.playtime_30d_avg + smallTrend(data.playtime_30d_avg_trend) + '</td>');
|
||||
$(element).find('#data_playtime_7d_avg').text(data.playtime_7d_avg);
|
||||
$(element).find('#data_playtime_24h_avg').text(data.playtime_24h_avg);
|
||||
element.querySelector('#data_playtime_30d_avg').innerHTML = data.playtime_30d_avg + smallTrend(data.playtime_30d_avg_trend);
|
||||
element.querySelector('#data_playtime_7d_avg').innerText = data.playtime_7d_avg;
|
||||
element.querySelector('#data_playtime_24h_avg').innerText = data.playtime_24h_avg;
|
||||
|
||||
$(element).find('#data_session_length_30d_avg').replaceWith('<td>' + data.session_length_30d_avg + smallTrend(data.session_length_30d_trend) + '</td>');
|
||||
$(element).find('#data_session_length_7d_avg').text(data.session_length_7d_avg);
|
||||
$(element).find('#data_session_length_24h_avg').text(data.session_length_24h_avg);
|
||||
element.querySelector('#data_session_length_30d_avg').innerHTML = data.session_length_30d_avg + smallTrend(data.session_length_30d_trend);
|
||||
element.querySelector('#data_session_length_7d_avg').innerText = data.session_length_7d_avg;
|
||||
element.querySelector('#data_session_length_24h_avg').innerText = data.session_length_24h_avg;
|
||||
|
||||
$(element).find('#data_sessions_30d').replaceWith('<td>' + data.sessions_30d + smallTrend(data.sessions_30d_trend) + '</td>');
|
||||
$(element).find('#data_sessions_7d').text(data.sessions_7d);
|
||||
$(element).find('#data_sessions_24h').text(data.sessions_24h);
|
||||
element.querySelector('#data_sessions_30d').innerHTML = data.sessions_30d + smallTrend(data.sessions_30d_trend);
|
||||
element.querySelector('#data_sessions_7d').innerText = data.sessions_7d;
|
||||
element.querySelector('#data_sessions_24h').innerText = data.sessions_24h;
|
||||
|
||||
// Insights
|
||||
data = json.insights;
|
||||
element = $(tab).find('#data_insights');
|
||||
element = tab.querySelector('#data_insights');
|
||||
|
||||
$(element).find('#data_players_first_join_avg').replaceWith(data.players_first_join_avg + smallTrend(data.players_first_join_trend));
|
||||
$(element).find('#data_first_session_length_avg').replaceWith(data.first_session_length_avg + smallTrend(data.first_session_length_trend));
|
||||
$(element).find('#data_lone_joins').replaceWith(data.lone_joins + smallTrend(data.lone_joins_trend));
|
||||
$(element).find('#data_lone_new_joins').replaceWith(data.lone_new_joins + smallTrend(data.lone_new_joins_trend))
|
||||
element.querySelector('#data_players_first_join_avg').innerHTML = data.players_first_join_avg + smallTrend(data.players_first_join_trend);
|
||||
element.querySelector('#data_first_session_length_avg').innerHTML = data.first_session_length_avg + smallTrend(data.first_session_length_trend);
|
||||
element.querySelector('#data_lone_joins').innerHTML = data.lone_joins + smallTrend(data.lone_joins_trend);
|
||||
element.querySelector('#data_lone_new_joins').innerHTML = data.lone_new_joins + smallTrend(data.lone_new_joins_trend);
|
||||
}
|
||||
|
||||
/* This function loads Sessions tab */
|
||||
function loadSessionValues(json, error) {
|
||||
tab = $('#sessions-overview');
|
||||
const tab = document.getElementById('sessions-overview');
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Insights
|
||||
data = json.insights;
|
||||
element = $(tab).find('#data_insights');
|
||||
let data = json.insights;
|
||||
let element = tab.querySelector('#data_insights');
|
||||
|
||||
$(element).find('#data_most_active_gamemode').text(data.most_active_gamemode);
|
||||
$(element).find('#data_most_active_gamemode_perc').text(data.most_active_gamemode_perc);
|
||||
$(element).find('#data_server_occupied').text(data.server_occupied);
|
||||
$(element).find('#data_server_occupied_perc').text(data.server_occupied_perc);
|
||||
$(element).find('#data_total_playtime').text(data.total_playtime);
|
||||
$(element).find('#data_afk_time').text(data.afk_time);
|
||||
$(element).find('#data_afk_time_perc').text(data.afk_time_perc)
|
||||
element.querySelector('#data_total_playtime').innerText = data.total_playtime;
|
||||
element.querySelector('#data_afk_time').innerText = data.afk_time;
|
||||
element.querySelector('#data_afk_time_perc').innerText = data.afk_time_perc
|
||||
}
|
||||
|
||||
/* This function loads Playerbase Overview tab */
|
||||
function loadPlayerbaseOverviewValues(json, error) {
|
||||
tab = $('#playerbase-overview');
|
||||
const tab = document.getElementById('playerbase-overview');
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Trends
|
||||
data = json.trends;
|
||||
element = $(tab).find('#data_trends');
|
||||
let data = json.trends;
|
||||
let element = tab.querySelector('#data_trends');
|
||||
|
||||
$(element).find('#data_total_players_then').text(data.total_players_then);
|
||||
$(element).find('#data_total_players_now').text(data.total_players_now);
|
||||
$(element).find('#data_total_players_trend').replaceWith(trend(data.total_players_trend));
|
||||
$(element).find('#data_regular_players_then').text(data.regular_players_then);
|
||||
$(element).find('#data_regular_players_now').text(data.regular_players_now);
|
||||
$(element).find('#data_regular_players_trend').replaceWith(trend(data.regular_players_trend));
|
||||
$(element).find('#data_playtime_avg_then').text(data.playtime_avg_then);
|
||||
$(element).find('#data_playtime_avg_now').text(data.playtime_avg_now);
|
||||
$(element).find('#data_playtime_avg_trend').replaceWith(trend(data.playtime_avg_trend));
|
||||
$(element).find('#data_afk_then').text(data.afk_then);
|
||||
$(element).find('#data_afk_now').text(data.afk_now);
|
||||
$(element).find('#data_afk_trend').replaceWith(trend(data.afk_trend));
|
||||
$(element).find('#data_regular_playtime_avg_then').text(data.regular_playtime_avg_then);
|
||||
$(element).find('#data_regular_playtime_avg_now').text(data.regular_playtime_avg_now);
|
||||
$(element).find('#data_regular_playtime_avg_trend').replaceWith(trend(data.regular_playtime_avg_trend));
|
||||
$(element).find('#data_regular_session_avg_then').text(data.regular_session_avg_then);
|
||||
$(element).find('#data_regular_session_avg_now').text(data.regular_session_avg_now);
|
||||
$(element).find('#data_regular_session_avg_trend').replaceWith(trend(data.regular_session_avg_trend));
|
||||
$(element).find('#data_regular_afk_then').text(data.regular_afk_avg_then);
|
||||
$(element).find('#data_regular_afk_now').text(data.regular_afk_avg_now);
|
||||
$(element).find('#data_regular_afk_trend').replaceWith(trend(data.regular_afk_avg_trend));
|
||||
element.querySelector('#data_total_players_then').innerText = data.total_players_then;
|
||||
element.querySelector('#data_total_players_now').innerText = data.total_players_now;
|
||||
element.querySelector('#data_total_players_trend').innerHTML = trend(data.total_players_trend);
|
||||
element.querySelector('#data_regular_players_then').innerText = data.regular_players_then;
|
||||
element.querySelector('#data_regular_players_now').innerText = data.regular_players_now;
|
||||
element.querySelector('#data_regular_players_trend').innerHTML = trend(data.regular_players_trend);
|
||||
element.querySelector('#data_playtime_avg_then').innerText = data.playtime_avg_then;
|
||||
element.querySelector('#data_playtime_avg_now').innerText = data.playtime_avg_now;
|
||||
element.querySelector('#data_playtime_avg_trend').innerHTML = trend(data.playtime_avg_trend);
|
||||
element.querySelector('#data_afk_then').innerText = data.afk_then;
|
||||
element.querySelector('#data_afk_now').innerText = data.afk_now;
|
||||
element.querySelector('#data_afk_trend').innerHTML = trend(data.afk_trend);
|
||||
element.querySelector('#data_regular_playtime_avg_then').innerText = data.regular_playtime_avg_then;
|
||||
element.querySelector('#data_regular_playtime_avg_now').innerText = data.regular_playtime_avg_now;
|
||||
element.querySelector('#data_regular_playtime_avg_trend').innerHTML = trend(data.regular_playtime_avg_trend);
|
||||
element.querySelector('#data_regular_session_avg_then').innerText = data.regular_session_avg_then;
|
||||
element.querySelector('#data_regular_session_avg_now').innerText = data.regular_session_avg_now;
|
||||
element.querySelector('#data_regular_session_avg_trend').innerHTML = trend(data.regular_session_avg_trend);
|
||||
element.querySelector('#data_regular_afk_then').innerText = data.regular_afk_avg_then;
|
||||
element.querySelector('#data_regular_afk_now').innerText = data.regular_afk_avg_now;
|
||||
element.querySelector('#data_regular_afk_trend').innerHTML = trend(data.regular_afk_avg_trend);
|
||||
|
||||
// Insights
|
||||
data = json.insights;
|
||||
element = $(tab).find('#data_insights');
|
||||
element = tab.querySelector('#data_insights');
|
||||
|
||||
$(element).find('#data_new_to_regular').replaceWith(data.new_to_regular + smallTrend(data.new_to_regular_trend));
|
||||
$(element).find('#data_regular_to_inactive').replaceWith(data.regular_to_inactive + smallTrend(data.regular_to_inactive_trend))
|
||||
element.querySelector('#data_new_to_regular').innerHTML = data.new_to_regular + smallTrend(data.new_to_regular_trend);
|
||||
element.querySelector('#data_regular_to_inactive').innerHTML = data.regular_to_inactive + smallTrend(data.regular_to_inactive_trend);
|
||||
}
|
||||
|
||||
function loadservers(servers, error) {
|
||||
if (error) {
|
||||
displayError($('#servers-tab'), error);
|
||||
displayError(document.getElementById('servers-tab'), error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!servers || !servers.length) {
|
||||
$('#data_server_list').replaceWith(
|
||||
document.getElementById('data_server_list').innerHTML =
|
||||
`<div class="card shadow mb-4"><div class="card-body"><p>No servers found in the database.</p><p>It appears that Plan is not installed on any game servers or not connected to the same database. See <a href="https://github.com/plan-player-analytics/Plan/wiki">wiki</a> for Network tutorial.</p></div></div>`
|
||||
);
|
||||
$('#quick_view_players_online').text(`No server to display online activity for.`);
|
||||
document.getElementById('quick_view_players_online').innerText = `No server to display online activity for.`;
|
||||
return;
|
||||
}
|
||||
|
||||
var serversHtml = '';
|
||||
for (var i = 0; i < servers.length; i++) {
|
||||
let serversHtml = '';
|
||||
for (let i = 0; i < servers.length; i++) {
|
||||
serversHtml += createnetworkserverBox(i, servers[i]);
|
||||
}
|
||||
$("#data_server_list").replaceWith(serversHtml);
|
||||
document.getElementById("data_server_list").innerHTML = serversHtml;
|
||||
|
||||
for (var i = 0; i < servers.length; i++) {
|
||||
$('#server_quick_view_' + i).click(onViewserver(i, servers));
|
||||
for (let i = 0; i < servers.length; i++) {
|
||||
document.getElementById(`server_quick_view_${i}`)
|
||||
.addEventListener('click', onViewserver(i, servers));
|
||||
}
|
||||
onViewserver(0, servers)(); // Open first server.
|
||||
}
|
||||
|
||||
function createnetworkserverBox(i, server) {
|
||||
return `<div class="card shadow mb-4">` +
|
||||
`<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">` +
|
||||
`<h6 class="m-0 font-weight-bold col-black"><i class="fas fa-fw fa-server col-light-green"></i> ` + server.name + `</h6>` +
|
||||
`<div class="mb-0 col-lg-6">` +
|
||||
`<p class="mb-1"><i class="fa fa-fw fa-users col-black"></i> Registered Players` +
|
||||
`<span class="float-right"><b>` + server.players + `</b></span></p>` +
|
||||
`<p class="mb-0"><i class="fa fa-fw fa-user col-blue"></i> Players Online` +
|
||||
`<span class="float-right"><b>` + server.online + `</b></span></p>` +
|
||||
`</div>` + // /column
|
||||
`</div>` + // /header
|
||||
`<div class="d-flex align-items-center justify-content-between">` +
|
||||
`<a class="btn col-light-green ml-2" href="server/` + server.name + `"><i class="fa fa-fw fa-chart-line"></i> Server Analysis</a>` +
|
||||
`<button class="btn bg-blue my-2 mr-2" id="server_quick_view_` + i + `">Quick view <i class="fa fa-fw fa-caret-square-right"></i></button>` +
|
||||
`</div>` + // /buttons
|
||||
`</div>` // /card
|
||||
return `<div class="card shadow mb-4">
|
||||
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold col-black">
|
||||
<i class="fas fa-fw fa-server col-light-green"></i> ${server.name}
|
||||
</h6>
|
||||
<div class="mb-0 col-lg-6">
|
||||
<p class="mb-1"><i class="fa fa-fw fa-users col-black"></i> Registered Players<span class="float-right"><b>${server.players}</b></span></p>
|
||||
<p class="mb-0"><i class="fa fa-fw fa-user col-blue"></i> Players Online<span class="float-right"><b>${server.online}</b></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<a class="btn col-light-green ml-2" href="server/${server.name}">
|
||||
<i class="fa fa-fw fa-chart-line"></i> Server Analysis
|
||||
</a>
|
||||
<button class="btn bg-blue my-2 mr-2" id="server_quick_view_${i}">
|
||||
Quick view <i class="fa fa-fw fa-caret-square-right"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function onViewserver(i, servers) {
|
||||
return function () {
|
||||
setTimeout(function () {
|
||||
var server = servers[i];
|
||||
var playersOnlineSeries = {
|
||||
const server = servers[i];
|
||||
const playersOnlineSeries = {
|
||||
name: s.name.playersOnline,
|
||||
type: s.type.areaSpline,
|
||||
tooltip: s.tooltip.zeroDecimals,
|
||||
@ -285,21 +291,122 @@ function onViewserver(i, servers) {
|
||||
color: v.colors.playersOnline,
|
||||
yAxis: 0
|
||||
};
|
||||
$('.data_server_name').text(server.name);
|
||||
document.querySelector('.data_server_name').innerText = server.name
|
||||
playersChart('quick_view_players_online', playersOnlineSeries, 2);
|
||||
|
||||
var quickView = $('#data_quick_view');
|
||||
const quickView = document.getElementById('data_quick_view');
|
||||
|
||||
quickView.find('#data_last_peak_date').text(server.last_peak_date);
|
||||
quickView.find('#data_last_peak_players').text(server.last_peak_players);
|
||||
quickView.find('#data_best_peak_date').text(server.best_peak_date);
|
||||
quickView.find('#data_best_peak_players').text(server.best_peak_players);
|
||||
quickView.querySelector('#data_last_peak_date').innerText = server.last_peak_date;
|
||||
quickView.querySelector('#data_last_peak_players').innerText = server.last_peak_players;
|
||||
quickView.querySelector('#data_best_peak_date').innerText = server.best_peak_date;
|
||||
quickView.querySelector('#data_best_peak_players').innerText = server.best_peak_players;
|
||||
|
||||
quickView.find('#data_unique').text(server.unique_players);
|
||||
quickView.find('#data_new').text(server.new_players);
|
||||
quickView.find('#data_avg_tps').text(server.avg_tps);
|
||||
quickView.find('#data_low_tps_spikes').text(server.low_tps_spikes);
|
||||
quickView.find('#data_downtime').text(server.downtime);
|
||||
quickView.querySelector('#data_unique').innerText = server.unique_players;
|
||||
quickView.querySelector('#data_new').innerText = server.new_players;
|
||||
quickView.querySelector('#data_avg_tps').innerText = server.avg_tps;
|
||||
quickView.querySelector('#data_low_tps_spikes').innerText = server.low_tps_spikes;
|
||||
quickView.querySelector('#data_downtime').innerText = server.downtime;
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function loadPlayersOnlineGraph(json, error) {
|
||||
if (json) {
|
||||
const series = {
|
||||
playersOnline: {
|
||||
name: s.name.playersOnline, type: s.type.areaSpline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.playersOnline, color: v.colors.playersOnline, yAxis: 0
|
||||
}
|
||||
};
|
||||
playersChart('playersOnlineChart', series.playersOnline, 2);
|
||||
} else if (error) {
|
||||
document.getElementById('playersOnlineChart').innerText = `Failed to load graph data: ${error}`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadUniqueAndNewGraph(json, error) {
|
||||
if (json) {
|
||||
const uniquePlayers = {
|
||||
name: s.name.uniquePlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.uniquePlayers, color: v.colors.playersOnline
|
||||
};
|
||||
const newPlayers = {
|
||||
name: s.name.newPlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.newPlayers, color: v.colors.newPlayers
|
||||
};
|
||||
dayByDay('uniqueChart', [uniquePlayers, newPlayers]);
|
||||
} else if (error) {
|
||||
document.getElementById('uniqueChart').innerText = `Failed to load graph data: ${error}`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadHourlyUniqueAndNewGraph(json, error) {
|
||||
if (json) {
|
||||
const uniquePlayers = {
|
||||
name: s.name.uniquePlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.uniquePlayers, color: v.colors.playersOnline
|
||||
};
|
||||
const newPlayers = {
|
||||
name: s.name.newPlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.newPlayers, color: v.colors.newPlayers
|
||||
};
|
||||
dayByDay('hourlyUniqueChart', [uniquePlayers, newPlayers]);
|
||||
} else if (error) {
|
||||
document.getElementById('uniqueChart').innerText = `Failed to load graph data: ${error}`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadServerPie(json, error) {
|
||||
if (json) {
|
||||
serverPieSeries = {
|
||||
name: 'Server Playtime',
|
||||
colorByPoint: true,
|
||||
colors: json.server_pie_colors,
|
||||
data: json.server_pie_series_30d
|
||||
};
|
||||
serverPie('serverPie', serverPieSeries);
|
||||
} else if (error) {
|
||||
document.getElementById('serverPie').innerText = `Failed to load graph data: ${error}`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadActivityGraphs(json, error) {
|
||||
if (json) {
|
||||
activityPie('activityPie', {
|
||||
name: s.name.unit_players, colorByPoint: true, data: json.activity_pie_series
|
||||
});
|
||||
stackChart('activityStackGraph', json.activity_labels, json.activity_series, s.name.unit_players);
|
||||
} else if (error) {
|
||||
const errorMessage = `Failed to load graph data: ${error}`;
|
||||
document.getElementById('activityPie').innerText = errorMessage;
|
||||
document.getElementById('activityStackGraph').innerText = errorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
function loadGeolocationGraph(json, error) {
|
||||
if (json) {
|
||||
const geolocationSeries = {
|
||||
name: s.name.unit_players,
|
||||
type: 'map',
|
||||
mapData: Highcharts.maps['custom/world'],
|
||||
data: json.geolocation_series,
|
||||
joinBy: ['iso-a3', 'code']
|
||||
};
|
||||
const geolocationBarSeries = {
|
||||
color: json.colors.bars,
|
||||
name: s.name.unit_players,
|
||||
data: json.geolocation_bar_series.map(function (bar) {
|
||||
return bar.value
|
||||
})
|
||||
};
|
||||
const geolocationBarCategories = json.geolocation_bar_series.map(function (bar) {
|
||||
return bar.label
|
||||
});
|
||||
worldMap('worldMap', json.colors.low, json.colors.high, geolocationSeries);
|
||||
horizontalBarChart('countryBarChart', geolocationBarCategories, [geolocationBarSeries], s.name.unit_players);
|
||||
} else if (error) {
|
||||
const errorMessage = `Failed to load graph data: ${error}`;
|
||||
document.getElementById('worldMap').innerText = errorMessage;
|
||||
document.getElementById('countryBarChart').innerText = errorMessage;
|
||||
}
|
||||
}
|
@ -1,32 +1,26 @@
|
||||
function loadPingTable(json, error) {
|
||||
pingTable = $("#geolocations").find("#data_ping_table").find("tbody");
|
||||
const pingTable = document.querySelector('#geolocations #data_ping_table tbody');
|
||||
|
||||
if (error) {
|
||||
pingTable.append('<tr><td>Error: ' + error + '</td><td>-</td><td>-</td><td>-</td></tr>');
|
||||
pingTable.innerHTML = `<tr><td>Error: ${error}</td><td>-</td><td>-</td><td>-</td></tr>`;
|
||||
return;
|
||||
}
|
||||
|
||||
var countries = json;
|
||||
const countries = json.table;
|
||||
|
||||
if (!countries.length) {
|
||||
pingTable.append('<tr><td>No Data</td><td>-</td><td>-</td><td>-</td></tr>');
|
||||
pingTable.innerHTML = '<tr><td>No Data</td><td>-</td><td>-</td><td>-</td></tr>';
|
||||
return;
|
||||
}
|
||||
|
||||
var tableHtml = '';
|
||||
|
||||
for (var i = 0; i < countries.length; i++) {
|
||||
var country = countries[i];
|
||||
tableHtml += createPingTableRow(country);
|
||||
}
|
||||
|
||||
pingTable.append(tableHtml);
|
||||
pingTable.innerHTML = countries.map(createPingTableRow).join('');
|
||||
}
|
||||
|
||||
function createPingTableRow(entry) {
|
||||
return '<tr><td>' + entry.country +
|
||||
'</td><td>' + entry.avg_ping +
|
||||
'</td><td>' + entry.min_ping +
|
||||
'</td><td>' + entry.max_ping +
|
||||
'</td></tr>'
|
||||
return `<tr>
|
||||
<td>${entry.country}</td>
|
||||
<td>${entry.avg_ping}</td>
|
||||
<td>${entry.min_ping}</td>
|
||||
<td>${entry.max_ping}</td>
|
||||
</tr>`
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
var trend_up_good = "<span class=\"badge badge-success\"><i class=\"fa fa-caret-up\"></i> ";
|
||||
var trend_up_bad = "<span class=\"badge badge-danger\"><i class=\"fa fa-caret-up\"></i> ";
|
||||
var trend_down_bad = "<span class=\"badge badge-danger\"><i class=\"fa fa-caret-down\"></i> ";
|
||||
var trend_down_good = "<span class=\"badge badge-success\"><i class=\"fa fa-caret-down\"></i> ";
|
||||
var trend_same = "<span class=\"badge badge-warning\"><i class=\"fa fa-caret-right\"></i> ";
|
||||
const trend_up_good = "<span class=\"badge badge-success\"><i class=\"fa fa-caret-up\"></i> ";
|
||||
const trend_up_bad = "<span class=\"badge badge-danger\"><i class=\"fa fa-caret-up\"></i> ";
|
||||
const trend_down_bad = "<span class=\"badge badge-danger\"><i class=\"fa fa-caret-down\"></i> ";
|
||||
const trend_down_good = "<span class=\"badge badge-success\"><i class=\"fa fa-caret-down\"></i> ";
|
||||
const trend_same = "<span class=\"badge badge-warning\"><i class=\"fa fa-caret-right\"></i> ";
|
||||
|
||||
var trend_end = "</span>";
|
||||
const trend_end = "</span>";
|
||||
|
||||
function trend(trend) {
|
||||
if (!trend) {
|
||||
@ -27,22 +27,28 @@ function smallTrend(trend) {
|
||||
switch (trend.direction) {
|
||||
case '+':
|
||||
trend_color = trend.reversed ? 'text-danger' : 'text-success';
|
||||
return ' <i class="' + trend_color + ' fa fa-caret-up" title="' + trend.text + '"></i>';
|
||||
return ` <i class="${trend_color} fa fa-caret-up" title="${trend.text}"></i>`;
|
||||
case '-':
|
||||
trend_color = trend.reversed ? 'text-success' : 'text-danger';
|
||||
return ' <i class="' + trend_color + ' fa fa-caret-down" title="' + trend.text + '"></i>';
|
||||
return ` <i class="${trend_color} fa fa-caret-down" title="${trend.text}"></i>`;
|
||||
default:
|
||||
return ' <i class="text-warning fa fa-caret-right" title="' + trend.text + '"></i>';
|
||||
return ` <i class="text-warning fa fa-caret-right" title="${trend.text}"></i>`;
|
||||
}
|
||||
}
|
||||
|
||||
function displayError(element, error) {
|
||||
element.find('.d-sm-flex').after(`<div class="alert alert-danger" role="alert">Failed to load values: ` + error + '</div>')
|
||||
insertElementAfterElement(element.querySelector('.d-sm-flex'), () => {
|
||||
const alert = document.createElement('div');
|
||||
alert.classList.add('alert', 'alert-danger');
|
||||
alert.setAttribute('role', 'alert');
|
||||
alert.innerText = `Failed to load values: ${error}`;
|
||||
return alert;
|
||||
})
|
||||
}
|
||||
|
||||
/* This function loads Server Overview tab */
|
||||
function loadserverOverviewValues(json, error) {
|
||||
tab = $('#server-overview');
|
||||
const tab = document.getElementById('server-overview');
|
||||
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
@ -50,80 +56,80 @@ function loadserverOverviewValues(json, error) {
|
||||
}
|
||||
|
||||
// Last 7 days
|
||||
data = json.last_7_days;
|
||||
element = $(tab).find('#data_7_days');
|
||||
let data = json.last_7_days;
|
||||
let element = tab.querySelector('#data_7_days');
|
||||
|
||||
$(element).find('#data_unique').text(data.unique_players);
|
||||
$(element).find('#data_unique_day').text(data.unique_players_day);
|
||||
$(element).find('#data_new').text(data.new_players);
|
||||
$(element).find('#data_retention').text('(' + data.new_players_retention + '/' + data.new_players + ')');
|
||||
$(element).find('#data_retention_perc').text(data.new_players_retention_perc);
|
||||
element.querySelector('#data_unique').innerText = data.unique_players;
|
||||
element.querySelector('#data_unique_day').innerText = data.unique_players_day;
|
||||
element.querySelector('#data_new').innerText = data.new_players;
|
||||
element.querySelector('#data_retention').innerText = '(' + data.new_players_retention + '/' + data.new_players + ')';
|
||||
element.querySelector('#data_retention_perc').innerText = data.new_players_retention_perc;
|
||||
|
||||
$(element).find('#data_avg_tps').text(data.average_tps);
|
||||
$(element).find('#data_low_tps_spikes').text(data.low_tps_spikes);
|
||||
$(element).find('#data_downtime').text(data.downtime);
|
||||
element.querySelector('#data_avg_tps').innerText = data.average_tps;
|
||||
element.querySelector('#data_low_tps_spikes').innerText = data.low_tps_spikes;
|
||||
element.querySelector('#data_downtime').innerText = data.downtime;
|
||||
|
||||
// Server As Numbers
|
||||
data = json.numbers;
|
||||
element = $(tab).find('#data_numbers');
|
||||
element = tab.querySelector('#data_numbers');
|
||||
|
||||
$(element).find('#data_total').text(data.total_players);
|
||||
$(element).find('#data_regular').text(data.regular_players);
|
||||
$(element).find('#data_online').text(data.online_players);
|
||||
element.querySelector('#data_total').innerText = data.total_players;
|
||||
element.querySelector('#data_regular').innerText = data.regular_players;
|
||||
element.querySelector('#data_online').innerText = data.online_players;
|
||||
|
||||
$(element).find('#data_last_peak_date').text(data.last_peak_date);
|
||||
$(element).find('#data_last_peak_players').text(data.last_peak_players);
|
||||
$(element).find('#data_best_peak_date').text(data.best_peak_date);
|
||||
$(element).find('#data_best_peak_players').text(data.best_peak_players);
|
||||
element.querySelector('#data_last_peak_date').innerText = data.last_peak_date;
|
||||
element.querySelector('#data_last_peak_players').innerText = data.last_peak_players;
|
||||
element.querySelector('#data_best_peak_date').innerText = data.best_peak_date;
|
||||
element.querySelector('#data_best_peak_players').innerText = data.best_peak_players;
|
||||
|
||||
$(element).find('#data_playtime').text(data.playtime);
|
||||
$(element).find('#data_player_playtime').text(data.player_playtime);
|
||||
$(element).find('#data_sessions').text(data.sessions);
|
||||
element.querySelector('#data_playtime').innerText = data.playtime;
|
||||
element.querySelector('#data_player_playtime').innerText = data.player_playtime;
|
||||
element.querySelector('#data_sessions').innerText = data.sessions;
|
||||
|
||||
$(element).find('#data_player_kills').text(data.player_kills);
|
||||
$(element).find('#data_mob_kills').text(data.mob_kills);
|
||||
$(element).find('#data_deaths').text(data.deaths);
|
||||
element.querySelector('#data_player_kills').innerText = data.player_kills;
|
||||
element.querySelector('#data_mob_kills').innerText = data.mob_kills;
|
||||
element.querySelector('#data_deaths').innerText = data.deaths;
|
||||
|
||||
// Week Comparison
|
||||
data = json.weeks;
|
||||
element = $(tab).find('#data_weeks');
|
||||
element = tab.querySelector('#data_weeks');
|
||||
|
||||
$(element).find('#data_start').text(data.start);
|
||||
$(element).find('#data_midpoint').text(data.midpoint);
|
||||
$(element).find('#data_midpoint2').text(data.midpoint);
|
||||
$(element).find('#data_end').text(data.end);
|
||||
element.querySelector('#data_start').innerText = data.start;
|
||||
element.querySelector('#data_midpoint').innerText = data.midpoint;
|
||||
element.querySelector('#data_midpoint2').innerText = data.midpoint;
|
||||
element.querySelector('#data_end').innerText = data.end;
|
||||
|
||||
$(element).find('#data_unique_before').text(data.unique_before);
|
||||
$(element).find('#data_unique_after').text(data.unique_after);
|
||||
$(element).find('#data_unique_trend').replaceWith(trend(data.unique_trend));
|
||||
$(element).find('#data_new_before').text(data.new_before);
|
||||
$(element).find('#data_new_after').text(data.new_after);
|
||||
$(element).find('#data_new_trend').replaceWith(trend(data.new_trend));
|
||||
$(element).find('#data_regular_before').text(data.regular_before);
|
||||
$(element).find('#data_regular_after').text(data.regular_after);
|
||||
$(element).find('#data_regular_trend').replaceWith(trend(data.regular_trend));
|
||||
element.querySelector('#data_unique_before').innerText = data.unique_before;
|
||||
element.querySelector('#data_unique_after').innerText = data.unique_after;
|
||||
element.querySelector('#data_unique_trend').innerHTML = trend(data.unique_trend);
|
||||
element.querySelector('#data_new_before').innerText = data.new_before;
|
||||
element.querySelector('#data_new_after').innerText = data.new_after;
|
||||
element.querySelector('#data_new_trend').innerHTML = trend(data.new_trend);
|
||||
element.querySelector('#data_regular_before').innerText = data.regular_before;
|
||||
element.querySelector('#data_regular_after').innerText = data.regular_after;
|
||||
element.querySelector('#data_regular_trend').innerHTML = trend(data.regular_trend);
|
||||
|
||||
$(element).find('#data_average_playtime_before').text(data.average_playtime_before);
|
||||
$(element).find('#data_average_playtime_after').text(data.average_playtime_after);
|
||||
$(element).find('#data_average_playtime_trend').replaceWith(trend(data.average_playtime_trend));
|
||||
$(element).find('#data_sessions_before').text(data.sessions_before);
|
||||
$(element).find('#data_sessions_after').text(data.sessions_after);
|
||||
$(element).find('#data_sessions_trend').replaceWith(trend(data.sessions_trend));
|
||||
element.querySelector('#data_average_playtime_before').innerText = data.average_playtime_before;
|
||||
element.querySelector('#data_average_playtime_after').innerText = data.average_playtime_after;
|
||||
element.querySelector('#data_average_playtime_trend').innerHTML = trend(data.average_playtime_trend);
|
||||
element.querySelector('#data_sessions_before').innerText = data.sessions_before;
|
||||
element.querySelector('#data_sessions_after').innerText = data.sessions_after;
|
||||
element.querySelector('#data_sessions_trend').innerHTML = trend(data.sessions_trend);
|
||||
|
||||
$(element).find('#data_player_kills_before').text(data.player_kills_before);
|
||||
$(element).find('#data_player_kills_after').text(data.player_kills_after);
|
||||
$(element).find('#data_player_kills_trend').replaceWith(trend(data.player_kills_trend));
|
||||
$(element).find('#data_mob_kills_before').text(data.mob_kills_before);
|
||||
$(element).find('#data_mob_kills_after').text(data.mob_kills_after);
|
||||
$(element).find('#data_mob_kills_trend').replaceWith(trend(data.mob_kills_trend));
|
||||
$(element).find('#data_deaths_before').text(data.deaths_before);
|
||||
$(element).find('#data_deaths_after').text(data.deaths_after);
|
||||
$(element).find('#data_deaths_trend').replaceWith(trend(data.deaths_trend))
|
||||
element.querySelector('#data_player_kills_before').innerText = data.player_kills_before;
|
||||
element.querySelector('#data_player_kills_after').innerText = data.player_kills_after;
|
||||
element.querySelector('#data_player_kills_trend').innerHTML = trend(data.player_kills_trend);
|
||||
element.querySelector('#data_mob_kills_before').innerText = data.mob_kills_before;
|
||||
element.querySelector('#data_mob_kills_after').innerText = data.mob_kills_after;
|
||||
element.querySelector('#data_mob_kills_trend').innerHTML = trend(data.mob_kills_trend);
|
||||
element.querySelector('#data_deaths_before').innerText = data.deaths_before;
|
||||
element.querySelector('#data_deaths_after').innerText = data.deaths_after;
|
||||
element.querySelector('#data_deaths_trend').innerHTML = trend(data.deaths_trend);
|
||||
}
|
||||
|
||||
/* This function loads Online Activity Overview tab */
|
||||
function loadOnlineActivityOverviewValues(json, error) {
|
||||
tab = $('#online-activity-overview');
|
||||
const tab = document.getElementById('online-activity-overview');
|
||||
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
@ -131,59 +137,59 @@ function loadOnlineActivityOverviewValues(json, error) {
|
||||
}
|
||||
|
||||
// Online Activity as Numbers
|
||||
data = json.numbers;
|
||||
element = $(tab).find('#data_numbers');
|
||||
let data = json.numbers;
|
||||
let element = tab.querySelector('#data_numbers');
|
||||
|
||||
$(element).find('#data_unique_players_30d').replaceWith('<td>' + data.unique_players_30d + smallTrend(data.unique_players_30d_trend) + '</td>');
|
||||
$(element).find('#data_unique_players_7d').text(data.unique_players_7d);
|
||||
$(element).find('#data_unique_players_24h').text(data.unique_players_24h);
|
||||
element.querySelector('#data_unique_players_30d').innerHTML = data.unique_players_30d + smallTrend(data.unique_players_30d_trend);
|
||||
element.querySelector('#data_unique_players_7d').innerText = data.unique_players_7d;
|
||||
element.querySelector('#data_unique_players_24h').innerText = data.unique_players_24h;
|
||||
|
||||
$(element).find('#data_unique_players_30d_avg').replaceWith('<td>' + data.unique_players_30d_avg + smallTrend(data.unique_players_30d_avg_trend) + '</td>');
|
||||
$(element).find('#data_unique_players_7d_avg').text(data.unique_players_7d_avg);
|
||||
$(element).find('#data_unique_players_24h_avg').text(data.unique_players_24h_avg);
|
||||
element.querySelector('#data_unique_players_30d_avg').innerHTML = data.unique_players_30d_avg + smallTrend(data.unique_players_30d_avg_trend);
|
||||
element.querySelector('#data_unique_players_7d_avg').innerText = data.unique_players_7d_avg;
|
||||
element.querySelector('#data_unique_players_24h_avg').innerText = data.unique_players_24h_avg;
|
||||
|
||||
$(element).find('#data_new_players_30d').replaceWith('<td>' + data.new_players_30d + smallTrend(data.new_players_30d_trend) + '</td>');
|
||||
$(element).find('#data_new_players_7d').text(data.new_players_7d);
|
||||
$(element).find('#data_new_players_24h').text(data.new_players_24h);
|
||||
element.querySelector('#data_new_players_30d').innerHTML = data.new_players_30d + smallTrend(data.new_players_30d_trend);
|
||||
element.querySelector('#data_new_players_7d').innerText = data.new_players_7d;
|
||||
element.querySelector('#data_new_players_24h').innerText = data.new_players_24h;
|
||||
|
||||
$(element).find('#data_new_players_30d_avg').replaceWith('<td>' + data.new_players_30d_avg + smallTrend(data.new_players_30d_avg_trend) + '</td>');
|
||||
$(element).find('#data_new_players_7d_avg').text(data.new_players_7d_avg);
|
||||
$(element).find('#data_new_players_24h_avg').text(data.new_players_24h_avg);
|
||||
element.querySelector('#data_new_players_30d_avg').innerHTML = data.new_players_30d_avg + smallTrend(data.new_players_30d_avg_trend);
|
||||
element.querySelector('#data_new_players_7d_avg').innerText = data.new_players_7d_avg;
|
||||
element.querySelector('#data_new_players_24h_avg').innerText = data.new_players_24h_avg;
|
||||
|
||||
$(element).find('#data_new_players_retention_30d').text('(' + data.new_players_retention_30d + '/' + data.new_players_30d + ') ' + data.new_players_retention_30d_perc);
|
||||
$(element).find('#data_new_players_retention_7d').text('(' + data.new_players_retention_7d + '/' + data.new_players_7d + ') ' + data.new_players_retention_7d_perc);
|
||||
$(element).find('#data_new_players_retention_24h').replaceWith(`<td title="This value is a prediction based on previous players.">(` + data.new_players_retention_24h + '/' + data.new_players_24h + ') ' + data.new_players_retention_24h_perc + ' <i class="far fa-fw fa-eye"></i></td>');
|
||||
element.querySelector('#data_new_players_retention_30d').innerText = '(' + data.new_players_retention_30d + '/' + data.new_players_30d + ') ' + data.new_players_retention_30d_perc;
|
||||
element.querySelector('#data_new_players_retention_7d').innerText = '(' + data.new_players_retention_7d + '/' + data.new_players_7d + ') ' + data.new_players_retention_7d_perc;
|
||||
element.querySelector('#data_new_players_retention_24h').innerHTML = '(' + data.new_players_retention_24h + '/' + data.new_players_24h + ') ' + data.new_players_retention_24h_perc + ' <i class="far fa-fw fa-eye"></i>';
|
||||
|
||||
$(element).find('#data_playtime_30d').replaceWith('<td>' + data.playtime_30d + smallTrend(data.playtime_30d_trend) + '</td>');
|
||||
$(element).find('#data_playtime_7d').text(data.playtime_7d);
|
||||
$(element).find('#data_playtime_24h').text(data.playtime_24h);
|
||||
element.querySelector('#data_playtime_30d').innerHTML = data.playtime_30d + smallTrend(data.playtime_30d_trend);
|
||||
element.querySelector('#data_playtime_7d').innerText = data.playtime_7d;
|
||||
element.querySelector('#data_playtime_24h').innerText = data.playtime_24h;
|
||||
|
||||
$(element).find('#data_playtime_30d_avg').replaceWith('<td>' + data.playtime_30d_avg + smallTrend(data.playtime_30d_avg_trend) + '</td>');
|
||||
$(element).find('#data_playtime_7d_avg').text(data.playtime_7d_avg);
|
||||
$(element).find('#data_playtime_24h_avg').text(data.playtime_24h_avg);
|
||||
element.querySelector('#data_playtime_30d_avg').innerHTML = data.playtime_30d_avg + smallTrend(data.playtime_30d_avg_trend);
|
||||
element.querySelector('#data_playtime_7d_avg').innerText = data.playtime_7d_avg;
|
||||
element.querySelector('#data_playtime_24h_avg').innerText = data.playtime_24h_avg;
|
||||
|
||||
$(element).find('#data_session_length_30d_avg').replaceWith('<td>' + data.session_length_30d_avg + smallTrend(data.session_length_30d_trend) + '</td>');
|
||||
$(element).find('#data_session_length_7d_avg').text(data.session_length_7d_avg);
|
||||
$(element).find('#data_session_length_24h_avg').text(data.session_length_24h_avg);
|
||||
element.querySelector('#data_session_length_30d_avg').innerHTML = data.session_length_30d_avg + smallTrend(data.session_length_30d_trend);
|
||||
element.querySelector('#data_session_length_7d_avg').innerText = data.session_length_7d_avg;
|
||||
element.querySelector('#data_session_length_24h_avg').innerText = data.session_length_24h_avg;
|
||||
|
||||
$(element).find('#data_sessions_30d').replaceWith('<td>' + data.sessions_30d + smallTrend(data.sessions_30d_trend) + '</td>');
|
||||
$(element).find('#data_sessions_7d').text(data.sessions_7d);
|
||||
$(element).find('#data_sessions_24h').text(data.sessions_24h);
|
||||
element.querySelector('#data_sessions_30d').innerHTML = data.sessions_30d + smallTrend(data.sessions_30d_trend);
|
||||
element.querySelector('#data_sessions_7d').innerText = data.sessions_7d;
|
||||
element.querySelector('#data_sessions_24h').innerText = data.sessions_24h;
|
||||
|
||||
// Insights
|
||||
data = json.insights;
|
||||
element = $(tab).find('#data_insights');
|
||||
element = tab.querySelector('#data_insights');
|
||||
|
||||
$(element).find('#data_players_first_join_avg').replaceWith(data.players_first_join_avg + smallTrend(data.players_first_join_trend));
|
||||
$(element).find('#data_first_session_length_avg').replaceWith(data.first_session_length_avg + smallTrend(data.first_session_length_trend));
|
||||
$(element).find('#data_first_session_length_median').replaceWith(data.first_session_length_median + smallTrend(data.first_session_length_median_trend));
|
||||
$(element).find('#data_lone_joins').replaceWith(data.lone_joins + smallTrend(data.lone_joins_trend));
|
||||
$(element).find('#data_lone_new_joins').replaceWith(data.lone_new_joins + smallTrend(data.lone_new_joins_trend))
|
||||
element.querySelector('#data_players_first_join_avg').innerHTML = data.players_first_join_avg + smallTrend(data.players_first_join_trend);
|
||||
element.querySelector('#data_first_session_length_avg').innerHTML = data.first_session_length_avg + smallTrend(data.first_session_length_trend);
|
||||
element.querySelector('#data_first_session_length_median').innerHTML = data.first_session_length_median + smallTrend(data.first_session_length_median_trend);
|
||||
element.querySelector('#data_lone_joins').innerHTML = data.lone_joins + smallTrend(data.lone_joins_trend);
|
||||
element.querySelector('#data_lone_new_joins').innerHTML = data.lone_new_joins + smallTrend(data.lone_new_joins_trend);
|
||||
}
|
||||
|
||||
/* This function loads Sessions tab */
|
||||
function loadSessionValues(json, error) {
|
||||
tab = $('#sessions-overview');
|
||||
const tab = document.getElementById('sessions-overview');
|
||||
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
@ -191,161 +197,386 @@ function loadSessionValues(json, error) {
|
||||
}
|
||||
|
||||
// Insights
|
||||
data = json.insights;
|
||||
element = $(tab).find('#data_insights');
|
||||
let data = json.insights;
|
||||
const element = tab.querySelector('#data_insights');
|
||||
|
||||
$(element).find('#data_most_active_gamemode').text(data.most_active_gamemode);
|
||||
$(element).find('#data_most_active_gamemode_perc').text(data.most_active_gamemode_perc);
|
||||
$(element).find('#data_server_occupied').text("~" + data.server_occupied);
|
||||
$(element).find('#data_server_occupied_perc').text(data.server_occupied_perc);
|
||||
$(element).find('#data_total_playtime').text(data.total_playtime);
|
||||
$(element).find('#data_afk_time').text(data.afk_time);
|
||||
$(element).find('#data_afk_time_perc').text(data.afk_time_perc)
|
||||
element.querySelector('#data_most_active_gamemode').innerText = data.most_active_gamemode;
|
||||
element.querySelector('#data_most_active_gamemode_perc').innerText = data.most_active_gamemode_perc;
|
||||
element.querySelector('#data_server_occupied').innerText = "~" + data.server_occupied;
|
||||
element.querySelector('#data_server_occupied_perc').innerText = data.server_occupied_perc;
|
||||
element.querySelector('#data_total_playtime').innerText = data.total_playtime;
|
||||
element.querySelector('#data_afk_time').innerText = data.afk_time;
|
||||
element.querySelector('#data_afk_time_perc').innerText = data.afk_time_perc;
|
||||
}
|
||||
|
||||
/* This function loads PvP & PvE tab */
|
||||
function loadPvPPvEValues(json, error) {
|
||||
tab = $('#pvp-pve');
|
||||
const tab = document.getElementById('pvp-pve');
|
||||
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
return;
|
||||
}
|
||||
|
||||
// as Numbers
|
||||
data = json.numbers;
|
||||
element = $(tab).find('#data_numbers');
|
||||
let data = json.numbers;
|
||||
let element = tab.querySelector('#data_numbers');
|
||||
|
||||
$(element).find('#data_player_kills_total').text(data.player_kills_total);
|
||||
$(element).find('#data_player_kills_30d').text(data.player_kills_30d);
|
||||
$(element).find('#data_player_kills_7d').text(data.player_kills_7d);
|
||||
element.querySelector('#data_player_kills_total').innerText = data.player_kills_total;
|
||||
element.querySelector('#data_player_kills_30d').innerText = data.player_kills_30d;
|
||||
element.querySelector('#data_player_kills_7d').innerText = data.player_kills_7d;
|
||||
|
||||
$(element).find('#data_player_kdr_avg').text(data.player_kdr_avg);
|
||||
$(element).find('#data_player_kdr_avg_30d').text(data.player_kdr_avg_30d);
|
||||
$(element).find('#data_player_kdr_avg_7d').text(data.player_kdr_avg_7d);
|
||||
element.querySelector('#data_player_kdr_avg').innerText = data.player_kdr_avg;
|
||||
element.querySelector('#data_player_kdr_avg_30d').innerText = data.player_kdr_avg_30d;
|
||||
element.querySelector('#data_player_kdr_avg_7d').innerText = data.player_kdr_avg_7d;
|
||||
|
||||
$(element).find('#data_mob_kills_total').text(data.mob_kills_total);
|
||||
$(element).find('#data_mob_kills_30d').text(data.mob_kills_30d);
|
||||
$(element).find('#data_mob_kills_7d').text(data.mob_kills_7d);
|
||||
element.querySelector('#data_mob_kills_total').innerText = data.mob_kills_total;
|
||||
element.querySelector('#data_mob_kills_30d').innerText = data.mob_kills_30d;
|
||||
element.querySelector('#data_mob_kills_7d').innerText = data.mob_kills_7d;
|
||||
|
||||
$(element).find('#data_mob_deaths_total').text(data.mob_deaths_total);
|
||||
$(element).find('#data_mob_deaths_30d').text(data.mob_deaths_30d);
|
||||
$(element).find('#data_mob_deaths_7d').text(data.mob_deaths_7d);
|
||||
element.querySelector('#data_mob_deaths_total').innerText = data.mob_deaths_total;
|
||||
element.querySelector('#data_mob_deaths_30d').innerText = data.mob_deaths_30d;
|
||||
element.querySelector('#data_mob_deaths_7d').innerText = data.mob_deaths_7d;
|
||||
|
||||
$(element).find('#data_mob_kdr_total').text(data.mob_kdr_total);
|
||||
$(element).find('#data_mob_kdr_30d').text(data.mob_kdr_30d);
|
||||
$(element).find('#data_mob_kdr_7d').text(data.mob_kdr_7d);
|
||||
element.querySelector('#data_mob_kdr_total').innerText = data.mob_kdr_total;
|
||||
element.querySelector('#data_mob_kdr_30d').innerText = data.mob_kdr_30d;
|
||||
element.querySelector('#data_mob_kdr_7d').innerText = data.mob_kdr_7d;
|
||||
|
||||
$(element).find('#data_deaths_total').text(data.deaths_total);
|
||||
$(element).find('#data_deaths_30d').text(data.deaths_30d);
|
||||
$(element).find('#data_deaths_7d').text(data.deaths_7d);
|
||||
element.querySelector('#data_deaths_total').innerText = data.deaths_total;
|
||||
element.querySelector('#data_deaths_30d').innerText = data.deaths_30d;
|
||||
element.querySelector('#data_deaths_7d').innerText = data.deaths_7d;
|
||||
|
||||
// Insights
|
||||
data = json.insights;
|
||||
element = $(tab).find('#data_insights');
|
||||
element = tab.querySelector('#data_insights');
|
||||
|
||||
$(element).find('#data_weapon_1st').text(data.weapon_1st);
|
||||
$(element).find('#data_weapon_2nd').text(data.weapon_2nd);
|
||||
$(element).find('#data_weapon_3rd').text(data.weapon_3rd);
|
||||
element.querySelector('#data_weapon_1st').innerText = data.weapon_1st;
|
||||
element.querySelector('#data_weapon_2nd').innerText = data.weapon_2nd;
|
||||
element.querySelector('#data_weapon_3rd').innerText = data.weapon_3rd;
|
||||
}
|
||||
|
||||
/* This function loads Playerbase Overview tab */
|
||||
function loadPlayerbaseOverviewValues(json, error) {
|
||||
tab = $('#playerbase-overview');
|
||||
const tab = document.getElementById('playerbase-overview');
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Trends
|
||||
data = json.trends;
|
||||
element = $(tab).find('#data_trends');
|
||||
let data = json.trends;
|
||||
let element = tab.querySelector('#data_trends');
|
||||
|
||||
$(element).find('#data_total_players_then').text(data.total_players_then);
|
||||
$(element).find('#data_total_players_now').text(data.total_players_now);
|
||||
$(element).find('#data_total_players_trend').replaceWith(trend(data.total_players_trend));
|
||||
$(element).find('#data_regular_players_then').text(data.regular_players_then);
|
||||
$(element).find('#data_regular_players_now').text(data.regular_players_now);
|
||||
$(element).find('#data_regular_players_trend').replaceWith(trend(data.regular_players_trend));
|
||||
$(element).find('#data_playtime_avg_then').text(data.playtime_avg_then);
|
||||
$(element).find('#data_playtime_avg_now').text(data.playtime_avg_now);
|
||||
$(element).find('#data_playtime_avg_trend').replaceWith(trend(data.playtime_avg_trend));
|
||||
$(element).find('#data_afk_then').text(data.afk_then);
|
||||
$(element).find('#data_afk_now').text(data.afk_now);
|
||||
$(element).find('#data_afk_trend').replaceWith(trend(data.afk_trend));
|
||||
$(element).find('#data_regular_playtime_avg_then').text(data.regular_playtime_avg_then);
|
||||
$(element).find('#data_regular_playtime_avg_now').text(data.regular_playtime_avg_now);
|
||||
$(element).find('#data_regular_playtime_avg_trend').replaceWith(trend(data.regular_playtime_avg_trend));
|
||||
$(element).find('#data_regular_session_avg_then').text(data.regular_session_avg_then);
|
||||
$(element).find('#data_regular_session_avg_now').text(data.regular_session_avg_now);
|
||||
$(element).find('#data_regular_session_avg_trend').replaceWith(trend(data.regular_session_avg_trend));
|
||||
$(element).find('#data_regular_afk_then').text(data.regular_afk_avg_then);
|
||||
$(element).find('#data_regular_afk_now').text(data.regular_afk_avg_now);
|
||||
$(element).find('#data_regular_afk_trend').replaceWith(trend(data.regular_afk_avg_trend));
|
||||
element.querySelector('#data_total_players_then').innerText = data.total_players_then;
|
||||
element.querySelector('#data_total_players_now').innerText = data.total_players_now;
|
||||
element.querySelector('#data_total_players_trend').innerHTML = trend(data.total_players_trend);
|
||||
element.querySelector('#data_regular_players_then').innerText = data.regular_players_then;
|
||||
element.querySelector('#data_regular_players_now').innerText = data.regular_players_now;
|
||||
element.querySelector('#data_regular_players_trend').innerHTML = trend(data.regular_players_trend);
|
||||
element.querySelector('#data_playtime_avg_then').innerText = data.playtime_avg_then;
|
||||
element.querySelector('#data_playtime_avg_now').innerText = data.playtime_avg_now;
|
||||
element.querySelector('#data_playtime_avg_trend').innerHTML = trend(data.playtime_avg_trend);
|
||||
element.querySelector('#data_afk_then').innerText = data.afk_then;
|
||||
element.querySelector('#data_afk_now').innerText = data.afk_now;
|
||||
element.querySelector('#data_afk_trend').innerHTML = trend(data.afk_trend);
|
||||
element.querySelector('#data_regular_playtime_avg_then').innerText = data.regular_playtime_avg_then;
|
||||
element.querySelector('#data_regular_playtime_avg_now').innerText = data.regular_playtime_avg_now;
|
||||
element.querySelector('#data_regular_playtime_avg_trend').innerHTML = trend(data.regular_playtime_avg_trend);
|
||||
element.querySelector('#data_regular_session_avg_then').innerText = data.regular_session_avg_then;
|
||||
element.querySelector('#data_regular_session_avg_now').innerText = data.regular_session_avg_now;
|
||||
element.querySelector('#data_regular_session_avg_trend').innerHTML = trend(data.regular_session_avg_trend);
|
||||
element.querySelector('#data_regular_afk_then').innerText = data.regular_afk_avg_then;
|
||||
element.querySelector('#data_regular_afk_now').innerText = data.regular_afk_avg_now;
|
||||
element.querySelector('#data_regular_afk_trend').innerHTML = trend(data.regular_afk_avg_trend);
|
||||
|
||||
// Insights
|
||||
data = json.insights;
|
||||
element = $(tab).find('#data_insights');
|
||||
element = tab.querySelector('#data_insights');
|
||||
|
||||
$(element).find('#data_new_to_regular').replaceWith(data.new_to_regular + smallTrend(data.new_to_regular_trend));
|
||||
$(element).find('#data_regular_to_inactive').replaceWith(data.regular_to_inactive + smallTrend(data.regular_to_inactive_trend))
|
||||
element.querySelector('#data_new_to_regular').innerHTML = data.new_to_regular + smallTrend(data.new_to_regular_trend);
|
||||
element.querySelector('#data_regular_to_inactive').innerHTML = data.regular_to_inactive + smallTrend(data.regular_to_inactive_trend);
|
||||
}
|
||||
|
||||
/* This function loads Performance tab */
|
||||
function loadPerformanceValues(json, error) {
|
||||
tab = $('#performance');
|
||||
const tab = document.getElementById('performance');
|
||||
if (error) {
|
||||
displayError(tab, error);
|
||||
return;
|
||||
}
|
||||
|
||||
// as Numbers
|
||||
data = json.numbers;
|
||||
element = $(tab).find('#data_numbers');
|
||||
let data = json.numbers;
|
||||
let element = tab.querySelector('#data_numbers');
|
||||
|
||||
$(element).find('#data_low_tps_spikes_30d').text(data.low_tps_spikes_30d);
|
||||
$(element).find('#data_low_tps_spikes_7d').text(data.low_tps_spikes_7d);
|
||||
$(element).find('#data_low_tps_spikes_24h').text(data.low_tps_spikes_24h);
|
||||
$(element).find('#data_server_downtime_30d').text(data.server_downtime_30d);
|
||||
$(element).find('#data_server_downtime_7d').text(data.server_downtime_7d);
|
||||
$(element).find('#data_server_downtime_24h').text(data.server_downtime_24h);
|
||||
$(element).find('#data_tps_30d').text(data.tps_30d);
|
||||
$(element).find('#data_tps_7d').text(data.tps_7d);
|
||||
$(element).find('#data_tps_24h').text(data.tps_24h);
|
||||
$(element).find('#data_cpu_30d').text(data.cpu_30d);
|
||||
$(element).find('#data_cpu_7d').text(data.cpu_7d);
|
||||
$(element).find('#data_cpu_24h').text(data.cpu_24h);
|
||||
$(element).find('#data_ram_30d').text(data.ram_30d);
|
||||
$(element).find('#data_ram_7d').text(data.ram_7d);
|
||||
$(element).find('#data_ram_24h').text(data.ram_24h);
|
||||
$(element).find('#data_entities_30d').text(data.entities_30d);
|
||||
$(element).find('#data_entities_7d').text(data.entities_7d);
|
||||
$(element).find('#data_entities_24h').text(data.entities_24h);
|
||||
$(element).find('#data_chunks_30d').text(data.chunks_30d);
|
||||
$(element).find('#data_chunks_7d').text(data.chunks_7d);
|
||||
$(element).find('#data_chunks_24h').text(data.chunks_24h);
|
||||
$(element).find('#data_max_disk_30d').text(data.max_disk_30d);
|
||||
$(element).find('#data_max_disk_7d').text(data.max_disk_7d);
|
||||
$(element).find('#data_max_disk_24h').text(data.max_disk_24h);
|
||||
$(element).find('#data_min_disk_30d').text(data.min_disk_30d);
|
||||
$(element).find('#data_min_disk_7d').text(data.min_disk_7d);
|
||||
$(element).find('#data_min_disk_24h').text(data.min_disk_24h);
|
||||
element.querySelector('#data_low_tps_spikes_30d').innerText = data.low_tps_spikes_30d;
|
||||
element.querySelector('#data_low_tps_spikes_7d').innerText = data.low_tps_spikes_7d;
|
||||
element.querySelector('#data_low_tps_spikes_24h').innerText = data.low_tps_spikes_24h;
|
||||
element.querySelector('#data_server_downtime_30d').innerText = data.server_downtime_30d;
|
||||
element.querySelector('#data_server_downtime_7d').innerText = data.server_downtime_7d;
|
||||
element.querySelector('#data_server_downtime_24h').innerText = data.server_downtime_24h;
|
||||
element.querySelector('#data_tps_30d').innerText = data.tps_30d;
|
||||
element.querySelector('#data_tps_7d').innerText = data.tps_7d;
|
||||
element.querySelector('#data_tps_24h').innerText = data.tps_24h;
|
||||
element.querySelector('#data_cpu_30d').innerText = data.cpu_30d;
|
||||
element.querySelector('#data_cpu_7d').innerText = data.cpu_7d;
|
||||
element.querySelector('#data_cpu_24h').innerText = data.cpu_24h;
|
||||
element.querySelector('#data_ram_30d').innerText = data.ram_30d;
|
||||
element.querySelector('#data_ram_7d').innerText = data.ram_7d;
|
||||
element.querySelector('#data_ram_24h').innerText = data.ram_24h;
|
||||
element.querySelector('#data_entities_30d').innerText = data.entities_30d;
|
||||
element.querySelector('#data_entities_7d').innerText = data.entities_7d;
|
||||
element.querySelector('#data_entities_24h').innerText = data.entities_24h;
|
||||
element.querySelector('#data_chunks_30d').innerText = data.chunks_30d;
|
||||
element.querySelector('#data_chunks_7d').innerText = data.chunks_7d;
|
||||
element.querySelector('#data_chunks_24h').innerText = data.chunks_24h;
|
||||
element.querySelector('#data_max_disk_30d').innerText = data.max_disk_30d;
|
||||
element.querySelector('#data_max_disk_7d').innerText = data.max_disk_7d;
|
||||
element.querySelector('#data_max_disk_24h').innerText = data.max_disk_24h;
|
||||
element.querySelector('#data_min_disk_30d').innerText = data.min_disk_30d;
|
||||
element.querySelector('#data_min_disk_7d').innerText = data.min_disk_7d;
|
||||
element.querySelector('#data_min_disk_24h').innerText = data.min_disk_24h;
|
||||
|
||||
// Insights
|
||||
data = json.insights;
|
||||
element = $(tab).find('#data_insights');
|
||||
element = tab.querySelector('#data_insights');
|
||||
|
||||
$(element).find('#data_low_tps_players').text(data.low_tps_players);
|
||||
$(element).find('#data_low_tps_entities').text(data.low_tps_entities);
|
||||
$(element).find('#data_low_tps_chunks').text(data.low_tps_chunks);
|
||||
$(element).find('#data_low_tps_cpu').text(data.low_tps_cpu);
|
||||
element.querySelector('#data_low_tps_players').innerText = data.low_tps_players;
|
||||
element.querySelector('#data_low_tps_entities').innerText = data.low_tps_entities;
|
||||
element.querySelector('#data_low_tps_chunks').innerText = data.low_tps_chunks;
|
||||
element.querySelector('#data_low_tps_cpu').innerText = data.low_tps_cpu;
|
||||
}
|
||||
|
||||
dates = data.low_disk_space_dates;
|
||||
dateString = '';
|
||||
for (i in dates) {
|
||||
dateString += (dates[i] + '<br>')
|
||||
async function loadOptimizedPerformanceGraph(json, error) {
|
||||
if (json) {
|
||||
const zones = {
|
||||
tps: [{
|
||||
value: json.zones.tpsThresholdMed,
|
||||
color: json.colors.low
|
||||
}, {
|
||||
value: json.zones.tpsThresholdHigh,
|
||||
color: json.colors.med
|
||||
}, {
|
||||
value: 30,
|
||||
color: json.colors.high
|
||||
}],
|
||||
disk: [{
|
||||
value: json.zones.diskThresholdMed,
|
||||
color: json.colors.low
|
||||
}, {
|
||||
value: json.zones.tpsThresholdHigh,
|
||||
color: json.colors.med
|
||||
}, {
|
||||
value: Number.MAX_VALUE,
|
||||
color: json.colors.high
|
||||
}]
|
||||
};
|
||||
const dataSeries = await mapToDataSeries(json.values);
|
||||
const series = {
|
||||
playersOnline: {
|
||||
name: s.name.playersOnline, type: s.type.areaSpline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.playersOnline, color: json.colors.playersOnline, yAxis: 0
|
||||
},
|
||||
tps: {
|
||||
name: s.name.tps, type: s.type.spline, color: json.colors.high,
|
||||
zones: zones.tps, tooltip: s.tooltip.twoDecimals, data: dataSeries.tps,
|
||||
yAxis: 1
|
||||
},
|
||||
cpu: {
|
||||
name: s.name.cpu, type: s.type.spline, tooltip: s.tooltip.twoDecimals,
|
||||
data: dataSeries.cpu, color: json.colors.cpu, yAxis: 2
|
||||
},
|
||||
cpu_alt: {
|
||||
name: s.name.cpu, type: s.type.spline, tooltip: s.tooltip.twoDecimals,
|
||||
data: dataSeries.cpu, color: json.colors.cpu, yAxis: 1
|
||||
},
|
||||
ram: {
|
||||
name: s.name.ram, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.ram, color: json.colors.ram, yAxis: 3
|
||||
},
|
||||
ram_alt: {
|
||||
name: s.name.ram, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.ram, color: json.colors.ram, yAxis: 2
|
||||
},
|
||||
entities: {
|
||||
name: s.name.entities, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.entities, color: json.colors.entities, yAxis: 4
|
||||
},
|
||||
entities_alt: {
|
||||
name: s.name.entities, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.entities, color: json.colors.entities, yAxis: 1
|
||||
},
|
||||
chunks: {
|
||||
name: s.name.chunks, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.chunks, color: json.colors.chunks, yAxis: 5
|
||||
},
|
||||
chunks_alt: {
|
||||
name: s.name.chunks, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.chunks, color: json.colors.chunks, yAxis: 2
|
||||
},
|
||||
disk: {
|
||||
name: s.name.disk, type: s.type.spline, color: json.colors.high,
|
||||
zones: zones.disk, tooltip: s.tooltip.zeroDecimals, data: dataSeries.disk
|
||||
}
|
||||
};
|
||||
setTimeout(() => playersChart('playersOnlineChart', series.playersOnline, 2), 10)
|
||||
setTimeout(() => performanceChart('performanceGraph', series.playersOnline, series.tps, series.cpu, series.ram, series.entities, series.chunks), 20)
|
||||
setTimeout(() => tpsChart('tpsGraph', series.tps, series.playersOnline), 30)
|
||||
setTimeout(() => resourceChart('resourceGraph', series.cpu_alt, series.ram_alt, series.playersOnline), 40)
|
||||
setTimeout(() => worldChart('worldGraph', series.entities_alt, series.chunks_alt, series.playersOnline), 50)
|
||||
setTimeout(() => diskChart('diskGraph', [series.disk]), 60)
|
||||
} else if (error) {
|
||||
const errorMessage = `Failed to load graph data: ${error}`;
|
||||
document.getElementById('playersOnlineChart').innerText = errorMessage;
|
||||
document.getElementById('performanceGraph').innerText = errorMessage;
|
||||
document.getElementById('tpsGraph').innerText = errorMessage;
|
||||
document.getElementById('resourceGraph').innerText = errorMessage;
|
||||
document.getElementById('worldGraph').innerText = errorMessage;
|
||||
document.getElementById('diskGraph').innerText = errorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
$(element).find('#data_low_disk_space_dates').replaceWith(
|
||||
dateString
|
||||
)
|
||||
function loadPingGraph(json, error) {
|
||||
if (json) {
|
||||
const series = {
|
||||
avgPing: {
|
||||
name: s.name.avgPing,
|
||||
type: s.type.spline,
|
||||
tooltip: s.tooltip.twoDecimals,
|
||||
data: json.avg_ping_series,
|
||||
color: json.colors.avg
|
||||
},
|
||||
maxPing: {
|
||||
name: s.name.maxPing,
|
||||
type: s.type.spline,
|
||||
tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.max_ping_series,
|
||||
color: json.colors.max
|
||||
},
|
||||
minPing: {
|
||||
name: s.name.minPing,
|
||||
type: s.type.spline,
|
||||
tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.min_ping_series,
|
||||
color: json.colors.min
|
||||
}
|
||||
};
|
||||
lineChart('pingGraph', [series.avgPing, series.maxPing, series.minPing]);
|
||||
} else if (error) {
|
||||
document.getElementById('pingGraph').innerText = `Failed to load graph data: ${error}`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadWorldPie(json, error) {
|
||||
if (json) {
|
||||
const worldSeries = {name: 'World Playtime', colorByPoint: true, data: json.world_series};
|
||||
const gmSeries = json.gm_series;
|
||||
worldPie("worldPie", worldSeries, gmSeries);
|
||||
} else if (error) {
|
||||
document.getElementById('worldPie').innerText = `Failed to load graph data: ${error}`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadActivityGraph(json, error) {
|
||||
if (json) {
|
||||
activityPie('activityPie', {
|
||||
name: s.name.unit_players, colorByPoint: true, data: json.activity_pie_series
|
||||
});
|
||||
stackChart('activityStackGraph', json.activity_labels, json.activity_series, s.name.unit_players);
|
||||
} else if (error) {
|
||||
const errorMessage = `Failed to load graph data: ${error}`;
|
||||
document.getElementById('activityPie').innerText = errorMessage;
|
||||
document.getElementById('activityStackGraph').innerText = errorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
function loadGeolocationGraph(json, error) {
|
||||
if (json) {
|
||||
const geolocationSeries = {
|
||||
name: s.name.unit_players,
|
||||
type: 'map',
|
||||
mapData: Highcharts.maps['custom/world'],
|
||||
data: json.geolocation_series,
|
||||
joinBy: ['iso-a3', 'code']
|
||||
};
|
||||
const geolocationBarSeries = {
|
||||
color: json.colors.bars,
|
||||
name: s.name.unit_players,
|
||||
data: json.geolocation_bar_series.map(function (bar) {
|
||||
return bar.value
|
||||
})
|
||||
};
|
||||
const geolocationBarCategories = json.geolocation_bar_series.map(function (bar) {
|
||||
return bar.label
|
||||
});
|
||||
worldMap('worldMap', json.colors.low, json.colors.high, geolocationSeries);
|
||||
horizontalBarChart('countryBarChart', geolocationBarCategories, [geolocationBarSeries], s.name.unit_players);
|
||||
} else if (error) {
|
||||
const errorMessage = `Failed to load graph data: ${error}`;
|
||||
document.getElementById('worldMap').innerText = errorMessage;
|
||||
document.getElementById('countryBarChart').innerText = errorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
function loadUniqueAndNewGraph(json, error) {
|
||||
if (json) {
|
||||
const uniquePlayers = {
|
||||
name: s.name.uniquePlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.uniquePlayers, color: json.colors.playersOnline
|
||||
};
|
||||
const newPlayers = {
|
||||
name: s.name.newPlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.newPlayers, color: json.colors.newPlayers
|
||||
};
|
||||
dayByDay('uniqueChart', [uniquePlayers, newPlayers]);
|
||||
} else if (error) {
|
||||
document.getElementById('uniqueChart').innerText = `Failed to load graph data: ${error}`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadHourlyUniqueAndNewGraph(json, error) {
|
||||
if (json) {
|
||||
const uniquePlayers = {
|
||||
name: s.name.uniquePlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.uniquePlayers, color: json.colors.playersOnline
|
||||
};
|
||||
const newPlayers = {
|
||||
name: s.name.newPlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.newPlayers, color: json.colors.newPlayers
|
||||
};
|
||||
dayByDay('hourlyUniqueChart', [uniquePlayers, newPlayers]);
|
||||
} else if (error) {
|
||||
document.getElementById('uniqueChart').innerText = `Failed to load graph data: ${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
|
||||
// to finish. We need this because if the calendar is rendered
|
||||
// immediately, it renders for a width of 0.
|
||||
setTimeout(function () {
|
||||
window.calendars.online_activity.render();
|
||||
}, 0);
|
||||
});
|
||||
} else if (error) {
|
||||
document.getElementById('calendar').innerText = `Failed to load calendar data: ${error}`;
|
||||
}
|
||||
}
|
||||
|
||||
function loadPunchCard(json, error) {
|
||||
if (json) {
|
||||
const punchCardSeries = {
|
||||
name: 'Relative Join Activity',
|
||||
color: json.color,
|
||||
data: json.punchCard
|
||||
};
|
||||
punchCard('punchCard', punchCardSeries);
|
||||
} else if (error) {
|
||||
document.getElementById('punchCard').innerText = `Failed to load graph data: ${error}`;
|
||||
}
|
||||
}
|
@ -1,49 +1,48 @@
|
||||
function loadSessionAccordion(json, error) {
|
||||
sessionTable = $("#sessions-overview").find("#tableAccordion").find("tbody");
|
||||
const sessionTable = document.querySelector('#sessions-overview #tableAccordion tbody');
|
||||
|
||||
if (error) {
|
||||
sessionTable.append(`<tr><td>Error: ` + error + '</td><td>-</td><td>-</td><td>-</td></tr>');
|
||||
sessionTable.innerHTML = `<tr><td>Error: ${error}</td><td>-</td><td>-</td><td>-</td></tr>`;
|
||||
return;
|
||||
}
|
||||
|
||||
var sessions = json.sessions;
|
||||
const sessions = json.sessions;
|
||||
|
||||
if (!sessions.length) {
|
||||
sessionTable.append(`<tr><td>No Data</td><td>-</td><td>-</td><td>-</td></tr>`);
|
||||
sessionTable.innerHTML = `<tr><td>No Data</td><td>-</td><td>-</td><td>-</td></tr>`;
|
||||
return;
|
||||
}
|
||||
|
||||
// sessions_per_page can be undefined (-> NaN) or higher than amount of sessions.
|
||||
var limit = json.sessions_per_page ? json.sessions_per_page : sessions.length;
|
||||
let limit = json.sessions_per_page ? json.sessions_per_page : sessions.length;
|
||||
limit = Math.min(limit, sessions.length);
|
||||
|
||||
var sessionsHtml = '';
|
||||
for (var i = 0; i < limit; i++) {
|
||||
var session = sessions[i];
|
||||
var title = createAccordionTitle(i, session);
|
||||
var body = createAccordionBody(i, session);
|
||||
let sessionsHtml = '';
|
||||
for (let i = 0; i < limit; i++) {
|
||||
const session = sessions[i];
|
||||
const title = createAccordionTitle(i, session);
|
||||
const body = createAccordionBody(i, session);
|
||||
sessionsHtml += title + body;
|
||||
}
|
||||
sessionTable.innerHTML = sessionsHtml;
|
||||
|
||||
sessionTable.append(sessionsHtml);
|
||||
|
||||
for (var i = 0; i < limit; i++) {
|
||||
$('#session_h_' + i).click(onOpenSession(i, sessions));
|
||||
for (let i = 0; i < limit; i++) {
|
||||
document.getElementById(`session_h_${i}`).addEventListener('click', onOpenSession(i, sessions));
|
||||
}
|
||||
}
|
||||
|
||||
function onOpenSession(i, sessions) {
|
||||
var opened = false;
|
||||
let opened = false;
|
||||
return function () {
|
||||
if (opened) {
|
||||
return;
|
||||
}
|
||||
setTimeout(function () {
|
||||
var session = sessions[i];
|
||||
var worldSeries = {name: `World Playtime`, colorByPoint: true, data: session.world_series};
|
||||
var gmSeries = session.gm_series;
|
||||
const session = sessions[i];
|
||||
const worldSeries = {name: `World Playtime`, colorByPoint: true, data: session.world_series};
|
||||
const gmSeries = session.gm_series;
|
||||
|
||||
worldPie("worldpie_" + i, worldSeries, gmSeries);
|
||||
worldPie(`worldpie_${i}`, worldSeries, gmSeries);
|
||||
}, 250);
|
||||
opened = true;
|
||||
}
|
||||
@ -51,7 +50,7 @@ function onOpenSession(i, sessions) {
|
||||
|
||||
function loadPlayerKills(json, error) {
|
||||
if (error) {
|
||||
$('#playerKillTable').replaceWith(`<p>Failed to load player kills: ` + error + '</p>');
|
||||
$('#playerKillTable').replaceWith(`<p>Failed to load player kills: ${error}</p>`);
|
||||
return;
|
||||
}
|
||||
$('#playerKillTable').replaceWith(createKillsTable(json.player_kills));
|
||||
@ -59,7 +58,7 @@ function loadPlayerKills(json, error) {
|
||||
|
||||
function loadPlayerdeaths(json, error) {
|
||||
if (error) {
|
||||
$('#playerDeathTable').replaceWith(`<p>Failed to load player deaths: ` + error + '</p>');
|
||||
$('#playerDeathTable').replaceWith(`<p>Failed to load player deaths: ${error}</p>`);
|
||||
return;
|
||||
}
|
||||
$('#playerDeathTable').replaceWith(createKillsTable(json.player_deaths));
|
||||
@ -67,50 +66,62 @@ function loadPlayerdeaths(json, error) {
|
||||
|
||||
function createAccordionTitle(i, session) {
|
||||
let style = session.start.includes("Online") ? 'bg-teal' : 'bg-teal-outline';
|
||||
return `<tr id="session_h_` + i + `" aria-controls="session_t_` + i + `" aria-expanded="false" class="clickable collapsed ` + style + `" data-target="#session_t_` + i + `" data-toggle="collapse"><td>`
|
||||
+ session.name + (session.first_session ? ` <i title="Registered (First session)" class="far fa-calendar-plus"></i>` : ``) + `</td>`
|
||||
+ `<td>` + session.start + `</td>`
|
||||
+ `<td>` + session.length + `</td>`
|
||||
+ `<td>` + (session.network_server ? session.network_server : session.most_used_world) + `</td></tr>`
|
||||
return `<tr id="session_h_${i}" aria-controls="session_t_${i}" aria-expanded="false"
|
||||
class="clickable collapsed ${style}" data-target="#session_t_${i}" data-toggle="collapse">
|
||||
<td>${session.name}${session.first_session ? ` <i title="Registered (First session)" class="far fa-calendar-plus"></i>` : ``}</td>
|
||||
<td>${session.start}</td><td>${session.length}</td>
|
||||
<td>${session.network_server ? session.network_server : session.most_used_world}</td>
|
||||
</tr>`
|
||||
}
|
||||
|
||||
function createAccordionBody(i, session) {
|
||||
return `<tr class="collapse" data-parent="#tableAccordion" id="session_t_` + i + `">` +
|
||||
`<td colspan="4">` +
|
||||
`<div class="collapse row" data-parent="#tableAccordion" id="session_t_` + i + `">` +
|
||||
`<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">` +
|
||||
`<p><i class="col-teal far fa-fw fa-clock"></i> Ended<span class="float-right"><b>` + session.end + `</b></span></p>` +
|
||||
`<p><i class="col-green far fa-fw fa-clock"></i> Length<span class="float-right"><b>` + session.length + `</b></span></p>` +
|
||||
`<p><i class="col-grey far fa-fw fa-clock"></i> AFK Time<span class="float-right"><b>` + session.afk_time + `</b></span></p>` +
|
||||
`<p><i class="col-green fa fa-fw fa-server"></i> Server<span class="float-right"><b>` + session.server_name + `</b></span></p>` +
|
||||
(session.avg_ping ? `<p><i class="col-amber fa fa-fw fa-signal"></i> Average Ping<span class="float-right"><b>` + session.avg_ping + `</b></span></p>` : ``) +
|
||||
`<br>` +
|
||||
`<p><i class="col-red fa fa-fw fa-crosshairs"></i> Player Kills<span class="float-right"><b>` + session.player_kills.length + `</b></span></p>` +
|
||||
`<p><i class="col-green fa fa-fw fa-crosshairs"></i> Mob Kills<span class="float-right"><b>` + session.mob_kills + `</b></span></p>` +
|
||||
`<p><i class=" fa fa-fw fa-skull"></i> Deaths<span class="float-right"><b>` + session.deaths + `</b></span></p><hr>` +
|
||||
createKillsTable(session.player_kills) +
|
||||
`</div><div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">` +
|
||||
`<div id="worldpie_` + i + `" class="chart-pie"></div>` +
|
||||
`<a href="` + (session.network_server ? `./player/` : `../player/`) + session.player_url_name + `" class="float-right btn bg-blue"><i class="fa fa-user"></i><span> Player Page</span></a>` +
|
||||
(session.network_server ? `<a href="./server/` + session.server_url_name + `" class="float-right btn bg-light-green mr-2"><i class="fa fa-server"></i><span> Server Analysis</span></a>` : ``) +
|
||||
`</div>` +
|
||||
`</div></td></tr>`
|
||||
return `<tr class="collapse" data-parent="#tableAccordion" id="session_t_${i}">
|
||||
<td colspan="4">
|
||||
<div class="collapse row" data-parent="#tableAccordion" id="session_t_${i}">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<p><i class="col-teal far fa-fw fa-clock"></i> Ended<span class="float-right"><b>${session.end}</b></span></p>
|
||||
<p><i class="col-green far fa-fw fa-clock"></i> Length<span class="float-right"><b>${session.length}</b></span></p>
|
||||
<p><i class="col-grey far fa-fw fa-clock"></i> AFK Time<span class="float-right"><b>${session.afk_time}</b></span></p>
|
||||
<p><i class="col-green fa fa-fw fa-server"></i> Server<span class="float-right"><b>${session.server_name}</b></span></p>
|
||||
${session.avg_ping ? `<p><i class="col-amber fa fa-fw fa-signal"></i> Average Ping<span class="float-right"><b>` + session.avg_ping + `</b></span></p>` : ``}
|
||||
<br>
|
||||
<p><i class="col-red fa fa-fw fa-crosshairs"></i> Player Kills<span class="float-right"><b>${session.player_kills.length}</b></span></p>
|
||||
<p><i class="col-green fa fa-fw fa-crosshairs"></i> Mob Kills<span class="float-right"><b>${session.mob_kills}</b></span></p>
|
||||
<p><i class=" fa fa-fw fa-skull"></i> Deaths<span class="float-right"><b>${session.deaths}</b></span></p>
|
||||
<hr>
|
||||
${createKillsTable(session.player_kills)}
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div id="worldpie_${i}" class="chart-pie"></div>
|
||||
<a href="${session.network_server ? `./player/` : `../player/`}${session.player_url_name}" class="float-right btn bg-blue">
|
||||
<i class="fa fa-user"></i><span> Player Page</span>
|
||||
</a>
|
||||
${session.network_server ? `<a href="./server/${session.server_url_name}" class="float-right btn bg-light-green mr-2">
|
||||
<i class="fa fa-server"></i><span> Server Analysis</span>
|
||||
</a>` : ``}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>`;
|
||||
}
|
||||
|
||||
function createKillsTable(player_kills) {
|
||||
var table = '<table class="table mb-0"><tbody>';
|
||||
let table = '<table class="table mb-0"><tbody>';
|
||||
|
||||
if (player_kills.length === 0) {
|
||||
if (!player_kills.length) {
|
||||
table += `<tr><td>None</td><td>-</td><td>-</td></tr>`
|
||||
}
|
||||
|
||||
for (var i = 0; i < player_kills.length; i++) {
|
||||
var kill = player_kills[i];
|
||||
table += '<tr><td>' + kill.date + '</td>' +
|
||||
'<td>' + kill.killer +
|
||||
(kill.killer === kill.victim ? '<i class="fa fa-fw fa-skull-crossbones col-red"></i>' : '<i class="fa fa-fw fa-angle-right col-red"></i>') +
|
||||
kill.victim + '</td>' +
|
||||
'<td>' + kill.weapon + '</td></tr>'
|
||||
for (const kill of player_kills) {
|
||||
table += `<tr>
|
||||
<td>${kill.date}</td>
|
||||
<td>${kill.killer} ${
|
||||
kill.killer === kill.victim
|
||||
? '<i class="fa fa-fw fa-skull-crossbones col-red"></i>'
|
||||
: '<i class="fa fa-fw fa-angle-right col-red"></i>'
|
||||
} ${kill.victim}</td>
|
||||
<td>${kill.weapon}</td>
|
||||
</tr>`
|
||||
}
|
||||
|
||||
table += '</tbody></table>';
|
||||
|
@ -1,3 +1,60 @@
|
||||
// Stored by tab {'tab-id': ['address', 'address']}
|
||||
const currentlyRefreshing = {};
|
||||
let refreshBarrierMs = 0;
|
||||
|
||||
function refreshingJsonRequest(address, callback, tabID, skipOldData) {
|
||||
const timestamp = Date.now();
|
||||
const addressWithTimestamp = address.includes('?')
|
||||
? `${address}×tamp=${timestamp}`
|
||||
: `${address}?timestamp=${timestamp}`
|
||||
|
||||
const refreshElement = document.querySelector(`#${tabID} .refresh-element`);
|
||||
refreshElement.querySelector('i').addEventListener('click', () => {
|
||||
if (currentlyRefreshing[tabID].includes(address)) {
|
||||
return;
|
||||
}
|
||||
refreshElement.querySelector('.refresh-notice').innerHTML = '<i class="fa fa-fw fa-cog fa-spin"></i> Updating..';
|
||||
refreshingJsonRequest(address, callback, tabID, true);
|
||||
});
|
||||
|
||||
let timeout = 1000;
|
||||
|
||||
if (!currentlyRefreshing[tabID]) currentlyRefreshing[tabID] = [];
|
||||
currentlyRefreshing[tabID].push(address);
|
||||
|
||||
function makeTheRequest(skipOldData) {
|
||||
jsonRequest(addressWithTimestamp, (json, error) => {
|
||||
if (error) {
|
||||
currentlyRefreshing[tabID].splice(currentlyRefreshing[tabID].indexOf(address), 1);
|
||||
if (error.status === 400 && error.error.includes('Attempt to get data from the future!')) {
|
||||
console.error(error.error); // System time not in sync with UTC
|
||||
refreshElement.innerHTML = "System times out of sync with UTC";
|
||||
return jsonRequest(address, callback);
|
||||
}
|
||||
refreshElement.querySelector('.refresh-notice').innerHTML = "";
|
||||
return callback(json, error);
|
||||
}
|
||||
|
||||
refreshElement.querySelector('.refresh-time').innerText = json.timestamp_f;
|
||||
|
||||
const lastUpdated = json.timestamp;
|
||||
if (lastUpdated + refreshBarrierMs < timestamp) {
|
||||
setTimeout(() => makeTheRequest(true), timeout);
|
||||
timeout = timeout >= 12000 ? timeout : timeout * 2;
|
||||
if (!skipOldData) callback(json, error);
|
||||
} else {
|
||||
currentlyRefreshing[tabID].splice(currentlyRefreshing[tabID].indexOf(address), 1);
|
||||
if (!currentlyRefreshing[tabID].length) {
|
||||
refreshElement.querySelector('.refresh-notice').innerHTML = "";
|
||||
}
|
||||
callback(json, error);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
makeTheRequest(skipOldData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make an XMLHttpRequest for JSON data.
|
||||
* @param address Address to request from
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
<body>
|
||||
<script>
|
||||
var gmPieColors = [${gmPieColors}];
|
||||
const gmPieColors = [${gmPieColors}];
|
||||
</script>
|
||||
<div class="page-loader">
|
||||
<span class="loader"></span>
|
||||
@ -147,7 +147,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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>${networkDisplayName}
|
||||
· Network Overview</h1>
|
||||
· Network Overview
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@ -267,7 +272,7 @@
|
||||
<h6 class="m-0 font-weight-bold col-black"><i class="fa fa-fw fa-exchange-alt"></i>
|
||||
Week Comparison</h6>
|
||||
</div>
|
||||
<table class="table">
|
||||
<table class="table" id="data_weeks">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><i class="text-success fa fa-caret-up"></i><i
|
||||
@ -279,7 +284,7 @@
|
||||
<th>Trend</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="data_weeks">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><i class="col-blue fa fa-fw fa-users"></i> Unique Players</td>
|
||||
<td id="data_unique_before"></td>
|
||||
@ -331,7 +336,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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>${networkDisplayName}
|
||||
· Servers</h1>
|
||||
· Servers
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="row" id="data_servers">
|
||||
@ -388,7 +398,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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>${networkDisplayName}
|
||||
· 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>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@ -451,7 +466,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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>${networkDisplayName}
|
||||
· Playerbase Overview</h1>
|
||||
· Playerbase Overview
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@ -593,7 +613,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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>${networkDisplayName}
|
||||
· Geolocations</h1>
|
||||
· Geolocations
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@ -799,6 +824,7 @@
|
||||
<script src="./vendor/highcharts/no-data-to-display.js"></script>
|
||||
|
||||
<!-- Custom scripts for all pages-->
|
||||
<script src="./js/domUtils.js"></script>
|
||||
<script src="./js/sb-admin-2.js"></script>
|
||||
<script src="./js/xmlhttprequests.js"></script>
|
||||
<script src="./js/color-selector.js"></script>
|
||||
@ -810,162 +836,67 @@
|
||||
<script src="./js/network-values.js"></script>
|
||||
|
||||
<script id="mainScript">
|
||||
// HighCharts Series
|
||||
const s = {
|
||||
name: {
|
||||
playersOnline: 'Players Online',
|
||||
uniquePlayers: 'Unique Players',
|
||||
newPlayers: 'New Players',
|
||||
maxPing: 'Worst Ping',
|
||||
minPing: 'Best Ping',
|
||||
avgPing: 'Average Ping',
|
||||
unit_players: 'Players'
|
||||
},
|
||||
tooltip: {
|
||||
twoDecimals: {valueDecimals: 2},
|
||||
zeroDecimals: {valueDecimals: 0}
|
||||
},
|
||||
type: {
|
||||
areaSpline: 'areaspline',
|
||||
spline: 'spline'
|
||||
}
|
||||
};
|
||||
// TODO remove
|
||||
const v = {
|
||||
colors: {
|
||||
playersOnline: '${playersGraphColor}',
|
||||
newPlayers: '#8BC34A',
|
||||
geolocationsLow: '${worldMapColLow}',
|
||||
geolocationsHigh: '${worldMapColHigh}',
|
||||
maxPing: '${maxPingColor}',
|
||||
minPing: '${minPingColor}',
|
||||
avgPing: '${avgPingColor}'
|
||||
},
|
||||
values: {
|
||||
timezoneOffset: ${timeZone}
|
||||
}
|
||||
};
|
||||
try {
|
||||
setLoadingText('Calculating values..');
|
||||
jsonRequest("./v1/network/overview", loadNetworkOverviewValues);
|
||||
jsonRequest("./v1/network/servers", loadservers);
|
||||
jsonRequest("./v1/network/sessionsOverview", loadSessionValues);
|
||||
jsonRequest("./v1/network/playerbaseOverview", loadPlayerbaseOverviewValues);
|
||||
jsonRequest("./v1/sessions", loadSessionAccordion);
|
||||
setLoadingText('Rendering graphs..');
|
||||
refreshBarrierMs = ${refreshBarrier};
|
||||
|
||||
// TODO remove
|
||||
var v = {
|
||||
colors: {
|
||||
playersOnline: '${playersGraphColor}',
|
||||
newPlayers: '#8BC34A',
|
||||
geolocationsLow: '${worldMapColLow}',
|
||||
geolocationsHigh: '${worldMapColHigh}',
|
||||
maxPing: '${maxPingColor}',
|
||||
minPing: '${minPingColor}',
|
||||
avgPing: '${avgPingColor}'
|
||||
},
|
||||
values: {
|
||||
timezoneOffset: ${timeZone}
|
||||
}
|
||||
};
|
||||
setLoadingText('Calculating values..');
|
||||
refreshingJsonRequest("./v1/network/overview", loadNetworkOverviewValues, 'network-overview');
|
||||
refreshingJsonRequest("./v1/network/servers", loadservers, 'servers');
|
||||
refreshingJsonRequest("./v1/network/sessionsOverview", loadSessionValues, 'sessions-overview');
|
||||
refreshingJsonRequest("./v1/network/playerbaseOverview", loadPlayerbaseOverviewValues, 'playerbase-overview');
|
||||
refreshingJsonRequest("./v1/sessions", loadSessionAccordion, 'sessions-overview');
|
||||
setLoadingText('Rendering graphs..');
|
||||
|
||||
Highcharts.setOptions({
|
||||
lang: {noData: "No Data to Display"},
|
||||
time: {timezoneOffset: v.values.timezoneOffset * 60}
|
||||
});
|
||||
|
||||
// HighCharts Series
|
||||
var s = {
|
||||
name: {
|
||||
playersOnline: 'Players Online',
|
||||
uniquePlayers: 'Unique Players',
|
||||
newPlayers: 'New Players',
|
||||
maxPing: 'Worst Ping',
|
||||
minPing: 'Best Ping',
|
||||
avgPing: 'Average Ping'
|
||||
},
|
||||
tooltip: {
|
||||
twoDecimals: {
|
||||
valueDecimals: 2
|
||||
},
|
||||
zeroDecimals: {
|
||||
valueDecimals: 0
|
||||
}
|
||||
},
|
||||
type: {
|
||||
areaSpline: 'areaspline',
|
||||
spline: 'spline'
|
||||
}
|
||||
};
|
||||
|
||||
jsonRequest("./v1/graph?type=playersOnline&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
var series = {
|
||||
playersOnline: {
|
||||
name: s.name.playersOnline, type: s.type.areaSpline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.playersOnline, color: v.colors.playersOnline, yAxis: 0
|
||||
}
|
||||
};
|
||||
playersChart('playersOnlineChart', series.playersOnline, 2);
|
||||
} else if (error) {
|
||||
$('#playersOnlineChart').text("Failed to load graph data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("./v1/graph?type=uniqueAndNew", function (json, error) {
|
||||
if (json) {
|
||||
var uniquePlayers = {
|
||||
name: s.name.uniquePlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.uniquePlayers, color: v.colors.playersOnline
|
||||
};
|
||||
var newPlayers = {
|
||||
name: s.name.newPlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.newPlayers, color: v.colors.newPlayers
|
||||
};
|
||||
dayByDay('uniqueChart', [uniquePlayers, newPlayers]);
|
||||
} else if (error) {
|
||||
$('#uniqueChart').text("Failed to load graph data: " + error)
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("./v1/graph?type=hourlyUniqueAndNew", function (json, error) {
|
||||
if (json) {
|
||||
var uniquePlayers = {
|
||||
name: s.name.uniquePlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.uniquePlayers, color: v.colors.playersOnline
|
||||
};
|
||||
var newPlayers = {
|
||||
name: s.name.newPlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.newPlayers, color: v.colors.newPlayers
|
||||
};
|
||||
dayByDay('hourlyUniqueChart', [uniquePlayers, newPlayers]);
|
||||
} else if (error) {
|
||||
$('#uniqueChart').text("Failed to load graph data: " + error)
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("./v1/graph?type=serverPie", function (json, error) {
|
||||
if (json) {
|
||||
serverPieSeries = {
|
||||
name: 'Server Playtime',
|
||||
colorByPoint: true,
|
||||
colors: json.server_pie_colors,
|
||||
data: json.server_pie_series_30d
|
||||
};
|
||||
serverPie('serverPie', serverPieSeries);
|
||||
} else if (error) {
|
||||
$('#serverPie').text("Failed to load graph data: " + error)
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("./v1/graph?type=activity", function (json, error) {
|
||||
if (json) {
|
||||
activityPie('activityPie', {
|
||||
name: 'Players', colorByPoint: true, data: json.activity_pie_series
|
||||
});
|
||||
stackChart('activityStackGraph', json.activity_labels, json.activity_series, 'Players');
|
||||
} else if (error) {
|
||||
$('#activityPie').text("Failed to load graph data: " + error);
|
||||
$('#activityStackGraph').text("Failed to load graph data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("./v1/graph?type=geolocation", function (json, error) {
|
||||
if (json) {
|
||||
var geolocationSeries = {
|
||||
name: 'Players',
|
||||
type: 'map',
|
||||
mapData: Highcharts.maps['custom/world'],
|
||||
data: json.geolocation_series,
|
||||
joinBy: ['iso-a3', 'code']
|
||||
};
|
||||
var geolocationBarSeries = {
|
||||
color: json.colors.bars,
|
||||
name: 'Players',
|
||||
data: json.geolocation_bar_series.map(function (bar) {
|
||||
return bar.value
|
||||
})
|
||||
};
|
||||
var geolocationBarCategories = json.geolocation_bar_series.map(function (bar) {
|
||||
return bar.label
|
||||
});
|
||||
worldMap('worldMap', json.colors.low, json.colors.high, geolocationSeries);
|
||||
horizontalBarChart('countryBarChart', geolocationBarCategories, [geolocationBarSeries], 'Players');
|
||||
} else if (error) {
|
||||
$('#worldMap').text("Failed to load graph data: " + error);
|
||||
$('#countryBarChart').text("Failed to load graph data: " + error);
|
||||
}
|
||||
});
|
||||
refreshingJsonRequest("./v1/graph?type=playersOnline&server=${serverUUID}", loadPlayersOnlineGraph, 'network-overview');
|
||||
refreshingJsonRequest("./v1/graph?type=uniqueAndNew", loadUniqueAndNewGraph, 'network-overview');
|
||||
refreshingJsonRequest("./v1/graph?type=hourlyUniqueAndNew", loadHourlyUniqueAndNewGraph, 'network-overview');
|
||||
refreshingJsonRequest("./v1/graph?type=serverPie", loadServerPie, 'sessions-overview');
|
||||
refreshingJsonRequest("./v1/graph?type=activity", loadActivityGraphs, 'playerbase-overview');
|
||||
refreshingJsonRequest("./v1/graph?type=geolocation", loadGeolocationGraph, 'geolocations');
|
||||
|
||||
setLoadingText('Sorting out plugin tables..');
|
||||
|
||||
jsonRequest("./v1/network/pingTable", loadPingTable);
|
||||
refreshingJsonRequest("./v1/network/pingTable", loadPingTable, 'geolocations');
|
||||
|
||||
$('.player-plugin-table').DataTable({
|
||||
responsive: true
|
||||
@ -987,7 +918,7 @@
|
||||
}
|
||||
|
||||
function setLoadingText(text) {
|
||||
$('.loader-text').text(text);
|
||||
document.querySelector('.loader-text').innerText = text;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -691,8 +691,8 @@
|
||||
<script src="../vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Page level plugins -->
|
||||
<script src="../vendor/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="../vendor/datatables/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="../vendor/datatables/datatables.min.js"></script>
|
||||
<link href='../vendor/datatables/datatables.min.css' rel='stylesheet'/>
|
||||
<script src="../vendor/highcharts/highstock.js"></script>
|
||||
<script src="../vendor/highcharts/drilldown.js"></script>
|
||||
<script src="../vendor/highcharts/highcharts-more.js"></script>
|
||||
|
@ -87,7 +87,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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>${networkName}
|
||||
| Players</h1>
|
||||
| Players
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@ -256,8 +261,8 @@
|
||||
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Page level plugins -->
|
||||
<script src="vendor/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="vendor/datatables/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="vendor/datatables/datatables.min.js"></script>
|
||||
<link href='vendor/datatables/datatables.min.css' rel='stylesheet'/>
|
||||
|
||||
<!-- Custom scripts for all pages-->
|
||||
<script src="js/sb-admin-2.js"></script>
|
||||
@ -265,10 +270,20 @@
|
||||
<script src="js/color-selector.js"></script>
|
||||
|
||||
<script id="mainScript">
|
||||
refreshBarrierMs = ${refreshBarrier};
|
||||
try {
|
||||
jsonRequest("./v1/players", function (playersTableJson, error) {
|
||||
let table;
|
||||
refreshingJsonRequest("./v1/players", function (playersTableJson, error) {
|
||||
if (playersTableJson) {
|
||||
$('.player-table').DataTable({
|
||||
if (table) {
|
||||
table.destroy();
|
||||
$('.player-table').replaceWith(`<table class="table table-bordered table-striped table-hover player-table dataTable">
|
||||
<tr>
|
||||
<td>Loading..</td>
|
||||
</tr>
|
||||
</table>`);
|
||||
}
|
||||
table = $('.player-table').DataTable({
|
||||
responsive: true,
|
||||
columns: playersTableJson.columns,
|
||||
data: playersTableJson.data,
|
||||
@ -277,7 +292,7 @@
|
||||
} else if (error) {
|
||||
$('.player-table').text("Failed to load Players table data: " + error);
|
||||
}
|
||||
});
|
||||
}, 'players', true);
|
||||
} catch (loadingError) {
|
||||
window.alert("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||
setTimeout(function () {
|
||||
|
@ -308,8 +308,8 @@
|
||||
<script src="./vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Page level plugins -->
|
||||
<script src="vendor/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="vendor/datatables/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="./vendor/datatables/datatables.min.js"></script>
|
||||
<link href='./vendor/datatables/datatables.min.css' rel='stylesheet'/>
|
||||
<script src="./vendor/highcharts/highstock.js"></script>
|
||||
<script src="./vendor/highcharts/map.js"></script>
|
||||
<script src="./vendor/highcharts/world.js"></script>
|
||||
@ -328,7 +328,7 @@
|
||||
<script id="mainScript">
|
||||
if (location.search.includes("error=")) {
|
||||
insertElementBefore('.tab .row .card div', () => {
|
||||
const element = document.createElement('alert');
|
||||
const element = document.createElement('div');
|
||||
element.classList.add("alert", "alert-danger", "alert-dismissable", "show");
|
||||
element.innerHTML = `<span id="error-text"></span>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
|
@ -157,7 +157,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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}
|
||||
· Server Overview</h1>
|
||||
· Server Overview
|
||||
<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}
|
||||
</div>
|
||||
|
||||
@ -328,7 +333,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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}
|
||||
· Online Activity Overview</h1>
|
||||
· Online Activity Overview
|
||||
<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}
|
||||
</div>
|
||||
|
||||
@ -446,7 +456,8 @@
|
||||
</td>
|
||||
<td id="data_new_players_retention_30d"></td>
|
||||
<td id="data_new_players_retention_7d"></td>
|
||||
<td id="data_new_players_retention_24h"></td>
|
||||
<td id="data_new_players_retention_24h"
|
||||
title="This value is a prediction based on previous players."></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
@ -521,7 +532,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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}
|
||||
· 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}
|
||||
</div>
|
||||
|
||||
@ -595,7 +611,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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}
|
||||
· PvP & PvE</h1>
|
||||
· PvP & PvE
|
||||
<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}
|
||||
</div>
|
||||
|
||||
@ -693,8 +714,7 @@
|
||||
Recent Kills</h6>
|
||||
</div>
|
||||
<div class="scrollbar">
|
||||
<table class="table" id="playerKillTable">
|
||||
</table>
|
||||
<table class="table" id="playerKillTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -707,7 +727,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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}
|
||||
· Playerbase Overview</h1>
|
||||
· Playerbase Overview
|
||||
<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}
|
||||
</div>
|
||||
|
||||
@ -850,7 +875,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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}
|
||||
· Player List</h1>
|
||||
· Player List
|
||||
<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}
|
||||
</div>
|
||||
|
||||
@ -881,7 +911,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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}
|
||||
· Geolocations</h1>
|
||||
· Geolocations
|
||||
<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}
|
||||
</div>
|
||||
|
||||
@ -938,7 +973,12 @@
|
||||
<!-- Page Heading -->
|
||||
<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}
|
||||
· Performance</h1>
|
||||
· Performance
|
||||
<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}
|
||||
</div>
|
||||
|
||||
@ -1264,8 +1304,8 @@
|
||||
<script src="../vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Page level plugins -->
|
||||
<script src="../vendor/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="../vendor/datatables/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="../vendor/datatables/datatables.min.js"></script>
|
||||
<link href='../vendor/datatables/datatables.min.css' rel='stylesheet'/>
|
||||
<script src="../vendor/highcharts/highstock.js"></script>
|
||||
<script src="../vendor/highcharts/map.js"></script>
|
||||
<script src="../vendor/highcharts/world.js"></script>
|
||||
@ -1277,6 +1317,7 @@
|
||||
<script src='../vendor/fullcalendar/fullcalendar.min.js'></script>
|
||||
|
||||
<!-- Custom scripts for all pages-->
|
||||
<script src="../js/domUtils.js"></script>
|
||||
<script src="../js/sb-admin-2.js"></script>
|
||||
<script src="../js/xmlhttprequests.js"></script>
|
||||
<script src="../js/color-selector.js"></script>
|
||||
@ -1288,14 +1329,42 @@
|
||||
<script src="../js/server-values.js"></script>
|
||||
|
||||
<script id="mainScript">
|
||||
refreshBarrierMs = ${refreshBarrier};
|
||||
// HighCharts Series
|
||||
const s = {
|
||||
name: {
|
||||
playersOnline: 'Players Online',
|
||||
uniquePlayers: 'Unique Players',
|
||||
newPlayers: 'New Players',
|
||||
tps: 'TPS',
|
||||
cpu: 'CPU (%)',
|
||||
ram: 'RAM (MB)',
|
||||
entities: 'Entities',
|
||||
chunks: 'Chunks',
|
||||
maxPing: 'Worst Ping',
|
||||
minPing: 'Best Ping',
|
||||
avgPing: 'Average Ping',
|
||||
disk: 'Free Disk Space (MB)',
|
||||
unit_players: 'Players'
|
||||
},
|
||||
tooltip: {
|
||||
twoDecimals: {valueDecimals: 2},
|
||||
zeroDecimals: {valueDecimals: 0}
|
||||
},
|
||||
type: {
|
||||
areaSpline: 'areaspline',
|
||||
spline: 'spline'
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
setLoadingText('Calculating values..');
|
||||
jsonRequest("../v1/serverOverview?server=${serverUUID}", loadserverOverviewValues);
|
||||
jsonRequest("../v1/onlineOverview?server=${serverUUID}", loadOnlineActivityOverviewValues);
|
||||
jsonRequest("../v1/sessionsOverview?server=${serverUUID}", loadSessionValues);
|
||||
jsonRequest("../v1/playerVersus?server=${serverUUID}", loadPvPPvEValues);
|
||||
jsonRequest("../v1/playerbaseOverview?server=${serverUUID}", loadPlayerbaseOverviewValues);
|
||||
jsonRequest("../v1/performanceOverview?server=${serverUUID}", loadPerformanceValues);
|
||||
refreshingJsonRequest("../v1/serverOverview?server=${serverUUID}", loadserverOverviewValues, 'server-overview');
|
||||
refreshingJsonRequest("../v1/onlineOverview?server=${serverUUID}", loadOnlineActivityOverviewValues, 'online-activity-overview');
|
||||
refreshingJsonRequest("../v1/sessionsOverview?server=${serverUUID}", loadSessionValues, 'sessions-overview');
|
||||
refreshingJsonRequest("../v1/playerVersus?server=${serverUUID}", loadPvPPvEValues, "pvp-pve");
|
||||
refreshingJsonRequest("../v1/playerbaseOverview?server=${serverUUID}", loadPlayerbaseOverviewValues, 'playerbase-overview');
|
||||
refreshingJsonRequest("../v1/performanceOverview?server=${serverUUID}", loadPerformanceValues, 'performance');
|
||||
setLoadingText('Rendering graphs..');
|
||||
|
||||
Highcharts.setOptions({
|
||||
@ -1303,282 +1372,41 @@
|
||||
time: {timezoneOffset: (${timeZone}) * 60}
|
||||
});
|
||||
|
||||
// HighCharts Series
|
||||
const s = {
|
||||
name: {
|
||||
playersOnline: 'Players Online',
|
||||
uniquePlayers: 'Unique Players',
|
||||
newPlayers: 'New Players',
|
||||
tps: 'TPS',
|
||||
cpu: 'CPU (%)',
|
||||
ram: 'RAM (MB)',
|
||||
entities: 'Entities',
|
||||
chunks: 'Chunks',
|
||||
maxPing: 'Worst Ping',
|
||||
minPing: 'Best Ping',
|
||||
avgPing: 'Average Ping',
|
||||
disk: 'Free Disk Space (MB)'
|
||||
},
|
||||
tooltip: {
|
||||
twoDecimals: {
|
||||
valueDecimals: 2
|
||||
},
|
||||
zeroDecimals: {
|
||||
valueDecimals: 0
|
||||
}
|
||||
},
|
||||
type: {
|
||||
areaSpline: 'areaspline',
|
||||
spline: 'spline'
|
||||
}
|
||||
};
|
||||
|
||||
jsonRequest("../v1/graph?type=optimizedPerformance&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
const zones = {
|
||||
tps: [{
|
||||
value: json.zones.tpsThresholdMed,
|
||||
color: json.colors.low
|
||||
}, {
|
||||
value: json.zones.tpsThresholdHigh,
|
||||
color: json.colors.med
|
||||
}, {
|
||||
value: 30,
|
||||
color: json.colors.high
|
||||
}],
|
||||
disk: [{
|
||||
value: json.zones.diskThresholdMed,
|
||||
color: json.colors.low
|
||||
}, {
|
||||
value: json.zones.tpsThresholdHigh,
|
||||
color: json.colors.med
|
||||
}, {
|
||||
value: Number.MAX_VALUE,
|
||||
color: json.colors.high
|
||||
}]
|
||||
};
|
||||
const dataSeries = mapToDataSeries(json.values);
|
||||
const series = {
|
||||
playersOnline: {
|
||||
name: s.name.playersOnline, type: s.type.areaSpline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.playersOnline, color: json.colors.playersOnline, yAxis: 0
|
||||
},
|
||||
tps: {
|
||||
name: s.name.tps, type: s.type.spline, color: json.colors.high,
|
||||
zones: zones.tps, tooltip: s.tooltip.twoDecimals, data: dataSeries.tps,
|
||||
yAxis: 1
|
||||
},
|
||||
cpu: {
|
||||
name: s.name.cpu, type: s.type.spline, tooltip: s.tooltip.twoDecimals,
|
||||
data: dataSeries.cpu, color: json.colors.cpu, yAxis: 2
|
||||
},
|
||||
cpu_alt: {
|
||||
name: s.name.cpu, type: s.type.spline, tooltip: s.tooltip.twoDecimals,
|
||||
data: dataSeries.cpu, color: json.colors.cpu, yAxis: 1
|
||||
},
|
||||
ram: {
|
||||
name: s.name.ram, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.ram, color: json.colors.ram, yAxis: 3
|
||||
},
|
||||
ram_alt: {
|
||||
name: s.name.ram, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.ram, color: json.colors.ram, yAxis: 2
|
||||
},
|
||||
entities: {
|
||||
name: s.name.entities, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.entities, color: json.colors.entities, yAxis: 4
|
||||
},
|
||||
entities_alt: {
|
||||
name: s.name.entities, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.entities, color: json.colors.entities, yAxis: 1
|
||||
},
|
||||
chunks: {
|
||||
name: s.name.chunks, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.chunks, color: json.colors.chunks, yAxis: 5
|
||||
},
|
||||
chunks_alt: {
|
||||
name: s.name.chunks, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: dataSeries.chunks, color: json.colors.chunks, yAxis: 2
|
||||
},
|
||||
disk: {
|
||||
name: s.name.disk, type: s.type.spline, color: json.colors.high,
|
||||
zones: zones.disk, tooltip: s.tooltip.zeroDecimals, data: dataSeries.disk
|
||||
}
|
||||
};
|
||||
playersChart('playersOnlineChart', series.playersOnline, 2);
|
||||
performanceChart('performanceGraph', series.playersOnline, series.tps, series.cpu, series.ram, series.entities, series.chunks);
|
||||
tpsChart('tpsGraph', series.tps, series.playersOnline);
|
||||
resourceChart('resourceGraph', series.cpu_alt, series.ram_alt, series.playersOnline);
|
||||
worldChart('worldGraph', series.entities_alt, series.chunks_alt, series.playersOnline);
|
||||
diskChart('diskGraph', [series.disk]);
|
||||
} else if (error) {
|
||||
$('#playersOnlineChart').text("Failed to load graph data: " + error);
|
||||
$('#performanceGraph').text("Failed to load graph data: " + error);
|
||||
$('#tpsGraph').text("Failed to load graph data: " + error);
|
||||
$('#resourceGraph').text("Failed to load graph data: " + error);
|
||||
$('#worldGraph').text("Failed to load graph data: " + error);
|
||||
$('#diskGraph').text("Failed to load graph data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("../v1/graph?type=aggregatedPing&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
var series = {
|
||||
avgPing: {
|
||||
name: s.name.avgPing,
|
||||
type: s.type.spline,
|
||||
tooltip: s.tooltip.twoDecimals,
|
||||
data: json.avg_ping_series,
|
||||
color: json.colors.avg
|
||||
},
|
||||
maxPing: {
|
||||
name: s.name.maxPing,
|
||||
type: s.type.spline,
|
||||
tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.max_ping_series,
|
||||
color: json.colors.max
|
||||
},
|
||||
minPing: {
|
||||
name: s.name.minPing,
|
||||
type: s.type.spline,
|
||||
tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.min_ping_series,
|
||||
color: json.colors.min
|
||||
}
|
||||
};
|
||||
lineChart('pingGraph', [series.avgPing, series.maxPing, series.minPing]);
|
||||
} else if (error) {
|
||||
$('#pingGraph').text("Failed to load graph data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("../v1/graph?type=worldPie&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
var worldSeries = {name: 'World Playtime', colorByPoint: true, data: json.world_series};
|
||||
var gmSeries = json.gm_series;
|
||||
worldPie("worldPie", worldSeries, gmSeries);
|
||||
} else if (error) {
|
||||
$('#worldPie').text("Failed to load graph data: " + error)
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("../v1/graph?type=activity&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
activityPie('activityPie', {
|
||||
name: 'Players', colorByPoint: true, data: json.activity_pie_series
|
||||
});
|
||||
stackChart('activityStackGraph', json.activity_labels, json.activity_series, 'Players');
|
||||
} else if (error) {
|
||||
$('#activityPie').text("Failed to load graph data: " + error);
|
||||
$('#activityStackGraph').text("Failed to load graph data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("../v1/graph?type=geolocation&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
var geolocationSeries = {
|
||||
name: 'Players',
|
||||
type: 'map',
|
||||
mapData: Highcharts.maps['custom/world'],
|
||||
data: json.geolocation_series,
|
||||
joinBy: ['iso-a3', 'code']
|
||||
};
|
||||
var geolocationBarSeries = {
|
||||
color: json.colors.bars,
|
||||
name: 'Players',
|
||||
data: json.geolocation_bar_series.map(function (bar) {
|
||||
return bar.value
|
||||
})
|
||||
};
|
||||
var geolocationBarCategories = json.geolocation_bar_series.map(function (bar) {
|
||||
return bar.label
|
||||
});
|
||||
worldMap('worldMap', json.colors.low, json.colors.high, geolocationSeries);
|
||||
horizontalBarChart('countryBarChart', geolocationBarCategories, [geolocationBarSeries], 'Players');
|
||||
} else if (error) {
|
||||
$('#worldMap').text("Failed to load graph data: " + error);
|
||||
$('#countryBarChart').text("Failed to load graph data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("../v1/graph?type=uniqueAndNew&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
var uniquePlayers = {
|
||||
name: s.name.uniquePlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.uniquePlayers, color: json.colors.playersOnline
|
||||
};
|
||||
var newPlayers = {
|
||||
name: s.name.newPlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.newPlayers, color: json.colors.newPlayers
|
||||
};
|
||||
dayByDay('uniqueChart', [uniquePlayers, newPlayers]);
|
||||
} else if (error) {
|
||||
$('#uniqueChart').text("Failed to load graph data: " + error)
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("../v1/graph?type=hourlyUniqueAndNew&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
var uniquePlayers = {
|
||||
name: s.name.uniquePlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.uniquePlayers, color: json.colors.playersOnline
|
||||
};
|
||||
var newPlayers = {
|
||||
name: s.name.newPlayers, type: s.type.spline, tooltip: s.tooltip.zeroDecimals,
|
||||
data: json.newPlayers, color: json.colors.newPlayers
|
||||
};
|
||||
dayByDay('hourlyUniqueChart', [uniquePlayers, newPlayers]);
|
||||
} else if (error) {
|
||||
$('#uniqueChart').text("Failed to load graph data: " + error)
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("../v1/graph?type=serverCalendar&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
$('#calendar').text('');
|
||||
onlineActivityCalendar('#calendar', json.data, json.firstDay);
|
||||
$('#online-calendar-tab').click(function () {
|
||||
// Wrapping this in a 0ms setTimeout waits for all other event handlers
|
||||
// to finish. We need this because if the calendar is rendered
|
||||
// immediately, it renders for a width of 0.
|
||||
setTimeout(function () {
|
||||
window.calendars.online_activity.render();
|
||||
}, 0);
|
||||
});
|
||||
} else if (error) {
|
||||
$('#calendar').text("Failed to load calendar data: " + error)
|
||||
}
|
||||
});
|
||||
|
||||
jsonRequest("../v1/graph?type=punchCard&server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
var punchCardSeries = {
|
||||
name: 'Relative Join Activity',
|
||||
color: json.color,
|
||||
data: json.punchCard
|
||||
};
|
||||
punchCard('punchCard', punchCardSeries);
|
||||
} else if (error) {
|
||||
$('#punchCard').text("Failed to load graph data: " + error)
|
||||
}
|
||||
});
|
||||
refreshingJsonRequest("../v1/graph?type=optimizedPerformance&server=${serverUUID}", loadOptimizedPerformanceGraph, 'performance', true);
|
||||
refreshingJsonRequest("../v1/graph?type=aggregatedPing&server=${serverUUID}", loadPingGraph, 'performance');
|
||||
refreshingJsonRequest("../v1/graph?type=worldPie&server=${serverUUID}", loadWorldPie, 'sessions-overview');
|
||||
refreshingJsonRequest("../v1/graph?type=activity&server=${serverUUID}", loadActivityGraph, 'playerbase-overview');
|
||||
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');
|
||||
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..');
|
||||
|
||||
jsonRequest("../v1/players?server=${serverUUID}", function (json, error) {
|
||||
let table;
|
||||
refreshingJsonRequest("../v1/players?server=${serverUUID}", function (json, error) {
|
||||
if (json) {
|
||||
$('.player-table').DataTable({
|
||||
if (table) {
|
||||
table.destroy();
|
||||
$('.player-table').replaceWith(`<table class="table table-bordered table-striped table-hover player-table dataTable">
|
||||
<tr>
|
||||
<td>Loading..</td>
|
||||
</tr>
|
||||
</table>`);
|
||||
}
|
||||
table = $('.player-table').DataTable({
|
||||
responsive: true,
|
||||
columns: json.columns,
|
||||
data: json.data,
|
||||
order: [[5, "desc"]]
|
||||
})
|
||||
});
|
||||
} else if (error) {
|
||||
$('.player-table').text("Failed to load Players table data: " + error);
|
||||
}
|
||||
});
|
||||
jsonRequest("../v1/kills?server=${serverUUID}", loadPlayerKills);
|
||||
jsonRequest("../v1/pingTable?server=${serverUUID}", loadPingTable);
|
||||
}, 'playerlist', true);
|
||||
refreshingJsonRequest("../v1/kills?server=${serverUUID}", loadPlayerKills, 'pvp-pve');
|
||||
refreshingJsonRequest("../v1/pingTable?server=${serverUUID}", loadPingTable, 'geolocations');
|
||||
|
||||
$('.player-plugin-table').DataTable({
|
||||
responsive: true
|
||||
@ -1587,7 +1415,7 @@
|
||||
setLoadingText('Almost done..');
|
||||
openPage();
|
||||
|
||||
jsonRequest("../v1/sessions?server=${serverUUID}", loadSessionAccordion);
|
||||
refreshingJsonRequest("../v1/sessions?server=${serverUUID}", loadSessionAccordion, 'sessions-overview');
|
||||
|
||||
setLoadingText('Done.');
|
||||
setTimeout(function () {
|
||||
|
@ -1,234 +0,0 @@
|
||||
table.dataTable {
|
||||
clear: both;
|
||||
margin-top: 6px !important;
|
||||
margin-bottom: 6px !important;
|
||||
max-width: none !important;
|
||||
border-collapse: separate !important;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
table.dataTable td,
|
||||
table.dataTable th {
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
table.dataTable td.dataTables_empty,
|
||||
table.dataTable th.dataTables_empty {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.dataTable.nowrap th,
|
||||
table.dataTable.nowrap td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_length label {
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_length select {
|
||||
width: auto;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter label {
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter input {
|
||||
margin-left: 0.5em;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_info {
|
||||
padding-top: 0.85em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_paginate {
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
|
||||
margin: 2px 0;
|
||||
white-space: nowrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_processing {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 200px;
|
||||
margin-left: -100px;
|
||||
margin-top: -26px;
|
||||
text-align: center;
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting,
|
||||
table.dataTable thead > tr > td.sorting_asc,
|
||||
table.dataTable thead > tr > td.sorting_desc,
|
||||
table.dataTable thead > tr > td.sorting {
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
table.dataTable thead > tr > th:active,
|
||||
table.dataTable thead > tr > td:active {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting,
|
||||
table.dataTable thead .sorting_asc,
|
||||
table.dataTable thead .sorting_desc,
|
||||
table.dataTable thead .sorting_asc_disabled,
|
||||
table.dataTable thead .sorting_desc_disabled {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting:before, table.dataTable thead .sorting:after,
|
||||
table.dataTable thead .sorting_asc:before,
|
||||
table.dataTable thead .sorting_asc:after,
|
||||
table.dataTable thead .sorting_desc:before,
|
||||
table.dataTable thead .sorting_desc:after,
|
||||
table.dataTable thead .sorting_asc_disabled:before,
|
||||
table.dataTable thead .sorting_asc_disabled:after,
|
||||
table.dataTable thead .sorting_desc_disabled:before,
|
||||
table.dataTable thead .sorting_desc_disabled:after {
|
||||
position: absolute;
|
||||
bottom: 0.9em;
|
||||
display: block;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting:before,
|
||||
table.dataTable thead .sorting_asc:before,
|
||||
table.dataTable thead .sorting_desc:before,
|
||||
table.dataTable thead .sorting_asc_disabled:before,
|
||||
table.dataTable thead .sorting_desc_disabled:before {
|
||||
right: 1em;
|
||||
content: "\2191";
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting:after,
|
||||
table.dataTable thead .sorting_asc:after,
|
||||
table.dataTable thead .sorting_desc:after,
|
||||
table.dataTable thead .sorting_asc_disabled:after,
|
||||
table.dataTable thead .sorting_desc_disabled:after {
|
||||
right: 0.5em;
|
||||
content: "\2193";
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting_asc:before,
|
||||
table.dataTable thead .sorting_desc:after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting_asc_disabled:before,
|
||||
table.dataTable thead .sorting_desc_disabled:after {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollHead table.dataTable {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody table {
|
||||
border-top: none;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody table thead .sorting:before,
|
||||
div.dataTables_scrollBody table thead .sorting_asc:before,
|
||||
div.dataTables_scrollBody table thead .sorting_desc:before,
|
||||
div.dataTables_scrollBody table thead .sorting:after,
|
||||
div.dataTables_scrollBody table thead .sorting_asc:after,
|
||||
div.dataTables_scrollBody table thead .sorting_desc:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody table tbody tr:first-child th,
|
||||
div.dataTables_scrollBody table tbody tr:first-child td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
div.dataTables_scrollFoot > .dataTables_scrollFootInner {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
|
||||
margin-top: 0 !important;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
div.dataTables_wrapper div.dataTables_length,
|
||||
div.dataTables_wrapper div.dataTables_filter,
|
||||
div.dataTables_wrapper div.dataTables_info,
|
||||
div.dataTables_wrapper div.dataTables_paginate {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
table.dataTable.table-sm > thead > tr > th {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
table.dataTable.table-sm .sorting:before,
|
||||
table.dataTable.table-sm .sorting_asc:before,
|
||||
table.dataTable.table-sm .sorting_desc:before {
|
||||
top: 5px;
|
||||
right: 0.85em;
|
||||
}
|
||||
|
||||
table.dataTable.table-sm .sorting:after,
|
||||
table.dataTable.table-sm .sorting_asc:after,
|
||||
table.dataTable.table-sm .sorting_desc:after {
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
table.table-bordered.dataTable th,
|
||||
table.table-bordered.dataTable td {
|
||||
border-left-width: 0;
|
||||
}
|
||||
|
||||
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child,
|
||||
table.table-bordered.dataTable td:last-child,
|
||||
table.table-bordered.dataTable td:last-child {
|
||||
border-right-width: 0;
|
||||
}
|
||||
|
||||
table.table-bordered.dataTable tbody th,
|
||||
table.table-bordered.dataTable tbody td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollHead table.table-bordered {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
div.table-responsive > div.dataTables_wrapper > div.row {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:last-child {
|
||||
padding-right: 0;
|
||||
}
|
@ -1,181 +0,0 @@
|
||||
/*! DataTables Bootstrap 4 integration
|
||||
* ©2011-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* DataTables integration for Bootstrap 4. This requires Bootstrap 4 and
|
||||
* DataTables 1.10 or newer.
|
||||
*
|
||||
* This file sets the defaults and adds options to DataTables to style its
|
||||
* controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
|
||||
* for further information.
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery', 'datatables.net'], function ($) {
|
||||
return factory($, window, document);
|
||||
});
|
||||
} else if (typeof exports === 'object') {
|
||||
// CommonJS
|
||||
module.exports = function (root, $) {
|
||||
if (!root) {
|
||||
root = window;
|
||||
}
|
||||
|
||||
if (!$ || !$.fn.dataTable) {
|
||||
// Require DataTables, which attaches to jQuery, including
|
||||
// jQuery if needed and have a $ property so we can access the
|
||||
// jQuery object that is used
|
||||
$ = require('datatables.net')(root, $).$;
|
||||
}
|
||||
|
||||
return factory($, root, root.document);
|
||||
};
|
||||
} else {
|
||||
// Browser
|
||||
factory(jQuery, window, document);
|
||||
}
|
||||
}(function ($, window, document, undefined) {
|
||||
'use strict';
|
||||
var DataTable = $.fn.dataTable;
|
||||
|
||||
|
||||
/* Set the defaults for DataTables initialisation */
|
||||
$.extend(true, DataTable.defaults, {
|
||||
dom:
|
||||
"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
||||
renderer: 'bootstrap'
|
||||
});
|
||||
|
||||
|
||||
/* Default class modification */
|
||||
$.extend(DataTable.ext.classes, {
|
||||
sWrapper: "dataTables_wrapper dt-bootstrap4",
|
||||
sFilterInput: "form-control form-control-sm",
|
||||
sLengthSelect: "custom-select custom-select-sm form-control form-control-sm",
|
||||
sProcessing: "dataTables_processing card",
|
||||
sPageButton: "paginate_button page-item"
|
||||
});
|
||||
|
||||
|
||||
/* Bootstrap paging button renderer */
|
||||
DataTable.ext.renderer.pageButton.bootstrap = function (settings, host, idx, buttons, page, pages) {
|
||||
var api = new DataTable.Api(settings);
|
||||
var classes = settings.oClasses;
|
||||
var lang = settings.oLanguage.oPaginate;
|
||||
var aria = settings.oLanguage.oAria.paginate || {};
|
||||
var btnDisplay, btnClass, counter = 0;
|
||||
|
||||
var attach = function (container, buttons) {
|
||||
var i, ien, node, button;
|
||||
var clickHandler = function (e) {
|
||||
e.preventDefault();
|
||||
if (!$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action) {
|
||||
api.page(e.data.action).draw('page');
|
||||
}
|
||||
};
|
||||
|
||||
for (i = 0, ien = buttons.length; i < ien; i++) {
|
||||
button = buttons[i];
|
||||
|
||||
if ($.isArray(button)) {
|
||||
attach(container, button);
|
||||
} else {
|
||||
btnDisplay = '';
|
||||
btnClass = '';
|
||||
|
||||
switch (button) {
|
||||
case 'ellipsis':
|
||||
btnDisplay = '…';
|
||||
btnClass = 'disabled';
|
||||
break;
|
||||
|
||||
case 'first':
|
||||
btnDisplay = lang.sFirst;
|
||||
btnClass = button + (page > 0 ?
|
||||
'' : ' disabled');
|
||||
break;
|
||||
|
||||
case 'previous':
|
||||
btnDisplay = lang.sPrevious;
|
||||
btnClass = button + (page > 0 ?
|
||||
'' : ' disabled');
|
||||
break;
|
||||
|
||||
case 'next':
|
||||
btnDisplay = lang.sNext;
|
||||
btnClass = button + (page < pages - 1 ?
|
||||
'' : ' disabled');
|
||||
break;
|
||||
|
||||
case 'last':
|
||||
btnDisplay = lang.sLast;
|
||||
btnClass = button + (page < pages - 1 ?
|
||||
'' : ' disabled');
|
||||
break;
|
||||
|
||||
default:
|
||||
btnDisplay = button + 1;
|
||||
btnClass = page === button ?
|
||||
'active' : '';
|
||||
break;
|
||||
}
|
||||
|
||||
if (btnDisplay) {
|
||||
node = $('<li>', {
|
||||
'class': classes.sPageButton + ' ' + btnClass,
|
||||
'id': idx === 0 && typeof button === 'string' ?
|
||||
settings.sTableId + '_' + button :
|
||||
null
|
||||
})
|
||||
.append($('<a>', {
|
||||
'href': '#',
|
||||
'aria-controls': settings.sTableId,
|
||||
'aria-label': aria[button],
|
||||
'data-dt-idx': counter,
|
||||
'tabindex': settings.iTabIndex,
|
||||
'class': 'page-link'
|
||||
})
|
||||
.html(btnDisplay)
|
||||
)
|
||||
.appendTo(container);
|
||||
|
||||
settings.oApi._fnBindAction(
|
||||
node, {action: button}, clickHandler
|
||||
);
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// IE9 throws an 'unknown error' if document.activeElement is used
|
||||
// inside an iframe or frame.
|
||||
var activeEl;
|
||||
|
||||
try {
|
||||
// Because this approach is destroying and recreating the paging
|
||||
// elements, focus is lost on the select button which is bad for
|
||||
// accessibility. So we want to restore focus once the draw has
|
||||
// completed
|
||||
activeEl = $(host).find(document.activeElement).data('dt-idx');
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
attach(
|
||||
$(host).empty().html('<ul class="pagination"/>').children('ul'),
|
||||
buttons
|
||||
);
|
||||
|
||||
if (activeEl !== undefined) {
|
||||
$(host).find('[data-dt-idx=' + activeEl + ']').focus();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return DataTable;
|
||||
}));
|
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@
|
||||
/*!
|
||||
DataTables Bootstrap 4 integration
|
||||
©2011-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d,m){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
||||
renderer:"bootstrap"});b.extend(f.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"custom-select custom-select-sm form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,s,j,n){var o=new f.Api(a),t=a.oClasses,k=a.oLanguage.oPaginate,u=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();
|
||||
!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")};l=0;for(h=f.length;l<h;l++)if(c=f[l],b.isArray(c))q(d,c);else{g=e="";switch(c){case "ellipsis":e="…";g="disabled";break;case "first":e=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":e=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":e=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":e=k.sLast;g=c+(j<n-1?"":" disabled");break;default:e=c+1,g=j===c?"active":""}e&&(i=b("<li>",
|
||||
{"class":t.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#","aria-controls":a.sTableId,"aria-label":u[c],"data-dt-idx":p,tabindex:a.iTabIndex,"class":"page-link"}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(v){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),s);i!==m&&b(h).find("[data-dt-idx="+i+"]").focus()};return f});
|
469
Plan/common/src/main/resources/assets/plan/web/vendor/datatables/datatables.css
vendored
Normal file
469
Plan/common/src/main/resources/assets/plan/web/vendor/datatables/datatables.css
vendored
Normal file
@ -0,0 +1,469 @@
|
||||
/*
|
||||
* This combined file was created by the DataTables downloader builder:
|
||||
* https://datatables.net/download
|
||||
*
|
||||
* To rebuild or modify this file with the latest versions of the included
|
||||
* software please visit:
|
||||
* https://datatables.net/download/#bs4/dt-1.10.23/r-2.2.7
|
||||
*
|
||||
* Included libraries:
|
||||
* DataTables 1.10.23, Responsive 2.2.7
|
||||
*/
|
||||
|
||||
@charset "UTF-8";
|
||||
table.dataTable {
|
||||
clear: both;
|
||||
margin-top: 6px !important;
|
||||
margin-bottom: 6px !important;
|
||||
max-width: none !important;
|
||||
border-collapse: separate !important;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
table.dataTable td,
|
||||
table.dataTable th {
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
table.dataTable td.dataTables_empty,
|
||||
table.dataTable th.dataTables_empty {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.dataTable.nowrap th,
|
||||
table.dataTable.nowrap td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_length label {
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_length select {
|
||||
width: auto;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter label {
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter input {
|
||||
margin-left: 0.5em;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_info {
|
||||
padding-top: 0.85em;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_paginate {
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
|
||||
margin: 2px 0;
|
||||
white-space: nowrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_processing {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 200px;
|
||||
margin-left: -100px;
|
||||
margin-top: -26px;
|
||||
text-align: center;
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
table.dataTable > thead > tr > th:active,
|
||||
table.dataTable > thead > tr > td:active {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
table.dataTable > thead > tr > th:not(.sorting_disabled),
|
||||
table.dataTable > thead > tr > td:not(.sorting_disabled) {
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
table.dataTable > thead .sorting,
|
||||
table.dataTable > thead .sorting_asc,
|
||||
table.dataTable > thead .sorting_desc,
|
||||
table.dataTable > thead .sorting_asc_disabled,
|
||||
table.dataTable > thead .sorting_desc_disabled {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
table.dataTable > thead .sorting:before, table.dataTable > thead .sorting:after,
|
||||
table.dataTable > thead .sorting_asc:before,
|
||||
table.dataTable > thead .sorting_asc:after,
|
||||
table.dataTable > thead .sorting_desc:before,
|
||||
table.dataTable > thead .sorting_desc:after,
|
||||
table.dataTable > thead .sorting_asc_disabled:before,
|
||||
table.dataTable > thead .sorting_asc_disabled:after,
|
||||
table.dataTable > thead .sorting_desc_disabled:before,
|
||||
table.dataTable > thead .sorting_desc_disabled:after {
|
||||
position: absolute;
|
||||
bottom: 0.9em;
|
||||
display: block;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
table.dataTable > thead .sorting:before,
|
||||
table.dataTable > thead .sorting_asc:before,
|
||||
table.dataTable > thead .sorting_desc:before,
|
||||
table.dataTable > thead .sorting_asc_disabled:before,
|
||||
table.dataTable > thead .sorting_desc_disabled:before {
|
||||
right: 1em;
|
||||
content: "↑";
|
||||
}
|
||||
|
||||
table.dataTable > thead .sorting:after,
|
||||
table.dataTable > thead .sorting_asc:after,
|
||||
table.dataTable > thead .sorting_desc:after,
|
||||
table.dataTable > thead .sorting_asc_disabled:after,
|
||||
table.dataTable > thead .sorting_desc_disabled:after {
|
||||
right: 0.5em;
|
||||
content: "↓";
|
||||
}
|
||||
|
||||
table.dataTable > thead .sorting_asc:before,
|
||||
table.dataTable > thead .sorting_desc:after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
table.dataTable > thead .sorting_asc_disabled:before,
|
||||
table.dataTable > thead .sorting_desc_disabled:after {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollHead table.dataTable {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody table {
|
||||
border-top: none;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody table thead .sorting:before,
|
||||
div.dataTables_scrollBody table thead .sorting_asc:before,
|
||||
div.dataTables_scrollBody table thead .sorting_desc:before,
|
||||
div.dataTables_scrollBody table thead .sorting:after,
|
||||
div.dataTables_scrollBody table thead .sorting_asc:after,
|
||||
div.dataTables_scrollBody table thead .sorting_desc:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody table tbody tr:first-child th,
|
||||
div.dataTables_scrollBody table tbody tr:first-child td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
div.dataTables_scrollFoot > .dataTables_scrollFootInner {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
|
||||
margin-top: 0 !important;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
div.dataTables_wrapper div.dataTables_length,
|
||||
div.dataTables_wrapper div.dataTables_filter,
|
||||
div.dataTables_wrapper div.dataTables_info,
|
||||
div.dataTables_wrapper div.dataTables_paginate {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
|
||||
justify-content: center !important;
|
||||
}
|
||||
}
|
||||
|
||||
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
table.dataTable.table-sm .sorting:before,
|
||||
table.dataTable.table-sm .sorting_asc:before,
|
||||
table.dataTable.table-sm .sorting_desc:before {
|
||||
top: 5px;
|
||||
right: 0.85em;
|
||||
}
|
||||
|
||||
table.dataTable.table-sm .sorting:after,
|
||||
table.dataTable.table-sm .sorting_asc:after,
|
||||
table.dataTable.table-sm .sorting_desc:after {
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
table.table-bordered.dataTable {
|
||||
border-right-width: 0;
|
||||
}
|
||||
|
||||
table.table-bordered.dataTable th,
|
||||
table.table-bordered.dataTable td {
|
||||
border-left-width: 0;
|
||||
}
|
||||
|
||||
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child,
|
||||
table.table-bordered.dataTable td:last-child,
|
||||
table.table-bordered.dataTable td:last-child {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
table.table-bordered.dataTable tbody th,
|
||||
table.table-bordered.dataTable tbody td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollHead table.table-bordered {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
div.table-responsive > div.dataTables_wrapper > div.row {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.child,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > th.child,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty {
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.child:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > th.child:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty:before {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
|
||||
position: relative;
|
||||
padding-left: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
|
||||
top: 50%;
|
||||
left: 5px;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin-top: -9px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
color: white;
|
||||
border: 0.15em solid white;
|
||||
border-radius: 1em;
|
||||
box-shadow: 0 0 0.2em #444;
|
||||
box-sizing: content-box;
|
||||
text-align: center;
|
||||
text-indent: 0 !important;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
line-height: 1em;
|
||||
content: "+";
|
||||
background-color: #0275d8;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
|
||||
content: "-";
|
||||
background-color: #d33333;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td.dtr-control,
|
||||
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th.dtr-control {
|
||||
padding-left: 27px;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td.dtr-control:before,
|
||||
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th.dtr-control:before {
|
||||
left: 4px;
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
border-radius: 14px;
|
||||
line-height: 14px;
|
||||
text-indent: 3px;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-column > tbody > tr > td.dtr-control,
|
||||
table.dataTable.dtr-column > tbody > tr > th.dtr-control,
|
||||
table.dataTable.dtr-column > tbody > tr > td.control,
|
||||
table.dataTable.dtr-column > tbody > tr > th.control {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-column > tbody > tr > td.dtr-control:before,
|
||||
table.dataTable.dtr-column > tbody > tr > th.dtr-control:before,
|
||||
table.dataTable.dtr-column > tbody > tr > td.control:before,
|
||||
table.dataTable.dtr-column > tbody > tr > th.control:before {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
height: 0.8em;
|
||||
width: 0.8em;
|
||||
margin-top: -0.5em;
|
||||
margin-left: -0.5em;
|
||||
display: block;
|
||||
position: absolute;
|
||||
color: white;
|
||||
border: 0.15em solid white;
|
||||
border-radius: 1em;
|
||||
box-shadow: 0 0 0.2em #444;
|
||||
box-sizing: content-box;
|
||||
text-align: center;
|
||||
text-indent: 0 !important;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
line-height: 1em;
|
||||
content: "+";
|
||||
background-color: #0275d8;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-column > tbody > tr.parent td.dtr-control:before,
|
||||
table.dataTable.dtr-column > tbody > tr.parent th.dtr-control:before,
|
||||
table.dataTable.dtr-column > tbody > tr.parent td.control:before,
|
||||
table.dataTable.dtr-column > tbody > tr.parent th.control:before {
|
||||
content: "-";
|
||||
background-color: #d33333;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child {
|
||||
padding: 0.5em 1em;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child:hover {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details {
|
||||
display: inline-block;
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details > li {
|
||||
border-bottom: 1px solid #efefef;
|
||||
padding: 0.5em 0;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details > li:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child span.dtr-title {
|
||||
display: inline-block;
|
||||
min-width: 75px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.dtr-modal {
|
||||
position: fixed;
|
||||
box-sizing: border-box;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
padding: 10em 1em;
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-display {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
overflow: auto;
|
||||
margin: auto;
|
||||
z-index: 102;
|
||||
overflow: auto;
|
||||
background-color: #f5f5f7;
|
||||
border: 1px solid black;
|
||||
border-radius: 0.5em;
|
||||
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-content {
|
||||
position: relative;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-close {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border: 1px solid #eaeaea;
|
||||
background-color: #f9f9f9;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
z-index: 12;
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-close:hover {
|
||||
background-color: #eaeaea;
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-background {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 101;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
div.dtr-modal div.dtr-modal-display {
|
||||
width: 95%;
|
||||
}
|
||||
}
|
||||
|
||||
div.dtr-bs-modal table.table tr:first-child td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed.table-sm > tbody > tr > td:first-child:before,
|
||||
table.dataTable.dtr-inline.collapsed.table-sm > tbody > tr > th:first-child:before {
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
18
Plan/common/src/main/resources/assets/plan/web/vendor/datatables/datatables.min.css
vendored
Normal file
18
Plan/common/src/main/resources/assets/plan/web/vendor/datatables/datatables.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
278
Plan/common/src/main/resources/assets/plan/web/vendor/datatables/datatables.min.js
vendored
Normal file
278
Plan/common/src/main/resources/assets/plan/web/vendor/datatables/datatables.min.js
vendored
Normal file
@ -0,0 +1,278 @@
|
||||
/*
|
||||
* This combined file was created by the DataTables downloader builder:
|
||||
* https://datatables.net/download
|
||||
*
|
||||
* To rebuild or modify this file with the latest versions of the included
|
||||
* software please visit:
|
||||
* https://datatables.net/download/#bs4/dt-1.10.23/r-2.2.7
|
||||
*
|
||||
* Included libraries:
|
||||
* DataTables 1.10.23, Responsive 2.2.7
|
||||
*/
|
||||
|
||||
/*!
|
||||
Copyright 2008-2020 SpryMedia Ltd.
|
||||
|
||||
This source file is free software, available under the following license:
|
||||
MIT license - http://datatables.net/license
|
||||
|
||||
This source file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
|
||||
For details please refer to: http://www.datatables.net
|
||||
DataTables 1.10.23
|
||||
©2008-2020 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(k,y,z){k instanceof String&&(k=String(k));for(var q=k.length,G=0;G<q;G++){var O=k[G];if(y.call(z,O,G,k))return{i:G,v:O}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(k,y,z){if(k==Array.prototype||k==Object.prototype)return k;k[y]=z.value;return k};$jscomp.getGlobal=function(k){k=["object"==typeof globalThis&&globalThis,k,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var y=0;y<k.length;++y){var z=k[y];if(z&&z.Math==Math)return z}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(k,y){var z=$jscomp.propertyToPolyfillSymbol[y];if(null==z)return k[y];z=k[z];return void 0!==z?z:k[y]};
|
||||
$jscomp.polyfill=function(k,y,z,q){y&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(k,y,z,q):$jscomp.polyfillUnisolated(k,y,z,q))};$jscomp.polyfillUnisolated=function(k,y,z,q){z=$jscomp.global;k=k.split(".");for(q=0;q<k.length-1;q++){var G=k[q];if(!(G in z))return;z=z[G]}k=k[k.length-1];q=z[k];y=y(q);y!=q&&null!=y&&$jscomp.defineProperty(z,k,{configurable:!0,writable:!0,value:y})};
|
||||
$jscomp.polyfillIsolated=function(k,y,z,q){var G=k.split(".");k=1===G.length;q=G[0];q=!k&&q in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var O=0;O<G.length-1;O++){var ma=G[O];if(!(ma in q))return;q=q[ma]}G=G[G.length-1];z=$jscomp.IS_SYMBOL_NATIVE&&"es6"===z?q[G]:null;y=y(z);null!=y&&(k?$jscomp.defineProperty($jscomp.polyfills,G,{configurable:!0,writable:!0,value:y}):y!==z&&($jscomp.propertyToPolyfillSymbol[G]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(G):$jscomp.POLYFILL_PREFIX+G,
|
||||
G=$jscomp.propertyToPolyfillSymbol[G],$jscomp.defineProperty(q,G,{configurable:!0,writable:!0,value:y})))};$jscomp.polyfill("Array.prototype.find",function(k){return k?k:function(y,z){return $jscomp.findInternal(this,y,z).v}},"es6","es3");
|
||||
(function(k){"function"===typeof define&&define.amd?define(["jquery"],function(y){return k(y,window,document)}):"object"===typeof exports?module.exports=function(y,z){y||(y=window);z||(z="undefined"!==typeof window?require("jquery"):require("jquery")(y));return k(z,y,y.document)}:k(jQuery,window,document)})(function(k,y,z,q){function G(a){var b,c,d={};k.each(a,function(e,f){(b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" ")&&(c=e.replace(b[0],b[2].toLowerCase()),
|
||||
d[c]=e,"o"===b[1]&&G(a[e]))});a._hungarianMap=d}function O(a,b,c){a._hungarianMap||G(a);var d;k.each(b,function(e,f){d=a._hungarianMap[e];d===q||!c&&b[d]!==q||("o"===d.charAt(0)?(b[d]||(b[d]={}),k.extend(!0,b[d],b[e]),O(a[d],b[d],c)):b[d]=b[e])})}function ma(a){var b=u.defaults.oLanguage,c=b.sDecimal;c&&Va(c);if(a){var d=a.sZeroRecords;!a.sEmptyTable&&d&&"No data available in table"===b.sEmptyTable&&V(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&d&&"Loading..."===b.sLoadingRecords&&V(a,a,
|
||||
"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&c!==a&&Va(a)}}function yb(a){R(a,"ordering","bSort");R(a,"orderMulti","bSortMulti");R(a,"orderClasses","bSortClasses");R(a,"orderCellsTop","bSortCellsTop");R(a,"order","aaSorting");R(a,"orderFixed","aaSortingFixed");R(a,"paging","bPaginate");R(a,"pagingType","sPaginationType");R(a,"pageLength","iDisplayLength");R(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":
|
||||
"");"boolean"===typeof a.scrollX&&(a.scrollX=a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&O(u.models.oSearch,a[b])}function zb(a){R(a,"orderable","bSortable");R(a,"orderData","aDataSort");R(a,"orderSequence","asSorting");R(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"!==typeof b||Array.isArray(b)||(a.aDataSort=[b])}function Ab(a){if(!u.__browser){var b={};u.__browser=b;var c=k("<div/>").css({position:"fixed",top:0,left:-1*k(y).scrollLeft(),height:1,
|
||||
width:1,overflow:"hidden"}).append(k("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(k("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}k.extend(a.oBrowser,u.__browser);a.oScroll.iBarWidth=u.__browser.barWidth}
|
||||
function Bb(a,b,c,d,e,f){var g=!1;if(c!==q){var h=c;g=!0}for(;d!==e;)a.hasOwnProperty(d)&&(h=g?b(h,a[d],d,a):a[d],g=!0,d+=f);return h}function Wa(a,b){var c=u.defaults.column,d=a.aoColumns.length;c=k.extend({},u.models.oColumn,c,{nTh:b?b:z.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=k.extend({},u.models.oSearch,c[d]);Da(a,d,k(b).data())}function Da(a,b,c){b=a.aoColumns[b];
|
||||
var d=a.oClasses,e=k(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==q&&null!==c&&(zb(c),O(u.defaults.column,c,!0),c.mDataProp===q||c.mData||(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),k.extend(b,c),V(b,c,"sWidth","sWidthOrig"),c.iDataSort!==q&&(b.aDataSort=[c.iDataSort]),V(b,c,"aDataSort"));var g=b.mData,h=ia(g),
|
||||
l=b.mRender?ia(b.mRender):null;c=function(n){return"string"===typeof n&&-1!==n.indexOf("@")};b._bAttrSrc=k.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(n,m,p){var t=h(n,m,q,p);return l&&m?l(t,m,n,p):t};b.fnSetData=function(n,m,p){return da(g)(n,m,p)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==k.inArray("asc",b.asSorting);c=-1!==k.inArray("desc",b.asSorting);b.bSortable&&(a||c)?a&&!c?
|
||||
(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI):(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI="")}function ra(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Xa(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;""===b.sY&&""===b.sX||Ea(a);I(a,null,"column-sizing",[a])}function sa(a,b){a=Fa(a,"bVisible");
|
||||
return"number"===typeof a[b]?a[b]:null}function ta(a,b){a=Fa(a,"bVisible");b=k.inArray(b,a);return-1!==b?b:null}function na(a){var b=0;k.each(a.aoColumns,function(c,d){d.bVisible&&"none"!==k(d.nTh).css("display")&&b++});return b}function Fa(a,b){var c=[];k.map(a.aoColumns,function(d,e){d[b]&&c.push(e)});return c}function Ya(a){var b=a.aoColumns,c=a.aoData,d=u.ext.type.detect,e,f,g;var h=0;for(e=b.length;h<e;h++){var l=b[h];var n=[];if(!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){var m=
|
||||
0;for(f=d.length;m<f;m++){var p=0;for(g=c.length;p<g;p++){n[p]===q&&(n[p]=S(a,p,h,"type"));var t=d[m](n[p],a);if(!t&&m!==d.length-1)break;if("html"===t)break}if(t){l.sType=t;break}}l.sType||(l.sType="string")}}}function Cb(a,b,c,d){var e,f,g,h=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){var l=b[e];var n=l.targets!==q?l.targets:l.aTargets;Array.isArray(n)||(n=[n]);var m=0;for(f=n.length;m<f;m++)if("number"===typeof n[m]&&0<=n[m]){for(;h.length<=n[m];)Wa(a);d(n[m],l)}else if("number"===typeof n[m]&&
|
||||
0>n[m])d(h.length+n[m],l);else if("string"===typeof n[m]){var p=0;for(g=h.length;p<g;p++)("_all"==n[m]||k(h[p].nTh).hasClass(n[m]))&&d(p,l)}}if(c)for(e=0,a=c.length;e<a;e++)d(e,c[e])}function ea(a,b,c,d){var e=a.aoData.length,f=k.extend(!0,{},u.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,h=0,l=g.length;h<l;h++)g[h].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==q&&(a.aIds[b]=f);!c&&a.oFeatures.bDeferRender||Za(a,e,c,d);return e}function Ga(a,
|
||||
b){var c;b instanceof k||(b=k(b));return b.map(function(d,e){c=$a(a,e);return ea(a,c.data,e,c.cells)})}function S(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,h=f.sDefaultContent,l=f.fnGetData(g,d,{settings:a,row:b,col:c});if(l===q)return a.iDrawError!=e&&null===h&&(aa(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),h;if((l===g||null===l)&&null!==h&&d!==q)l=h;else if("function"===typeof l)return l.call(g);
|
||||
return null===l&&"display"==d?"":l}function Db(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}function ab(a){return k.map(a.match(/(\\.|[^\.])+/g)||[""],function(b){return b.replace(/\\\./g,".")})}function ia(a){if(k.isPlainObject(a)){var b={};k.each(a,function(d,e){e&&(b[d]=ia(e))});return function(d,e,f,g){var h=b[e]||b._;return h!==q?h(d,e,f,g):d}}if(null===a)return function(d){return d};if("function"===typeof a)return function(d,e,f,g){return a(d,e,f,g)};if("string"!==
|
||||
typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(d,e){return d[a]};var c=function(d,e,f){if(""!==f){var g=ab(f);for(var h=0,l=g.length;h<l;h++){f=g[h].match(ua);var n=g[h].match(oa);if(f){g[h]=g[h].replace(ua,"");""!==g[h]&&(d=d[g[h]]);n=[];g.splice(0,h+1);g=g.join(".");if(Array.isArray(d))for(h=0,l=d.length;h<l;h++)n.push(c(d[h],e,g));d=f[0].substring(1,f[0].length-1);d=""===d?n:n.join(d);break}else if(n){g[h]=g[h].replace(oa,"");d=d[g[h]]();continue}if(null===
|
||||
d||d[g[h]]===q)return q;d=d[g[h]]}}return d};return function(d,e){return c(d,e,a)}}function da(a){if(k.isPlainObject(a))return da(a._);if(null===a)return function(){};if("function"===typeof a)return function(c,d,e){a(c,"set",d,e)};if("string"!==typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(c,d){c[a]=d};var b=function(c,d,e){e=ab(e);var f=e[e.length-1];for(var g,h,l=0,n=e.length-1;l<n;l++){if("__proto__"===e[l]||"constructor"===e[l])throw Error("Cannot set prototype values");
|
||||
g=e[l].match(ua);h=e[l].match(oa);if(g){e[l]=e[l].replace(ua,"");c[e[l]]=[];f=e.slice();f.splice(0,l+1);g=f.join(".");if(Array.isArray(d))for(h=0,n=d.length;h<n;h++)f={},b(f,d[h],g),c[e[l]].push(f);else c[e[l]]=d;return}h&&(e[l]=e[l].replace(oa,""),c=c[e[l]](d));if(null===c[e[l]]||c[e[l]]===q)c[e[l]]={};c=c[e[l]]}if(f.match(oa))c[f.replace(oa,"")](d);else c[f.replace(ua,"")]=d};return function(c,d){return b(c,d,a)}}function bb(a){return T(a.aoData,"_aData")}function Ha(a){a.aoData.length=0;a.aiDisplayMaster.length=
|
||||
0;a.aiDisplay.length=0;a.aIds={}}function Ia(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===q&&a.splice(d,1)}function va(a,b,c,d){var e=a.aoData[b],f,g=function(l,n){for(;l.childNodes.length;)l.removeChild(l.firstChild);l.innerHTML=S(a,b,n,"display")};if("dom"!==c&&(c&&"auto"!==c||"dom"!==e.src)){var h=e.anCells;if(h)if(d!==q)g(h[d],d);else for(c=0,f=h.length;c<f;c++)g(h[c],c)}else e._aData=$a(a,e,d,d===q?q:e._aData).data;e._aSortData=null;e._aFilterData=null;g=
|
||||
a.aoColumns;if(d!==q)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;cb(a,e)}}function $a(a,b,c,d){var e=[],f=b.firstChild,g,h=0,l,n=a.aoColumns,m=a._rowReadObject;d=d!==q?d:m?{}:[];var p=function(x,r){if("string"===typeof x){var A=x.indexOf("@");-1!==A&&(A=x.substring(A+1),da(x)(d,r.getAttribute(A)))}},t=function(x){if(c===q||c===h)g=n[h],l=x.innerHTML.trim(),g&&g._bAttrSrc?(da(g.mData._)(d,l),p(g.mData.sort,x),p(g.mData.type,x),p(g.mData.filter,x)):m?(g._setter||(g._setter=da(g.mData)),
|
||||
g._setter(d,l)):d[h]=l;h++};if(f)for(;f;){var v=f.nodeName.toUpperCase();if("TD"==v||"TH"==v)t(f),e.push(f);f=f.nextSibling}else for(e=b.anCells,f=0,v=e.length;f<v;f++)t(e[f]);(b=b.firstChild?b:b.nTr)&&(b=b.getAttribute("id"))&&da(a.rowId)(d,b);return{data:d,cells:e}}function Za(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],h,l;if(null===e.nTr){var n=c||z.createElement("tr");e.nTr=n;e.anCells=g;n._DT_RowIndex=b;cb(a,e);var m=0;for(h=a.aoColumns.length;m<h;m++){var p=a.aoColumns[m];e=(l=c?!1:!0)?z.createElement(p.sCellType):
|
||||
d[m];e._DT_CellIndex={row:b,column:m};g.push(e);if(l||!(!p.mRender&&p.mData===m||k.isPlainObject(p.mData)&&p.mData._===m+".display"))e.innerHTML=S(a,b,m,"display");p.sClass&&(e.className+=" "+p.sClass);p.bVisible&&!c?n.appendChild(e):!p.bVisible&&c&&e.parentNode.removeChild(e);p.fnCreatedCell&&p.fnCreatedCell.call(a.oInstance,e,S(a,b,m),f,b,m)}I(a,"aoRowCreatedCallback",null,[n,f,b,g])}}function cb(a,b){var c=b.nTr,d=b._aData;if(c){if(a=a.rowIdFn(d))c.id=a;d.DT_RowClass&&(a=d.DT_RowClass.split(" "),
|
||||
b.__rowc=b.__rowc?Ja(b.__rowc.concat(a)):a,k(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&k(c).attr(d.DT_RowAttr);d.DT_RowData&&k(c).data(d.DT_RowData)}}function Eb(a){var b,c,d=a.nTHead,e=a.nTFoot,f=0===k("th, td",d).length,g=a.oClasses,h=a.aoColumns;f&&(c=k("<tr/>").appendTo(d));var l=0;for(b=h.length;l<b;l++){var n=h[l];var m=k(n.nTh).addClass(n.sClass);f&&m.appendTo(c);a.oFeatures.bSort&&(m.addClass(n.sSortingClass),!1!==n.bSortable&&(m.attr("tabindex",a.iTabIndex).attr("aria-controls",
|
||||
a.sTableId),db(a,n.nTh,l)));n.sTitle!=m[0].innerHTML&&m.html(n.sTitle);eb(a,"header")(a,m,n,g)}f&&wa(a.aoHeader,d);k(d).children("tr").attr("role","row");k(d).children("tr").children("th, td").addClass(g.sHeaderTH);k(e).children("tr").children("th, td").addClass(g.sFooterTH);if(null!==e)for(a=a.aoFooter[0],l=0,b=a.length;l<b;l++)n=h[l],n.nTf=a[l].cell,n.sClass&&k(n.nTf).addClass(n.sClass)}function xa(a,b,c){var d,e,f=[],g=[],h=a.aoColumns.length;if(b){c===q&&(c=!1);var l=0;for(d=b.length;l<d;l++){f[l]=
|
||||
b[l].slice();f[l].nTr=b[l].nTr;for(e=h-1;0<=e;e--)a.aoColumns[e].bVisible||c||f[l].splice(e,1);g.push([])}l=0;for(d=f.length;l<d;l++){if(a=f[l].nTr)for(;e=a.firstChild;)a.removeChild(e);e=0;for(b=f[l].length;e<b;e++){var n=h=1;if(g[l][e]===q){a.appendChild(f[l][e].cell);for(g[l][e]=1;f[l+h]!==q&&f[l][e].cell==f[l+h][e].cell;)g[l+h][e]=1,h++;for(;f[l][e+n]!==q&&f[l][e].cell==f[l][e+n].cell;){for(c=0;c<h;c++)g[l+c][e+n]=1;n++}k(f[l][e].cell).attr("rowspan",h).attr("colspan",n)}}}}}function fa(a){var b=
|
||||
I(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==k.inArray(!1,b))U(a,!1);else{b=[];var c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,h="ssp"==P(a),l=a.aiDisplay;a.bDrawing=!0;g!==q&&-1!==g&&(a._iDisplayStart=h?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);g=a._iDisplayStart;var n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,U(a,!1);else if(!h)a.iDraw++;else if(!a.bDestroying&&!Fb(a))return;if(0!==l.length)for(f=h?a.aoData.length:n,h=h?0:g;h<f;h++){var m=
|
||||
l[h],p=a.aoData[m];null===p.nTr&&Za(a,m);var t=p.nTr;if(0!==e){var v=d[c%e];p._sRowStripe!=v&&(k(t).removeClass(p._sRowStripe).addClass(v),p._sRowStripe=v)}I(a,"aoRowCallback",null,[t,p._aData,c,h,m]);b.push(t);c++}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==P(a)?c=f.sLoadingRecords:f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=k("<tr/>",{"class":e?d[0]:""}).append(k("<td />",{valign:"top",colSpan:na(a),"class":a.oClasses.sRowEmpty}).html(c))[0];I(a,"aoHeaderCallback","header",[k(a.nTHead).children("tr")[0],
|
||||
bb(a),g,n,l]);I(a,"aoFooterCallback","footer",[k(a.nTFoot).children("tr")[0],bb(a),g,n,l]);d=k(a.nTBody);d.children().detach();d.append(k(b));I(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function ja(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&Gb(a);d?ya(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;fa(a);a._drawHold=!1}function Hb(a){var b=a.oClasses,c=k(a.nTable);c=k("<div/>").insertBefore(c);var d=a.oFeatures,
|
||||
e=k("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,h,l,n,m,p,t=0;t<f.length;t++){g=null;h=f[t];if("<"==h){l=k("<div/>")[0];n=f[t+1];if("'"==n||'"'==n){m="";for(p=2;f[t+p]!=n;)m+=f[t+p],p++;"H"==m?m=b.sJUIHeader:"F"==m&&(m=b.sJUIFooter);-1!=m.indexOf(".")?(n=m.split("."),l.id=n[0].substr(1,n[0].length-1),l.className=n[1]):"#"==m.charAt(0)?l.id=m.substr(1,
|
||||
m.length-1):l.className=m;t+=p}e.append(l);e=k(l)}else if(">"==h)e=e.parent();else if("l"==h&&d.bPaginate&&d.bLengthChange)g=Ib(a);else if("f"==h&&d.bFilter)g=Jb(a);else if("r"==h&&d.bProcessing)g=Kb(a);else if("t"==h)g=Lb(a);else if("i"==h&&d.bInfo)g=Mb(a);else if("p"==h&&d.bPaginate)g=Nb(a);else if(0!==u.ext.feature.length)for(l=u.ext.feature,p=0,n=l.length;p<n;p++)if(h==l[p].cFeature){g=l[p].fnInit(a);break}g&&(l=a.aanFeatures,l[h]||(l[h]=[]),l[h].push(g),e.append(g))}c.replaceWith(e);a.nHolding=
|
||||
null}function wa(a,b){b=k(b).children("tr");var c,d,e;a.splice(0,a.length);var f=0;for(e=b.length;f<e;f++)a.push([]);f=0;for(e=b.length;f<e;f++){var g=b[f];for(c=g.firstChild;c;){if("TD"==c.nodeName.toUpperCase()||"TH"==c.nodeName.toUpperCase()){var h=1*c.getAttribute("colspan");var l=1*c.getAttribute("rowspan");h=h&&0!==h&&1!==h?h:1;l=l&&0!==l&&1!==l?l:1;var n=0;for(d=a[f];d[n];)n++;var m=n;var p=1===h?!0:!1;for(d=0;d<h;d++)for(n=0;n<l;n++)a[f+n][m+d]={cell:c,unique:p},a[f+n].nTr=g}c=c.nextSibling}}}
|
||||
function Ka(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],wa(c,b)));b=0;for(var e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)!c[b][f].unique||d[f]&&a.bSortCellsTop||(d[f]=c[b][f].cell);return d}function La(a,b,c){I(a,"aoServerParams","serverParams",[b]);if(b&&Array.isArray(b)){var d={},e=/(.*?)\[\]$/;k.each(b,function(m,p){(m=p.name.match(e))?(m=m[0],d[m]||(d[m]=[]),d[m].push(p.value)):d[p.name]=p.value});b=d}var f=a.ajax,g=a.oInstance,h=function(m){I(a,null,"xhr",[a,m,a.jqXHR]);c(m)};if(k.isPlainObject(f)&&
|
||||
f.data){var l=f.data;var n="function"===typeof l?l(b,a):l;b="function"===typeof l&&n?n:k.extend(!0,b,n);delete f.data}n={data:b,success:function(m){var p=m.error||m.sError;p&&aa(a,0,p);a.json=m;h(m)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(m,p,t){t=I(a,null,"xhr",[a,null,a.jqXHR]);-1===k.inArray(!0,t)&&("parsererror"==p?aa(a,0,"Invalid JSON response",1):4===m.readyState&&aa(a,0,"Ajax error",7));U(a,!1)}};a.oAjaxData=b;I(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(g,
|
||||
a.sAjaxSource,k.map(b,function(m,p){return{name:p,value:m}}),h,a):a.sAjaxSource||"string"===typeof f?a.jqXHR=k.ajax(k.extend(n,{url:f||a.sAjaxSource})):"function"===typeof f?a.jqXHR=f.call(g,b,h,a):(a.jqXHR=k.ajax(k.extend(n,f)),f.data=l)}function Fb(a){return a.bAjaxDataGet?(a.iDraw++,U(a,!0),La(a,Ob(a),function(b){Pb(a,b)}),!1):!0}function Ob(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g=[],h=pa(a);var l=a._iDisplayStart;var n=!1!==d.bPaginate?a._iDisplayLength:
|
||||
-1;var m=function(x,r){g.push({name:x,value:r})};m("sEcho",a.iDraw);m("iColumns",c);m("sColumns",T(b,"sName").join(","));m("iDisplayStart",l);m("iDisplayLength",n);var p={draw:a.iDraw,columns:[],order:[],start:l,length:n,search:{value:e.sSearch,regex:e.bRegex}};for(l=0;l<c;l++){var t=b[l];var v=f[l];n="function"==typeof t.mData?"function":t.mData;p.columns.push({data:n,name:t.sName,searchable:t.bSearchable,orderable:t.bSortable,search:{value:v.sSearch,regex:v.bRegex}});m("mDataProp_"+l,n);d.bFilter&&
|
||||
(m("sSearch_"+l,v.sSearch),m("bRegex_"+l,v.bRegex),m("bSearchable_"+l,t.bSearchable));d.bSort&&m("bSortable_"+l,t.bSortable)}d.bFilter&&(m("sSearch",e.sSearch),m("bRegex",e.bRegex));d.bSort&&(k.each(h,function(x,r){p.order.push({column:r.col,dir:r.dir});m("iSortCol_"+x,r.col);m("sSortDir_"+x,r.dir)}),m("iSortingCols",h.length));b=u.ext.legacy.ajax;return null===b?a.sAjaxSource?g:p:b?g:p}function Pb(a,b){var c=function(g,h){return b[g]!==q?b[g]:b[h]},d=Ma(a,b),e=c("sEcho","draw"),f=c("iTotalRecords",
|
||||
"recordsTotal");c=c("iTotalDisplayRecords","recordsFiltered");if(e!==q){if(1*e<a.iDraw)return;a.iDraw=1*e}Ha(a);a._iRecordsTotal=parseInt(f,10);a._iRecordsDisplay=parseInt(c,10);e=0;for(f=d.length;e<f;e++)ea(a,d[e]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;fa(a);a._bInitComplete||Na(a,b);a.bAjaxDataGet=!0;U(a,!1)}function Ma(a,b){a=k.isPlainObject(a.ajax)&&a.ajax.dataSrc!==q?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===a?b.aaData||b[a]:""!==a?ia(a)(b):b}function Jb(a){var b=a.oClasses,
|
||||
c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',h=d.sSearch;h=h.match(/_INPUT_/)?h.replace("_INPUT_",g):h+g;b=k("<div/>",{id:f.f?null:c+"_filter","class":b.sFilter}).append(k("<label/>").append(h));var l=function(){var m=this.value?this.value:"";m!=e.sSearch&&(ya(a,{sSearch:m,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,fa(a))};f=null!==a.searchDelay?a.searchDelay:"ssp"===P(a)?400:0;var n=
|
||||
k("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",f?fb(l,f):l).on("mouseup",function(m){setTimeout(function(){l.call(n[0])},10)}).on("keypress.DT",function(m){if(13==m.keyCode)return!1}).attr("aria-controls",c);k(a.nTable).on("search.dt.DT",function(m,p){if(a===p)try{n[0]!==z.activeElement&&n.val(e.sSearch)}catch(t){}});return b[0]}function ya(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(h){d.sSearch=h.sSearch;d.bRegex=
|
||||
h.bRegex;d.bSmart=h.bSmart;d.bCaseInsensitive=h.bCaseInsensitive},g=function(h){return h.bEscapeRegex!==q?!h.bEscapeRegex:h.bRegex};Ya(a);if("ssp"!=P(a)){Qb(a,b.sSearch,c,g(b),b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)Rb(a,e[b].sSearch,b,g(e[b]),e[b].bSmart,e[b].bCaseInsensitive);Sb(a)}else f(b);a.bFiltered=!0;I(a,null,"search",[a])}function Sb(a){for(var b=u.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var h=[],l=0,n=c.length;l<n;l++)e=c[l],d=a.aoData[e],b[f](a,d._aFilterData,
|
||||
e,d._aData,l)&&h.push(e);c.length=0;k.merge(c,h)}}function Rb(a,b,c,d,e,f){if(""!==b){var g=[],h=a.aiDisplay;d=gb(b,d,e,f);for(e=0;e<h.length;e++)b=a.aoData[h[e]]._aFilterData[c],d.test(b)&&g.push(h[e]);a.aiDisplay=g}}function Qb(a,b,c,d,e,f){e=gb(b,d,e,f);var g=a.oPreviousSearch.sSearch,h=a.aiDisplayMaster;f=[];0!==u.ext.search.length&&(c=!0);var l=Tb(a);if(0>=b.length)a.aiDisplay=h.slice();else{if(l||c||d||g.length>b.length||0!==b.indexOf(g)||a.bSorted)a.aiDisplay=h.slice();b=a.aiDisplay;for(c=
|
||||
0;c<b.length;c++)e.test(a.aoData[b[c]]._sFilterRow)&&f.push(b[c]);a.aiDisplay=f}}function gb(a,b,c,d){a=b?a:hb(a);c&&(a="^(?=.*?"+k.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(e){if('"'===e.charAt(0)){var f=e.match(/^"(.*)"$/);e=f?f[1]:e}return e.replace('"',"")}).join(")(?=.*?")+").*$");return new RegExp(a,d?"i":"")}function Tb(a){var b=a.aoColumns,c,d,e=u.ext.type.search;var f=!1;var g=0;for(c=a.aoData.length;g<c;g++){var h=a.aoData[g];if(!h._aFilterData){var l=[];var n=0;for(d=b.length;n<d;n++){f=
|
||||
b[n];if(f.bSearchable){var m=S(a,g,n,"filter");e[f.sType]&&(m=e[f.sType](m));null===m&&(m="");"string"!==typeof m&&m.toString&&(m=m.toString())}else m="";m.indexOf&&-1!==m.indexOf("&")&&(Oa.innerHTML=m,m=rc?Oa.textContent:Oa.innerText);m.replace&&(m=m.replace(/[\r\n\u2028]/g,""));l.push(m)}h._aFilterData=l;h._sFilterRow=l.join(" ");f=!0}}return f}function Ub(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}function Vb(a){return{sSearch:a.search,bSmart:a.smart,
|
||||
bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function Mb(a){var b=a.sTableId,c=a.aanFeatures.i,d=k("<div/>",{"class":a.oClasses.sInfo,id:c?null:b+"_info"});c||(a.aoDrawCallback.push({fn:Wb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),k(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Wb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),h=g?c.sInfo:c.sInfoEmpty;
|
||||
g!==f&&(h+=" "+c.sInfoFiltered);h+=c.sInfoPostFix;h=Xb(a,h);c=c.fnInfoCallback;null!==c&&(h=c.call(a.oInstance,a,d,e,f,g,h));k(b).html(h)}}function Xb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/
|
||||
e)))}function za(a){var b=a.iInitDisplayStart,c=a.aoColumns;var d=a.oFeatures;var e=a.bDeferLoading;if(a.bInitialised){Hb(a);Eb(a);xa(a,a.aoHeader);xa(a,a.aoFooter);U(a,!0);d.bAutoWidth&&Xa(a);var f=0;for(d=c.length;f<d;f++){var g=c[f];g.sWidth&&(g.nTh.style.width=K(g.sWidth))}I(a,null,"preInit",[a]);ja(a);c=P(a);if("ssp"!=c||e)"ajax"==c?La(a,[],function(h){var l=Ma(a,h);for(f=0;f<l.length;f++)ea(a,l[f]);a.iInitDisplayStart=b;ja(a);U(a,!1);Na(a,h)},a):(U(a,!1),Na(a))}else setTimeout(function(){za(a)},
|
||||
200)}function Na(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&ra(a);I(a,null,"plugin-init",[a,b]);I(a,"aoInitComplete","init",[a,b])}function ib(a,b){b=parseInt(b,10);a._iDisplayLength=b;jb(a);I(a,null,"length",[a,b])}function Ib(a){var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=Array.isArray(d[0]),f=e?d[0]:d;d=e?d[1]:d;e=k("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect});for(var g=0,h=f.length;g<h;g++)e[0][g]=new Option("number"===typeof d[g]?a.fnFormatNumber(d[g]):d[g],
|
||||
f[g]);var l=k("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(l[0].id=c+"_length");l.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));k("select",l).val(a._iDisplayLength).on("change.DT",function(n){ib(a,k(this).val());fa(a)});k(a.nTable).on("length.dt.DT",function(n,m,p){a===m&&k("select",l).val(p)});return l[0]}function Nb(a){var b=a.sPaginationType,c=u.ext.pager[b],d="function"===typeof c,e=function(g){fa(g)};b=k("<div/>").addClass(a.oClasses.sPaging+b)[0];
|
||||
var f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(g){if(d){var h=g._iDisplayStart,l=g._iDisplayLength,n=g.fnRecordsDisplay(),m=-1===l;h=m?0:Math.ceil(h/l);l=m?1:Math.ceil(n/l);n=c(h,l);var p;m=0;for(p=f.p.length;m<p;m++)eb(g,"pageButton")(g,f.p[m],m,n,h,l)}else c.fnUpdate(g,e)},sName:"pagination"}));return b}function kb(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&
|
||||
(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:aa(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(I(a,null,"page",[a]),c&&fa(a));return b}function Kb(a){return k("<div/>",{id:a.aanFeatures.r?null:a.sTableId+"_processing","class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function U(a,b){a.oFeatures.bProcessing&&k(a.aanFeatures.r).css("display",b?"block":"none");
|
||||
I(a,null,"processing",[a,b])}function Lb(a){var b=k(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),h=g.length?g[0]._captionSide:null,l=k(b[0].cloneNode(!1)),n=k(b[0].cloneNode(!1)),m=b.children("tfoot");m.length||(m=null);l=k("<div/>",{"class":f.sScrollWrapper}).append(k("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?d?K(d):null:"100%"}).append(k("<div/>",
|
||||
{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(l.removeAttr("id").css("margin-left",0).append("top"===h?g:null).append(b.children("thead"))))).append(k("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:d?K(d):null}).append(b));m&&l.append(k("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?d?K(d):null:"100%"}).append(k("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",
|
||||
0).append("bottom"===h?g:null).append(b.children("tfoot")))));b=l.children();var p=b[0];f=b[1];var t=m?b[2]:null;if(d)k(f).on("scroll.DT",function(v){v=this.scrollLeft;p.scrollLeft=v;m&&(t.scrollLeft=v)});k(f).css("max-height",e);c.bCollapse||k(f).css("height",e);a.nScrollHead=p;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:Ea,sName:"scrolling"});return l[0]}function Ea(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY;b=b.iBarWidth;var f=k(a.nScrollHead),g=f[0].style,h=f.children("div"),l=
|
||||
h[0].style,n=h.children("table");h=a.nScrollBody;var m=k(h),p=h.style,t=k(a.nScrollFoot).children("div"),v=t.children("table"),x=k(a.nTHead),r=k(a.nTable),A=r[0],E=A.style,H=a.nTFoot?k(a.nTFoot):null,W=a.oBrowser,M=W.bScrollOversize,C=T(a.aoColumns,"nTh"),B=[],ba=[],X=[],lb=[],Aa,Yb=function(F){F=F.style;F.paddingTop="0";F.paddingBottom="0";F.borderTopWidth="0";F.borderBottomWidth="0";F.height=0};var ha=h.scrollHeight>h.clientHeight;if(a.scrollBarVis!==ha&&a.scrollBarVis!==q)a.scrollBarVis=ha,ra(a);
|
||||
else{a.scrollBarVis=ha;r.children("thead, tfoot").remove();if(H){var ka=H.clone().prependTo(r);var la=H.find("tr");ka=ka.find("tr")}var mb=x.clone().prependTo(r);x=x.find("tr");ha=mb.find("tr");mb.find("th, td").removeAttr("tabindex");c||(p.width="100%",f[0].style.width="100%");k.each(Ka(a,mb),function(F,Y){Aa=sa(a,F);Y.style.width=a.aoColumns[Aa].sWidth});H&&Z(function(F){F.style.width=""},ka);f=r.outerWidth();""===c?(E.width="100%",M&&(r.find("tbody").height()>h.offsetHeight||"scroll"==m.css("overflow-y"))&&
|
||||
(E.width=K(r.outerWidth()-b)),f=r.outerWidth()):""!==d&&(E.width=K(d),f=r.outerWidth());Z(Yb,ha);Z(function(F){X.push(F.innerHTML);B.push(K(k(F).css("width")))},ha);Z(function(F,Y){-1!==k.inArray(F,C)&&(F.style.width=B[Y])},x);k(ha).height(0);H&&(Z(Yb,ka),Z(function(F){lb.push(F.innerHTML);ba.push(K(k(F).css("width")))},ka),Z(function(F,Y){F.style.width=ba[Y]},la),k(ka).height(0));Z(function(F,Y){F.innerHTML='<div class="dataTables_sizing">'+X[Y]+"</div>";F.childNodes[0].style.height="0";F.childNodes[0].style.overflow=
|
||||
"hidden";F.style.width=B[Y]},ha);H&&Z(function(F,Y){F.innerHTML='<div class="dataTables_sizing">'+lb[Y]+"</div>";F.childNodes[0].style.height="0";F.childNodes[0].style.overflow="hidden";F.style.width=ba[Y]},ka);r.outerWidth()<f?(la=h.scrollHeight>h.offsetHeight||"scroll"==m.css("overflow-y")?f+b:f,M&&(h.scrollHeight>h.offsetHeight||"scroll"==m.css("overflow-y"))&&(E.width=K(la-b)),""!==c&&""===d||aa(a,1,"Possible column misalignment",6)):la="100%";p.width=K(la);g.width=K(la);H&&(a.nScrollFoot.style.width=
|
||||
K(la));!e&&M&&(p.height=K(A.offsetHeight+b));c=r.outerWidth();n[0].style.width=K(c);l.width=K(c);d=r.height()>h.clientHeight||"scroll"==m.css("overflow-y");e="padding"+(W.bScrollbarLeft?"Left":"Right");l[e]=d?b+"px":"0px";H&&(v[0].style.width=K(c),t[0].style.width=K(c),t[0].style[e]=d?b+"px":"0px");r.children("colgroup").insertBefore(r.children("thead"));m.trigger("scroll");!a.bSorted&&!a.bFiltered||a._drawHold||(h.scrollTop=0)}}function Z(a,b,c){for(var d=0,e=0,f=b.length,g,h;e<f;){g=b[e].firstChild;
|
||||
for(h=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,h,d):a(g,d),d++),g=g.nextSibling,h=c?h.nextSibling:null;e++}}function Xa(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,h=c.length,l=Fa(a,"bVisible"),n=k("th",a.nTHead),m=b.getAttribute("width"),p=b.parentNode,t=!1,v,x=a.oBrowser;d=x.bScrollOversize;(v=b.style.width)&&-1!==v.indexOf("%")&&(m=v);for(v=0;v<l.length;v++){var r=c[l[v]];null!==r.sWidth&&(r.sWidth=Zb(r.sWidthOrig,p),t=!0)}if(d||!t&&!f&&!e&&h==na(a)&&h==n.length)for(v=
|
||||
0;v<h;v++)l=sa(a,v),null!==l&&(c[l].sWidth=K(n.eq(v).width()));else{h=k(b).clone().css("visibility","hidden").removeAttr("id");h.find("tbody tr").remove();var A=k("<tr/>").appendTo(h.find("tbody"));h.find("thead, tfoot").remove();h.append(k(a.nTHead).clone()).append(k(a.nTFoot).clone());h.find("tfoot th, tfoot td").css("width","");n=Ka(a,h.find("thead")[0]);for(v=0;v<l.length;v++)r=c[l[v]],n[v].style.width=null!==r.sWidthOrig&&""!==r.sWidthOrig?K(r.sWidthOrig):"",r.sWidthOrig&&f&&k(n[v]).append(k("<div/>").css({width:r.sWidthOrig,
|
||||
margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(v=0;v<l.length;v++)t=l[v],r=c[t],k($b(a,t)).clone(!1).append(r.sContentPadding).appendTo(A);k("[name]",h).removeAttr("name");r=k("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(h).appendTo(p);f&&g?h.width(g):f?(h.css("width","auto"),h.removeAttr("width"),h.width()<p.clientWidth&&m&&h.width(p.clientWidth)):e?h.width(p.clientWidth):m&&h.width(m);for(v=e=0;v<l.length;v++)p=k(n[v]),g=p.outerWidth()-
|
||||
p.width(),p=x.bBounding?Math.ceil(n[v].getBoundingClientRect().width):p.outerWidth(),e+=p,c[l[v]].sWidth=K(p-g);b.style.width=K(e);r.remove()}m&&(b.style.width=K(m));!m&&!f||a._reszEvt||(b=function(){k(y).on("resize.DT-"+a.sInstance,fb(function(){ra(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0)}function Zb(a,b){if(!a)return 0;a=k("<div/>").css("width",K(a)).appendTo(b||z.body);b=a[0].offsetWidth;a.remove();return b}function $b(a,b){var c=ac(a,b);if(0>c)return null;var d=a.aoData[c];return d.nTr?d.anCells[b]:
|
||||
k("<td/>").html(S(a,c,b,"display"))[0]}function ac(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=S(a,f,b,"display")+"",c=c.replace(sc,""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function K(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function pa(a){var b=[],c=a.aoColumns;var d=a.aaSortingFixed;var e=k.isPlainObject(d);var f=[];var g=function(m){m.length&&!Array.isArray(m[0])?f.push(m):k.merge(f,m)};Array.isArray(d)&&g(d);
|
||||
e&&d.pre&&g(d.pre);g(a.aaSorting);e&&d.post&&g(d.post);for(a=0;a<f.length;a++){var h=f[a][0];g=c[h].aDataSort;d=0;for(e=g.length;d<e;d++){var l=g[d];var n=c[l].sType||"string";f[a]._idx===q&&(f[a]._idx=k.inArray(f[a][1],c[l].asSorting));b.push({src:h,col:l,dir:f[a][1],index:f[a]._idx,type:n,formatter:u.ext.type.order[n+"-pre"]})}}return b}function Gb(a){var b,c=[],d=u.ext.type.order,e=a.aoData,f=0,g=a.aiDisplayMaster;Ya(a);var h=pa(a);var l=0;for(b=h.length;l<b;l++){var n=h[l];n.formatter&&f++;bc(a,
|
||||
n.col)}if("ssp"!=P(a)&&0!==h.length){l=0;for(b=g.length;l<b;l++)c[g[l]]=l;f===h.length?g.sort(function(m,p){var t,v=h.length,x=e[m]._aSortData,r=e[p]._aSortData;for(t=0;t<v;t++){var A=h[t];var E=x[A.col];var H=r[A.col];E=E<H?-1:E>H?1:0;if(0!==E)return"asc"===A.dir?E:-E}E=c[m];H=c[p];return E<H?-1:E>H?1:0}):g.sort(function(m,p){var t,v=h.length,x=e[m]._aSortData,r=e[p]._aSortData;for(t=0;t<v;t++){var A=h[t];var E=x[A.col];var H=r[A.col];A=d[A.type+"-"+A.dir]||d["string-"+A.dir];E=A(E,H);if(0!==E)return E}E=
|
||||
c[m];H=c[p];return E<H?-1:E>H?1:0})}a.bSorted=!0}function cc(a){var b=a.aoColumns,c=pa(a);a=a.oLanguage.oAria;for(var d=0,e=b.length;d<e;d++){var f=b[d];var g=f.asSorting;var h=f.sTitle.replace(/<.*?>/g,"");var l=f.nTh;l.removeAttribute("aria-sort");f.bSortable&&(0<c.length&&c[0].col==d?(l.setAttribute("aria-sort","asc"==c[0].dir?"ascending":"descending"),f=g[c[0].index+1]||g[0]):f=g[0],h+="asc"===f?a.sSortAscending:a.sSortDescending);l.setAttribute("aria-label",h)}}function nb(a,b,c,d){var e=a.aaSorting,
|
||||
f=a.aoColumns[b].asSorting,g=function(h,l){var n=h._idx;n===q&&(n=k.inArray(h[1],f));return n+1<f.length?n+1:l?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=k.inArray(b,T(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);ja(a);"function"==typeof d&&d(a)}
|
||||
function db(a,b,c,d){var e=a.aoColumns[c];ob(b,{},function(f){!1!==e.bSortable&&(a.oFeatures.bProcessing?(U(a,!0),setTimeout(function(){nb(a,c,f.shiftKey,d);"ssp"!==P(a)&&U(a,!1)},0)):nb(a,c,f.shiftKey,d))})}function Pa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=pa(a),e=a.oFeatures,f;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++){var g=b[e].src;k(T(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3))}e=0;for(f=d.length;e<f;e++)g=d[e].src,k(T(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=
|
||||
d}function bc(a,b){var c=a.aoColumns[b],d=u.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ta(a,b)));for(var f,g=u.ext.type.order[c.sType+"-pre"],h=0,l=a.aoData.length;h<l;h++)if(c=a.aoData[h],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[h]:S(a,h,b,"sort"),c._aSortData[b]=g?g(f):f}function Qa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:k.extend(!0,[],a.aaSorting),search:Ub(a.oPreviousSearch),columns:k.map(a.aoColumns,
|
||||
function(c,d){return{visible:c.bVisible,search:Ub(a.aoPreSearchCols[d])}})};I(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function dc(a,b,c){var d,e,f=a.aoColumns;b=function(h){if(h&&h.time){var l=I(a,"aoStateLoadParams","stateLoadParams",[a,h]);if(-1===k.inArray(!1,l)&&(l=a.iStateDuration,!(0<l&&h.time<+new Date-1E3*l||h.columns&&f.length!==h.columns.length))){a.oLoadedState=k.extend(!0,{},h);h.start!==q&&(a._iDisplayStart=h.start,a.iInitDisplayStart=
|
||||
h.start);h.length!==q&&(a._iDisplayLength=h.length);h.order!==q&&(a.aaSorting=[],k.each(h.order,function(n,m){a.aaSorting.push(m[0]>=f.length?[0,m[1]]:m)}));h.search!==q&&k.extend(a.oPreviousSearch,Vb(h.search));if(h.columns)for(d=0,e=h.columns.length;d<e;d++)l=h.columns[d],l.visible!==q&&(f[d].bVisible=l.visible),l.search!==q&&k.extend(a.aoPreSearchCols[d],Vb(l.search));I(a,"aoStateLoaded","stateLoaded",[a,h])}}c()};if(a.oFeatures.bStateSave){var g=a.fnStateLoadCallback.call(a.oInstance,a,b);g!==
|
||||
q&&b(g)}else c()}function Ra(a){var b=u.settings;a=k.inArray(a,T(b,"nTable"));return-1!==a?b[a]:null}function aa(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)y.console&&console.log&&console.log(c);else if(b=u.ext,b=b.sErrMode||b.errMode,a&&I(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function V(a,b,c,d){Array.isArray(c)?
|
||||
k.each(c,function(e,f){Array.isArray(f)?V(a,b,f[0],f[1]):V(a,b,f)}):(d===q&&(d=c),b[c]!==q&&(a[d]=b[c]))}function pb(a,b,c){var d;for(d in b)if(b.hasOwnProperty(d)){var e=b[d];k.isPlainObject(e)?(k.isPlainObject(a[d])||(a[d]={}),k.extend(!0,a[d],e)):c&&"data"!==d&&"aaData"!==d&&Array.isArray(e)?a[d]=e.slice():a[d]=e}return a}function ob(a,b,c){k(a).on("click.DT",b,function(d){k(a).trigger("blur");c(d)}).on("keypress.DT",b,function(d){13===d.which&&(d.preventDefault(),c(d))}).on("selectstart.DT",function(){return!1})}
|
||||
function Q(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function I(a,b,c,d){var e=[];b&&(e=k.map(a[b].slice().reverse(),function(f,g){return f.fn.apply(a.oInstance,d)}));null!==c&&(b=k.Event(c+".dt"),k(a.nTable).trigger(b,d),e.push(b.result));return e}function jb(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function eb(a,b){a=a.renderer;var c=u.ext.renderer[b];return k.isPlainObject(a)&&a[b]?c[a[b]]||c._:"string"===typeof a?c[a]||
|
||||
c._:c._}function P(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Ba(a,b){var c=ec.numbers_length,d=Math.floor(c/2);b<=c?a=qa(0,b):a<=d?(a=qa(0,c-2),a.push("ellipsis"),a.push(b-1)):(a>=b-1-d?a=qa(b-(c-2),b):(a=qa(a-d+2,a+d-1),a.push("ellipsis"),a.push(b-1)),a.splice(0,0,"ellipsis"),a.splice(0,0,0));a.DT_el="span";return a}function Va(a){k.each({num:function(b){return Sa(b,a)},"num-fmt":function(b){return Sa(b,a,qb)},"html-num":function(b){return Sa(b,a,Ta)},"html-num-fmt":function(b){return Sa(b,
|
||||
a,Ta,qb)}},function(b,c){L.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(L.type.search[b+a]=L.type.search.html)})}function fc(a){return function(){var b=[Ra(this[u.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return u.ext.internal[a].apply(this,b)}}var u=function(a){this.$=function(f,g){return this.api(!0).$(f,g)};this._=function(f,g){return this.api(!0).rows(f,g).data()};this.api=function(f){return f?new D(Ra(this[L.iApiIndex])):new D(this)};this.fnAddData=function(f,g){var h=this.api(!0);
|
||||
f=Array.isArray(f)&&(Array.isArray(f[0])||k.isPlainObject(f[0]))?h.rows.add(f):h.row.add(f);(g===q||g)&&h.draw();return f.flatten().toArray()};this.fnAdjustColumnSizing=function(f){var g=this.api(!0).columns.adjust(),h=g.settings()[0],l=h.oScroll;f===q||f?g.draw(!1):(""!==l.sX||""!==l.sY)&&Ea(h)};this.fnClearTable=function(f){var g=this.api(!0).clear();(f===q||f)&&g.draw()};this.fnClose=function(f){this.api(!0).row(f).child.hide()};this.fnDeleteRow=function(f,g,h){var l=this.api(!0);f=l.rows(f);var n=
|
||||
f.settings()[0],m=n.aoData[f[0][0]];f.remove();g&&g.call(this,n,m);(h===q||h)&&l.draw();return m};this.fnDestroy=function(f){this.api(!0).destroy(f)};this.fnDraw=function(f){this.api(!0).draw(f)};this.fnFilter=function(f,g,h,l,n,m){n=this.api(!0);null===g||g===q?n.search(f,h,l,m):n.column(g).search(f,h,l,m);n.draw()};this.fnGetData=function(f,g){var h=this.api(!0);if(f!==q){var l=f.nodeName?f.nodeName.toLowerCase():"";return g!==q||"td"==l||"th"==l?h.cell(f,g).data():h.row(f).data()||null}return h.data().toArray()};
|
||||
this.fnGetNodes=function(f){var g=this.api(!0);return f!==q?g.row(f).node():g.rows().nodes().flatten().toArray()};this.fnGetPosition=function(f){var g=this.api(!0),h=f.nodeName.toUpperCase();return"TR"==h?g.row(f).index():"TD"==h||"TH"==h?(f=g.cell(f).index(),[f.row,f.columnVisible,f.column]):null};this.fnIsOpen=function(f){return this.api(!0).row(f).child.isShown()};this.fnOpen=function(f,g,h){return this.api(!0).row(f).child(g,h).show().child()[0]};this.fnPageChange=function(f,g){f=this.api(!0).page(f);
|
||||
(g===q||g)&&f.draw(!1)};this.fnSetColumnVis=function(f,g,h){f=this.api(!0).column(f).visible(g);(h===q||h)&&f.columns.adjust().draw()};this.fnSettings=function(){return Ra(this[L.iApiIndex])};this.fnSort=function(f){this.api(!0).order(f).draw()};this.fnSortListener=function(f,g,h){this.api(!0).order.listener(f,g,h)};this.fnUpdate=function(f,g,h,l,n){var m=this.api(!0);h===q||null===h?m.row(g).data(f):m.cell(g,h).data(f);(n===q||n)&&m.columns.adjust();(l===q||l)&&m.draw();return 0};this.fnVersionCheck=
|
||||
L.fnVersionCheck;var b=this,c=a===q,d=this.length;c&&(a={});this.oApi=this.internal=L.internal;for(var e in u.ext.internal)e&&(this[e]=fc(e));this.each(function(){var f={},g=1<d?pb(f,a,!0):a,h=0,l;f=this.getAttribute("id");var n=!1,m=u.defaults,p=k(this);if("table"!=this.nodeName.toLowerCase())aa(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{yb(m);zb(m.column);O(m,m,!0);O(m.column,m.column,!0);O(m,k.extend(g,p.data()),!0);var t=u.settings;h=0;for(l=t.length;h<l;h++){var v=t[h];
|
||||
if(v.nTable==this||v.nTHead&&v.nTHead.parentNode==this||v.nTFoot&&v.nTFoot.parentNode==this){var x=g.bRetrieve!==q?g.bRetrieve:m.bRetrieve;if(c||x)return v.oInstance;if(g.bDestroy!==q?g.bDestroy:m.bDestroy){v.oInstance.fnDestroy();break}else{aa(v,0,"Cannot reinitialise DataTable",3);return}}if(v.sTableId==this.id){t.splice(h,1);break}}if(null===f||""===f)this.id=f="DataTables_Table_"+u.ext._unique++;var r=k.extend(!0,{},u.models.oSettings,{sDestroyWidth:p[0].style.width,sInstance:f,sTableId:f});r.nTable=
|
||||
this;r.oApi=b.internal;r.oInit=g;t.push(r);r.oInstance=1===b.length?b:p.dataTable();yb(g);ma(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=Array.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=pb(k.extend(!0,{},m),g);V(r.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));V(r,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed",
|
||||
"aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]);V(r.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);V(r.oLanguage,g,"fnInfoCallback");Q(r,"aoDrawCallback",g.fnDrawCallback,
|
||||
"user");Q(r,"aoServerParams",g.fnServerParams,"user");Q(r,"aoStateSaveParams",g.fnStateSaveParams,"user");Q(r,"aoStateLoadParams",g.fnStateLoadParams,"user");Q(r,"aoStateLoaded",g.fnStateLoaded,"user");Q(r,"aoRowCallback",g.fnRowCallback,"user");Q(r,"aoRowCreatedCallback",g.fnCreatedRow,"user");Q(r,"aoHeaderCallback",g.fnHeaderCallback,"user");Q(r,"aoFooterCallback",g.fnFooterCallback,"user");Q(r,"aoInitComplete",g.fnInitComplete,"user");Q(r,"aoPreDrawCallback",g.fnPreDrawCallback,"user");r.rowIdFn=
|
||||
ia(g.rowId);Ab(r);var A=r.oClasses;k.extend(A,u.ext.classes,g.oClasses);p.addClass(A.sTable);r.iInitDisplayStart===q&&(r.iInitDisplayStart=g.iDisplayStart,r._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(r.bDeferLoading=!0,f=Array.isArray(g.iDeferLoading),r._iRecordsDisplay=f?g.iDeferLoading[0]:g.iDeferLoading,r._iRecordsTotal=f?g.iDeferLoading[1]:g.iDeferLoading);var E=r.oLanguage;k.extend(!0,E,g.oLanguage);E.sUrl&&(k.ajax({dataType:"json",url:E.sUrl,success:function(C){ma(C);O(m.oLanguage,
|
||||
C);k.extend(!0,E,C);za(r)},error:function(){za(r)}}),n=!0);null===g.asStripeClasses&&(r.asStripeClasses=[A.sStripeOdd,A.sStripeEven]);f=r.asStripeClasses;var H=p.children("tbody").find("tr").eq(0);-1!==k.inArray(!0,k.map(f,function(C,B){return H.hasClass(C)}))&&(k("tbody tr",this).removeClass(f.join(" ")),r.asDestroyStripes=f.slice());f=[];t=this.getElementsByTagName("thead");0!==t.length&&(wa(r.aoHeader,t[0]),f=Ka(r));if(null===g.aoColumns)for(t=[],h=0,l=f.length;h<l;h++)t.push(null);else t=g.aoColumns;
|
||||
h=0;for(l=t.length;h<l;h++)Wa(r,f?f[h]:null);Cb(r,g.aoColumnDefs,t,function(C,B){Da(r,C,B)});if(H.length){var W=function(C,B){return null!==C.getAttribute("data-"+B)?B:null};k(H[0]).children("th, td").each(function(C,B){var ba=r.aoColumns[C];if(ba.mData===C){var X=W(B,"sort")||W(B,"order");B=W(B,"filter")||W(B,"search");if(null!==X||null!==B)ba.mData={_:C+".display",sort:null!==X?C+".@data-"+X:q,type:null!==X?C+".@data-"+X:q,filter:null!==B?C+".@data-"+B:q},Da(r,C)}})}var M=r.oFeatures;f=function(){if(g.aaSorting===
|
||||
q){var C=r.aaSorting;h=0;for(l=C.length;h<l;h++)C[h][1]=r.aoColumns[h].asSorting[0]}Pa(r);M.bSort&&Q(r,"aoDrawCallback",function(){if(r.bSorted){var ba=pa(r),X={};k.each(ba,function(lb,Aa){X[Aa.src]=Aa.dir});I(r,null,"order",[r,ba,X]);cc(r)}});Q(r,"aoDrawCallback",function(){(r.bSorted||"ssp"===P(r)||M.bDeferRender)&&Pa(r)},"sc");C=p.children("caption").each(function(){this._captionSide=k(this).css("caption-side")});var B=p.children("thead");0===B.length&&(B=k("<thead/>").appendTo(p));r.nTHead=B[0];
|
||||
B=p.children("tbody");0===B.length&&(B=k("<tbody/>").appendTo(p));r.nTBody=B[0];B=p.children("tfoot");0===B.length&&0<C.length&&(""!==r.oScroll.sX||""!==r.oScroll.sY)&&(B=k("<tfoot/>").appendTo(p));0===B.length||0===B.children().length?p.addClass(A.sNoFooter):0<B.length&&(r.nTFoot=B[0],wa(r.aoFooter,r.nTFoot));if(g.aaData)for(h=0;h<g.aaData.length;h++)ea(r,g.aaData[h]);else(r.bDeferLoading||"dom"==P(r))&&Ga(r,k(r.nTBody).children("tr"));r.aiDisplay=r.aiDisplayMaster.slice();r.bInitialised=!0;!1===
|
||||
n&&za(r)};g.bStateSave?(M.bStateSave=!0,Q(r,"aoDrawCallback",Qa,"state_save"),dc(r,g,f)):f()}});b=null;return this},L,w,J,rb={},gc=/[\r\n\u2028]/g,Ta=/<.*?>/g,tc=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,uc=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\|\$|\^|\-)/g,qb=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,ca=function(a){return a&&!0!==a&&"-"!==a?!1:!0},hc=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},ic=function(a,b){rb[b]||
|
||||
(rb[b]=new RegExp(hb(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(rb[b],"."):a},sb=function(a,b,c){var d="string"===typeof a;if(ca(a))return!0;b&&d&&(a=ic(a,b));c&&d&&(a=a.replace(qb,""));return!isNaN(parseFloat(a))&&isFinite(a)},jc=function(a,b,c){return ca(a)?!0:ca(a)||"string"===typeof a?sb(a.replace(Ta,""),b,c)?!0:null:null},T=function(a,b,c){var d=[],e=0,f=a.length;if(c!==q)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},
|
||||
Ca=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==q)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},qa=function(a,b){var c=[];if(b===q){b=0;var d=a}else d=b,b=a;for(a=b;a<d;a++)c.push(a);return c},kc=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},Ja=function(a){a:{if(!(2>a.length)){var b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d<e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();b=[];e=a.length;var f,
|
||||
g=0;d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b},lc=function(a,b){if(Array.isArray(b))for(var c=0;c<b.length;c++)lc(a,b[c]);else a.push(b);return a};Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});u.util={throttle:function(a,b){var c=b!==q?b:200,d,e;return function(){var f=this,g=
|
||||
+new Date,h=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=q;a.apply(f,h)},c)):(d=g,a.apply(f,h))}},escapeRegex:function(a){return a.replace(uc,"\\$1")}};var R=function(a,b,c){a[b]!==q&&(a[c]=a[b])},ua=/\[.*?\]$/,oa=/\(\)$/,hb=u.util.escapeRegex,Oa=k("<div>")[0],rc=Oa.textContent!==q,sc=/<.*?>/g,fb=u.util.throttle,mc=[],N=Array.prototype,vc=function(a){var b,c=u.settings,d=k.map(c,function(f,g){return f.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase()){var e=
|
||||
k.inArray(a,d);return-1!==e?[c[e]]:null}if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?b=k(a):a instanceof k&&(b=a)}else return[];if(b)return b.map(function(f){e=k.inArray(this,d);return-1!==e?c[e]:null}).toArray()};var D=function(a,b){if(!(this instanceof D))return new D(a,b);var c=[],d=function(g){(g=vc(g))&&c.push.apply(c,g)};if(Array.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=Ja(c);b&&k.merge(this,b);this.selector={rows:null,
|
||||
cols:null,opts:null};D.extend(this,this,mc)};u.Api=D;k.extend(D.prototype,{any:function(){return 0!==this.count()},concat:N.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new D(b[a],this[a]):null},filter:function(a){var b=[];if(N.filter)b=N.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);
|
||||
return new D(this.context,b)},flatten:function(){var a=[];return new D(this.context,a.concat.apply(a,this.toArray()))},join:N.join,indexOf:N.indexOf||function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1},iterator:function(a,b,c,d){var e=[],f,g,h=this.context,l,n=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);var m=0;for(f=h.length;m<f;m++){var p=new D(h[m]);if("table"===b){var t=c.call(p,h[m],m);t!==q&&e.push(t)}else if("columns"===b||"rows"===b)t=c.call(p,h[m],
|
||||
this[m],m),t!==q&&e.push(t);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){var v=this[m];"column-rows"===b&&(l=Ua(h[m],n.opts));var x=0;for(g=v.length;x<g;x++)t=v[x],t="cell"===b?c.call(p,h[m],t.row,t.column,m,x):c.call(p,h[m],t,m,x,l),t!==q&&e.push(t)}}return e.length||d?(a=new D(h,a?e.concat.apply([],e):e),b=a.selector,b.rows=n.rows,b.cols=n.cols,b.opts=n.opts,a):this},lastIndexOf:N.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,
|
||||
map:function(a){var b=[];if(N.map)b=N.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new D(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:N.pop,push:N.push,reduce:N.reduce||function(a,b){return Bb(this,a,b,0,this.length,1)},reduceRight:N.reduceRight||function(a,b){return Bb(this,a,b,this.length-1,-1,-1)},reverse:N.reverse,selector:null,shift:N.shift,slice:function(){return new D(this.context,this)},sort:N.sort,
|
||||
splice:N.splice,toArray:function(){return N.slice.call(this)},to$:function(){return k(this)},toJQuery:function(){return k(this)},unique:function(){return new D(this.context,Ja(this))},unshift:N.unshift});D.extend=function(a,b,c){if(c.length&&b&&(b instanceof D||b.__dt_wrapper)){var d,e=function(h,l,n){return function(){var m=l.apply(h,arguments);D.extend(m,m,n.methodExt);return m}};var f=0;for(d=c.length;f<d;f++){var g=c[f];b[g.name]="function"===g.type?e(a,g.val,g):"object"===g.type?{}:g.val;b[g.name].__dt_wrapper=
|
||||
!0;D.extend(a,b[g.name],g.propExt)}}};D.register=w=function(a,b){if(Array.isArray(a))for(var c=0,d=a.length;c<d;c++)D.register(a[c],b);else{d=a.split(".");var e=mc,f;a=0;for(c=d.length;a<c;a++){var g=(f=-1!==d[a].indexOf("()"))?d[a].replace("()",""):d[a];a:{var h=0;for(var l=e.length;h<l;h++)if(e[h].name===g){h=e[h];break a}h=null}h||(h={name:g,val:{},methodExt:[],propExt:[],type:"object"},e.push(h));a===c-1?(h.val=b,h.type="function"===typeof b?"function":k.isPlainObject(b)?"object":"other"):e=f?
|
||||
h.methodExt:h.propExt}}};D.registerPlural=J=function(a,b,c){D.register(a,c);D.register(b,function(){var d=c.apply(this,arguments);return d===this?this:d instanceof D?d.length?Array.isArray(d[0])?new D(d.context,d[0]):d[0]:q:d})};var nc=function(a,b){if(Array.isArray(a))return k.map(a,function(d){return nc(d,b)});if("number"===typeof a)return[b[a]];var c=k.map(b,function(d,e){return d.nTable});return k(c).filter(a).map(function(d){d=k.inArray(this,c);return b[d]}).toArray()};w("tables()",function(a){return a!==
|
||||
q&&null!==a?new D(nc(a,this.context)):this});w("table()",function(a){a=this.tables(a);var b=a.context;return b.length?new D(b[0]):a});J("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});J("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});J("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});J("tables().footer()","table().footer()",
|
||||
function(){return this.iterator("table",function(a){return a.nTFoot},1)});J("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});w("draw()",function(a){return this.iterator("table",function(b){"page"===a?fa(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),ja(b,!1===a))})});w("page()",function(a){return a===q?this.page.info().page:this.iterator("table",function(b){kb(b,a)})});w("page.info()",function(a){if(0===this.context.length)return q;
|
||||
a=this.context[0];var b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===P(a)}});w("page.len()",function(a){return a===q?0!==this.context.length?this.context[0]._iDisplayLength:q:this.iterator("table",function(b){ib(b,a)})});var oc=function(a,b,c){if(c){var d=new D(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==
|
||||
P(a))ja(a,b);else{U(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();La(a,[],function(f){Ha(a);f=Ma(a,f);for(var g=0,h=f.length;g<h;g++)ea(a,f[g]);ja(a,b);U(a,!1)})}};w("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});w("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});w("ajax.reload()",function(a,b){return this.iterator("table",function(c){oc(c,!1===b,a)})});w("ajax.url()",function(a){var b=this.context;if(a===q){if(0===b.length)return q;
|
||||
b=b[0];return b.ajax?k.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(c){k.isPlainObject(c.ajax)?c.ajax.url=a:c.ajax=a})});w("ajax.url().load()",function(a,b){return this.iterator("table",function(c){oc(c,!1===b,a)})});var tb=function(a,b,c,d,e){var f=[],g,h,l;var n=typeof b;b&&"string"!==n&&"function"!==n&&b.length!==q||(b=[b]);n=0;for(h=b.length;n<h;n++){var m=b[n]&&b[n].split&&!b[n].match(/[\[\(:]/)?b[n].split(","):[b[n]];var p=0;for(l=m.length;p<l;p++)(g=
|
||||
c("string"===typeof m[p]?m[p].trim():m[p]))&&g.length&&(f=f.concat(g))}a=L.selector[a];if(a.length)for(n=0,h=a.length;n<h;n++)f=a[n](d,e,f);return Ja(f)},ub=function(a){a||(a={});a.filter&&a.search===q&&(a.search=a.filter);return k.extend({search:"none",order:"current",page:"all"},a)},vb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ua=function(a,b){var c=[],d=a.aiDisplay;var e=a.aiDisplayMaster;
|
||||
var f=b.search;var g=b.order;b=b.page;if("ssp"==P(a))return"removed"===f?[]:qa(0,e.length);if("current"==b)for(g=a._iDisplayStart,a=a.fnDisplayEnd();g<a;g++)c.push(d[g]);else if("current"==g||"applied"==g)if("none"==f)c=e.slice();else if("applied"==f)c=d.slice();else{if("removed"==f){var h={};g=0;for(a=d.length;g<a;g++)h[d[g]]=null;c=k.map(e,function(l){return h.hasOwnProperty(l)?null:l})}}else if("index"==g||"original"==g)for(g=0,a=a.aoData.length;g<a;g++)"none"==f?c.push(g):(e=k.inArray(g,d),(-1===
|
||||
e&&"removed"==f||0<=e&&"applied"==f)&&c.push(g));return c},wc=function(a,b,c){var d;return tb("row",b,function(e){var f=hc(e),g=a.aoData;if(null!==f&&!c)return[f];d||(d=Ua(a,c));if(null!==f&&-1!==k.inArray(f,d))return[f];if(null===e||e===q||""===e)return d;if("function"===typeof e)return k.map(d,function(l){var n=g[l];return e(l,n._aData,n.nTr)?l:null});if(e.nodeName){f=e._DT_RowIndex;var h=e._DT_CellIndex;if(f!==q)return g[f]&&g[f].nTr===e?[f]:[];if(h)return g[h.row]&&g[h.row].nTr===e.parentNode?
|
||||
[h.row]:[];f=k(e).closest("*[data-dt-row]");return f.length?[f.data("dt-row")]:[]}if("string"===typeof e&&"#"===e.charAt(0)&&(f=a.aIds[e.replace(/^#/,"")],f!==q))return[f.idx];f=kc(Ca(a.aoData,d,"nTr"));return k(f).filter(e).map(function(){return this._DT_RowIndex}).toArray()},a,c)};w("rows()",function(a,b){a===q?a="":k.isPlainObject(a)&&(b=a,a="");b=ub(b);var c=this.iterator("table",function(d){return wc(d,a,b)},1);c.selector.rows=a;c.selector.opts=b;return c});w("rows().nodes()",function(){return this.iterator("row",
|
||||
function(a,b){return a.aoData[b].nTr||q},1)});w("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return Ca(a.aoData,b,"_aData")},1)});J("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){b=b.aoData[c];return"search"===a?b._aFilterData:b._aSortData},1)});J("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){va(b,c,a)})});J("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,
|
||||
b){return b},1)});J("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new D(c,b)});J("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h;e.splice(c,1);var l=0;for(g=e.length;l<g;l++){var n=e[l];var m=n.anCells;null!==n.nTr&&(n.nTr._DT_RowIndex=l);if(null!==m)for(n=0,h=m.length;n<
|
||||
h;n++)m[n]._DT_CellIndex.row=l}Ia(b.aiDisplayMaster,c);Ia(b.aiDisplay,c);Ia(a[d],c,!1);0<b._iRecordsDisplay&&b._iRecordsDisplay--;jb(b);c=b.rowIdFn(f._aData);c!==q&&delete b.aIds[c]});this.iterator("table",function(b){for(var c=0,d=b.aoData.length;c<d;c++)b.aoData[c].idx=c});return this});w("rows.add()",function(a){var b=this.iterator("table",function(d){var e,f=[];var g=0;for(e=a.length;g<e;g++){var h=a[g];h.nodeName&&"TR"===h.nodeName.toUpperCase()?f.push(Ga(d,h)[0]):f.push(ea(d,h))}return f},1),
|
||||
c=this.rows(-1);c.pop();k.merge(c,b);return c});w("row()",function(a,b){return vb(this.rows(a,b))});w("row().data()",function(a){var b=this.context;if(a===q)return b.length&&this.length?b[0].aoData[this[0]]._aData:q;var c=b[0].aoData[this[0]];c._aData=a;Array.isArray(a)&&c.nTr&&c.nTr.id&&da(b[0].rowId)(a,c.nTr.id);va(b[0],this[0],"data");return this});w("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});w("row.add()",function(a){a instanceof
|
||||
k&&a.length&&(a=a[0]);var b=this.iterator("table",function(c){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?Ga(c,a)[0]:ea(c,a)});return this.row(b[0])});var xc=function(a,b,c,d){var e=[],f=function(g,h){if(Array.isArray(g)||g instanceof k)for(var l=0,n=g.length;l<n;l++)f(g[l],h);else g.nodeName&&"tr"===g.nodeName.toLowerCase()?e.push(g):(l=k("<tr><td></td></tr>").addClass(h),k("td",l).addClass(h).html(g)[0].colSpan=na(a),e.push(l[0]))};f(c,d);b._details&&b._details.detach();b._details=k(e);b._detailsShow&&
|
||||
b._details.insertAfter(b.nTr)},wb=function(a,b){var c=a.context;c.length&&(a=c[0].aoData[b!==q?b:a[0]])&&a._details&&(a._details.remove(),a._detailsShow=q,a._details=q)},pc=function(a,b){var c=a.context;c.length&&a.length&&(a=c[0].aoData[a[0]],a._details&&((a._detailsShow=b)?a._details.insertAfter(a.nTr):a._details.detach(),yc(c[0])))},yc=function(a){var b=new D(a),c=a.aoData;b.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<T(c,"_details").length&&(b.on("draw.dt.DT_details",
|
||||
function(d,e){a===e&&b.rows({page:"current"}).eq(0).each(function(f){f=c[f];f._detailsShow&&f._details.insertAfter(f.nTr)})}),b.on("column-visibility.dt.DT_details",function(d,e,f,g){if(a===e)for(e=na(e),f=0,g=c.length;f<g;f++)d=c[f],d._details&&d._details.children("td[colspan]").attr("colspan",e)}),b.on("destroy.dt.DT_details",function(d,e){if(a===e)for(d=0,e=c.length;d<e;d++)c[d]._details&&wb(b,d)}))};w("row().child()",function(a,b){var c=this.context;if(a===q)return c.length&&this.length?c[0].aoData[this[0]]._details:
|
||||
q;!0===a?this.child.show():!1===a?wb(this):c.length&&this.length&&xc(c[0],c[0].aoData[this[0]],a,b);return this});w(["row().child.show()","row().child().show()"],function(a){pc(this,!0);return this});w(["row().child.hide()","row().child().hide()"],function(){pc(this,!1);return this});w(["row().child.remove()","row().child().remove()"],function(){wb(this);return this});w("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var zc=
|
||||
/^([^:]+):(name|visIdx|visible)$/,qc=function(a,b,c,d,e){c=[];d=0;for(var f=e.length;d<f;d++)c.push(S(a,e[d],b));return c},Ac=function(a,b,c){var d=a.aoColumns,e=T(d,"sName"),f=T(d,"nTh");return tb("column",b,function(g){var h=hc(g);if(""===g)return qa(d.length);if(null!==h)return[0<=h?h:d.length+h];if("function"===typeof g){var l=Ua(a,c);return k.map(d,function(p,t){return g(t,qc(a,t,0,0,l),f[t])?t:null})}var n="string"===typeof g?g.match(zc):"";if(n)switch(n[2]){case "visIdx":case "visible":h=parseInt(n[1],
|
||||
10);if(0>h){var m=k.map(d,function(p,t){return p.bVisible?t:null});return[m[m.length+h]]}return[sa(a,h)];case "name":return k.map(e,function(p,t){return p===n[1]?t:null});default:return[]}if(g.nodeName&&g._DT_CellIndex)return[g._DT_CellIndex.column];h=k(f).filter(g).map(function(){return k.inArray(this,f)}).toArray();if(h.length||!g.nodeName)return h;h=k(g).closest("*[data-dt-column]");return h.length?[h.data("dt-column")]:[]},a,c)};w("columns()",function(a,b){a===q?a="":k.isPlainObject(a)&&(b=a,
|
||||
a="");b=ub(b);var c=this.iterator("table",function(d){return Ac(d,a,b)},1);c.selector.cols=a;c.selector.opts=b;return c});J("columns().header()","column().header()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTh},1)});J("columns().footer()","column().footer()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTf},1)});J("columns().data()","column().data()",function(){return this.iterator("column-rows",qc,1)});J("columns().dataSrc()",
|
||||
"column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});J("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return Ca(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});J("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return Ca(a.aoData,e,"anCells",b)},1)});J("columns().visible()","column().visible()",function(a,b){var c=
|
||||
this,d=this.iterator("column",function(e,f){if(a===q)return e.aoColumns[f].bVisible;var g=e.aoColumns,h=g[f],l=e.aoData,n;if(a!==q&&h.bVisible!==a){if(a){var m=k.inArray(!0,T(g,"bVisible"),f+1);g=0;for(n=l.length;g<n;g++){var p=l[g].nTr;e=l[g].anCells;p&&p.insertBefore(e[f],e[m]||null)}}else k(T(e.aoData,"anCells",f)).detach();h.bVisible=a}});a!==q&&this.iterator("table",function(e){xa(e,e.aoHeader);xa(e,e.aoFooter);e.aiDisplay.length||k(e.nTBody).find("td[colspan]").attr("colspan",na(e));Qa(e);c.iterator("column",
|
||||
function(f,g){I(f,null,"column-visibility",[f,g,a,b])});(b===q||b)&&c.columns.adjust()});return d});J("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?ta(b,c):c},1)});w("columns.adjust()",function(){return this.iterator("table",function(a){ra(a)},1)});w("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return sa(c,b);if("fromData"===a||"toVisible"===a)return ta(c,b)}});
|
||||
w("column()",function(a,b){return vb(this.columns(a,b))});var Bc=function(a,b,c){var d=a.aoData,e=Ua(a,c),f=kc(Ca(d,e,"anCells")),g=k(lc([],f)),h,l=a.aoColumns.length,n,m,p,t,v,x;return tb("cell",b,function(r){var A="function"===typeof r;if(null===r||r===q||A){n=[];m=0;for(p=e.length;m<p;m++)for(h=e[m],t=0;t<l;t++)v={row:h,column:t},A?(x=d[h],r(v,S(a,h,t),x.anCells?x.anCells[t]:null)&&n.push(v)):n.push(v);return n}if(k.isPlainObject(r))return r.column!==q&&r.row!==q&&-1!==k.inArray(r.row,e)?[r]:[];
|
||||
A=g.filter(r).map(function(E,H){return{row:H._DT_CellIndex.row,column:H._DT_CellIndex.column}}).toArray();if(A.length||!r.nodeName)return A;x=k(r).closest("*[data-dt-row]");return x.length?[{row:x.data("dt-row"),column:x.data("dt-column")}]:[]},a,c)};w("cells()",function(a,b,c){k.isPlainObject(a)&&(a.row===q?(c=a,a=null):(c=b,b=null));k.isPlainObject(b)&&(c=b,b=null);if(null===b||b===q)return this.iterator("table",function(m){return Bc(m,a,ub(c))});var d=c?{page:c.page,order:c.order,search:c.search}:
|
||||
{},e=this.columns(b,d),f=this.rows(a,d),g,h,l,n;d=this.iterator("table",function(m,p){m=[];g=0;for(h=f[p].length;g<h;g++)for(l=0,n=e[p].length;l<n;l++)m.push({row:f[p][g],column:e[p][l]});return m},1);d=c&&c.selected?this.cells(d,c):d;k.extend(d.selector,{cols:b,rows:a,opts:c});return d});J("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&a.anCells?a.anCells[c]:q},1)});w("cells().data()",function(){return this.iterator("cell",function(a,
|
||||
b,c){return S(a,b,c)},1)});J("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});J("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return S(b,c,d,a)},1)});J("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{row:b,column:c,columnVisible:ta(a,c)}},1)});J("cells().invalidate()","cell().invalidate()",
|
||||
function(a){return this.iterator("cell",function(b,c,d){va(b,c,a,d)})});w("cell()",function(a,b,c){return vb(this.cells(a,b,c))});w("cell().data()",function(a){var b=this.context,c=this[0];if(a===q)return b.length&&c.length?S(b[0],c[0].row,c[0].column):q;Db(b[0],c[0].row,c[0].column,a);va(b[0],c[0].row,"data",c[0].column);return this});w("order()",function(a,b){var c=this.context;if(a===q)return 0!==c.length?c[0].aaSorting:q;"number"===typeof a?a=[[a,b]]:a.length&&!Array.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));
|
||||
return this.iterator("table",function(d){d.aaSorting=a.slice()})});w("order.listener()",function(a,b,c){return this.iterator("table",function(d){db(d,a,b,c)})});w("order.fixed()",function(a){if(!a){var b=this.context;b=b.length?b[0].aaSortingFixed:q;return Array.isArray(b)?{pre:b}:b}return this.iterator("table",function(c){c.aaSortingFixed=k.extend(!0,{},a)})});w(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];k.each(b[d],function(f,
|
||||
g){e.push([g,a])});c.aaSorting=e})});w("search()",function(a,b,c,d){var e=this.context;return a===q?0!==e.length?e[0].oPreviousSearch.sSearch:q:this.iterator("table",function(f){f.oFeatures.bFilter&&ya(f,k.extend({},f.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});J("columns().search()","column().search()",function(a,b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===q)return g[f].sSearch;e.oFeatures.bFilter&&
|
||||
(k.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ya(e,e.oPreviousSearch,1))})});w("state()",function(){return this.context.length?this.context[0].oSavedState:null});w("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});w("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});w("state.save()",function(){return this.iterator("table",function(a){Qa(a)})});
|
||||
u.versionCheck=u.fnVersionCheck=function(a){var b=u.version.split(".");a=a.split(".");for(var c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};u.isDataTable=u.fnIsDataTable=function(a){var b=k(a).get(0),c=!1;if(a instanceof u.Api)return!0;k.each(u.settings,function(d,e){d=e.nScrollHead?k("table",e.nScrollHead)[0]:null;var f=e.nScrollFoot?k("table",e.nScrollFoot)[0]:null;if(e.nTable===b||d===b||f===b)c=!0});return c};u.tables=u.fnTables=function(a){var b=
|
||||
!1;k.isPlainObject(a)&&(b=a.api,a=a.visible);var c=k.map(u.settings,function(d){if(!a||a&&k(d.nTable).is(":visible"))return d.nTable});return b?new D(c):c};u.camelToHungarian=O;w("$()",function(a,b){b=this.rows(b).nodes();b=k(b);return k([].concat(b.filter(a).toArray(),b.find(a).toArray()))});k.each(["on","one","off"],function(a,b){w(b+"()",function(){var c=Array.prototype.slice.call(arguments);c[0]=k.map(c[0].split(/\s/),function(e){return e.match(/\.dt\b/)?e:e+".dt"}).join(" ");var d=k(this.tables().nodes());
|
||||
d[b].apply(d,c);return this})});w("clear()",function(){return this.iterator("table",function(a){Ha(a)})});w("settings()",function(){return new D(this.context,this.context)});w("init()",function(){var a=this.context;return a.length?a[0].oInit:null});w("data()",function(){return this.iterator("table",function(a){return T(a.aoData,"_aData")}).flatten()});w("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,
|
||||
h=b.nTFoot,l=k(e);f=k(f);var n=k(b.nTableWrapper),m=k.map(b.aoData,function(t){return t.nTr}),p;b.bDestroying=!0;I(b,"aoDestroyCallback","destroy",[b]);a||(new D(b)).columns().visible(!0);n.off(".DT").find(":not(tbody *)").off(".DT");k(y).off(".DT-"+b.sInstance);e!=g.parentNode&&(l.children("thead").detach(),l.append(g));h&&e!=h.parentNode&&(l.children("tfoot").detach(),l.append(h));b.aaSorting=[];b.aaSortingFixed=[];Pa(b);k(m).removeClass(b.asStripeClasses.join(" "));k("th, td",g).removeClass(d.sSortable+
|
||||
" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);f.children().detach();f.append(m);g=a?"remove":"detach";l[g]();n[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),l.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&f.children().each(function(t){k(this).addClass(b.asDestroyStripes[t%p])}));c=k.inArray(b,u.settings);-1!==c&&u.settings.splice(c,1)})});k.each(["column","row","cell"],function(a,b){w(b+"s().every()",function(c){var d=this.selector.opts,e=
|
||||
this;return this.iterator(b,function(f,g,h,l,n){c.call(e[b](g,"cell"===b?h:d,"cell"===b?d:q),g,h,l,n)})})});w("i18n()",function(a,b,c){var d=this.context[0];a=ia(a)(d.oLanguage);a===q&&(a=b);c!==q&&k.isPlainObject(a)&&(a=a[c]!==q?a[c]:a._);return a.replace("%d",c)});u.version="1.10.23";u.settings=[];u.models={};u.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};u.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,
|
||||
idx:-1};u.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};u.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,
|
||||
25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,
|
||||
fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){return{}}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},
|
||||
fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",
|
||||
sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:k.extend({},u.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};G(u.defaults);u.defaults.column={aDataSort:null,
|
||||
iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};G(u.defaults.column);u.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,
|
||||
iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],
|
||||
aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:q,oAjaxData:q,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,
|
||||
iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==P(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==P(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,
|
||||
f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};u.ext=L={buttons:{},classes:{},build:"bs4/dt-1.10.23/r-2.2.7",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:u.fnVersionCheck,
|
||||
iApiIndex:0,oJUIClasses:{},sVersion:u.version};k.extend(L,{afnFiltering:L.search,aTypes:L.type.detect,ofnSearch:L.type.search,oSort:L.type.order,afnSortData:L.order,aoFeatures:L.feature,oApi:L.internal,oStdClasses:L.classes,oPagination:L.pager});k.extend(u.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",
|
||||
sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",
|
||||
sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var ec=u.ext.pager;k.extend(ec,{simple:function(a,b){return["previous","next"]},full:function(a,b){return["first","previous","next","last"]},numbers:function(a,b){return[Ba(a,b)]},simple_numbers:function(a,b){return["previous",Ba(a,b),"next"]},
|
||||
full_numbers:function(a,b){return["first","previous",Ba(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",Ba(a,b),"last"]},_numbers:Ba,numbers_length:7});k.extend(!0,u.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,h=a.oLanguage.oPaginate,l=a.oLanguage.oAria.paginate||{},n,m,p=0,t=function(x,r){var A,E=g.sPageButtonDisabled,H=function(B){kb(a,B.data.action,!0)};var W=0;for(A=r.length;W<A;W++){var M=r[W];if(Array.isArray(M)){var C=k("<"+(M.DT_el||"div")+"/>").appendTo(x);
|
||||
t(C,M)}else{n=null;m=M;C=a.iTabIndex;switch(M){case "ellipsis":x.append('<span class="ellipsis">…</span>');break;case "first":n=h.sFirst;0===e&&(C=-1,m+=" "+E);break;case "previous":n=h.sPrevious;0===e&&(C=-1,m+=" "+E);break;case "next":n=h.sNext;if(0===f||e===f-1)C=-1,m+=" "+E;break;case "last":n=h.sLast;if(0===f||e===f-1)C=-1,m+=" "+E;break;default:n=a.fnFormatNumber(M+1),m=e===M?g.sPageButtonActive:""}null!==n&&(C=k("<a>",{"class":g.sPageButton+" "+m,"aria-controls":a.sTableId,"aria-label":l[M],
|
||||
"data-dt-idx":p,tabindex:C,id:0===c&&"string"===typeof M?a.sTableId+"_"+M:null}).html(n).appendTo(x),ob(C,{action:M},H),p++)}}};try{var v=k(b).find(z.activeElement).data("dt-idx")}catch(x){}t(k(b).empty(),d);v!==q&&k(b).find("[data-dt-idx="+v+"]").trigger("focus")}}});k.extend(u.ext.type.detect,[function(a,b){b=b.oLanguage.sDecimal;return sb(a,b)?"num"+b:null},function(a,b){if(a&&!(a instanceof Date)&&!tc.test(a))return null;b=Date.parse(a);return null!==b&&!isNaN(b)||ca(a)?"date":null},function(a,
|
||||
b){b=b.oLanguage.sDecimal;return sb(a,b,!0)?"num-fmt"+b:null},function(a,b){b=b.oLanguage.sDecimal;return jc(a,b)?"html-num"+b:null},function(a,b){b=b.oLanguage.sDecimal;return jc(a,b,!0)?"html-num-fmt"+b:null},function(a,b){return ca(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);k.extend(u.ext.type.search,{html:function(a){return ca(a)?a:"string"===typeof a?a.replace(gc," ").replace(Ta,""):""},string:function(a){return ca(a)?a:"string"===typeof a?a.replace(gc," "):a}});var Sa=function(a,
|
||||
b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=ic(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};k.extend(L.type.order,{"date-pre":function(a){a=Date.parse(a);return isNaN(a)?-Infinity:a},"html-pre":function(a){return ca(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return ca(a)?"":"string"===typeof a?a.toLowerCase():a.toString?a.toString():""},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<
|
||||
b?1:a>b?-1:0}});Va("");k.extend(!0,u.ext.renderer,{header:{_:function(a,b,c,d){k(a.nTable).on("order.dt.DT",function(e,f,g,h){a===f&&(e=c.idx,b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass("asc"==h[e]?d.sSortAsc:"desc"==h[e]?d.sSortDesc:c.sSortingClass))})},jqueryui:function(a,b,c,d){k("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(k("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);k(a.nTable).on("order.dt.DT",function(e,f,g,h){a===f&&
|
||||
(e=c.idx,b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass("asc"==h[e]?d.sSortAsc:"desc"==h[e]?d.sSortDesc:c.sSortingClass),b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass("asc"==h[e]?d.sSortJUIAsc:"desc"==h[e]?d.sSortJUIDesc:c.sSortingClassJUI))})}}});var xb=function(a){return"string"===typeof a?a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):a};u.render=
|
||||
{number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return xb(f);h=h.toFixed(c);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:xb,filter:xb}}};k.extend(u.ext.internal,{_fnExternApiFunc:fc,_fnBuildAjax:La,_fnAjaxUpdate:Fb,_fnAjaxParameters:Ob,_fnAjaxUpdateDraw:Pb,_fnAjaxDataSrc:Ma,
|
||||
_fnAddColumn:Wa,_fnColumnOptions:Da,_fnAdjustColumnSizing:ra,_fnVisibleToColumnIndex:sa,_fnColumnIndexToVisible:ta,_fnVisbleColumns:na,_fnGetColumns:Fa,_fnColumnTypes:Ya,_fnApplyColumnDefs:Cb,_fnHungarianMap:G,_fnCamelToHungarian:O,_fnLanguageCompat:ma,_fnBrowserDetect:Ab,_fnAddData:ea,_fnAddTr:Ga,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==q?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return k.inArray(c,a.aoData[b].anCells)},_fnGetCellData:S,_fnSetCellData:Db,_fnSplitObjNotation:ab,
|
||||
_fnGetObjectDataFn:ia,_fnSetObjectDataFn:da,_fnGetDataMaster:bb,_fnClearTable:Ha,_fnDeleteIndex:Ia,_fnInvalidate:va,_fnGetRowElements:$a,_fnCreateTr:Za,_fnBuildHead:Eb,_fnDrawHead:xa,_fnDraw:fa,_fnReDraw:ja,_fnAddOptionsHtml:Hb,_fnDetectHeader:wa,_fnGetUniqueThs:Ka,_fnFeatureHtmlFilter:Jb,_fnFilterComplete:ya,_fnFilterCustom:Sb,_fnFilterColumn:Rb,_fnFilter:Qb,_fnFilterCreateSearch:gb,_fnEscapeRegex:hb,_fnFilterData:Tb,_fnFeatureHtmlInfo:Mb,_fnUpdateInfo:Wb,_fnInfoMacros:Xb,_fnInitialise:za,_fnInitComplete:Na,
|
||||
_fnLengthChange:ib,_fnFeatureHtmlLength:Ib,_fnFeatureHtmlPaginate:Nb,_fnPageChange:kb,_fnFeatureHtmlProcessing:Kb,_fnProcessingDisplay:U,_fnFeatureHtmlTable:Lb,_fnScrollDraw:Ea,_fnApplyToChildren:Z,_fnCalculateColumnWidths:Xa,_fnThrottle:fb,_fnConvertToWidth:Zb,_fnGetWidestNode:$b,_fnGetMaxLenString:ac,_fnStringToCss:K,_fnSortFlatten:pa,_fnSort:Gb,_fnSortAria:cc,_fnSortListener:nb,_fnSortAttachListener:db,_fnSortingClasses:Pa,_fnSortData:bc,_fnSaveState:Qa,_fnLoadState:dc,_fnSettingsFromNode:Ra,_fnLog:aa,
|
||||
_fnMap:V,_fnBindAction:ob,_fnCallbackReg:Q,_fnCallbackFire:I,_fnLengthOverflow:jb,_fnRenderer:eb,_fnDataSource:P,_fnRowAttributes:cb,_fnExtend:pb,_fnCalculateEnd:function(){}});k.fn.dataTable=u;u.$=k;k.fn.dataTableSettings=u.settings;k.fn.dataTableExt=u.ext;k.fn.DataTable=function(a){return k(this).dataTable(a).api()};k.each(u,function(a,b){k.fn.DataTable[a]=b});return k.fn.dataTable});
|
||||
|
||||
|
||||
/*!
|
||||
DataTables Bootstrap 4 integration
|
||||
©2011-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var f=a[d];if(b.call(c,f,d,a))return{i:d,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};
|
||||
$jscomp.polyfill=function(a,b,c,e){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,e):$jscomp.polyfillUnisolated(a,b,c,e))};$jscomp.polyfillUnisolated=function(a,b,c,e){c=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];if(!(d in c))return;c=c[d]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
|
||||
$jscomp.polyfillIsolated=function(a,b,c,e){var d=a.split(".");a=1===d.length;e=d[0];e=!a&&e in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<d.length-1;f++){var l=d[f];if(!(l in e))return;e=e[l]}d=d[d.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?e[d]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,d,{configurable:!0,writable:!0,value:b}):b!==c&&($jscomp.propertyToPolyfillSymbol[d]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(d):$jscomp.POLYFILL_PREFIX+d,d=
|
||||
$jscomp.propertyToPolyfillSymbol[d],$jscomp.defineProperty(e,d,{configurable:!0,writable:!0,value:b})))};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(b,c){return $jscomp.findInternal(this,b,c).v}},"es6","es3");
|
||||
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);c&&c.fn.dataTable||(c=require("datatables.net")(b,c).$);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a,b,c,e){var d=a.fn.dataTable;a.extend(!0,d.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
||||
renderer:"bootstrap"});a.extend(d.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"custom-select custom-select-sm form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"});d.ext.renderer.pageButton.bootstrap=function(f,l,A,B,m,t){var u=new d.Api(f),C=f.oClasses,n=f.oLanguage.oPaginate,D=f.oLanguage.oAria.paginate||{},h,k,v=0,y=function(q,w){var x,E=function(p){p.preventDefault();
|
||||
a(p.currentTarget).hasClass("disabled")||u.page()==p.data.action||u.page(p.data.action).draw("page")};var r=0;for(x=w.length;r<x;r++){var g=w[r];if(Array.isArray(g))y(q,g);else{k=h="";switch(g){case "ellipsis":h="…";k="disabled";break;case "first":h=n.sFirst;k=g+(0<m?"":" disabled");break;case "previous":h=n.sPrevious;k=g+(0<m?"":" disabled");break;case "next":h=n.sNext;k=g+(m<t-1?"":" disabled");break;case "last":h=n.sLast;k=g+(m<t-1?"":" disabled");break;default:h=g+1,k=m===g?"active":""}if(h){var F=
|
||||
a("<li>",{"class":C.sPageButton+" "+k,id:0===A&&"string"===typeof g?f.sTableId+"_"+g:null}).append(a("<a>",{href:"#","aria-controls":f.sTableId,"aria-label":D[g],"data-dt-idx":v,tabindex:f.iTabIndex,"class":"page-link"}).html(h)).appendTo(q);f.oApi._fnBindAction(F,{action:g},E);v++}}}};try{var z=a(l).find(c.activeElement).data("dt-idx")}catch(q){}y(a(l).empty().html('<ul class="pagination"/>').children("ul"),B);z!==e&&a(l).find("[data-dt-idx="+z+"]").trigger("focus")};return d});
|
||||
|
||||
|
||||
/*!
|
||||
Copyright 2014-2021 SpryMedia Ltd.
|
||||
|
||||
This source file is free software, available under the following license:
|
||||
MIT license - http://datatables.net/license/mit
|
||||
|
||||
This source file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
|
||||
For details please refer to: http://www.datatables.net
|
||||
Responsive 2.2.7
|
||||
2014-2021 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,k,m){b instanceof String&&(b=String(b));for(var n=b.length,p=0;p<n;p++){var y=b[p];if(k.call(m,y,p,b))return{i:p,v:y}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,k,m){if(b==Array.prototype||b==Object.prototype)return b;b[k]=m.value;return b};$jscomp.getGlobal=function(b){b=["object"==typeof globalThis&&globalThis,b,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var k=0;k<b.length;++k){var m=b[k];if(m&&m.Math==Math)return m}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(b,k){var m=$jscomp.propertyToPolyfillSymbol[k];if(null==m)return b[k];m=b[m];return void 0!==m?m:b[k]};
|
||||
$jscomp.polyfill=function(b,k,m,n){k&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(b,k,m,n):$jscomp.polyfillUnisolated(b,k,m,n))};$jscomp.polyfillUnisolated=function(b,k,m,n){m=$jscomp.global;b=b.split(".");for(n=0;n<b.length-1;n++){var p=b[n];if(!(p in m))return;m=m[p]}b=b[b.length-1];n=m[b];k=k(n);k!=n&&null!=k&&$jscomp.defineProperty(m,b,{configurable:!0,writable:!0,value:k})};
|
||||
$jscomp.polyfillIsolated=function(b,k,m,n){var p=b.split(".");b=1===p.length;n=p[0];n=!b&&n in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var y=0;y<p.length-1;y++){var z=p[y];if(!(z in n))return;n=n[z]}p=p[p.length-1];m=$jscomp.IS_SYMBOL_NATIVE&&"es6"===m?n[p]:null;k=k(m);null!=k&&(b?$jscomp.defineProperty($jscomp.polyfills,p,{configurable:!0,writable:!0,value:k}):k!==m&&($jscomp.propertyToPolyfillSymbol[p]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(p):$jscomp.POLYFILL_PREFIX+p,p=
|
||||
$jscomp.propertyToPolyfillSymbol[p],$jscomp.defineProperty(n,p,{configurable:!0,writable:!0,value:k})))};$jscomp.polyfill("Array.prototype.find",function(b){return b?b:function(k,m){return $jscomp.findInternal(this,k,m).v}},"es6","es3");
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(k){return b(k,window,document)}):"object"===typeof exports?module.exports=function(k,m){k||(k=window);m&&m.fn.dataTable||(m=require("datatables.net")(k,m).$);return b(m,k,k.document)}:b(jQuery,window,document)})(function(b,k,m,n){function p(a,c,d){var f=c+"-"+d;if(A[f])return A[f];var g=[];a=a.cell(c,d).node().childNodes;c=0;for(d=a.length;c<d;c++)g.push(a[c]);return A[f]=g}function y(a,c,d){var f=c+"-"+
|
||||
d;if(A[f]){a=a.cell(c,d).node();d=A[f][0].parentNode.childNodes;c=[];for(var g=0,l=d.length;g<l;g++)c.push(d[g]);d=0;for(g=c.length;d<g;d++)a.appendChild(c[d]);A[f]=n}}var z=b.fn.dataTable,u=function(a,c){if(!z.versionCheck||!z.versionCheck("1.10.10"))throw"DataTables Responsive requires DataTables 1.10.10 or newer";this.s={dt:new z.Api(a),columns:[],current:[]};this.s.dt.settings()[0].responsive||(c&&"string"===typeof c.details?c.details={type:c.details}:c&&!1===c.details?c.details={type:!1}:c&&
|
||||
!0===c.details&&(c.details={type:"inline"}),this.c=b.extend(!0,{},u.defaults,z.defaults.responsive,c),a.responsive=this,this._constructor())};b.extend(u.prototype,{_constructor:function(){var a=this,c=this.s.dt,d=c.settings()[0],f=b(k).innerWidth();c.settings()[0]._responsive=this;b(k).on("resize.dtr orientationchange.dtr",z.util.throttle(function(){var g=b(k).innerWidth();g!==f&&(a._resize(),f=g)}));d.oApi._fnCallbackReg(d,"aoRowCreatedCallback",function(g,l,h){-1!==b.inArray(!1,a.s.current)&&b(">td, >th",
|
||||
g).each(function(e){e=c.column.index("toData",e);!1===a.s.current[e]&&b(this).css("display","none")})});c.on("destroy.dtr",function(){c.off(".dtr");b(c.table().body()).off(".dtr");b(k).off("resize.dtr orientationchange.dtr");c.cells(".dtr-control").nodes().to$().removeClass("dtr-control");b.each(a.s.current,function(g,l){!1===l&&a._setColumnVis(g,!0)})});this.c.breakpoints.sort(function(g,l){return g.width<l.width?1:g.width>l.width?-1:0});this._classLogic();this._resizeAuto();d=this.c.details;!1!==
|
||||
d.type&&(a._detailsInit(),c.on("column-visibility.dtr",function(){a._timer&&clearTimeout(a._timer);a._timer=setTimeout(function(){a._timer=null;a._classLogic();a._resizeAuto();a._resize(!0);a._redrawChildren()},100)}),c.on("draw.dtr",function(){a._redrawChildren()}),b(c.table().node()).addClass("dtr-"+d.type));c.on("column-reorder.dtr",function(g,l,h){a._classLogic();a._resizeAuto();a._resize(!0)});c.on("column-sizing.dtr",function(){a._resizeAuto();a._resize()});c.on("preXhr.dtr",function(){var g=
|
||||
[];c.rows().every(function(){this.child.isShown()&&g.push(this.id(!0))});c.one("draw.dtr",function(){a._resizeAuto();a._resize();c.rows(g).every(function(){a._detailsDisplay(this,!1)})})});c.on("draw.dtr",function(){a._controlClass()}).on("init.dtr",function(g,l,h){"dt"===g.namespace&&(a._resizeAuto(),a._resize(),b.inArray(!1,a.s.current)&&c.columns.adjust())});this._resize()},_columnsVisiblity:function(a){var c=this.s.dt,d=this.s.columns,f,g=d.map(function(t,v){return{columnIdx:v,priority:t.priority}}).sort(function(t,
|
||||
v){return t.priority!==v.priority?t.priority-v.priority:t.columnIdx-v.columnIdx}),l=b.map(d,function(t,v){return!1===c.column(v).visible()?"not-visible":t.auto&&null===t.minWidth?!1:!0===t.auto?"-":-1!==b.inArray(a,t.includeIn)}),h=0;var e=0;for(f=l.length;e<f;e++)!0===l[e]&&(h+=d[e].minWidth);e=c.settings()[0].oScroll;e=e.sY||e.sX?e.iBarWidth:0;h=c.table().container().offsetWidth-e-h;e=0;for(f=l.length;e<f;e++)d[e].control&&(h-=d[e].minWidth);var r=!1;e=0;for(f=g.length;e<f;e++){var q=g[e].columnIdx;
|
||||
"-"===l[q]&&!d[q].control&&d[q].minWidth&&(r||0>h-d[q].minWidth?(r=!0,l[q]=!1):l[q]=!0,h-=d[q].minWidth)}g=!1;e=0;for(f=d.length;e<f;e++)if(!d[e].control&&!d[e].never&&!1===l[e]){g=!0;break}e=0;for(f=d.length;e<f;e++)d[e].control&&(l[e]=g),"not-visible"===l[e]&&(l[e]=!1);-1===b.inArray(!0,l)&&(l[0]=!0);return l},_classLogic:function(){var a=this,c=this.c.breakpoints,d=this.s.dt,f=d.columns().eq(0).map(function(h){var e=this.column(h),r=e.header().className;h=d.settings()[0].aoColumns[h].responsivePriority;
|
||||
e=e.header().getAttribute("data-priority");h===n&&(h=e===n||null===e?1E4:1*e);return{className:r,includeIn:[],auto:!1,control:!1,never:r.match(/\bnever\b/)?!0:!1,priority:h}}),g=function(h,e){h=f[h].includeIn;-1===b.inArray(e,h)&&h.push(e)},l=function(h,e,r,q){if(!r)f[h].includeIn.push(e);else if("max-"===r)for(q=a._find(e).width,e=0,r=c.length;e<r;e++)c[e].width<=q&&g(h,c[e].name);else if("min-"===r)for(q=a._find(e).width,e=0,r=c.length;e<r;e++)c[e].width>=q&&g(h,c[e].name);else if("not-"===r)for(e=
|
||||
0,r=c.length;e<r;e++)-1===c[e].name.indexOf(q)&&g(h,c[e].name)};f.each(function(h,e){for(var r=h.className.split(" "),q=!1,t=0,v=r.length;t<v;t++){var B=r[t].trim();if("all"===B){q=!0;h.includeIn=b.map(c,function(w){return w.name});return}if("none"===B||h.never){q=!0;return}if("control"===B||"dtr-control"===B){q=!0;h.control=!0;return}b.each(c,function(w,D){w=D.name.split("-");var x=B.match(new RegExp("(min\\-|max\\-|not\\-)?("+w[0]+")(\\-[_a-zA-Z0-9])?"));x&&(q=!0,x[2]===w[0]&&x[3]==="-"+w[1]?l(e,
|
||||
D.name,x[1],x[2]+x[3]):x[2]!==w[0]||x[3]||l(e,D.name,x[1],x[2]))})}q||(h.auto=!0)});this.s.columns=f},_controlClass:function(){if("inline"===this.c.details.type){var a=this.s.dt,c=b.inArray(!0,this.s.current);a.cells(null,function(d){return d!==c},{page:"current"}).nodes().to$().filter(".dtr-control").removeClass("dtr-control");a.cells(null,c,{page:"current"}).nodes().to$().addClass("dtr-control")}},_detailsDisplay:function(a,c){var d=this,f=this.s.dt,g=this.c.details;if(g&&!1!==g.type){var l=g.display(a,
|
||||
c,function(){return g.renderer(f,a[0],d._detailsObj(a[0]))});!0!==l&&!1!==l||b(f.table().node()).triggerHandler("responsive-display.dt",[f,a,l,c])}},_detailsInit:function(){var a=this,c=this.s.dt,d=this.c.details;"inline"===d.type&&(d.target="td.dtr-control, th.dtr-control");c.on("draw.dtr",function(){a._tabIndexes()});a._tabIndexes();b(c.table().body()).on("keyup.dtr","td, th",function(g){13===g.keyCode&&b(this).data("dtr-keyboard")&&b(this).click()});var f=d.target;d="string"===typeof f?f:"td, th";
|
||||
if(f!==n||null!==f)b(c.table().body()).on("click.dtr mousedown.dtr mouseup.dtr",d,function(g){if(b(c.table().node()).hasClass("collapsed")&&-1!==b.inArray(b(this).closest("tr").get(0),c.rows().nodes().toArray())){if("number"===typeof f){var l=0>f?c.columns().eq(0).length+f:f;if(c.cell(this).index().column!==l)return}l=c.row(b(this).closest("tr"));"click"===g.type?a._detailsDisplay(l,!1):"mousedown"===g.type?b(this).css("outline","none"):"mouseup"===g.type&&b(this).trigger("blur").css("outline","")}})},
|
||||
_detailsObj:function(a){var c=this,d=this.s.dt;return b.map(this.s.columns,function(f,g){if(!f.never&&!f.control)return f=d.settings()[0].aoColumns[g],{className:f.sClass,columnIndex:g,data:d.cell(a,g).render(c.c.orthogonal),hidden:d.column(g).visible()&&!c.s.current[g],rowIndex:a,title:null!==f.sTitle?f.sTitle:b(d.column(g).header()).text()}})},_find:function(a){for(var c=this.c.breakpoints,d=0,f=c.length;d<f;d++)if(c[d].name===a)return c[d]},_redrawChildren:function(){var a=this,c=this.s.dt;c.rows({page:"current"}).iterator("row",
|
||||
function(d,f){c.row(f);a._detailsDisplay(c.row(f),!0)})},_resize:function(a){var c=this,d=this.s.dt,f=b(k).innerWidth(),g=this.c.breakpoints,l=g[0].name,h=this.s.columns,e,r=this.s.current.slice();for(e=g.length-1;0<=e;e--)if(f<=g[e].width){l=g[e].name;break}var q=this._columnsVisiblity(l);this.s.current=q;g=!1;e=0;for(f=h.length;e<f;e++)if(!1===q[e]&&!h[e].never&&!h[e].control&&!1===!d.column(e).visible()){g=!0;break}b(d.table().node()).toggleClass("collapsed",g);var t=!1,v=0;d.columns().eq(0).each(function(B,
|
||||
w){!0===q[w]&&v++;if(a||q[w]!==r[w])t=!0,c._setColumnVis(B,q[w])});t&&(this._redrawChildren(),b(d.table().node()).trigger("responsive-resize.dt",[d,this.s.current]),0===d.page.info().recordsDisplay&&b("td",d.table().body()).eq(0).attr("colspan",v));c._controlClass()},_resizeAuto:function(){var a=this.s.dt,c=this.s.columns;if(this.c.auto&&-1!==b.inArray(!0,b.map(c,function(e){return e.auto}))){b.isEmptyObject(A)||b.each(A,function(e){e=e.split("-");y(a,1*e[0],1*e[1])});a.table().node();var d=a.table().node().cloneNode(!1),
|
||||
f=b(a.table().header().cloneNode(!1)).appendTo(d),g=b(a.table().body()).clone(!1,!1).empty().appendTo(d);d.style.width="auto";var l=a.columns().header().filter(function(e){return a.column(e).visible()}).to$().clone(!1).css("display","table-cell").css("width","auto").css("min-width",0);b(g).append(b(a.rows({page:"current"}).nodes()).clone(!1)).find("th, td").css("display","");if(g=a.table().footer()){g=b(g.cloneNode(!1)).appendTo(d);var h=a.columns().footer().filter(function(e){return a.column(e).visible()}).to$().clone(!1).css("display",
|
||||
"table-cell");b("<tr/>").append(h).appendTo(g)}b("<tr/>").append(l).appendTo(f);"inline"===this.c.details.type&&b(d).addClass("dtr-inline collapsed");b(d).find("[name]").removeAttr("name");b(d).css("position","relative");d=b("<div/>").css({width:1,height:1,overflow:"hidden",clear:"both"}).append(d);d.insertBefore(a.table().node());l.each(function(e){e=a.column.index("fromVisible",e);c[e].minWidth=this.offsetWidth||0});d.remove()}},_responsiveOnlyHidden:function(){var a=this.s.dt;return b.map(this.s.current,
|
||||
function(c,d){return!1===a.column(d).visible()?!0:c})},_setColumnVis:function(a,c){var d=this.s.dt;c=c?"":"none";b(d.column(a).header()).css("display",c);b(d.column(a).footer()).css("display",c);d.column(a).nodes().to$().css("display",c);b.isEmptyObject(A)||d.cells(null,a).indexes().each(function(f){y(d,f.row,f.column)})},_tabIndexes:function(){var a=this.s.dt,c=a.cells({page:"current"}).nodes().to$(),d=a.settings()[0],f=this.c.details.target;c.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]");
|
||||
"number"===typeof f?a.cells(null,f,{page:"current"}).nodes().to$().attr("tabIndex",d.iTabIndex).data("dtr-keyboard",1):("td:first-child, th:first-child"===f&&(f=">td:first-child, >th:first-child"),b(f,a.rows({page:"current"}).nodes()).attr("tabIndex",d.iTabIndex).data("dtr-keyboard",1))}});u.breakpoints=[{name:"desktop",width:Infinity},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}];u.display={childRow:function(a,c,d){if(c){if(b(a.node()).hasClass("parent"))return a.child(d(),
|
||||
"child").show(),!0}else{if(a.child.isShown())return a.child(!1),b(a.node()).removeClass("parent"),!1;a.child(d(),"child").show();b(a.node()).addClass("parent");return!0}},childRowImmediate:function(a,c,d){if(!c&&a.child.isShown()||!a.responsive.hasHidden())return a.child(!1),b(a.node()).removeClass("parent"),!1;a.child(d(),"child").show();b(a.node()).addClass("parent");return!0},modal:function(a){return function(c,d,f){if(d)b("div.dtr-modal-content").empty().append(f());else{var g=function(){l.remove();
|
||||
b(m).off("keypress.dtr")},l=b('<div class="dtr-modal"/>').append(b('<div class="dtr-modal-display"/>').append(b('<div class="dtr-modal-content"/>').append(f())).append(b('<div class="dtr-modal-close">×</div>').click(function(){g()}))).append(b('<div class="dtr-modal-background"/>').click(function(){g()})).appendTo("body");b(m).on("keyup.dtr",function(h){27===h.keyCode&&(h.stopPropagation(),g())})}a&&a.header&&b("div.dtr-modal-content").prepend("<h2>"+a.header(c)+"</h2>")}}};var A={};u.renderer=
|
||||
{listHiddenNodes:function(){return function(a,c,d){var f=b('<ul data-dtr-index="'+c+'" class="dtr-details"/>'),g=!1;b.each(d,function(l,h){h.hidden&&(b("<li "+(h.className?'class="'+h.className+'"':"")+' data-dtr-index="'+h.columnIndex+'" data-dt-row="'+h.rowIndex+'" data-dt-column="'+h.columnIndex+'"><span class="dtr-title">'+h.title+"</span> </li>").append(b('<span class="dtr-data"/>').append(p(a,h.rowIndex,h.columnIndex))).appendTo(f),g=!0)});return g?f:!1}},listHidden:function(){return function(a,
|
||||
c,d){return(a=b.map(d,function(f){var g=f.className?'class="'+f.className+'"':"";return f.hidden?"<li "+g+' data-dtr-index="'+f.columnIndex+'" data-dt-row="'+f.rowIndex+'" data-dt-column="'+f.columnIndex+'"><span class="dtr-title">'+f.title+'</span> <span class="dtr-data">'+f.data+"</span></li>":""}).join(""))?b('<ul data-dtr-index="'+c+'" class="dtr-details"/>').append(a):!1}},tableAll:function(a){a=b.extend({tableClass:""},a);return function(c,d,f){c=b.map(f,function(g){return"<tr "+(g.className?
|
||||
'class="'+g.className+'"':"")+' data-dt-row="'+g.rowIndex+'" data-dt-column="'+g.columnIndex+'"><td>'+g.title+":</td> <td>"+g.data+"</td></tr>"}).join("");return b('<table class="'+a.tableClass+' dtr-details" width="100%"/>').append(c)}}};u.defaults={breakpoints:u.breakpoints,auto:!0,details:{display:u.display.childRow,renderer:u.renderer.listHidden(),target:0,type:"inline"},orthogonal:"display"};var C=b.fn.dataTable.Api;C.register("responsive()",function(){return this});C.register("responsive.index()",
|
||||
function(a){a=b(a);return{column:a.data("dtr-index"),row:a.parent().data("dtr-index")}});C.register("responsive.rebuild()",function(){return this.iterator("table",function(a){a._responsive&&a._responsive._classLogic()})});C.register("responsive.recalc()",function(){return this.iterator("table",function(a){a._responsive&&(a._responsive._resizeAuto(),a._responsive._resize())})});C.register("responsive.hasHidden()",function(){var a=this.context[0];return a._responsive?-1!==b.inArray(!1,a._responsive._responsiveOnlyHidden()):
|
||||
!1});C.registerPlural("columns().responsiveHidden()","column().responsiveHidden()",function(){return this.iterator("column",function(a,c){return a._responsive?a._responsive._responsiveOnlyHidden()[c]:!1},1)});u.version="2.2.7";b.fn.dataTable.Responsive=u;b.fn.DataTable.Responsive=u;b(m).on("preInit.dt.dtr",function(a,c,d){"dt"===a.namespace&&(b(c.nTable).hasClass("responsive")||b(c.nTable).hasClass("dt-responsive")||c.oInit.responsive||z.defaults.responsive)&&(a=c.oInit.responsive,!1!==a&&new u(c,
|
||||
b.isPlainObject(a)?a:{}))});return u});
|
||||
|
||||
|
||||
/*!
|
||||
Bootstrap 4 integration for DataTables' Responsive
|
||||
©2016 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var f=a[d];if(b.call(c,f,d,a))return{i:d,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};
|
||||
$jscomp.polyfill=function(a,b,c,e){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,e):$jscomp.polyfillUnisolated(a,b,c,e))};$jscomp.polyfillUnisolated=function(a,b,c,e){c=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];if(!(d in c))return;c=c[d]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
|
||||
$jscomp.polyfillIsolated=function(a,b,c,e){var d=a.split(".");a=1===d.length;e=d[0];e=!a&&e in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<d.length-1;f++){var g=d[f];if(!(g in e))return;e=e[g]}d=d[d.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?e[d]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,d,{configurable:!0,writable:!0,value:b}):b!==c&&($jscomp.propertyToPolyfillSymbol[d]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(d):$jscomp.POLYFILL_PREFIX+d,d=
|
||||
$jscomp.propertyToPolyfillSymbol[d],$jscomp.defineProperty(e,d,{configurable:!0,writable:!0,value:b})))};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(b,c){return $jscomp.findInternal(this,b,c).v}},"es6","es3");
|
||||
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-responsive"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);c&&c.fn.dataTable||(c=require("datatables.net-bs4")(b,c).$);c.fn.dataTable.Responsive||require("datatables.net-responsive")(b,c);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a,b,c,e){b=a.fn.dataTable;c=b.Responsive.display;var d=c.modal,f=a('<div class="modal fade dtr-bs-modal" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"/></div></div></div>');
|
||||
c.modal=function(g){return function(k,h,l){if(!a.fn.modal)d(k,h,l);else if(!h){if(g&&g.header){h=f.find("div.modal-header");var m=h.find("button").detach();h.empty().append('<h4 class="modal-title">'+g.header(k)+"</h4>").append(m)}f.find("div.modal-body").empty().append(l());f.appendTo("body").modal()}}};return b.Responsive});
|
||||
|
||||
|
@ -1,166 +0,0 @@
|
||||
/*!
|
||||
DataTables 1.10.19
|
||||
©2008-2018 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,H){E||(E=window);H||(H="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(H,E,E.document)}:h(jQuery,window,document)})(function(h,E,H,k){function Z(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
|
||||
d[c]=e,"o"===b[1]&&Z(a[e])});a._hungarianMap=d}function J(a,b,c){a._hungarianMap||Z(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),J(a[d],b[d],c)):b[d]=b[e]})}function Ca(a){var b=n.defaults.oLanguage,c=b.sDecimal;c&&Da(c);if(a){var d=a.sZeroRecords;!a.sEmptyTable&&(d&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(d&&"Loading..."===b.sLoadingRecords)&&F(a,
|
||||
a,"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&c!==a&&Da(a)}}function fb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":
|
||||
"");"boolean"===typeof a.scrollX&&(a.scrollX=a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&J(n.models.oSearch,a[b])}function gb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"===typeof b&&!h.isArray(b)&&(a.aDataSort=[b])}function hb(a){if(!n.__browser){var b={};n.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:-1*h(E).scrollLeft(),height:1,width:1,
|
||||
overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,n.__browser);a.oScroll.iBarWidth=n.__browser.barWidth}
|
||||
function ib(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==e;)a.hasOwnProperty(d)&&(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ea(a,b){var c=n.defaults.column,d=a.aoColumns.length,c=h.extend({},n.models.oColumn,c,{nTh:b?b:H.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},n.models.oSearch,c[d]);ka(a,d,h(b).data())}function ka(a,b,c){var b=a.aoColumns[b],
|
||||
d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(gb(c),J(n.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),h.extend(b,c),F(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),F(b,c,"aDataSort"));var g=b.mData,j=S(g),i=b.mRender?
|
||||
S(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return N(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,
|
||||
b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function $(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Fa(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&la(a);r(a,null,"column-sizing",[a])}function aa(a,b){var c=ma(a,"bVisible");return"number"===
|
||||
typeof c[b]?c[b]:null}function ba(a,b){var c=ma(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function V(a){var b=0;h.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==h(d.nTh).css("display")&&b++});return b}function ma(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ga(a){var b=a.aoColumns,c=a.aoData,d=n.ext.type.detect,e,f,g,j,i,h,l,q,t;e=0;for(f=b.length;e<f;e++)if(l=b[e],t=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<
|
||||
j;g++){i=0;for(h=c.length;i<h;i++){t[i]===k&&(t[i]=B(a,i,e,"type"));q=d[g](t[i],a);if(!q&&g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function jb(a,b,c,d){var e,f,g,j,i,m,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){m=b[e];var q=m.targets!==k?m.targets:m.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Ea(a);d(q[f],m)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],m);else if("string"===
|
||||
typeof q[f]){j=0;for(i=l.length;j<i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&&d(j,m)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function O(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},n.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ha(a,e,c,d);return e}function na(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,
|
||||
e){c=Ia(a,e);return O(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});if(i===k)return a.iDrawError!=e&&null===j&&(K(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j&&d!==k)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function kb(a,
|
||||
b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}function Ja(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\\./g,".")})}function S(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=S(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||
|
||||
-1!==a.indexOf("("))){var c=function(a,b,f){var g,j;if(""!==f){j=Ja(f);for(var i=0,m=j.length;i<m;i++){f=j[i].match(ca);g=j[i].match(W);if(f){j[i]=j[i].replace(ca,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(".");if(h.isArray(a)){i=0;for(m=a.length;i<m;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(W,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}
|
||||
function N(a){if(h.isPlainObject(a))return N(a._);if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=Ja(e),f;f=e[e.length-1];for(var g,j,i=0,m=e.length-1;i<m;i++){g=e[i].match(ca);j=e[i].match(W);if(g){e[i]=e[i].replace(ca,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(m=d.length;j<m;j++)f={},b(f,d[j],g),
|
||||
a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(W,""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(W))a[f.replace(W,"")](d);else a[f.replace(ca,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ka(a){return D(a.aoData,"_aData")}function oa(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function pa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,
|
||||
1)}function da(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ia(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;La(a,e)}}function Ia(a,b,c,d){var e=[],f=b.firstChild,g,
|
||||
j,i=0,m,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],t=function(a,b){if("string"===typeof a){var c=a.indexOf("@");-1!==c&&(c=a.substring(c+1),N(a)(d,b.getAttribute(c)))}},G=function(a){if(c===k||c===i)j=l[i],m=h.trim(a.innerHTML),j&&j._bAttrSrc?(N(j.mData._)(d,m),t(j.mData.sort,a),t(j.mData.type,a),t(j.mData.filter,a)):q?(j._setter||(j._setter=N(j.mData)),j._setter(d,m)):d[i]=m;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)G(f),e.push(f);f=f.nextSibling}else{e=b.anCells;
|
||||
f=0;for(g=e.length;f<g;f++)G(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&N(a.rowId)(d,b);return{data:d,cells:e}}function Ha(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,m,l,q;if(null===e.nTr){j=c||H.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;La(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){m=a.aoColumns[l];i=c?d[l]:H.createElement(m.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if((!c||m.mRender||m.mData!==l)&&(!h.isPlainObject(m.mData)||m.mData._!==l+".display"))i.innerHTML=
|
||||
B(a,b,l,"display");m.sClass&&(i.className+=" "+m.sClass);m.bVisible&&!c?j.appendChild(i):!m.bVisible&&c&&i.parentNode.removeChild(i);m.fnCreatedCell&&m.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}r(a,"aoRowCreatedCallback",null,[j,f,b,g])}e.nTr.setAttribute("role","row")}function La(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?qa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));
|
||||
d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function lb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0===h("th, td",g).length,m=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Ma(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Na(a,"header")(a,d,
|
||||
f,m);i&&ea(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(m.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(m.sFooterTH);if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function fa(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,m;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=
|
||||
0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(m=i=1,j[d][f]===k){a.appendChild(g[d][f].cell);for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+m]!==k&&g[d][f].cell==g[d][f+m].cell;){for(c=0;c<i;c++)j[d+c][f+m]=1;m++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",m)}}}}function P(a){var b=r(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=
|
||||
d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);var g=a._iDisplayStart,m=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!mb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:m;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ha(a,l);var t=q.nTr;if(0!==e){var G=d[c%e];q._sRowStripe!=G&&(h(t).removeClass(q._sRowStripe).addClass(G),
|
||||
q._sRowStripe=G)}r(a,"aoRowCallback",null,[t,q._aData,c,j,l]);b.push(t);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:V(a),"class":a.oClasses.sRowEmpty}).html(c))[0];r(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ka(a),g,m,i]);r(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ka(a),g,m,i]);d=h(a.nTBody);d.children().detach();
|
||||
d.append(h(b));r(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function T(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&nb(a);d?ga(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;P(a);a._drawHold=!1}function ob(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=
|
||||
a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,m,l,q,k=0;k<f.length;k++){g=null;j=f[k];if("<"==j){i=h("<div/>")[0];m=f[k+1];if("'"==m||'"'==m){l="";for(q=2;f[k+q]!=m;)l+=f[k+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(m=l.split("."),i.id=m[0].substr(1,m[0].length-1),i.className=m[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;k+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=pb(a);else if("f"==j&&
|
||||
d.bFilter)g=qb(a);else if("r"==j&&d.bProcessing)g=rb(a);else if("t"==j)g=sb(a);else if("i"==j&&d.bInfo)g=tb(a);else if("p"==j&&d.bPaginate)g=ub(a);else if(0!==n.ext.feature.length){i=n.ext.feature;q=0;for(m=i.length;q<m;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function ea(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,m,l,q,k;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<
|
||||
i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;m=g;k=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][m+j]={cell:e,unique:k},a[f+g].nTr=d}e=e.nextSibling}}}function ra(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],ea(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||
|
||||
!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function sa(a,b,c){r(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,j=a.oInstance,i=function(b){r(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var m="function"===typeof f?f(b,a):f,b="function"===typeof f&&m?m:h.extend(!0,b,m);delete g.data}m={data:b,success:function(b){var c=
|
||||
b.error||b.sError;c&&K(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=r(a,null,"xhr",[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?K(a,0,"Invalid JSON response",1):4===b.readyState&&K(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;r(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(m,{url:g||a.sAjaxSource})):
|
||||
"function"===typeof g?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(m,g)),g.data=f)}function mb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,!0),sa(a,vb(a),function(b){wb(a,b)}),!1):!0}function vb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,m,l,k=X(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var t=function(a,b){j.push({name:a,value:b})};t("sEcho",a.iDraw);t("iColumns",c);t("sColumns",D(b,"sName").join(","));t("iDisplayStart",g);t("iDisplayLength",
|
||||
i);var G={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)m=b[g],l=f[g],i="function"==typeof m.mData?"function":m.mData,G.columns.push({data:i,name:m.sName,searchable:m.bSearchable,orderable:m.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),t("mDataProp_"+g,i),d.bFilter&&(t("sSearch_"+g,l.sSearch),t("bRegex_"+g,l.bRegex),t("bSearchable_"+g,m.bSearchable)),d.bSort&&t("bSortable_"+g,m.bSortable);d.bFilter&&(t("sSearch",e.sSearch),t("bRegex",
|
||||
e.bRegex));d.bSort&&(h.each(k,function(a,b){G.order.push({column:b.col,dir:b.dir});t("iSortCol_"+a,b.col);t("sSortDir_"+a,b.dir)}),t("iSortingCols",k.length));b=n.ext.legacy.ajax;return null===b?a.sAjaxSource?j:G:b?j:G}function wb(a,b){var c=ta(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}oa(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,
|
||||
10);d=0;for(e=c.length;d<e;d++)O(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;P(a);a._bInitComplete||ua(a,b);a.bAjaxDataGet=!0;C(a,!1)}function ta(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?S(c)(b):b}function qb(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",
|
||||
g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value?"":this.value;b!=e.sSearch&&(ga(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,P(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",g?Oa(f,g):f).on("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",
|
||||
c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==H.activeElement&&i.val(e.sSearch)}catch(d){}});return b[0]}function ga(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Ga(a);if("ssp"!=y(a)){xb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)yb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,
|
||||
e[b].bSmart,e[b].bCaseInsensitive);zb(a)}else f(b);a.bFiltered=!0;r(a,null,"search",[a])}function zb(a){for(var b=n.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,m=c.length;i<m;i++)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function yb(a,b,c,d,e,f){if(""!==b){for(var g=[],j=a.aiDisplay,d=Pa(b,d,e,f),e=0;e<j.length;e++)b=a.aoData[j[e]]._aFilterData[c],d.test(b)&&g.push(j[e]);a.aiDisplay=g}}function xb(a,b,c,d,e,f){var d=Pa(b,
|
||||
d,e,f),f=a.oPreviousSearch.sSearch,g=a.aiDisplayMaster,j,e=[];0!==n.ext.search.length&&(c=!0);j=Ab(a);if(0>=b.length)a.aiDisplay=g.slice();else{if(j||c||f.length>b.length||0!==b.indexOf(f)||a.bSorted)a.aiDisplay=g.slice();b=a.aiDisplay;for(c=0;c<b.length;c++)d.test(a.aoData[b[c]]._sFilterRow)&&e.push(b[c]);a.aiDisplay=e}}function Pa(a,b,c,d){a=b?a:Qa(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',
|
||||
"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function Ab(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l=n.ext.type.search;c=!1;d=0;for(f=a.aoData.length;d<f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(va.innerHTML=i,i=Wb?va.textContent:va.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);
|
||||
h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function Bb(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}function Cb(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function tb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Db,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",
|
||||
b+"_info"));return d[0]}function Db(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Eb(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Eb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,
|
||||
c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ha(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){ob(a);lb(a);fa(a,a.aoHeader);fa(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Fa(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=v(f.sWidth));r(a,null,"preInit",[a]);T(a);e=
|
||||
y(a);if("ssp"!=e||g)"ajax"==e?sa(a,[],function(c){var f=ta(a,c);for(b=0;b<f.length;b++)O(a,f[b]);a.iInitDisplayStart=d;T(a);C(a,!1);ua(a,c)},a):(C(a,!1),ua(a))}else setTimeout(function(){ha(a)},200)}function ua(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&$(a);r(a,null,"plugin-init",[a,b]);r(a,"aoInitComplete","init",[a,b])}function Ra(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Sa(a);r(a,null,"length",[a,c])}function pb(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=
|
||||
e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,j=f.length;g<j;g++)e[0][g]=new Option("number"===typeof d[g]?a.fnFormatNumber(d[g]):d[g],f[g]);var i=h("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).on("change.DT",function(){Ra(a,h(this).val());P(a)});h(a.nTable).on("length.dt.DT",function(b,c,d){a===
|
||||
c&&h("select",i).val(d)});return i[0]}function ub(a){var b=a.sPaginationType,c=n.ext.pager[b],d="function"===typeof c,e=function(a){P(a)},b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Na(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,
|
||||
e)},sName:"pagination"}));return b}function Ta(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:K(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(r(a,null,"page",[a]),c&&P(a));return b}function rb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}
|
||||
function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");r(a,null,"processing",[a,b])}function sb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),m=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",
|
||||
position:"relative",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:v(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",
|
||||
{"class":f.sScrollFootInner}).append(m.removeAttr("id").css("margin-left",0).append("bottom"===j?g:null).append(b.children("tfoot")))));var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:la,sName:"scrolling"});return i[0]}function la(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,
|
||||
f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,m=j.children("table"),j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),n=t.children("table"),o=h(a.nTHead),p=h(a.nTable),s=p[0],r=s.style,u=a.nTFoot?h(a.nTFoot):null,x=a.oBrowser,U=x.bScrollOversize,Xb=D(a.aoColumns,"nTh"),Q,L,R,w,Ua=[],y=[],z=[],A=[],B,C=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};L=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==
|
||||
L&&a.scrollBarVis!==k)a.scrollBarVis=L,$(a);else{a.scrollBarVis=L;p.children("thead, tfoot").remove();u&&(R=u.clone().prependTo(p),Q=u.find("tr"),R=R.find("tr"));w=o.clone().prependTo(p);o=o.find("tr");L=w.find("tr");w.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(ra(a,w),function(b,c){B=aa(a,b);c.style.width=a.aoColumns[B].sWidth});u&&I(function(a){a.style.width=""},R);f=p.outerWidth();if(""===c){r.width="100%";if(U&&(p.find("tbody").height()>j.offsetHeight||
|
||||
"scroll"==l.css("overflow-y")))r.width=v(p.outerWidth()-b);f=p.outerWidth()}else""!==d&&(r.width=v(d),f=p.outerWidth());I(C,L);I(function(a){z.push(a.innerHTML);Ua.push(v(h(a).css("width")))},L);I(function(a,b){if(h.inArray(a,Xb)!==-1)a.style.width=Ua[b]},o);h(L).height(0);u&&(I(C,R),I(function(a){A.push(a.innerHTML);y.push(v(h(a).css("width")))},R),I(function(a,b){a.style.width=y[b]},Q),h(R).height(0));I(function(a,b){a.innerHTML='<div class="dataTables_sizing">'+z[b]+"</div>";a.childNodes[0].style.height=
|
||||
"0";a.childNodes[0].style.overflow="hidden";a.style.width=Ua[b]},L);u&&I(function(a,b){a.innerHTML='<div class="dataTables_sizing">'+A[b]+"</div>";a.childNodes[0].style.height="0";a.childNodes[0].style.overflow="hidden";a.style.width=y[b]},R);if(p.outerWidth()<f){Q=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(U&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=v(Q-b);(""===c||""!==d)&&K(a,1,"Possible column misalignment",6)}else Q="100%";q.width=v(Q);
|
||||
g.width=v(Q);u&&(a.nScrollFoot.style.width=v(Q));!e&&U&&(q.height=v(s.offsetHeight+b));c=p.outerWidth();m[0].style.width=v(c);i.width=v(c);d=p.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(x.bScrollbarLeft?"Left":"Right");i[e]=d?b+"px":"0px";u&&(n[0].style.width=v(c),t[0].style.width=v(c),t[0].style[e]=d?b+"px":"0px");p.children("colgroup").insertBefore(p.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function I(a,b,c){for(var d=0,e=0,
|
||||
f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Fa(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,j=c.length,i=ma(a,"bVisible"),m=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,t=!1,n,o,p=a.oBrowser,d=p.bScrollOversize;(n=b.style.width)&&-1!==n.indexOf("%")&&(l=n);for(n=0;n<i.length;n++)o=c[i[n]],null!==o.sWidth&&(o.sWidth=Fb(o.sWidthOrig,k),t=!0);if(d||
|
||||
!t&&!f&&!e&&j==V(a)&&j==m.length)for(n=0;n<j;n++)i=aa(a,n),null!==i&&(c[i].sWidth=v(m.eq(n).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var s=h("<tr/>").appendTo(j.find("tbody"));j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");m=ra(a,j.find("thead")[0]);for(n=0;n<i.length;n++)o=c[i[n]],m[n].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?v(o.sWidthOrig):
|
||||
"",o.sWidthOrig&&f&&h(m[n]).append(h("<div/>").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(n=0;n<i.length;n++)t=i[n],o=c[t],h(Gb(a,t)).clone(!1).append(o.sContentPadding).appendTo(s);h("[name]",j).removeAttr("name");o=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):
|
||||
l&&j.width(l);for(n=e=0;n<i.length;n++)k=h(m[n]),g=k.outerWidth()-k.width(),k=p.bBounding?Math.ceil(m[n].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[n]].sWidth=v(k-g);b.style.width=v(e);o.remove()}l&&(b.style.width=v(l));if((l||f)&&!a._reszEvt)b=function(){h(E).on("resize.DT-"+a.sInstance,Oa(function(){$(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function Fb(a,b){if(!a)return 0;var c=h("<div/>").css("width",v(a)).appendTo(b||H.body),d=c[0].offsetWidth;c.remove();return d}function Gb(a,
|
||||
b){var c=Hb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Hb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace(Yb,""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function v(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function X(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var m=[];f=function(a){a.length&&
|
||||
!h.isArray(a[0])?m.push(a):h.merge(m,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<m.length;a++){i=m[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||"string",m[a]._idx===k&&(m[a]._idx=h.inArray(m[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:m[a][1],index:m[a]._idx,type:j,formatter:n.ext.type.order[j+"-pre"]})}return d}function nb(a){var b,c,d=[],e=n.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Ga(a);h=X(a);b=0;for(c=h.length;b<
|
||||
c;b++)j=h[b],j.formatter&&g++,Ib(a,j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,n=f[b]._aSortData;for(g=0;g<i;g++)if(j=h[g],c=k[j.col],e=n[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,n=f[a]._aSortData,o=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=n[i.col],g=o[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],
|
||||
c=i(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,d=a.aoColumns,e=X(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Va(a,
|
||||
b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,D(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);T(a);"function"==
|
||||
typeof d&&d(a)}function Ma(a,b,c,d){var e=a.aoColumns[c];Wa(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Va(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Va(a,c,b.shiftKey,d))})}function wa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=X(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(D(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(D(a.aoData,"anCells",g)).addClass(c+
|
||||
(2>e?e+1:3))}a.aLastSort=d}function Ib(a,b){var c=a.aoColumns[b],d=n.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ba(a,b)));for(var f,g=n.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function xa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:Bb(a.oPreviousSearch),
|
||||
columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Bb(a.aoPreSearchCols[d])}})};r(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function Kb(a,b,c){var d,e,f=a.aoColumns,b=function(b){if(b&&b.time){var g=r(a,"aoStateLoadParams","stateLoadParams",[a,b]);if(-1===h.inArray(!1,g)&&(g=a.iStateDuration,!(0<g&&b.time<+new Date-1E3*g)&&!(b.columns&&f.length!==b.columns.length))){a.oLoadedState=h.extend(!0,{},b);b.start!==k&&
|
||||
(a._iDisplayStart=b.start,a.iInitDisplayStart=b.start);b.length!==k&&(a._iDisplayLength=b.length);b.order!==k&&(a.aaSorting=[],h.each(b.order,function(b,c){a.aaSorting.push(c[0]>=f.length?[0,c[1]]:c)}));b.search!==k&&h.extend(a.oPreviousSearch,Cb(b.search));if(b.columns){d=0;for(e=b.columns.length;d<e;d++)g=b.columns[d],g.visible!==k&&(f[d].bVisible=g.visible),g.search!==k&&h.extend(a.aoPreSearchCols[d],Cb(g.search))}r(a,"aoStateLoaded","stateLoaded",[a,b])}}c()};if(a.oFeatures.bStateSave){var g=
|
||||
a.fnStateLoadCallback.call(a.oInstance,a,b);g!==k&&b(g)}else c()}function ya(a){var b=n.settings,a=h.inArray(a,D(b,"nTable"));return-1!==a?b[a]:null}function K(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)E.console&&console.log&&console.log(c);else if(b=n.ext,b=b.sErrMode||b.errMode,a&&r(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==
|
||||
typeof b&&b(a,d,c)}}function F(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?F(a,b,d[0],d[1]):F(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Xa(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&h.isArray(d)?d.slice():d);return a}function Wa(a,b,c){h(a).on("click.DT",b,function(b){h(a).blur();c(b)}).on("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).on("selectstart.DT",
|
||||
function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function r(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Sa(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Na(a,b){var c=a.renderer,d=n.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===
|
||||
typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ia(a,b){var c=[],c=Lb.numbers_length,d=Math.floor(c/2);b<=c?c=Y(0,b):a<=d?(c=Y(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=Y(b-(c-2),b):(c=Y(a-d+2,a+d-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function Da(a){h.each({num:function(b){return za(b,a)},"num-fmt":function(b){return za(b,a,Ya)},"html-num":function(b){return za(b,
|
||||
a,Aa)},"html-num-fmt":function(b){return za(b,a,Aa,Ya)}},function(b,c){x.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(x.type.search[b+a]=x.type.search.html)})}function Mb(a){return function(){var b=[ya(this[n.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return n.ext.internal[a].apply(this,b)}}var n=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new s(ya(this[x.iApiIndex])):new s(this)};
|
||||
this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&la(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,
|
||||
b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():
|
||||
c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};
|
||||
this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return ya(this[x.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();
|
||||
(d===k||d)&&h.draw();return 0};this.fnVersionCheck=x.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=x.internal;for(var e in n.ext.internal)e&&(this[e]=Mb(e));this.each(function(){var e={},g=1<d?Xa(e,a,!0):a,j=0,i,e=this.getAttribute("id"),m=!1,l=n.defaults,q=h(this);if("table"!=this.nodeName.toLowerCase())K(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{fb(l);gb(l.column);J(l,l,!0);J(l.column,l.column,!0);J(l,h.extend(g,q.data()));var t=n.settings,
|
||||
j=0;for(i=t.length;j<i;j++){var o=t[j];if(o.nTable==this||o.nTHead&&o.nTHead.parentNode==this||o.nTFoot&&o.nTFoot.parentNode==this){var s=g.bRetrieve!==k?g.bRetrieve:l.bRetrieve;if(c||s)return o.oInstance;if(g.bDestroy!==k?g.bDestroy:l.bDestroy){o.oInstance.fnDestroy();break}else{K(o,0,"Cannot reinitialise DataTable",3);return}}if(o.sTableId==this.id){t.splice(j,1);break}}if(null===e||""===e)this.id=e="DataTables_Table_"+n.ext._unique++;var p=h.extend(!0,{},n.models.oSettings,{sDestroyWidth:q[0].style.width,
|
||||
sInstance:e,sTableId:e});p.nTable=this;p.oApi=b.internal;p.oInit=g;t.push(p);p.oInstance=1===b.length?b:q.dataTable();fb(g);Ca(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=h.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=Xa(h.extend(!0,{},l),g);F(p.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));F(p,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod",
|
||||
"aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]);F(p.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);F(p.oLanguage,g,"fnInfoCallback");
|
||||
z(p,"aoDrawCallback",g.fnDrawCallback,"user");z(p,"aoServerParams",g.fnServerParams,"user");z(p,"aoStateSaveParams",g.fnStateSaveParams,"user");z(p,"aoStateLoadParams",g.fnStateLoadParams,"user");z(p,"aoStateLoaded",g.fnStateLoaded,"user");z(p,"aoRowCallback",g.fnRowCallback,"user");z(p,"aoRowCreatedCallback",g.fnCreatedRow,"user");z(p,"aoHeaderCallback",g.fnHeaderCallback,"user");z(p,"aoFooterCallback",g.fnFooterCallback,"user");z(p,"aoInitComplete",g.fnInitComplete,"user");z(p,"aoPreDrawCallback",
|
||||
g.fnPreDrawCallback,"user");p.rowIdFn=S(g.rowId);hb(p);var u=p.oClasses;h.extend(u,n.ext.classes,g.oClasses);q.addClass(u.sTable);p.iInitDisplayStart===k&&(p.iInitDisplayStart=g.iDisplayStart,p._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(p.bDeferLoading=!0,e=h.isArray(g.iDeferLoading),p._iRecordsDisplay=e?g.iDeferLoading[0]:g.iDeferLoading,p._iRecordsTotal=e?g.iDeferLoading[1]:g.iDeferLoading);var v=p.oLanguage;h.extend(!0,v,g.oLanguage);v.sUrl&&(h.ajax({dataType:"json",url:v.sUrl,success:function(a){Ca(a);
|
||||
J(l.oLanguage,a);h.extend(true,v,a);ha(p)},error:function(){ha(p)}}),m=!0);null===g.asStripeClasses&&(p.asStripeClasses=[u.sStripeOdd,u.sStripeEven]);var e=p.asStripeClasses,x=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(e,function(a){return x.hasClass(a)}))&&(h("tbody tr",this).removeClass(e.join(" ")),p.asDestroyStripes=e.slice());e=[];t=this.getElementsByTagName("thead");0!==t.length&&(ea(p.aoHeader,t[0]),e=ra(p));if(null===g.aoColumns){t=[];j=0;for(i=e.length;j<i;j++)t.push(null)}else t=
|
||||
g.aoColumns;j=0;for(i=t.length;j<i;j++)Ea(p,e?e[j]:null);jb(p,g.aoColumnDefs,t,function(a,b){ka(p,a,b)});if(x.length){var w=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(x[0]).children("th, td").each(function(a,b){var c=p.aoColumns[a];if(c.mData===a){var d=w(b,"sort")||w(b,"order"),e=w(b,"filter")||w(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};ka(p,a)}}})}var U=p.oFeatures,
|
||||
e=function(){if(g.aaSorting===k){var a=p.aaSorting;j=0;for(i=a.length;j<i;j++)a[j][1]=p.aoColumns[j].asSorting[0]}wa(p);U.bSort&&z(p,"aoDrawCallback",function(){if(p.bSorted){var a=X(p),b={};h.each(a,function(a,c){b[c.src]=c.dir});r(p,null,"order",[p,a,b]);Jb(p)}});z(p,"aoDrawCallback",function(){(p.bSorted||y(p)==="ssp"||U.bDeferRender)&&wa(p)},"sc");var a=q.children("caption").each(function(){this._captionSide=h(this).css("caption-side")}),b=q.children("thead");b.length===0&&(b=h("<thead/>").appendTo(q));
|
||||
p.nTHead=b[0];b=q.children("tbody");b.length===0&&(b=h("<tbody/>").appendTo(q));p.nTBody=b[0];b=q.children("tfoot");if(b.length===0&&a.length>0&&(p.oScroll.sX!==""||p.oScroll.sY!==""))b=h("<tfoot/>").appendTo(q);if(b.length===0||b.children().length===0)q.addClass(u.sNoFooter);else if(b.length>0){p.nTFoot=b[0];ea(p.aoFooter,p.nTFoot)}if(g.aaData)for(j=0;j<g.aaData.length;j++)O(p,g.aaData[j]);else(p.bDeferLoading||y(p)=="dom")&&na(p,h(p.nTBody).children("tr"));p.aiDisplay=p.aiDisplayMaster.slice();
|
||||
p.bInitialised=true;m===false&&ha(p)};g.bStateSave?(U.bStateSave=!0,z(p,"aoDrawCallback",xa,"state_save"),Kb(p,g,e)):e()}});b=null;return this},x,s,o,u,Za={},Nb=/[\r\n]/g,Aa=/<.*?>/g,Zb=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,$b=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Ya=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,M=function(a){return!a||!0===a||"-"===a?!0:!1},Ob=function(a){var b=parseInt(a,10);return!isNaN(b)&&
|
||||
isFinite(a)?b:null},Pb=function(a,b){Za[b]||(Za[b]=RegExp(Qa(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(Za[b],"."):a},$a=function(a,b,c){var d="string"===typeof a;if(M(a))return!0;b&&d&&(a=Pb(a,b));c&&d&&(a=a.replace(Ya,""));return!isNaN(parseFloat(a))&&isFinite(a)},Qb=function(a,b,c){return M(a)?!0:!(M(a)||"string"===typeof a)?null:$a(a.replace(Aa,""),b,c)?!0:null},D=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<
|
||||
f;e++)a[e]&&d.push(a[e][b]);return d},ja=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},Y=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Rb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},qa=function(a){var b;a:{if(!(2>a.length)){b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d<e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();
|
||||
b=[];var e=a.length,f,g=0,d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b};n.util={throttle:function(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,j=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=k;a.apply(b,j)},c)):(d=g,a.apply(b,j))}},escapeRegex:function(a){return a.replace($b,"\\$1")}};var A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ca=/\[.*?\]$/,W=/\(\)$/,Qa=n.util.escapeRegex,va=h("<div>")[0],Wb=va.textContent!==k,Yb=
|
||||
/<.*?>/g,Oa=n.util.throttle,Sb=[],w=Array.prototype,ac=function(a){var b,c,d=n.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};s=function(a,b){if(!(this instanceof
|
||||
s))return new s(a,b);var c=[],d=function(a){(a=ac(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=qa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};s.extend(this,this,Sb)};n.Api=s;h.extend(s.prototype,{any:function(){return 0!==this.count()},concat:w.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=
|
||||
this.context;return b.length>a?new s(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new s(this.context,b)},flatten:function(){var a=[];return new s(this.context,a.concat.apply(a,this.toArray()))},join:w.join,indexOf:w.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,j,h,m,l=this.context,
|
||||
n,o,u=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(j=l.length;g<j;g++){var r=new s(l[g]);if("table"===b)f=c.call(r,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(r,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){o=this[g];"column-rows"===b&&(n=Ba(l[g],u.opts));h=0;for(m=o.length;h<m;h++)f=o[h],f="cell"===b?c.call(r,l[g],f.row,f.column,g,h):c.call(r,l[g],f,g,h,n),f!==k&&e.push(f)}}return e.length||d?(a=new s(l,a?
|
||||
e.concat.apply([],e):e),b=a.selector,b.rows=u.rows,b.cols=u.cols,b.opts=u.opts,a):this},lastIndexOf:w.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(w.map)b=w.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new s(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:w.pop,push:w.push,reduce:w.reduce||function(a,b){return ib(this,a,b,0,this.length,
|
||||
1)},reduceRight:w.reduceRight||function(a,b){return ib(this,a,b,this.length-1,-1,-1)},reverse:w.reverse,selector:null,shift:w.shift,slice:function(){return new s(this.context,this)},sort:w.sort,splice:w.splice,toArray:function(){return w.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},unique:function(){return new s(this.context,qa(this))},unshift:w.unshift});s.extend=function(a,b,c){if(c.length&&b&&(b instanceof s||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=
|
||||
b.apply(a,arguments);s.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,s.extend(a,b[f.name],f.propExt)}};s.register=o=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<d;c++)s.register(a[c],b);else for(var e=a.split("."),f=Sb,g,j,c=0,d=e.length;c<d;c++){g=(j=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var m=f.length;i<m;i++)if(f[i].name===g){i=
|
||||
f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};s.registerPlural=u=function(a,b,c){s.register(a,c);s.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof s?a.length?h.isArray(a[0])?new s(a.context,a[0]):a[0]:k:a})};o("tables()",function(a){var b;if(a){b=s;var c=this.context;if("number"===typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,
|
||||
d);return c[a]}).toArray();b=new b(a)}else b=this;return b});o("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new s(b[0]):a});u("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});u("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});u("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});u("tables().footer()",
|
||||
"table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});u("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});o("draw()",function(a){return this.iterator("table",function(b){"page"===a?P(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),T(b,!1===a))})});o("page()",function(a){return a===k?this.page.info().page:this.iterator("table",function(b){Ta(b,a)})});o("page.info()",function(){if(0===
|
||||
this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===y(a)}});o("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:k:this.iterator("table",function(b){Ra(b,a)})});var Tb=function(a,b,c){if(c){var d=new s(a);
|
||||
d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))T(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();sa(a,[],function(c){oa(a);for(var c=ta(a,c),d=0,e=c.length;d<e;d++)O(a,c[d]);T(a,b);C(a,!1)})}};o("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});o("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});o("ajax.reload()",function(a,b){return this.iterator("table",function(c){Tb(c,!1===b,a)})});o("ajax.url()",function(a){var b=
|
||||
this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});o("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Tb(c,!1===b,a)})});var ab=function(a,b,c,d,e){var f=[],g,j,i,m,l,n;i=typeof b;if(!b||"string"===i||"function"===i||b.length===k)b=[b];i=0;for(m=b.length;i<m;i++){j=b[i]&&b[i].split&&!b[i].match(/[\[\(:]/)?b[i].split(","):
|
||||
[b[i]];l=0;for(n=j.length;l<n;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=x.selector[a];if(a.length){i=0;for(m=a.length;i<m;i++)f=a[i](d,e,f)}return qa(f)},bb=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",page:"all"},a)},cb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ba=function(a,b){var c,
|
||||
d,e,f=[],g=a.aiDisplay;e=a.aiDisplayMaster;var j=b.search;c=b.order;d=b.page;if("ssp"==y(a))return"removed"===j?[]:Y(0,e.length);if("current"==d){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==c||"applied"==c)if("none"==j)f=e.slice();else if("applied"==j)f=g.slice();else{if("removed"==j){var i={};c=0;for(d=g.length;c<d;c++)i[g[c]]=null;f=h.map(e,function(a){return!i.hasOwnProperty(a)?a:null})}}else if("index"==c||"original"==c){c=0;for(d=a.aoData.length;c<d;c++)"none"==
|
||||
j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};o("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=bb(b),c=this.iterator("table",function(c){var e=b,f;return ab("row",a,function(a){var b=Ob(a),i=c.aoData;if(b!==null&&!e)return[b];f||(f=Ba(c,e));if(b!==null&&h.inArray(b,f)!==-1)return[b];if(a===null||a===k||a==="")return f;if(typeof a==="function")return h.map(f,function(b){var c=i[b];return a(b,c._aData,c.nTr)?b:null});if(a.nodeName){var b=
|
||||
a._DT_RowIndex,m=a._DT_CellIndex;if(b!==k)return i[b]&&i[b].nTr===a?[b]:[];if(m)return i[m.row]&&i[m.row].nTr===a?[m.row]:[];b=h(a).closest("*[data-dt-row]");return b.length?[b.data("dt-row")]:[]}if(typeof a==="string"&&a.charAt(0)==="#"){b=c.aIds[a.replace(/^#/,"")];if(b!==k)return[b.idx]}b=Rb(ja(c.aoData,f,"nTr"));return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});o("rows().nodes()",function(){return this.iterator("row",
|
||||
function(a,b){return a.aoData[b].nTr||k},1)});o("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return ja(a.aoData,b,"_aData")},1)});u("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});u("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){da(b,c,a)})});u("rows().indexes()","row().index()",function(){return this.iterator("row",
|
||||
function(a,b){return b},1)});u("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new s(c,b)});u("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,m,l;e.splice(c,1);g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(m=
|
||||
l.length;i<m;i++)l[i]._DT_CellIndex.row=g}pa(b.aiDisplayMaster,c);pa(b.aiDisplay,c);pa(a[d],c,!1);0<b._iRecordsDisplay&&b._iRecordsDisplay--;Sa(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});o("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(na(b,c)[0]):h.push(O(b,c));return h},
|
||||
1),c=this.rows(-1);c.pop();h.merge(c,b);return c});o("row()",function(a,b){return cb(this.rows(a,b))});o("row().data()",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;var c=b[0].aoData[this[0]];c._aData=a;h.isArray(a)&&c.nTr.id&&N(b[0].rowId)(a,c.nTr.id);da(b[0],this[0],"data");return this});o("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});o("row.add()",function(a){a instanceof h&&
|
||||
a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?na(b,a)[0]:O(b,a)});return this.row(b[0])});var db=function(a,b){var c=a.context;if(c.length&&(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Ub=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new s(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");
|
||||
0<D(g,"_details").length&&(f.on("draw.dt.DT_details",function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=V(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&db(f,c)}))}}};o("row().child()",function(a,b){var c=
|
||||
this.context;if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)db(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=V(d),e.push(c[0]))};f(a,b);c._details&&c._details.detach();c._details=h(e);
|
||||
c._detailsShow&&c._details.insertAfter(c.nTr)}return this});o(["row().child.show()","row().child().show()"],function(){Ub(this,!0);return this});o(["row().child.hide()","row().child().hide()"],function(){Ub(this,!1);return this});o(["row().child.remove()","row().child().remove()"],function(){db(this);return this});o("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var bc=/^([^:]+):(name|visIdx|visible)$/,Vb=function(a,b,
|
||||
c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));return c};o("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=bb(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=D(g,"sName"),i=D(g,"nTh");return ab("column",e,function(a){var b=Ob(a);if(a==="")return Y(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Ba(c,f);return h.map(g,function(b,f){return a(f,Vb(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(bc):
|
||||
"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],10);if(b<0){var n=h.map(g,function(a,b){return a.bVisible?b:null});return[n[n.length+b]]}return[aa(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},
|
||||
1);c.selector.cols=a;c.selector.opts=b;return c});u("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});u("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});u("columns().data()","column().data()",function(){return this.iterator("column-rows",Vb,1)});u("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},
|
||||
1)});u("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ja(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});u("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ja(a.aoData,e,"anCells",b)},1)});u("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===k)return b.aoColumns[c].bVisible;var f=b.aoColumns,g=f[c],j=b.aoData,
|
||||
i,m,l;if(a!==k&&g.bVisible!==a){if(a){var n=h.inArray(!0,D(f,"bVisible"),c+1);i=0;for(m=j.length;i<m;i++)l=j[i].nTr,f=j[i].anCells,l&&l.insertBefore(f[c],f[n]||null)}else h(D(b.aoData,"anCells",c)).detach();g.bVisible=a;fa(b,b.aoHeader);fa(b,b.aoFooter);b.aiDisplay.length||h(b.nTBody).find("td[colspan]").attr("colspan",V(b));xa(b)}});a!==k&&(this.iterator("column",function(c,e){r(c,null,"column-visibility",[c,e,a,b])}),(b===k||b)&&this.columns.adjust());return c});u("columns().indexes()","column().index()",
|
||||
function(a){return this.iterator("column",function(b,c){return"visible"===a?ba(b,c):c},1)});o("columns.adjust()",function(){return this.iterator("table",function(a){$(a)},1)});o("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return aa(c,b);if("fromData"===a||"toVisible"===a)return ba(c,b)}});o("column()",function(a,b){return cb(this.columns(a,b))});o("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));
|
||||
h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",function(b){var d=a,e=bb(c),f=b.aoData,g=Ba(b,e),j=Rb(ja(f,g,"anCells")),i=h([].concat.apply([],j)),l,m=b.aoColumns.length,n,o,u,s,r,v;return ab("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){n=[];o=0;for(u=g.length;o<u;o++){l=g[o];for(s=0;s<m;s++){r={row:l,column:s};if(c){v=f[l];a(r,B(b,l,s),v.anCells?v.anCells[s]:null)&&n.push(r)}else n.push(r)}}return n}if(h.isPlainObject(a))return a.column!==
|
||||
k&&a.row!==k&&h.inArray(a.row,g)!==-1?[a]:[];c=i.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();if(c.length||!a.nodeName)return c;v=h(a).closest("*[data-dt-row]");return v.length?[{row:v.data("dt-row"),column:v.data("dt-column")}]:[]},b,e)});var d=this.columns(b),e=this.rows(a),f,g,j,i,m;this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(m=d[b].length;i<m;i++)f.push({row:e[b][g],column:d[b][i]})}},1);var l=this.cells(f,
|
||||
c);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});u("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&a.anCells?a.anCells[c]:k},1)});o("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});u("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});u("cells().render()","cell().render()",
|
||||
function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});u("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{row:b,column:c,columnVisible:ba(a,c)}},1)});u("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){da(b,c,a,d)})});o("cell()",function(a,b,c){return cb(this.cells(a,b,c))});o("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],
|
||||
c[0].row,c[0].column):k;kb(b[0],c[0].row,c[0].column,a);da(b[0],c[0].row,"data",c[0].column);return this});o("order()",function(a,b){var c=this.context;if(a===k)return 0!==c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:a.length&&!h.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});o("order.listener()",function(a,b,c){return this.iterator("table",function(d){Ma(d,a,b,c)})});o("order.fixed()",function(a){if(!a){var b=
|
||||
this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});o(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});o("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&ga(e,
|
||||
h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});u("columns().search()","column().search()",function(a,b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ga(e,e.oPreviousSearch,1))})});o("state()",function(){return this.context.length?this.context[0].oSavedState:
|
||||
null});o("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});o("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});o("state.save()",function(){return this.iterator("table",function(a){xa(a)})});n.versionCheck=n.fnVersionCheck=function(a){for(var b=n.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};n.isDataTable=
|
||||
n.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;if(a instanceof n.Api)return!0;h.each(n.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?h("table",e.nScrollFoot)[0]:null;if(e.nTable===b||f===b||g===b)c=!0});return c};n.tables=n.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(n.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new s(c):c};n.camelToHungarian=J;o("$()",function(a,b){var c=
|
||||
this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){o(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0]=h.map(a[0].split(/\s/),function(a){return!a.match(/\.dt\b/)?a+".dt":a}).join(" ");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});o("clear()",function(){return this.iterator("table",function(a){oa(a)})});o("settings()",function(){return new s(this.context,this.context)});o("init()",function(){var a=
|
||||
this.context;return a.length?a[0].oInit:null});o("data()",function(){return this.iterator("table",function(a){return D(a.aoData,"_aData")}).flatten()});o("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),o;b.bDestroying=!0;r(b,"aoDestroyCallback","destroy",[b]);a||(new s(b)).columns().visible(!0);k.off(".DT").find(":not(tbody *)").off(".DT");
|
||||
h(E).off(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));b.aaSorting=[];b.aaSortingFixed=[];wa(b);h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),
|
||||
(o=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%o])}));c=h.inArray(b,n.settings);-1!==c&&n.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){o(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,m){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,m)})})});o("i18n()",function(a,b,c){var d=this.context[0],a=S(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:
|
||||
a._);return a.replace("%d",c)});n.version="1.10.19";n.settings=[];n.models={};n.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};n.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};n.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,
|
||||
sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};n.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,
|
||||
bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+
|
||||
a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},
|
||||
oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},
|
||||
n.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};Z(n.defaults);n.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};
|
||||
Z(n.defaults.column);n.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],
|
||||
aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",
|
||||
iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:
|
||||
this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};n.ext=x={buttons:{},
|
||||
classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:n.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:n.version};h.extend(x,{afnFiltering:x.search,aTypes:x.type.detect,ofnSearch:x.type.search,oSort:x.type.order,afnSortData:x.order,aoFeatures:x.feature,oApi:x.internal,oStdClasses:x.classes,oPagination:x.pager});
|
||||
h.extend(n.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",
|
||||
sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
|
||||
sJUIHeader:"",sJUIFooter:""});var Lb=n.ext.pager;h.extend(Lb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ia(a,b)]},simple_numbers:function(a,b){return["previous",ia(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ia(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",ia(a,b),"last"]},_numbers:ia,numbers_length:7});h.extend(!0,n.ext.renderer,{pageButton:{_:function(a,b,c,d,e,
|
||||
f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},m,l,n=0,o=function(b,d){var k,s,u,r,v=function(b){Ta(a,b.data.action,true)};k=0;for(s=d.length;k<s;k++){r=d[k];if(h.isArray(r)){u=h("<"+(r.DT_el||"div")+"/>").appendTo(b);o(u,r)}else{m=null;l="";switch(r){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":m=j.sFirst;l=r+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":m=j.sPrevious;l=r+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":m=
|
||||
j.sNext;l=r+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":m=j.sLast;l=r+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:m=r+1;l=e===r?g.sPageButtonActive:""}if(m!==null){u=h("<a>",{"class":g.sPageButton+" "+l,"aria-controls":a.sTableId,"aria-label":i[r],"data-dt-idx":n,tabindex:a.iTabIndex,id:c===0&&typeof r==="string"?a.sTableId+"_"+r:null}).html(m).appendTo(b);Wa(u,{action:r},v);n++}}}},s;try{s=h(b).find(H.activeElement).data("dt-idx")}catch(u){}o(h(b).empty(),d);s!==k&&h(b).find("[data-dt-idx="+
|
||||
s+"]").focus()}}});h.extend(n.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return $a(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&!Zb.test(a))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||M(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return $a(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Qb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Qb(a,c,!0)?"html-num-fmt"+c:null},function(a){return M(a)||
|
||||
"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(n.ext.type.search,{html:function(a){return M(a)?a:"string"===typeof a?a.replace(Nb," ").replace(Aa,""):""},string:function(a){return M(a)?a:"string"===typeof a?a.replace(Nb," "):a}});var za=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Pb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(x.type.order,{"date-pre":function(a){a=Date.parse(a);return isNaN(a)?-Infinity:a},"html-pre":function(a){return M(a)?
|
||||
"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return M(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});Da("");h.extend(!0,n.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:
|
||||
c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]==
|
||||
"asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var eb=function(a){return"string"===typeof a?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):a};n.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return eb(f);h=h.toFixed(c);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
|
||||
a)+f+(e||"")}}},text:function(){return{display:eb,filter:eb}}};h.extend(n.ext.internal,{_fnExternApiFunc:Mb,_fnBuildAjax:sa,_fnAjaxUpdate:mb,_fnAjaxParameters:vb,_fnAjaxUpdateDraw:wb,_fnAjaxDataSrc:ta,_fnAddColumn:Ea,_fnColumnOptions:ka,_fnAdjustColumnSizing:$,_fnVisibleToColumnIndex:aa,_fnColumnIndexToVisible:ba,_fnVisbleColumns:V,_fnGetColumns:ma,_fnColumnTypes:Ga,_fnApplyColumnDefs:jb,_fnHungarianMap:Z,_fnCamelToHungarian:J,_fnLanguageCompat:Ca,_fnBrowserDetect:hb,_fnAddData:O,_fnAddTr:na,_fnNodeToDataIndex:function(a,
|
||||
b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:kb,_fnSplitObjNotation:Ja,_fnGetObjectDataFn:S,_fnSetObjectDataFn:N,_fnGetDataMaster:Ka,_fnClearTable:oa,_fnDeleteIndex:pa,_fnInvalidate:da,_fnGetRowElements:Ia,_fnCreateTr:Ha,_fnBuildHead:lb,_fnDrawHead:fa,_fnDraw:P,_fnReDraw:T,_fnAddOptionsHtml:ob,_fnDetectHeader:ea,_fnGetUniqueThs:ra,_fnFeatureHtmlFilter:qb,_fnFilterComplete:ga,_fnFilterCustom:zb,
|
||||
_fnFilterColumn:yb,_fnFilter:xb,_fnFilterCreateSearch:Pa,_fnEscapeRegex:Qa,_fnFilterData:Ab,_fnFeatureHtmlInfo:tb,_fnUpdateInfo:Db,_fnInfoMacros:Eb,_fnInitialise:ha,_fnInitComplete:ua,_fnLengthChange:Ra,_fnFeatureHtmlLength:pb,_fnFeatureHtmlPaginate:ub,_fnPageChange:Ta,_fnFeatureHtmlProcessing:rb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:sb,_fnScrollDraw:la,_fnApplyToChildren:I,_fnCalculateColumnWidths:Fa,_fnThrottle:Oa,_fnConvertToWidth:Fb,_fnGetWidestNode:Gb,_fnGetMaxLenString:Hb,_fnStringToCss:v,
|
||||
_fnSortFlatten:X,_fnSort:nb,_fnSortAria:Jb,_fnSortListener:Va,_fnSortAttachListener:Ma,_fnSortingClasses:wa,_fnSortData:Ib,_fnSaveState:xa,_fnLoadState:Kb,_fnSettingsFromNode:ya,_fnLog:K,_fnMap:F,_fnBindAction:Wa,_fnCallbackReg:z,_fnCallbackFire:r,_fnLengthOverflow:Sa,_fnRenderer:Na,_fnDataSource:y,_fnRowAttributes:La,_fnExtend:Xa,_fnCalculateEnd:function(){}});h.fn.dataTable=n;n.$=h;h.fn.dataTableSettings=n.settings;h.fn.dataTableExt=n.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};
|
||||
h.each(n,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
|
@ -1,114 +0,0 @@
|
||||
/*
|
||||
* This file is part of Player Analytics (Plan).
|
||||
*
|
||||
* Plan is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License v3 as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Plan is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.delivery.webserver.cache;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
/**
|
||||
* Tests JSONCache invalidation.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
class JSONCacheTest {
|
||||
|
||||
private static final String CACHED = "Cached";
|
||||
private static final DataID TEST_ID = DataID.SESSIONS;
|
||||
private static final UUID TEST_UUID = UUID.randomUUID();
|
||||
|
||||
@BeforeEach
|
||||
void cleanCache() {
|
||||
JSONCache.invalidateAll();
|
||||
}
|
||||
|
||||
@Test
|
||||
void cachedByDataIDName() {
|
||||
JSONCache.getOrCache(TEST_ID, () -> CACHED);
|
||||
assertContains();
|
||||
}
|
||||
|
||||
private void assertContains() {
|
||||
List<String> cached = JSONCache.getCachedIDs();
|
||||
assertTrue(cached.contains(TEST_ID.name()));
|
||||
}
|
||||
|
||||
private void assertNotContains() {
|
||||
List<String> cached = JSONCache.getCachedIDs();
|
||||
assertFalse(cached.contains(TEST_ID.name()));
|
||||
}
|
||||
|
||||
@Test
|
||||
void invalidatedByExactDataID() {
|
||||
cachedByDataIDName();
|
||||
JSONCache.invalidate(TEST_ID);
|
||||
assertNotContains();
|
||||
}
|
||||
|
||||
@Test
|
||||
void allInvalidated() {
|
||||
cachedByDataIDName();
|
||||
JSONCache.invalidateAll();
|
||||
assertNotContains();
|
||||
}
|
||||
|
||||
@Test
|
||||
void cachedByServerUUID() {
|
||||
JSONCache.getOrCache(TEST_ID, TEST_UUID, () -> CACHED);
|
||||
assertContainsUUID();
|
||||
}
|
||||
|
||||
private void assertContainsUUID() {
|
||||
List<String> cached = JSONCache.getCachedIDs();
|
||||
assertTrue(cached.contains(TEST_ID.of(TEST_UUID)));
|
||||
}
|
||||
|
||||
private void assertNotContainsUUID() {
|
||||
List<String> cached = JSONCache.getCachedIDs();
|
||||
assertFalse(cached.contains(TEST_ID.of(TEST_UUID)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void invalidateByServerUUID() {
|
||||
cachedByServerUUID();
|
||||
JSONCache.invalidate(TEST_ID, TEST_UUID);
|
||||
assertNotContainsUUID();
|
||||
}
|
||||
|
||||
@Test
|
||||
void invalidateMatchingByID() {
|
||||
cachedByDataIDName();
|
||||
cachedByServerUUID();
|
||||
JSONCache.invalidateMatching(TEST_ID);
|
||||
assertNotContains();
|
||||
assertNotContainsUUID();
|
||||
}
|
||||
|
||||
@Test
|
||||
void invalidateMatchingByIDVarargs() {
|
||||
cachedByDataIDName();
|
||||
cachedByServerUUID();
|
||||
JSONCache.invalidateMatching(TEST_ID, TEST_ID);
|
||||
assertNotContains();
|
||||
assertNotContainsUUID();
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.djrapitops.plan.storage.json;
|
||||
package com.djrapitops.plan.delivery.webserver.cache;
|
||||
|
||||
import com.djrapitops.plan.storage.file.PlanFiles;
|
||||
import com.djrapitops.plugin.logging.console.TestPluginLogger;
|
||||
@ -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<File> findTheFile() {
|
@ -16,12 +16,12 @@
|
||||
*/
|
||||
package utilities.dagger;
|
||||
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONFileStorage;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONStorage;
|
||||
import com.djrapitops.plan.identification.ServerInfo;
|
||||
import com.djrapitops.plan.identification.ServerServerInfo;
|
||||
import com.djrapitops.plan.settings.BukkitConfigSystem;
|
||||
import com.djrapitops.plan.settings.ConfigSystem;
|
||||
import com.djrapitops.plan.storage.json.JSONFileStorage;
|
||||
import com.djrapitops.plan.storage.json.JSONStorage;
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
|
||||
|
@ -79,9 +79,8 @@ abstract class Mocker {
|
||||
"web/js/xmlhttprequests.js",
|
||||
|
||||
"web/vendor/bootstrap/js/bootstrap.bundle.min.js",
|
||||
"web/vendor/datatables/jquery.dataTables.min.js",
|
||||
"web/vendor/datatables/dataTables.bootstrap4.min.css",
|
||||
"web/vendor/datatables/dataTables.bootstrap4.min.js",
|
||||
"web/vendor/datatables/datatables.min.css",
|
||||
"web/vendor/datatables/datatables.min.js",
|
||||
"web/vendor/jquery/jquery.min.js",
|
||||
"web/vendor/fontawesome-free/css/all.min.css",
|
||||
"web/vendor/fontawesome-free/webfonts/fa-brands-400.eot",
|
||||
|
@ -27,8 +27,6 @@ import cn.nukkit.event.player.PlayerQuitEvent;
|
||||
import com.djrapitops.plan.delivery.domain.Nickname;
|
||||
import com.djrapitops.plan.delivery.domain.keys.SessionKeys;
|
||||
import com.djrapitops.plan.delivery.export.Exporter;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.extension.CallEvents;
|
||||
import com.djrapitops.plan.extension.ExtensionSvc;
|
||||
import com.djrapitops.plan.gathering.cache.NicknameCache;
|
||||
@ -150,8 +148,6 @@ public class PlayerOnlineListener implements Listener {
|
||||
UUID playerUUID = player.getUniqueId();
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
long time = System.currentTimeMillis();
|
||||
JSONCache.invalidate(DataID.SERVER_OVERVIEW, serverUUID);
|
||||
JSONCache.invalidate(DataID.GRAPH_PERFORMANCE, serverUUID);
|
||||
|
||||
NukkitAFKListener.AFK_TRACKER.performedAction(playerUUID, time);
|
||||
|
||||
@ -216,10 +212,6 @@ public class PlayerOnlineListener implements Listener {
|
||||
UUID playerUUID = player.getUniqueId();
|
||||
if (playerUUID == null) return; // Can be null when player is not signed in to xbox live
|
||||
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
JSONCache.invalidate(DataID.SERVER_OVERVIEW, serverUUID);
|
||||
JSONCache.invalidate(DataID.GRAPH_PERFORMANCE, serverUUID);
|
||||
|
||||
NukkitAFKListener.AFK_TRACKER.loggedOut(playerUUID, time);
|
||||
|
||||
nicknameCache.removeDisplayName(playerUUID);
|
||||
|
@ -18,7 +18,7 @@ package com.djrapitops.plan.modules.nukkit;
|
||||
|
||||
import cn.nukkit.level.Level;
|
||||
import com.djrapitops.plan.TaskSystem;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONFileStorage;
|
||||
import com.djrapitops.plan.extension.ExtensionServerDataUpdater;
|
||||
import com.djrapitops.plan.gathering.ShutdownHook;
|
||||
import com.djrapitops.plan.gathering.timed.NukkitPingCounter;
|
||||
@ -58,10 +58,6 @@ public interface NukkitTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindDBCleanTask(DBCleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONCacheCleanTask(JSONCache.CleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindRamAndCpuTask(SystemUsageBuffer.RamAndCpuTask ramAndCpuTask);
|
||||
@ -74,4 +70,7 @@ public interface NukkitTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindShutdownHookRegistration(ShutdownHook.Registrar registrar);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONFileStorageCleanTask(JSONFileStorage.CleanTask cleanTask);
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package com.djrapitops.plan.gathering.listeners.sponge;
|
||||
import com.djrapitops.plan.delivery.domain.Nickname;
|
||||
import com.djrapitops.plan.delivery.domain.keys.SessionKeys;
|
||||
import com.djrapitops.plan.delivery.export.Exporter;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.extension.CallEvents;
|
||||
import com.djrapitops.plan.extension.ExtensionSvc;
|
||||
import com.djrapitops.plan.gathering.cache.NicknameCache;
|
||||
@ -154,8 +152,6 @@ public class PlayerOnlineListener {
|
||||
UUID playerUUID = player.getUniqueId();
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
long time = System.currentTimeMillis();
|
||||
JSONCache.invalidate(DataID.SERVER_OVERVIEW, serverUUID);
|
||||
JSONCache.invalidate(DataID.GRAPH_PERFORMANCE, serverUUID);
|
||||
|
||||
SpongeAFKListener.AFK_TRACKER.performedAction(playerUUID, time);
|
||||
|
||||
@ -218,9 +214,6 @@ public class PlayerOnlineListener {
|
||||
Player player = event.getTargetEntity();
|
||||
String playerName = player.getName();
|
||||
UUID playerUUID = player.getUniqueId();
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
JSONCache.invalidate(DataID.SERVER_OVERVIEW, serverUUID);
|
||||
JSONCache.invalidate(DataID.GRAPH_PERFORMANCE, serverUUID);
|
||||
|
||||
SpongeAFKListener.AFK_TRACKER.loggedOut(playerUUID, time);
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.djrapitops.plan.modules.sponge;
|
||||
|
||||
import com.djrapitops.plan.TaskSystem;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONFileStorage;
|
||||
import com.djrapitops.plan.extension.ExtensionServerDataUpdater;
|
||||
import com.djrapitops.plan.gathering.ShutdownHook;
|
||||
import com.djrapitops.plan.gathering.timed.ServerTPSCounter;
|
||||
@ -58,10 +58,6 @@ public interface SpongeTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindDBCleanTask(DBCleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONCacheCleanTask(JSONCache.CleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindRamAndCpuTask(SystemUsageBuffer.RamAndCpuTask ramAndCpuTask);
|
||||
@ -74,4 +70,7 @@ public interface SpongeTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindShutdownHookRegistration(ShutdownHook.Registrar registrar);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONFileStorageCleanTask(JSONFileStorage.CleanTask cleanTask);
|
||||
}
|
||||
|
@ -18,8 +18,6 @@ package com.djrapitops.plan.gathering.listeners.velocity;
|
||||
|
||||
import com.djrapitops.plan.delivery.domain.keys.SessionKeys;
|
||||
import com.djrapitops.plan.delivery.export.Exporter;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.DataID;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.extension.CallEvents;
|
||||
import com.djrapitops.plan.extension.ExtensionSvc;
|
||||
import com.djrapitops.plan.gathering.cache.SessionCache;
|
||||
@ -127,12 +125,6 @@ public class PlayerOnlineListener {
|
||||
if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {
|
||||
processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));
|
||||
}
|
||||
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
JSONCache.invalidateMatching(DataID.SERVER_OVERVIEW);
|
||||
JSONCache.invalidate(DataID.GRAPH_ONLINE, serverUUID);
|
||||
JSONCache.invalidate(DataID.SERVERS);
|
||||
JSONCache.invalidate(DataID.SESSIONS);
|
||||
}
|
||||
|
||||
@Subscribe(order = PostOrder.NORMAL)
|
||||
@ -161,24 +153,6 @@ public class PlayerOnlineListener {
|
||||
if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {
|
||||
processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));
|
||||
}
|
||||
|
||||
processing.submit(() -> {
|
||||
JSONCache.invalidateMatching(
|
||||
DataID.SERVER_OVERVIEW,
|
||||
DataID.SESSIONS,
|
||||
DataID.GRAPH_WORLD_PIE,
|
||||
DataID.GRAPH_PUNCHCARD,
|
||||
DataID.KILLS,
|
||||
DataID.ONLINE_OVERVIEW,
|
||||
DataID.SESSIONS_OVERVIEW,
|
||||
DataID.PVP_PVE,
|
||||
DataID.GRAPH_UNIQUE_NEW,
|
||||
DataID.GRAPH_CALENDAR
|
||||
);
|
||||
UUID serverUUID = serverInfo.getServerUUID();
|
||||
JSONCache.invalidate(DataID.GRAPH_ONLINE, serverUUID);
|
||||
JSONCache.invalidate(DataID.SERVERS);
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(order = PostOrder.LAST)
|
||||
@ -205,7 +179,5 @@ public class PlayerOnlineListener {
|
||||
if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {
|
||||
processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));
|
||||
}
|
||||
|
||||
JSONCache.invalidate(DataID.SERVERS);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.djrapitops.plan.modules.velocity;
|
||||
|
||||
import com.djrapitops.plan.TaskSystem;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
||||
import com.djrapitops.plan.delivery.webserver.cache.JSONFileStorage;
|
||||
import com.djrapitops.plan.extension.ExtensionServerDataUpdater;
|
||||
import com.djrapitops.plan.gathering.timed.ProxyTPSCounter;
|
||||
import com.djrapitops.plan.gathering.timed.SystemUsageBuffer;
|
||||
@ -56,10 +56,6 @@ public interface VelocityTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindDBCleanTask(DBCleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONCacheCleanTask(JSONCache.CleanTask cleanTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindRamAndCpuTask(SystemUsageBuffer.RamAndCpuTask ramAndCpuTask);
|
||||
@ -68,4 +64,7 @@ public interface VelocityTaskModule {
|
||||
@IntoSet
|
||||
TaskSystem.Task bindDiskTask(SystemUsageBuffer.DiskTask diskTask);
|
||||
|
||||
@Binds
|
||||
@IntoSet
|
||||
TaskSystem.Task bindJSONFileStorageCleanTask(JSONFileStorage.CleanTask cleanTask);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user