From 8ccd9854bafa19fc6ab3b2e7c38576c7ddb602f6 Mon Sep 17 00:00:00 2001
From: Rsl1122 If your issue is about Bungee-Bukkit connection relations, please include the following debug information of available servers as well: ");
+ content.append(" If your issue is about Bungee-Bukkit connection relations, please include the following debug information of available servers as well: ").append(link).append("
");
+ content.append("
### Bungee Configuration
"); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlStructure.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlStructure.java index d022d5f4d..41e542a80 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlStructure.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlStructure.java @@ -4,20 +4,25 @@ */ package main.java.com.djrapitops.plan.utilities.html; +import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.utilities.Verify; import main.java.com.djrapitops.plan.Plan; +import main.java.com.djrapitops.plan.ServerVariableHolder; import main.java.com.djrapitops.plan.Settings; import main.java.com.djrapitops.plan.data.Session; import main.java.com.djrapitops.plan.data.additional.AnalysisType; import main.java.com.djrapitops.plan.data.additional.PluginData; +import main.java.com.djrapitops.plan.database.Database; import main.java.com.djrapitops.plan.systems.info.BukkitInformationManager; import main.java.com.djrapitops.plan.utilities.FormatUtils; import main.java.com.djrapitops.plan.utilities.analysis.AnalysisUtils; +import main.java.com.djrapitops.plan.utilities.html.graphs.PlayerActivityGraphCreator; import main.java.com.djrapitops.plan.utilities.html.structure.SessionTabStructureCreator; import main.java.com.djrapitops.plan.utilities.html.tables.SessionsTableCreator; import org.apache.commons.lang3.text.StrSubstitutor; import java.io.Serializable; +import java.sql.SQLException; import java.util.*; /** @@ -312,16 +317,12 @@ public class HtmlStructure { Listvalues = new ArrayList<>(networkPageContents.values()); Collections.sort(values); int size = values.size(); - int extra = size % 3; - for (int j = 0; j < extra; j++) { - values.add(""); - } for (String server : values) { - if (i % 3 == 0) { - b.append(" "); + if (i % 2 == 0) { + b.append(""); } b.append(server); - if ((i + 1) % 3 == 0 || i + 1 == size) { + if ((i + 1) % 2 == 0 || i + 1 == size) { b.append(""); } i++; @@ -330,23 +331,72 @@ public class HtmlStructure { } public static String createServerContainer(Plan plugin) { - int maxPlayers = plugin.getVariable().getMaxPlayers(); + ServerVariableHolder variable = plugin.getVariable(); + int maxPlayers = variable.getMaxPlayers(); int online = plugin.getServer().getOnlinePlayers().size(); OptionalanalysisRefreshDate = ((BukkitInformationManager) plugin.getInfoManager()).getAnalysisRefreshDate(); String refresh = analysisRefreshDate.map(FormatUtils::formatTimeStamp).orElse("-"); String serverName = plugin.getServerInfoManager().getServerName(); + String serverType = variable.getVersion(); String address = "../server/" + serverName; - return " " + ""; + Database db = plugin.getDB(); + UUID serverUUID = plugin.getServerUuid(); + String id = serverUUID.toString().replace("-", ""); + + int playerCount = db.getUserInfoTable().getServerUserCount(serverUUID); + String playerData = "[]"; + try { + playerData = PlayerActivityGraphCreator.buildSeriesDataString(db.getTpsTable().getTPSData(serverUUID)); + } catch (SQLException e) { + Log.toLog(HtmlStructure.class.getClass().getName(), e); + } + + return "" + - "" + - serverName + - "
" + - "" + online + "/" + maxPlayers + - " Players Online
" + + "" + + "" + + ""; } public static String parseOfflineServerContainer(String oldContent) { diff --git a/Plan/src/main/resources/web/js/charts/playerGraphNoNav.js b/Plan/src/main/resources/web/js/charts/playerGraphNoNav.js new file mode 100644 index 000000000..cb1914b3a --- /dev/null +++ b/Plan/src/main/resources/web/js/charts/playerGraphNoNav.js @@ -0,0 +1,37 @@ +function playersChartNoNav(id, playersOnlineSeries) { + Highcharts.stockChart(id, { + rangeSelector: { + selected: 3, + buttons: [{ + type: 'hour', + count: 12, + text: '12h' + }, { + type: 'hour', + count: 24, + text: '24h' + }, { + type: 'day', + count: 7, + text: '7d' + }, { + type: 'month', + count: 1, + text: '30d' + }, { + type: 'all', + text: 'All' + }] + }, + navigator: { + enabled: false + }, + title: {text: ''}, + plotOptions: { + areaspline: { + fillOpacity: 0.4 + } + }, + series: [playersOnlineSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/web/network - Example.html b/Plan/src/main/resources/web/network - Example.html index 64c29e53d..a4cdc4581 100644 --- a/Plan/src/main/resources/web/network - Example.html +++ b/Plan/src/main/resources/web/network - Example.html @@ -233,14 +233,8 @@ ${playersTotal}" + + "" + + "" + + "" + + "" + + "" + serverName + "
" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "Registered Players " + + "" + playerCount + "
" + + "Players Online " + + "" + online + " / " + maxPlayers + "
" + + "Type " + + "" + serverType + "
" + + "Last Refresh" + + "" + refresh + "
" + + "
" + + "- Unique Players / Day - (AVG.) - ${playersAverage} - -- New Players / Day - (AVG.) - ${playersNewAverage} + Players Online + ${playersOnline} Last Peak: ${lastPeakTime} + @@ -233,14 +234,8 @@ ${playersTotal}- Unique Players / Day - (AVG.) - ${playersAverage} - -- New Players / Day - (AVG.) - ${playersNewAverage} + Players Online + ${playersOnline} Last Peak: ${lastPeakTime} - +