123 lines
4.2 KiB
HTML
123 lines
4.2 KiB
HTML
{{template "header" .}}
|
|
<h1>{{.server.Title}}</h1>
|
|
|
|
<a class="btn btn-default" {{.server.GameUrl |safe_href }} rel="nofollow">Launch game</a>
|
|
{{if .server.SiteUrl}}
|
|
<a class="btn btn-default" href="{{.server.SiteUrl}}" rel="nofollow">Homepage</a>
|
|
{{else}}
|
|
<button class="btn btn-default">No homepage</button>
|
|
{{end}}
|
|
|
|
<h3>Status</h3>
|
|
{{ if .server.TimeIsGreater 24}}
|
|
<p id="server_status" class="status_offline">
|
|
<span title="Offline: was not seen during the last week." class="glyphicon glyphicon-remove-sign"></span>
|
|
{{ else if .server.TimeIsGreater 1}}
|
|
<p id="server_status" class="status_unknown">
|
|
<span title="Unknown: was not seen during the last day." class="glyphicon glyphicon-question-sign"></span>
|
|
{{else}}
|
|
<p id="server_status" class="status_online">
|
|
<span title="Online: was seen during the last hour." class="glyphicon glyphicon-ok-sign"></span>
|
|
{{end}}
|
|
<span id="timestamp" onmouseover="timestamp_tooltip({{.server.Timestamp}})" onmouseout="hide_tooltip()">
|
|
Last seen <span class="bold">{{.server.TimeSince}}</span> ago.
|
|
</span>
|
|
</p>
|
|
|
|
<h3>Players</h3>
|
|
<table id="player_stats" class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>Currently online</th>
|
|
<th>Average</th>
|
|
<th>Min</th>
|
|
<th>Max</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<th>{{.server.PlayersCurrent}}</th>
|
|
<th>{{.server.PlayersAvg}}</th>
|
|
<th>{{.server.PlayersMin}}</th>
|
|
<th>{{.server.PlayersMax}}</th>
|
|
</tr>
|
|
</table>
|
|
|
|
<h3>History</h3>
|
|
<b>Last week</b>
|
|
<div id="weekhistory"></div>
|
|
<b>Last month</b>
|
|
<div id="monthhistory"></div>
|
|
<h3>Average per day</h3>
|
|
<b> Last month</b>
|
|
<div id="weekdayavg"></div>
|
|
<div id="tooltip"></div>
|
|
|
|
<script type="text/javascript" src="/static/js/utils.js"></script>
|
|
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
|
|
<script type="text/javascript" src="/static/js/jquery.flot.js"></script>
|
|
<script type="text/javascript" src="/static/js/jquery.flot.time.js"></script>
|
|
<script type="text/javascript" src="/static/js/jquery.flot.categories.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var data = [
|
|
{{range .weekhistory}}[{{.Timestamp |inms}}, {{.Players}}], {{end}}
|
|
];
|
|
$.plot("#weekhistory", [data], {
|
|
xaxis: {
|
|
mode: "time",
|
|
timezone: "browser",
|
|
},
|
|
lines: {
|
|
show: true,
|
|
fill: true,
|
|
},
|
|
grid: {
|
|
hoverable: true,
|
|
borderWidth: 0,
|
|
},
|
|
});
|
|
|
|
var data = [
|
|
{{range .monthhistory}}[{{.Timestamp |inms}}, {{.Players}}], {{end}}
|
|
];
|
|
$.plot("#monthhistory", [data], {
|
|
xaxis: {
|
|
mode: "time",
|
|
timezone: "browser",
|
|
},
|
|
lines: {
|
|
show: true,
|
|
fill: true,
|
|
},
|
|
grid: {
|
|
hoverable: true,
|
|
borderWidth: 0,
|
|
},
|
|
});
|
|
|
|
var data= [
|
|
{{range .weekdayavg}}[{{.Day}}, {{.Players}}], {{end}}
|
|
];
|
|
$.plot("#weekdayavg", [data], {
|
|
xaxis: {
|
|
mode: "categories",
|
|
},
|
|
bars: {
|
|
show: true,
|
|
barWidth: 0.75,
|
|
align: "center",
|
|
},
|
|
grid: {
|
|
hoverable: true,
|
|
borderWidth: 0,
|
|
},
|
|
});
|
|
|
|
$("#weekhistory").bind("plothover", players_at_tooltip);
|
|
$("#monthhistory").bind("plothover", players_at_tooltip);
|
|
$("#weekdayavg").bind("plothover", players_tooltip);
|
|
});
|
|
</script>
|
|
{{template "footer"}}
|