aboutsummaryrefslogtreecommitdiff
path: root/util/master/servers.jst
blob: 54eea28425134ff564a4a1b5bb8b2eda853d961b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{{? !master.no_total}}
<div class="total">
	Players: {{=it.total.clients}}/{{=it.total_max.clients}}&nbsp;
	Servers: {{=it.total.servers}}/{{=it.total_max.servers}}
</div>
{{?}}
<table>
	<tr>
		{{? !master.no_address}}<th>IP[:Port]</th>{{?}}
		{{? !master.no_clients}}<th>Players/Max{{? !master.no_avgtop}}<br/>Avg/Top{{?}}</th>{{?}}
		{{? !master.no_version}}<th>Version, Gameid, MapGen</th>{{?}}
		{{? !master.no_name}}<th>Name</th>{{?}}
		{{? !master.no_description}}<th>Description</th>{{?}}
		{{? !master.no_flags}}<th>Flags</th>{{?}}
		{{? !master.no_uptime}}<th>Uptime, Age</th>{{?}}
		{{? !master.no_ping}}<th>Ping, Lag</th>{{?}}
	</tr>
	{{~it.list :server:index}}
	{{ if (master.limit && index + 1 > master.limit) break;}}
	{{ if (master.min_clients && server.clients < master.min_clients) continue;}}
	<tr>
		{{? !master.no_address}}
		<td class ="address">
			{{=addressString(server)}}
		</td>{{?}}
		{{? !master.no_clients}}
		<td class="clients{{? server.clients_list && server.clients_list.length > 0}} mts_hover_list_text{{?}}">
			{{=server.clients}}/{{=server.clients_max}}{{? !master.no_avgtop}} &nbsp;&nbsp;{{=Math.floor(server.pop_v)}}/{{=server.clients_top}}{{?}}
			{{=hoverList("Clients", server.clients_list)}}
		</td>{{?}}
		{{? !master.no_version}}
		<td class="version{{? server.mods && server.mods.length > 0}} mts_hover_list_text{{?}}">
			{{=escapeHTML(server.version)}}, {{=escapeHTML(server.gameid)}},&nbsp;
			{{=escapeHTML(server.mapgen || '?')}}
			{{=hoverList("Mods", server.mods)}}
		</td>{{?}}
		{{? !master.no_name}}
		<td class="name">
			{{? server.url}}
				<a href="{{=escapeHTML(server.url)}}">{{=tooltipString(server.name, 25)}}</a>
			{{??}}
				{{=tooltipString(server.name, 25)}}
			{{?}}
		</td>{{?}}
		{{? !master.no_description}}
		<td class="description">
			{{=tooltipString(server.description, 50)}}
		</td>{{?}}
		{{? !master.no_flags}}
		<td class="flags {{? server.privs}} mts_hover_list_text{{?}}">
			{{=hoverString("Privs", server.privs)}}
			{{=server.creative ? 'Cre ' : ''}}
			{{=server.dedicated ? 'Ded ' : ''}}
			{{=server.damage ? 'Dmg ' : ''}}
			{{=server.liquid_finite ? 'Liq ' : ''}}
			{{=server.pvp ? 'PvP ' : ''}}
			{{=server.password ? 'Pwd ' : ''}}
			{{=server.rollback ? 'Rol ' : ''}}
			{{=server.can_see_far_names ? 'Far ' : ''}}
		</td>{{?}}
		{{? !master.no_uptime}}
		<td class="uptime">
			{{=humanTime(server.uptime)}}, {{=humanTime(server.game_time)}}
		</td>{{?}}
		{{? !master.no_ping}}
		<td class="ping">
			{{=Math.floor(server.ping * 1000)}}{{? server.lag}}, {{= Math.floor(server.lag * 1000)}}{{?}}
		</td>{{?}}
	</tr>
	{{~}}
</table>
{{? master.min_clients || master.limit}}
	<a class="clickable" onclick="delete master.min_clients; delete master.limit; get();">More...</a>
{{?}}