Changed back links /server -> /server/

Also for /network -> /network/

This was causing some issues with relative links when Plan was in
subdirectory eg address/plan/server would direct requests to address/v1/
instead of address/plan/v1/

Affects issues:
- Fixed #1210
This commit is contained in:
Rsl1122 2020-01-07 13:59:03 +02:00
parent 3d3c7289bb
commit 304d8da86b
5 changed files with 7 additions and 7 deletions

View File

@ -68,7 +68,7 @@ public class ListPlayersCommand extends CommandNode {
// Link
String address = PlanSystem.getMainAddress(webServer, dbSystem);
String url = address + "/players/";
String url = address + "/players";
String linkPrefix = locale.getString(CommandLang.LINK_PREFIX);
boolean console = !CommandUtils.isPlayer(sender);
if (console) {

View File

@ -82,8 +82,8 @@ public class PlayerPageExporter extends FileExporter {
if (dbState == Database.State.CLOSED || dbState == Database.State.CLOSING) return;
if (!dbSystem.getDatabase().query(PlayerFetchQueries.isPlayerRegistered(playerUUID))) return;
exportPaths.put("../network", toRelativePathFromRoot("network"));
exportPaths.put("../server", toRelativePathFromRoot("server"));
exportPaths.put("../network/", toRelativePathFromRoot("network"));
exportPaths.put("../server/", toRelativePathFromRoot("server"));
exportRequiredResources(toDirectory);
Path playerDirectory = toDirectory.resolve("player/" + toFileName(playerName));

View File

@ -85,7 +85,7 @@ public class ServerPageExporter extends FileExporter {
Database.State dbState = dbSystem.getDatabase().getState();
if (dbState == Database.State.CLOSED || dbState == Database.State.CLOSING) return;
exportPaths.put("../network", toRelativePathFromRoot("network"));
exportPaths.put("../network/", toRelativePathFromRoot("network"));
exportRequiredResources(toDirectory);
exportJSON(toDirectory, server);
exportHtml(toDirectory, server);

View File

@ -52,13 +52,13 @@ public enum Html {
LINK("<a class=\"link\" href=\"${0}\">${1}</a>"),
LINK_EXTERNAL("<a class=\"link\" rel=\"noopener noreferrer\" target=\"_blank\" href=\"${0}\">${1}</a>"),
BACK_BUTTON_NETWORK("<a class=\"btn bg-plan btn-icon-split\" href=\"../network\">" +
BACK_BUTTON_NETWORK("<a class=\"btn bg-plan btn-icon-split\" href=\"../network/\">" +
"<span class=\"icon text-white-50\">" +
"<i class=\"fas fa-fw fa-arrow-left\"></i><i class=\"fas fa-fw fa-cloud\"></i>" +
"</span>" +
"<span class=\"text\">Network page</span>" +
"</a>"),
BACK_BUTTON_SERVER("<a class=\"btn bg-plan btn-icon-split\" href=\"../server\">" +
BACK_BUTTON_SERVER("<a class=\"btn bg-plan btn-icon-split\" href=\"../server/\">" +
"<span class=\"icon text-white-50\">" +
"<i class=\"fas fa-fw fa-arrow-left\"></i><i class=\"fas fa-fw fa-server\"></i>" +
"</span>" +

View File

@ -283,7 +283,7 @@
<script>
try {
jsonRequest("../v1/players", function (playersTableJson, error) {
jsonRequest("./v1/players", function (playersTableJson, error) {
if (playersTableJson) {
$('.player-table').DataTable({
responsive: true,