mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-02 14:37:45 +01:00
Changed sessionAccordion to use player names
Player names were in use previously, but changed to uuids to reduce odd player name issues (On cracked servers the names can be whatever) Encoded the playernames to URL (new session json parameter) and added that to sessionAccordion Affects issues: - Fixed #1269
This commit is contained in:
parent
d2b3b86154
commit
d22c850253
@ -21,6 +21,7 @@ import com.djrapitops.plan.delivery.domain.container.DataContainer;
|
||||
import com.djrapitops.plan.delivery.domain.keys.CommonKeys;
|
||||
import com.djrapitops.plan.delivery.domain.keys.SessionKeys;
|
||||
import com.djrapitops.plan.delivery.formatting.Formatters;
|
||||
import com.djrapitops.plan.delivery.rendering.html.Html;
|
||||
import com.djrapitops.plan.delivery.rendering.json.graphs.Graphs;
|
||||
import com.djrapitops.plan.delivery.rendering.json.graphs.pie.WorldPie;
|
||||
import com.djrapitops.plan.gathering.domain.PlayerKill;
|
||||
@ -265,8 +266,10 @@ public class SessionsMutator {
|
||||
return Lists.map(sessions, session -> {
|
||||
Map<String, Object> sessionMap = new HashMap<>();
|
||||
sessionMap.put("player_name", session.getValue(SessionKeys.NAME).orElse(session.getUnsafe(SessionKeys.UUID).toString()));
|
||||
sessionMap.put("player_url_name", Html.encodeToURL((String) sessionMap.get("player_name")));
|
||||
sessionMap.put("player_uuid", session.getUnsafe(SessionKeys.UUID).toString());
|
||||
sessionMap.put("server_name", session.getValue(SessionKeys.SERVER_NAME).orElse(session.getUnsafe(SessionKeys.SERVER_UUID).toString()));
|
||||
sessionMap.put("server_url_name", Html.encodeToURL((String) sessionMap.get("server_name")));
|
||||
sessionMap.put("server_uuid", session.getUnsafe(SessionKeys.SERVER_UUID).toString());
|
||||
sessionMap.put("name", nameFunction.apply(sessionMap));
|
||||
sessionMap.put("start", session.getValue(SessionKeys.START).map(formatters.yearLong()).orElse("-") +
|
||||
|
@ -90,8 +90,8 @@ function createAccordionBody(i, session) {
|
||||
createKillsTable(session.player_kills) +
|
||||
'</div><div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">' +
|
||||
'<div id="worldpie_' + i + '" class="chart-pie"></div>' +
|
||||
'<a href="' + (session.network_server ? './player/' : '../player/') + session.player_uuid + '" class="float-right btn bg-blue"><i class="fa fa-user"></i><span> Player Page</span></a>' +
|
||||
(session.network_server ? '<a href="./server/' + session.server_uuid + '" class="float-right btn bg-light-green mr-2"><i class="fa fa-server"></i><span> Server Analysis</span></a>' : '') +
|
||||
'<a href="' + (session.network_server ? './player/' : '../player/') + session.player_url_name + '" class="float-right btn bg-blue"><i class="fa fa-user"></i><span> Player Page</span></a>' +
|
||||
(session.network_server ? '<a href="./server/' + session.server_url_name + '" class="float-right btn bg-light-green mr-2"><i class="fa fa-server"></i><span> Server Analysis</span></a>' : '') +
|
||||
'</div>' +
|
||||
'</div></td></tr>'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user