Added networkName to player.html for #337

This commit is contained in:
Rsl1122 2017-10-08 11:53:47 +03:00
parent 56fa9dbeac
commit f8f0603951
5 changed files with 15 additions and 4 deletions

View File

@ -101,7 +101,7 @@ public enum Settings {
//
// Bungee
BUNGEE_IP("Server.IP"),
BUNGEE_NETWROK_NAME("Network.Name");
BUNGEE_NETWORK_NAME("Network.Name");
private static final ServerSpecificSettings serverSpecificSettings = new ServerSpecificSettings();

View File

@ -186,6 +186,10 @@ public class InspectPageParser extends PageParser {
addValue("playerClassification", active);
}
if (!plugin.getInfoManager().isUsingAnotherWebServer()) {
addValue("networkName", Settings.SERVER_NAME.toString());
}
return HtmlUtils.replacePlaceholders(FileUtil.getStringFromResource("player.html"), placeHolders);
} catch (Exception e) {
Log.toLog(this.getClass().getName(), e);

View File

@ -43,7 +43,7 @@ public class NetworkPageParser extends PageParser {
Database db = plugin.getDB();
List<TPS> networkOnlineData = db.getTpsTable().getNetworkOnlineData();
addValue("networkName", Settings.BUNGEE_NETWROK_NAME.toString());
addValue("networkName", Settings.BUNGEE_NETWORK_NAME.toString());
addValue("version", plugin.getVersion());
addValue("playersOnlineSeries", PlayerActivityGraphCreator.buildSeriesDataString(networkOnlineData));
addValue("playersGraphColor", Colors.PLAYERS_ONLINE.getColor());

View File

@ -4,6 +4,7 @@
*/
package main.java.com.djrapitops.plan.systems.webserver.webapi.bungee;
import main.java.com.djrapitops.plan.Settings;
import main.java.com.djrapitops.plan.api.IPlan;
import main.java.com.djrapitops.plan.api.exceptions.WebAPIException;
import main.java.com.djrapitops.plan.systems.info.InformationManager;
@ -12,7 +13,9 @@ import main.java.com.djrapitops.plan.systems.webserver.response.AnalysisPageResp
import main.java.com.djrapitops.plan.systems.webserver.response.InspectPageResponse;
import main.java.com.djrapitops.plan.systems.webserver.response.Response;
import main.java.com.djrapitops.plan.systems.webserver.webapi.WebAPI;
import org.apache.commons.lang3.text.StrSubstitutor;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@ -32,7 +35,11 @@ public class PostHtmlWebAPI extends WebAPI {
switch (target) {
case "inspectPage":
String uuid = variables.get("uuid");
PageCache.cachePage("inspectPage:" + uuid, () -> new InspectPageResponse(infoManager, UUID.fromString(uuid), html));
Map<String, String> map = new HashMap<>();
map.put("networkName", Settings.BUNGEE_NETWORK_NAME.toString());
PageCache.cachePage("inspectPage:" + uuid, () -> new InspectPageResponse(infoManager, UUID.fromString(uuid), StrSubstitutor.replace(html, map)));
break;
case "analysisPage":
PageCache.cachePage("analysisPage:" + variables.get("sender"), () -> new AnalysisPageResponse(html));

View File

@ -29,7 +29,7 @@
</div>
</div>
<p class="right">Player Analytics v.${version}</p>
<h1>Player | ${playerName}</h1>
<h1>${networkName} | ${playerName}</h1>
</div>
</header>
<div class="content-server">