From 2f32035845ee162c6ca6b8a102bb2adf0b6f878f Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Wed, 2 Oct 2019 20:38:02 +0300 Subject: [PATCH] Fixed /server page on exported /network page --- .../plan/delivery/export/NetworkPageExporter.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java index 2ddda2a54..aa92622c1 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java @@ -129,8 +129,8 @@ public class NetworkPageExporter extends FileExporter { String jsonResourceName = toFileName(toJSONResourceName(resource)) + ".json"; export(toDirectory.resolve("data").resolve(jsonResourceName), - // Replace ../server in urls to fix server page links - StringUtils.replaceEach(found.getContent(), new String[]{"../server", "../player"}, new String[]{toRelativePathFromRoot("server"), toRelativePathFromRoot("player")}) + // Replace ../player in urls to fix player page links + StringUtils.replace(found.getContent(), "../player", toRelativePathFromRoot("player")) ); exportPaths.put("../v1/" + resource, toRelativePathFromRoot("data/" + jsonResourceName)); } @@ -186,6 +186,9 @@ public class NetworkPageExporter extends FileExporter { Path to = toDirectory.resolve(resourceName); if (resourceName.endsWith(".css")) { export(to, theme.replaceThemeColors(resource.asString())); + } else if (resourceName.equalsIgnoreCase("js/network-values.js")) { + // Replace /server in urls to fix server page links + export(to, StringUtils.replace(resource.asString(), "server/", toRelativePathFromRoot("server") + '/')); } else { export(to, resource.asLines()); }