Config setting for Players table footers #461

This commit is contained in:
Rsl1122 2017-12-06 16:01:55 +02:00
parent f080aa6442
commit 90c448afe5
5 changed files with 21 additions and 3 deletions

View File

@ -297,7 +297,10 @@ public class AnalysisData extends RawData {
long allTimePeak = profile.getAllTimePeak();
long lastPeak = profile.getLastPeakDate();
addValue("tablePlayerlist", Html.TABLE_PLAYERS.parse(profile.createPlayersTableBody()));
String playersTableBody = profile.createPlayersTableBody();
addValue("tablePlayerlist", Settings.PLAYERTABLE_FOOTER.isTrue() ?
Html.TABLE_PLAYERS_FOOTER.parse(playersTableBody)
: Html.TABLE_PLAYERS.parse(playersTableBody));
addValue("worldTotal", FormatUtils.formatTimeAmount(worldTimes.getTotal()));
String[] seriesData = WorldPieCreator.createSeriesData(worldTimes);
addValue("worldSeries", seriesData[0]);

View File

@ -28,6 +28,7 @@ public enum Settings {
DISPLAY_SESSIONS_AS_TABLE("Customization.Display.SessionsAsTable"),
APPEND_WORLD_PERC("Customization.Display.LargestWorldPercInSessionTitle"),
ORDER_WORLD_PIE_BY_PERC("Customization.Display.OrderWorldPieByPercentage"),
PLAYERTABLE_FOOTER("Customization.Display.PlayerTableFooter"),
WEBSERVER_DISABLED("WebServer.DisableWebServer"),
// Integer

View File

@ -68,7 +68,11 @@ public class PlayersPageResponse extends Response {
StringBuilder html = new StringBuilder("<table class=\"table table-bordered table-striped table-hover player-table dataTable\">");
TableContainer tableContainer = new TableContainer(userS, playtimeS, sessionsS, registeredS, lastSeenS, geolocationS);
html.append(tableContainer.parseHeader());
String header = tableContainer.parseHeader();
html.append(header);
if (Settings.PLAYERTABLE_FOOTER.isTrue()) {
html.append(header.replace("thead", "tfoot"));
}
try {
if (users.isEmpty()) {

View File

@ -64,7 +64,7 @@ public enum Html {
TABLE_SESSIONS(DIV_W_CLASS_STYLE.parse("box-footer scrollbar", "padding: 2px;",
TABLE_START_4.parse("Player", "Started", "Length", "World - Time") + "${3}" + TABLE_END.parse())
),
TABLE_PLAYERS("<table class=\"table table-bordered table-striped table-hover player-table dataTable\"><thead><tr>" +
TABLE_PLAYERS_FOOTER("<table class=\"table table-bordered table-striped table-hover player-table dataTable\"><thead><tr>" +
"<th><i class=\"fa fa-user\"></i> Name</th>" +
"<th><i class=\"fa fa-check\"></i> Activity Index</th>" +
"<th><i class=\"fa fa-clock-o\"></i> Playtime</th>" +
@ -80,6 +80,15 @@ public enum Html {
"<th><i class=\"fa fa-calendar-check-o\"></i> Last Seen</th>" +
"<th><i class=\"fa fa-globe\"></i> Geolocation</th>" +
"</tr></tfoot><tbody>${0}</tbody></table>"),
TABLE_PLAYERS("<table class=\"table table-bordered table-striped table-hover player-table dataTable\"><thead><tr>" +
"<th><i class=\"fa fa-user\"></i> Name</th>" +
"<th><i class=\"fa fa-check\"></i> Activity Index</th>" +
"<th><i class=\"fa fa-clock-o\"></i> Playtime</th>" +
"<th><i class=\"fa fa-calendar-plus-o\"></i> Sessions</th>" +
"<th><i class=\"fa fa-user-plus\"></i> Registered</th>" +
"<th><i class=\"fa fa-calendar-check-o\"></i> Last Seen</th>" +
"<th><i class=\"fa fa-globe\"></i> Geolocation</th></thead>" +
"<tbody>${0}</tbody></table>"),
TABLE_SESSIONS_START(TABLE_START_3.parse("Session Started", "Session Ended", "Session Length")),
TABLE_KILLS_START(TABLE_START_3.parse(FONT_AWESOME_ICON.parse("clock-o") + " Time", "Killed", "With")),
TABLE_FACTIONS_START(TABLE_START_4.parse(FONT_AWESOME_ICON.parse("flag") + " Faction", FONT_AWESOME_ICON.parse("bolt") + " Power", FONT_AWESOME_ICON.parse("map-o") + " Land", FONT_AWESOME_ICON.parse("user") + " Leader")),

View File

@ -84,6 +84,7 @@ Customization:
MaxSessions: 50
MaxPlayers: 2500
MaxPlayersPlayersPage: 25000
PlayerTableFooter: true
Formatting:
DecimalPoints: '#.##'
TimeAmount: