diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/BungeeConnectionSystem.java b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/BungeeConnectionSystem.java index 019d49dbf..91f426932 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/BungeeConnectionSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/BungeeConnectionSystem.java @@ -54,6 +54,8 @@ public class BungeeConnectionSystem extends ConnectionSystem { Optional serverUUID = getServerWherePlayerIsOnline((GenerateInspectPageRequest) infoRequest); if (serverUUID.isPresent()) { server = bukkitServers.getOrDefault(serverUUID.get(), getOneBukkitServer()); + } else { + server = getOneBukkitServer(); } } if (server == null) { diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPageRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPageRequest.java index ad8351c38..e6202cfb3 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPageRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPageRequest.java @@ -8,6 +8,7 @@ import com.djrapitops.plan.api.exceptions.connection.TransferDatabaseException; import com.djrapitops.plan.api.exceptions.connection.WebException; import com.djrapitops.plan.api.exceptions.database.DBException; import com.djrapitops.plan.system.database.databases.Database; +import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.processing.Processor; import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plan.system.webserver.response.DefaultResponses; @@ -18,7 +19,9 @@ import com.djrapitops.plan.system.webserver.response.pages.InspectPageResponse; import com.djrapitops.plan.utilities.Base64Util; import com.djrapitops.plan.utilities.file.export.HtmlExport; import com.djrapitops.plugin.utilities.Verify; +import org.apache.commons.lang3.text.StrSubstitutor; +import java.util.Collections; import java.util.Map; import java.util.UUID; @@ -71,7 +74,9 @@ public class CacheInspectPageRequest implements CacheRequest { UUID uuid = entry.getKey(); String html = Base64Util.decode(entry.getValue()); - cache(export, uuid, html); + Map replace = Collections.singletonMap("networkName", ServerInfo.getServerName()); + + cache(export, uuid, StrSubstitutor.replace(html, replace)); } } catch (DBException e) { throw new TransferDatabaseException(e); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateAnalysisPageRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateAnalysisPageRequest.java index bfabbc2eb..62e033d68 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateAnalysisPageRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateAnalysisPageRequest.java @@ -69,6 +69,7 @@ public class GenerateAnalysisPageRequest extends InfoRequestWithVariables implem InfoSystem infoSystem = InfoSystem.getInstance(); infoSystem.sendRequest(new CacheAnalysisPageRequest(serverUUID, AnalysisPageResponse.getRefreshingHtml())); infoSystem.sendRequest(new CacheAnalysisPageRequest(serverUUID, analyseAndGetHtml())); + infoSystem.updateNetworkPage(); } @Override diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/AnalysisPageResponse.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/AnalysisPageResponse.java index 4c03db5ec..1b373085e 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/AnalysisPageResponse.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/AnalysisPageResponse.java @@ -1,11 +1,15 @@ package com.djrapitops.plan.system.webserver.response.pages; +import com.djrapitops.plan.api.exceptions.connection.NoServersException; import com.djrapitops.plan.api.exceptions.connection.WebException; import com.djrapitops.plan.system.info.InfoSystem; import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.processing.Processor; import com.djrapitops.plan.system.webserver.response.Response; +import com.djrapitops.plan.system.webserver.response.cache.PageId; +import com.djrapitops.plan.system.webserver.response.cache.ResponseCache; import com.djrapitops.plan.system.webserver.response.errors.ErrorResponse; +import com.djrapitops.plan.system.webserver.response.errors.NotFoundResponse; import com.djrapitops.plugin.api.utility.log.Log; import java.util.UUID; @@ -24,9 +28,11 @@ public class AnalysisPageResponse extends Response { Processor.queue(() -> { try { InfoSystem.getInstance().generateAnalysisPage(serverUUID); + } catch (NoServersException e) { + ResponseCache.cacheResponse(PageId.SERVER.of(serverUUID), () -> new NotFoundResponse(e.getMessage())); } catch (WebException e) { // TODO Exception handling - Log.toLog(AnalysisPageResponse.class, e); + Log.toLog(AnalysisPageResponse.class.getName(), e); } }); return new AnalysisPageResponse(getRefreshingHtml()); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/DebugPageResponse.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/DebugPageResponse.java index 856c1ffc7..c34714ed1 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/DebugPageResponse.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/response/pages/DebugPageResponse.java @@ -93,7 +93,7 @@ public class DebugPageResponse extends ErrorResponse { for (Server server : servers) { content.append(server.getName()).append(" | ") .append(server.getWebAddress()).append(" | ") - .append(server.getUuid()).append(" | ").append("
"); + .append(server.getUuid()).append("
"); } content.append("");