Fixed /server page on exported /network page

This commit is contained in:
Rsl1122 2019-10-02 20:38:02 +03:00
parent d58d6d231e
commit 2f32035845

View File

@ -129,8 +129,8 @@ public class NetworkPageExporter extends FileExporter {
String jsonResourceName = toFileName(toJSONResourceName(resource)) + ".json"; String jsonResourceName = toFileName(toJSONResourceName(resource)) + ".json";
export(toDirectory.resolve("data").resolve(jsonResourceName), export(toDirectory.resolve("data").resolve(jsonResourceName),
// Replace ../server in urls to fix server page links // Replace ../player in urls to fix player page links
StringUtils.replaceEach(found.getContent(), new String[]{"../server", "../player"}, new String[]{toRelativePathFromRoot("server"), toRelativePathFromRoot("player")}) StringUtils.replace(found.getContent(), "../player", toRelativePathFromRoot("player"))
); );
exportPaths.put("../v1/" + resource, toRelativePathFromRoot("data/" + jsonResourceName)); exportPaths.put("../v1/" + resource, toRelativePathFromRoot("data/" + jsonResourceName));
} }
@ -186,6 +186,9 @@ public class NetworkPageExporter extends FileExporter {
Path to = toDirectory.resolve(resourceName); Path to = toDirectory.resolve(resourceName);
if (resourceName.endsWith(".css")) { if (resourceName.endsWith(".css")) {
export(to, theme.replaceThemeColors(resource.asString())); 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 { } else {
export(to, resource.asLines()); export(to, resource.asLines());
} }