use of com.djrapitops.plan.delivery.rendering.pages.Page in project Plan by plan-player-analytics.
the class PlayerPageExporter method exportHtml.
private void exportHtml(ExportPaths exportPaths, Path playerDirectory, UUID playerUUID) throws IOException {
Path to = playerDirectory.resolve("index.html");
try {
Page page = pageFactory.playerPage(playerUUID);
export(to, exportPaths.resolveExportPaths(page.toHtml()));
} catch (IllegalStateException notFound) {
throw new NotFoundException(notFound.getMessage());
}
}
use of com.djrapitops.plan.delivery.rendering.pages.Page in project Plan by plan-player-analytics.
the class ServerPageExporter method exportHtml.
private void exportHtml(Path toDirectory, Server server) throws IOException {
ServerUUID serverUUID = server.getUuid();
Path to = toDirectory.resolve(serverInfo.getServer().isProxy() ? "server/" + toFileName(server.getName()) : "server").resolve("index.html");
Page page = pageFactory.serverPage(serverUUID);
// Fixes refreshingJsonRequest ignoring old data of export
String html = StringUtils.replaceEach(page.toHtml(), new String[] { "loadOptimizedPerformanceGraph, 'performance', true);", "loadserverCalendar, 'online-activity-overview', true);", "}, 'playerlist', true);", "<head>" }, new String[] { "loadOptimizedPerformanceGraph, 'performance');", "loadserverCalendar, 'online-activity-overview');", "}, 'playerlist');", "<head><style>.refresh-element {display: none;}</style>" });
export(to, exportPaths.resolveExportPaths(html));
}
use of com.djrapitops.plan.delivery.rendering.pages.Page in project Plan by plan-player-analytics.
the class NetworkPageExporter method exportHtml.
private void exportHtml(ExportPaths exportPaths, Path toDirectory) throws IOException {
Path to = toDirectory.resolve("network").resolve("index.html");
Page page = pageFactory.networkPage();
// Fixes refreshingJsonRequest ignoring old data of export
String html = StringUtils.replaceEach(page.toHtml(), new String[] { "loadPlayersOnlineGraph, 'network-overview', true);", "· Performance", "<head>" }, new String[] { "loadPlayersOnlineGraph, 'network-overview');", "· Performance (Unavailable with Export)", "<head><style>.refresh-element {display: none;}</style>" });
export(to, exportPaths.resolveExportPaths(html));
}
use of com.djrapitops.plan.delivery.rendering.pages.Page in project Plan by plan-player-analytics.
the class PlayersPageExporter method exportHtml.
private void exportHtml(Path toDirectory) throws IOException {
Path to = toDirectory.resolve("players").resolve("index.html");
Page page = pageFactory.playersPage();
// Fixes refreshingJsonRequest ignoring old data of export
String html = StringUtils.replaceEach(page.toHtml(), new String[] { "}, 'playerlist', true);", "<head>" }, new String[] { "}, 'playerlist');", "<head><style>.refresh-element {display: none;}</style>" });
export(to, exportPaths.resolveExportPaths(html));
}
Aggregations