[2.8.0] Added gm chart back, minor fixes to html

This commit is contained in:
Rsl1122 2017-03-06 11:40:07 +02:00
parent 1abdc26a11
commit d6fe6af5a0
5 changed files with 114 additions and 81 deletions

View File

@ -45,7 +45,8 @@ public enum Html {
TOTAL_VOTES("<p>Players have voted total of " + REPLACE0 + " times.</p>"), TOTAL_VOTES("<p>Players have voted total of " + REPLACE0 + " times.</p>"),
PLOT_OPTIONS("<p>Plot options: " + REPLACE0 + "</p>"), PLOT_OPTIONS("<p>Plot options: " + REPLACE0 + "</p>"),
FRIENDS("<p>Friends with " + REPLACE0 + "</p>"), FRIENDS("<p>Friends with " + REPLACE0 + "</p>"),
BALANCE("<p>Balance: " + REPLACE0 + "</p>"), BANNED("| " + SPAN.parse(COLOR_4.parse() + "Banned")), BALANCE("<p>Balance: " + REPLACE0 + "</p>"),
BANNED("| " + SPAN.parse(COLOR_4.parse() + "Banned")),
OPERATOR(", Operator (Op)"), OPERATOR(", Operator (Op)"),
ONLINE("| " + SPAN.parse(COLOR_2.parse() + "Online")), ONLINE("| " + SPAN.parse(COLOR_2.parse() + "Online")),
OFFLINE("| " + SPAN.parse(COLOR_4.parse() + "Offline")), OFFLINE("| " + SPAN.parse(COLOR_4.parse() + "Offline")),

View File

@ -144,6 +144,10 @@ public class PlaceholderUtils {
replaceMap.put("%gm1%", FormatUtils.formatTimeAmount("" + gmData[1])); replaceMap.put("%gm1%", FormatUtils.formatTimeAmount("" + gmData[1]));
replaceMap.put("%gm2%", FormatUtils.formatTimeAmount("" + gmData[2])); replaceMap.put("%gm2%", FormatUtils.formatTimeAmount("" + gmData[2]));
replaceMap.put("%gm3%", FormatUtils.formatTimeAmount("" + gmData[3])); replaceMap.put("%gm3%", FormatUtils.formatTimeAmount("" + gmData[3]));
replaceMap.put("%gmdata%", Arrays.toString(gmData));
replaceMap.put("%gmlabels%", "[\"Survival\", \"Creative\", \"Adventure\", \"Spectator\"]");
replaceMap.put("%gmcolors%", "\"#" + Settings.HCOLOR_GMP_0 + "\",\"#" + Settings.HCOLOR_GMP_1
+ "\",\"#" + Settings.HCOLOR_GMP_2 + "\",\"#" + Settings.HCOLOR_GMP_3 + "\"");
replaceMap.put("%gmtotal%", FormatUtils.formatTimeAmount("" + total)); replaceMap.put("%gmtotal%", FormatUtils.formatTimeAmount("" + total));
replaceMap.put("%ips%", (showIPandUUID ? data.getIps().toString() : Html.HIDDEN.parse())); replaceMap.put("%ips%", (showIPandUUID ? data.getIps().toString() : Html.HIDDEN.parse()));
replaceMap.put("%nicknames%", HtmlUtils.removeXSS(FormatUtils.swapColorsToSpan(data.getNicknames().toString()))); replaceMap.put("%nicknames%", HtmlUtils.removeXSS(FormatUtils.swapColorsToSpan(data.getNicknames().toString())));

View File

@ -481,13 +481,13 @@
<table class="sortable table"> <table class="sortable table">
<thead> <thead>
<tr> <tr>
<th>Player</th> <th><i class="fa fa-user" aria-hidden="true"></i> Player</th>
<th>Active</th> <th><i class="fa fa-check" aria-hidden="true"></i> Active</th>
<th>Playtime</th> <th><i class="fa fa-clock-o" aria-hidden="true"></i> Playtime</th>
<th>Login times</th> <th><i class="fa fa-calendar-plus-o" aria-hidden="true"></i> Login times</th>
<th>Registered</th> <th><i class="fa fa-user-plus" aria-hidden="true"></i> Registered</th>
<th>Last seen</th> <th><i class="fa fa-calendar-check-o" aria-hidden="true"></i> Last seen</th>
<th>Geolocation</th> <th><i class="fa fa-globe" aria-hidden="true"></i> Geolocation</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -517,8 +517,8 @@
<table class="sortable table"> <table class="sortable table">
<thead> <thead>
<tr> <tr>
<th>Command</th> <th><i class="fa fa-chevron-right" aria-hidden="true"></i> Command</th>
<th>Times used</th> <th><i class="fa fa-list-ol" aria-hidden="true"></i> Times used</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -174,7 +174,7 @@
<header> <header>
<img style="float: right; padding: 5px" src="http://puu.sh/tJZUb/c2e0ab220f.png" alt="Player Analytics | Inspect %name%"> <img style="float: right; padding: 5px" src="http://puu.sh/tJZUb/c2e0ab220f.png" alt="Player Analytics | Inspect %name%">
<p style="float: right; text-align: right;">Player Analytics v.%version%</p> <p style="float: right; text-align: right;">Player Analytics v.%version%</p>
<h1>Plan | Inspect Player %name%</h1> <h1>Plan | Inspect Player %name%%op%</h1>
<h4>Has Connected from ips: %ips%</h4> <h4>Has Connected from ips: %ips%</h4>
</header> </header>
%inaccuratedatawarning% %inaccuratedatawarning%
@ -204,11 +204,11 @@
</div> </div>
</div> </div>
<img style="float: right; padding: 5px" alt="%name%" src="http://cravatar.eu/head/%name%/128.png"> <img style="float: right; padding: 5px" alt="%name%" src="http://cravatar.eu/head/%name%/128.png">
<p><i class="fa fa-user" aria-hidden="true"></i> %active% %isonline% %essentials% %banned%%op%<br/> <p><i class="fa fa-user" aria-hidden="true"></i> %active% %isonline%%banned% %essentials%<br/>
<i class="fa fa-address-card-o" aria-hidden="true"></i> Nicknames: %nicknames%<br/> <i class="fa fa-address-card-o" aria-hidden="true"></i> Nicknames: %nicknames%<br/>
<i class="fa fa-clock-o" aria-hidden="true"></i> Playtime: %playtime%<br/> <i class="fa fa-clock-o" aria-hidden="true"></i> Playtime: %playtime%<br/>
<i class="fa fa-calendar-plus-o" aria-hidden="true"></i> Login times %logintimes%<br/> <i class="fa fa-calendar-plus-o" aria-hidden="true"></i> Login times: %logintimes%<br/>
<i class="fa fa-gavel" aria-hidden="true"></i> Times kicked %timeskicked%<br/> <i class="fa fa-gavel" aria-hidden="true"></i> Times kicked: %timeskicked%<br/>
<i class="fa fa-crosshairs" aria-hidden="true"></i> Player kills: %playerkills% | <i class="fa fa-crosshairs" aria-hidden="true"></i> Mob kills: %mobkills% | <i class="fa fa-meh-o" aria-hidden="true"></i> Deaths: %deaths%<br/> <i class="fa fa-crosshairs" aria-hidden="true"></i> Player kills: %playerkills% | <i class="fa fa-crosshairs" aria-hidden="true"></i> Mob kills: %mobkills% | <i class="fa fa-meh-o" aria-hidden="true"></i> Deaths: %deaths%<br/>
<br/> <br/>
<i class="fa fa-globe" aria-hidden="true"></i> Geolocation: %geoloc%<br/> <i class="fa fa-globe" aria-hidden="true"></i> Geolocation: %geoloc%<br/>
@ -233,6 +233,7 @@
</div> </div>
</div> </div>
</div> </div>
<div>
<div class="box-area"> <div class="box-area">
<div class="infobox" style="background-color: #%gm0col%; width: 23%;"> <div class="infobox" style="background-color: #%gm0col%; width: 23%;">
<div class="info-icon"> <div class="info-icon">
@ -287,6 +288,10 @@
</div> </div>
</div> </div>
</div> </div>
<div class="column info">
<canvas id="gmPie" width="1000" height="600" style="width: 95%;"></canvas>
</div>
</div>
</div> </div>
<div class="column graphs"> <div class="column graphs">
<div class="headerbox"> <div class="headerbox">
@ -356,6 +361,29 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.js"></script>
<script> <script>
// Script for All charts using Chart.js // Script for All charts using Chart.js
var ctxgmpie = document.getElementById("gmPie");
var dataGmPie = {
labels: %gmlabels% ,
datasets: [
{
data: %gmdata% ,
backgroundColor: [ %gmcolors% ],
hoverBackgroundColor: [ %gmcolors% ]
}
]
}
var GMPie = new Chart(ctxgmpie, {
type: 'doughnut',
data: dataGmPie,
options: {
legend: {
position: 'right',
labels: {
padding: 7
}
}
}
});
var ctxweek = document.getElementById("playerChartWeek"); var ctxweek = document.getElementById("playerChartWeek");
var dataweek = { var dataweek = {
labels: %labelsweek% , labels: %labelsweek% ,

View File

@ -1,7 +1,7 @@
name: Plan name: Plan
author: Rsl1122 author: Rsl1122
main: main.java.com.djrapitops.plan.Plan main: main.java.com.djrapitops.plan.Plan
version: 2.7.3 version: 2.8.0
softdepend: softdepend:
- OnTime - OnTime