Stopped ignoring old data on exported files

Adds technical debt that replaces stuff in the exported files.

Affects issues:
- Fixed  #1763
This commit is contained in:
Risto Lahtela 2021-02-19 11:35:54 +02:00
parent 7fc7488e16
commit 00eb4bb8bd
3 changed files with 29 additions and 3 deletions

View File

@ -95,7 +95,13 @@ public class NetworkPageExporter extends FileExporter {
.resolve("index.html");
Page page = pageFactory.networkPage();
export(to, exportPaths.resolveExportPaths(page.toHtml()));
// Fixes refreshingJsonRequest ignoring old data of export
String html = StringUtils.replaceEach(page.toHtml(),
new String[]{"loadPlayersOnlineGraph, 'network-overview', true);"},
new String[]{"loadPlayersOnlineGraph, 'network-overview');"});
export(to, exportPaths.resolveExportPaths(html));
}
/**

View File

@ -93,7 +93,13 @@ public class PlayersPageExporter extends FileExporter {
.resolve("index.html");
Page page = pageFactory.playersPage();
export(to, exportPaths.resolveExportPaths(page.toHtml()));
// Fixes refreshingJsonRequest ignoring old data of export
String html = StringUtils.replaceEach(page.toHtml(),
new String[]{"}, 'playerlist', true);"},
new String[]{"}, 'playerlist');"});
export(to, exportPaths.resolveExportPaths(html));
}
private void exportJSON(Path toDirectory) throws IOException {

View File

@ -105,7 +105,21 @@ public class ServerPageExporter extends FileExporter {
.resolve("index.html");
Page page = pageFactory.serverPage(serverUUID);
export(to, exportPaths.resolveExportPaths(page.toHtml()));
// 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);"
},
new String[]{
"loadOptimizedPerformanceGraph, 'performance');",
"loadServerCalendar, 'online-activity-overview');",
"}, 'playerlist');"
});
export(to, exportPaths.resolveExportPaths(html));
}
/**