mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-24 16:14:26 +08:00
Fixed players page links with directory reverse-proxies
This commit is contained in:
parent
6f73af4719
commit
c6507016cd
@ -110,7 +110,8 @@ public class JSONFactory {
|
||||
database.query(new NetworkTablePlayersQuery(System.currentTimeMillis(), playtimeThreshold, xMostRecentPlayers)),
|
||||
pluginData,
|
||||
openPlayerLinksInNewTab,
|
||||
formatters, locale
|
||||
formatters, locale,
|
||||
true // players page
|
||||
).toJSONMap();
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ public class PlayersTableJSONCreator {
|
||||
private final List<ExtensionDescription> extensionDescriptions;
|
||||
private final Map<UUID, ExtensionTabData> extensionData;
|
||||
private final Locale locale;
|
||||
private final boolean playersPage;
|
||||
|
||||
private final boolean openPlayerPageInNewTab;
|
||||
|
||||
@ -61,11 +62,24 @@ public class PlayersTableJSONCreator {
|
||||
boolean openPlayerPageInNewTab,
|
||||
Formatters formatters,
|
||||
Locale locale
|
||||
) {
|
||||
this(players, extensionData, openPlayerPageInNewTab, formatters, locale, false);
|
||||
}
|
||||
|
||||
public PlayersTableJSONCreator(
|
||||
List<TablePlayer> players,
|
||||
Map<UUID, ExtensionTabData> extensionData,
|
||||
// Settings
|
||||
boolean openPlayerPageInNewTab,
|
||||
Formatters formatters,
|
||||
Locale locale,
|
||||
boolean playersPage
|
||||
) {
|
||||
// Data
|
||||
this.players = players;
|
||||
this.extensionData = extensionData;
|
||||
this.locale = locale;
|
||||
this.playersPage = playersPage;
|
||||
|
||||
extensionDescriptions = new ArrayList<>();
|
||||
addExtensionDescriptions(extensionData);
|
||||
@ -122,7 +136,8 @@ public class PlayersTableJSONCreator {
|
||||
|
||||
private void addPlayerData(Map<String, Object> dataJson, TablePlayer player) {
|
||||
String name = player.getName().orElse(player.getPlayerUUID().toString());
|
||||
String url = "../player/" + Html.encodeToURL(player.getPlayerUUID().toString());
|
||||
String url = (playersPage ? "./player/" : "../player/") +
|
||||
Html.encodeToURL(player.getPlayerUUID().toString());
|
||||
|
||||
int loginTimes = player.getSessionCount().orElse(0);
|
||||
long activePlaytime = player.getActivePlaytime().orElse(-1L);
|
||||
|
@ -38,7 +38,7 @@
|
||||
<hr class="sidebar-divider my-0">
|
||||
|
||||
<li class="nav-item nav-button active">
|
||||
<a class="nav-link" href="/">
|
||||
<a class="nav-link" href="./">
|
||||
<i class="fas fa-fw fa-arrow-left"></i>
|
||||
<span>to main page</span></a>
|
||||
</li>
|
||||
@ -65,7 +65,7 @@
|
||||
<button class="btn bg-plan" data-target="#informationModal" data-toggle="modal" type="button">
|
||||
<i class="fa fa-fw fa-question-circle"></i>
|
||||
</button>
|
||||
<a class="btn bg-plan" href="auth/logout" id="logout-button">
|
||||
<a class="btn bg-plan" href="./auth/logout" id="logout-button">
|
||||
<i class="fa fa-fw fa-door-open"></i> Logout
|
||||
</a>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user