mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-07 04:18:26 +02:00
Back button to /server and /player
This commit is contained in:
parent
1dc3e294b5
commit
5bba175558
@ -47,7 +47,20 @@ public enum Html {
|
|||||||
|
|
||||||
SPAN("${0}</span>"),
|
SPAN("${0}</span>"),
|
||||||
LINK("<a class=\"link\" href=\"${0}\">${1}</a>"),
|
LINK("<a class=\"link\" href=\"${0}\">${1}</a>"),
|
||||||
LINK_EXTERNAL("<a class=\"link\" rel=\"noopener noreferrer\" target=\"_blank\" 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\">" +
|
||||||
|
"<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\">" +
|
||||||
|
"<span class=\"icon text-white-50\">" +
|
||||||
|
"<i class=\"fas fa-fw fa-arrow-left\"></i><i class=\"fas fa-fw fa-server\"></i>" +
|
||||||
|
"</span>" +
|
||||||
|
"<span class=\"text\">Server page</span>" +
|
||||||
|
"</a>");
|
||||||
|
|
||||||
private final String html;
|
private final String html;
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ public class PageFactory {
|
|||||||
versionCheckSystem.get(),
|
versionCheckSystem.get(),
|
||||||
fileSystem.get(),
|
fileSystem.get(),
|
||||||
dbSystem.get(),
|
dbSystem.get(),
|
||||||
|
serverInfo.get(),
|
||||||
formatters.get()
|
formatters.get()
|
||||||
)).orElseThrow(() -> new NotFoundException("Server not found in the database"));
|
)).orElseThrow(() -> new NotFoundException("Server not found in the database"));
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ import com.djrapitops.plan.system.update.VersionCheckSystem;
|
|||||||
import com.djrapitops.plan.utilities.formatting.Formatter;
|
import com.djrapitops.plan.utilities.formatting.Formatter;
|
||||||
import com.djrapitops.plan.utilities.formatting.Formatters;
|
import com.djrapitops.plan.utilities.formatting.Formatters;
|
||||||
import com.djrapitops.plan.utilities.formatting.PlaceholderReplacer;
|
import com.djrapitops.plan.utilities.formatting.PlaceholderReplacer;
|
||||||
|
import com.djrapitops.plan.utilities.html.Html;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -106,11 +107,7 @@ public class PlayerPage implements Page {
|
|||||||
placeholders.put("serverPieColors", theme.getValue(ThemeVal.GRAPH_SERVER_PREF_PIE));
|
placeholders.put("serverPieColors", theme.getValue(ThemeVal.GRAPH_SERVER_PREF_PIE));
|
||||||
placeholders.put("firstDay", 1);
|
placeholders.put("firstDay", 1);
|
||||||
|
|
||||||
if (serverInfo.getServer().isProxy()) {
|
placeholders.put("backButton", (serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK : Html.BACK_BUTTON_SERVER).parse());
|
||||||
placeholders.put("backButton", "<li><a title=\"to Network page\" href=\"/network\"><i class=\"material-icons\">arrow_back</i><i class=\"material-icons\">cloud</i></a></li>");
|
|
||||||
} else {
|
|
||||||
placeholders.put("backButton", "<li><a title=\"to Server page\" href=\"/server\"><i class=\"material-icons\">arrow_back</i><i class=\"material-icons\">storage</i></a></li>");
|
|
||||||
}
|
|
||||||
|
|
||||||
PlayerPluginTab pluginTabs = pageFactory.inspectPluginTabs(playerUUID);
|
PlayerPluginTab pluginTabs = pageFactory.inspectPluginTabs(playerUUID);
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ public class PlayerPluginTab implements Comparable<PlayerPluginTab> {
|
|||||||
return "<div class=\"tab\"><div class=\"container-fluid mt-4\">" +
|
return "<div class=\"tab\"><div class=\"container-fluid mt-4\">" +
|
||||||
// Page heading
|
// Page heading
|
||||||
"<div class=\"d-sm-flex align-items-center justify-content-between mb-4\">" +
|
"<div class=\"d-sm-flex align-items-center justify-content-between mb-4\">" +
|
||||||
"<h1 class=\"h3 mb-0 text-gray-800\"><i class=\"sidebar-toggler fa fa-fw fa-bars\"></i>${playerName} · " + serverName + " Plugins</h1>" +
|
"<h1 class=\"h3 mb-0 text-gray-800\"><i class=\"sidebar-toggler fa fa-fw fa-bars\"></i>${playerName} · " + serverName + " Plugins</h1>${backButton}" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
// End Page heading
|
// End Page heading
|
||||||
"<div class=\"card-columns\">" + content + "</div></div></div>";
|
"<div class=\"card-columns\">" + content + "</div></div></div>";
|
||||||
|
@ -25,6 +25,7 @@ import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionSer
|
|||||||
import com.djrapitops.plan.system.database.DBSystem;
|
import com.djrapitops.plan.system.database.DBSystem;
|
||||||
import com.djrapitops.plan.system.file.PlanFiles;
|
import com.djrapitops.plan.system.file.PlanFiles;
|
||||||
import com.djrapitops.plan.system.info.server.Server;
|
import com.djrapitops.plan.system.info.server.Server;
|
||||||
|
import com.djrapitops.plan.system.info.server.ServerInfo;
|
||||||
import com.djrapitops.plan.system.settings.config.PlanConfig;
|
import com.djrapitops.plan.system.settings.config.PlanConfig;
|
||||||
import com.djrapitops.plan.system.settings.paths.DisplaySettings;
|
import com.djrapitops.plan.system.settings.paths.DisplaySettings;
|
||||||
import com.djrapitops.plan.system.settings.theme.Theme;
|
import com.djrapitops.plan.system.settings.theme.Theme;
|
||||||
@ -32,6 +33,7 @@ import com.djrapitops.plan.system.settings.theme.ThemeVal;
|
|||||||
import com.djrapitops.plan.system.update.VersionCheckSystem;
|
import com.djrapitops.plan.system.update.VersionCheckSystem;
|
||||||
import com.djrapitops.plan.utilities.formatting.Formatters;
|
import com.djrapitops.plan.utilities.formatting.Formatters;
|
||||||
import com.djrapitops.plan.utilities.formatting.PlaceholderReplacer;
|
import com.djrapitops.plan.utilities.formatting.PlaceholderReplacer;
|
||||||
|
import com.djrapitops.plan.utilities.html.Html;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -51,6 +53,7 @@ public class ServerPage implements Page {
|
|||||||
private final VersionCheckSystem versionCheckSystem;
|
private final VersionCheckSystem versionCheckSystem;
|
||||||
private final PlanFiles files;
|
private final PlanFiles files;
|
||||||
private final DBSystem dbSystem;
|
private final DBSystem dbSystem;
|
||||||
|
private final ServerInfo serverInfo;
|
||||||
private Formatters formatters;
|
private Formatters formatters;
|
||||||
|
|
||||||
ServerPage(
|
ServerPage(
|
||||||
@ -60,6 +63,7 @@ public class ServerPage implements Page {
|
|||||||
VersionCheckSystem versionCheckSystem,
|
VersionCheckSystem versionCheckSystem,
|
||||||
PlanFiles files,
|
PlanFiles files,
|
||||||
DBSystem dbSystem,
|
DBSystem dbSystem,
|
||||||
|
ServerInfo serverInfo,
|
||||||
Formatters formatters
|
Formatters formatters
|
||||||
) {
|
) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
@ -68,6 +72,7 @@ public class ServerPage implements Page {
|
|||||||
this.versionCheckSystem = versionCheckSystem;
|
this.versionCheckSystem = versionCheckSystem;
|
||||||
this.files = files;
|
this.files = files;
|
||||||
this.dbSystem = dbSystem;
|
this.dbSystem = dbSystem;
|
||||||
|
this.serverInfo = serverInfo;
|
||||||
this.formatters = formatters;
|
this.formatters = formatters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,11 +118,7 @@ public class ServerPage implements Page {
|
|||||||
AVG_PING_COLOR, MAX_PING_COLOR, MIN_PING_COLOR
|
AVG_PING_COLOR, MAX_PING_COLOR, MIN_PING_COLOR
|
||||||
);
|
);
|
||||||
|
|
||||||
if (server.isProxy()) {
|
placeholders.put("backButton", serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK.parse() : "");
|
||||||
placeholders.put("backButton", "<li><a title=\"to Network page\" href=\"/network\"><i class=\"material-icons\">arrow_back</i><i class=\"material-icons\">cloud</i></a></li>");
|
|
||||||
} else {
|
|
||||||
placeholders.put("backButton", "");
|
|
||||||
}
|
|
||||||
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
|
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
|
||||||
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
|
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ public class ServerPluginTabs {
|
|||||||
return "<div class=\"tab\"><div class=\"container-fluid mt-4\">" +
|
return "<div class=\"tab\"><div class=\"container-fluid mt-4\">" +
|
||||||
// Page heading
|
// Page heading
|
||||||
"<div class=\"d-sm-flex align-items-center justify-content-between mb-4\">" +
|
"<div class=\"d-sm-flex align-items-center justify-content-between mb-4\">" +
|
||||||
"<h1 class=\"h3 mb-0 text-gray-800\"><i class=\"sidebar-toggler fa fa-fw fa-bars\"></i><span class=\"server-name\"></span> · Plugins Overview</h1>" +
|
"<h1 class=\"h3 mb-0 text-gray-800\"><i class=\"sidebar-toggler fa fa-fw fa-bars\"></i><span class=\"server-name\"></span> · Plugins Overview</h1>${backButton}" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
// End Page heading
|
// End Page heading
|
||||||
"<div class=\"card-columns\">" + content + "</div></div></div>";
|
"<div class=\"card-columns\">" + content + "</div></div></div>";
|
||||||
|
@ -129,12 +129,7 @@
|
|||||||
<h1 class="h3 mb-0 text-gray-800"><i
|
<h1 class="h3 mb-0 text-gray-800"><i
|
||||||
class="sidebar-toggler fa fa-fw fa-bars"></i>${playerName}
|
class="sidebar-toggler fa fa-fw fa-bars"></i>${playerName}
|
||||||
· Player Overview</h1>
|
· Player Overview</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -324,12 +319,7 @@
|
|||||||
<h1 class="h3 mb-0 text-gray-800"><i
|
<h1 class="h3 mb-0 text-gray-800"><i
|
||||||
class="sidebar-toggler fa fa-fw fa-bars"></i>${playerName}
|
class="sidebar-toggler fa fa-fw fa-bars"></i>${playerName}
|
||||||
· Sessions</h1>
|
· Sessions</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -391,12 +381,7 @@
|
|||||||
<h1 class="h3 mb-0 text-gray-800"><i
|
<h1 class="h3 mb-0 text-gray-800"><i
|
||||||
class="sidebar-toggler fa fa-fw fa-bars"></i>${playerName}
|
class="sidebar-toggler fa fa-fw fa-bars"></i>${playerName}
|
||||||
· PvP & PvE</h1>
|
· PvP & PvE</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -524,12 +509,7 @@
|
|||||||
<h1 class="h3 mb-0 text-gray-800"><i
|
<h1 class="h3 mb-0 text-gray-800"><i
|
||||||
class="sidebar-toggler fa fa-fw fa-bars"></i>${playerName}
|
class="sidebar-toggler fa fa-fw fa-bars"></i>${playerName}
|
||||||
· Servers Overview</h1>
|
· Servers Overview</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -146,12 +146,7 @@
|
|||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· Server Overview</h1>
|
· Server Overview</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -324,12 +319,7 @@
|
|||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· Online Activity Overview</h1>
|
· Online Activity Overview</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -510,12 +500,7 @@
|
|||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· Sessions</h1>
|
· Sessions</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -589,12 +574,7 @@
|
|||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· PvP & PvE</h1>
|
· PvP & PvE</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -707,12 +687,7 @@
|
|||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· Playerbase Overview</h1>
|
· Playerbase Overview</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -860,12 +835,7 @@
|
|||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· Player List</h1>
|
· Player List</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -897,12 +867,7 @@
|
|||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· Geolocations</h1>
|
· Geolocations</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -959,12 +924,7 @@
|
|||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
<h1 class="h3 mb-0 text-gray-800"><i class="sidebar-toggler fa fa-fw fa-bars"></i>${serverDisplayName}
|
||||||
· Performance</h1>
|
· Performance</h1>
|
||||||
<a class="btn bg-plan btn-icon-split" href="network">
|
${backButton}
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
Loading…
Reference in New Issue
Block a user