mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-07 00:48:24 +01:00
Show React version of /players page if opted to Frontend BETA
This commit is contained in:
parent
576485d20c
commit
5382049dcd
@ -86,7 +86,12 @@ public class PageFactory {
|
|||||||
this.locale = locale;
|
this.locale = locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayersPage playersPage() throws IOException {
|
public Page playersPage() throws IOException {
|
||||||
|
if (config.get().isTrue(PluginSettings.FRONTEND_BETA)) {
|
||||||
|
String reactHtml = getResource("index.html");
|
||||||
|
return () -> reactHtml;
|
||||||
|
}
|
||||||
|
|
||||||
return new PlayersPage(getResource("players.html"), versionChecker.get(),
|
return new PlayersPage(getResource("players.html"), versionChecker.get(),
|
||||||
config.get(), theme.get(), serverInfo.get());
|
config.get(), theme.get(), serverInfo.get());
|
||||||
}
|
}
|
||||||
@ -116,11 +121,17 @@ public class PageFactory {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerPage playerPage(UUID playerUUID) throws IOException {
|
public Page playerPage(UUID playerUUID) throws IOException {
|
||||||
Database db = dbSystem.get().getDatabase();
|
Database db = dbSystem.get().getDatabase();
|
||||||
PlayerContainer player = db.query(ContainerFetchQueries.fetchPlayerContainer(playerUUID));
|
PlayerContainer player = db.query(ContainerFetchQueries.fetchPlayerContainer(playerUUID));
|
||||||
|
|
||||||
|
if (config.get().isTrue(PluginSettings.FRONTEND_BETA)) {
|
||||||
|
String reactHtml = getResource("index.html");
|
||||||
|
return () -> reactHtml;
|
||||||
|
}
|
||||||
|
|
||||||
return new PlayerPage(
|
return new PlayerPage(
|
||||||
getResource(config.get().isTrue(PluginSettings.FRONTEND_BETA) ? "index.html" : "player.html"), player,
|
getResource("player.html"), player,
|
||||||
versionChecker.get(),
|
versionChecker.get(),
|
||||||
config.get(),
|
config.get(),
|
||||||
this,
|
this,
|
||||||
|
Loading…
Reference in New Issue
Block a user