[#708] Added "back" links

- Added a back link /server -> /network if on a network
- Added a back link /player -> /server if on a server
- Added a back link /player -> /network if on a network
This commit is contained in:
Rsl1122 2019-01-04 17:11:49 +02:00
parent ff266893d1
commit 7621167407
4 changed files with 15 additions and 6 deletions

View File

@ -23,6 +23,7 @@ import com.djrapitops.plan.system.file.PlanFiles;
import com.djrapitops.plan.system.update.VersionCheckSystem;
import com.djrapitops.plan.utilities.formatting.Formatter;
import com.djrapitops.plan.utilities.formatting.PlaceholderReplacer;
import com.djrapitops.plugin.api.Check;
import com.djrapitops.plugin.benchmarking.Timings;
import java.io.IOException;
@ -74,6 +75,11 @@ public class AnalysisPage implements Page {
TPS_LOW_COLOR, WORLD_MAP_HIGH_COLOR, WORLD_MAP_LOW_COLOR,
AVG_PING_COLOR, MAX_PING_COLOR, MIN_PING_COLOR
);
if (Check.isBungeeAvailable() || Check.isVelocityAvailable()) {
placeholderReplacer.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 {
placeholderReplacer.put("backButton", "");
}
placeholderReplacer.put("update", versionCheckSystem.getUpdateHtml().orElse(""));
playersTable(placeholderReplacer);
sessionStructures(placeholderReplacer);

View File

@ -45,6 +45,7 @@ import com.djrapitops.plan.utilities.html.structure.Accordions;
import com.djrapitops.plan.utilities.html.structure.ServerAccordion;
import com.djrapitops.plan.utilities.html.structure.SessionAccordion;
import com.djrapitops.plan.utilities.html.tables.HtmlTables;
import com.djrapitops.plugin.api.Check;
import com.djrapitops.plugin.api.TimeAmount;
import com.djrapitops.plugin.benchmarking.Timings;
@ -252,6 +253,12 @@ public class InspectPage implements Page {
: serverName
);
if (Check.isBungeeAvailable() || Check.isVelocityAvailable()) {
replacer.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 {
replacer.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>");
}
return replacer.apply(files.readCustomizableResourceFlat("web/player.html"));
}

View File

@ -87,9 +87,7 @@
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<!-- Call Search (Disabled)
<li><a href="javascript:void(0);" class="js-search" data-close="true"><i class="material-icons">search</i></a></li>
<!-- #END# Call Search -->
${backButton}
<li class="pull-right"><a href="javascript:void(0);" class="js-right-sidebar" data-close="true"><i
class="material-icons">settings</i></a></li>
</ul>

View File

@ -87,9 +87,7 @@
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<!-- Call Search (Disabled)
<li><a href="javascript:void(0);" class="js-search" data-close="true"><i class="material-icons">search</i></a></li>
<!-- #END# Call Search -->
${backButton}
<li class="pull-right"><a href="javascript:void(0);" class="js-right-sidebar" data-close="true"><i
class="material-icons">settings</i></a></li>
</ul>