Web Stats for Half-Life Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
6.2 KiB

{% extends 'default/layout.html.twig' %}
{% block main_content %}
{% for server in servers %}
<div class="border-default padding-8-px margin-y-8-px">
11 months ago
{% if server.info.HostName %}
<h2>{{ server.info.HostName }} [#{{ server.crc32server }}]</h2>
{% else %}
<h2>#{{ server.crc32server }}</h2>
{% endif %}
<hr />
<h3 class="padding-y-8-px text-align-right">{{ 'Address' | trans }}</h3>
<div>
{{ server.host }}:{{ server.port }}
{% if server.status %}
<span class="color-success" title="{{ 'online' | trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10"/>
</svg>
</span>
{% else %}
<span class="color-error" title="{{ 'offline' | trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10"/>
</svg>
</span>
{% endif %}
</div>
{% if server.aliases %}
<h3 class="padding-y-8-px text-align-right">{{ 'Aliases' | trans }}</h3>
{% for alias in server.aliases %}
<div>
{{ alias.host }}:{{ alias.port }}
{% if alias.status %}
<span class="color-success" title="{{ 'online' | trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10"/>
</svg>
</span>
{% else %}
<span class="color-error" title="{{ 'offline' | trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10"/>
</svg>
</span>
{% endif %}
</div>
{% endfor %}
{% endif %}
{% if server.info %}
<h3 class="padding-y-8-px text-align-right">{{ 'Info' | trans }}</h3>
<table>
{% for key, value in server.info %}
<tr>
<td class="text-align-left">{{ key }}</td>
<td class="text-align-left">{{ value }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% if server.session %}
<h3 class="padding-y-8-px text-align-right">{{ 'Session' | trans }}</h3>
<table>
<tr>
11 months ago
<th class="text-align-left">{{ 'Player' | trans }}</th>
<th class="text-align-center">{{ 'Frags' | trans }}</th>
<th class="text-align-center">{{ 'Time' | trans }}</th>
</tr>
{% for player in server.session %}
<tr>
<td class="text-align-left">{{ player.Name }}</td>
<td class="text-align-center">{{ player.Frags }}</td>
<td class="text-align-center">
{% if player.TimeF == '59:59' %}
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
<path d="M5.68 5.792 7.345 7.75 5.681 9.708a2.75 2.75 0 1 1 0-3.916ZM8 6.978 6.416 5.113l-.014-.015a3.75 3.75 0 1 0 0 5.304l.014-.015L8 8.522l1.584 1.865.014.015a3.75 3.75 0 1 0 0-5.304l-.014.015zm.656.772 1.663-1.958a2.75 2.75 0 1 1 0 3.916z"/>
</svg>
{% else %}
{{ player.TimeF }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% if server.online %}
<h3 class="padding-y-8-px text-align-right">
{{ 'Online' | trans }}
<a href="{{ path('rss_online', { crc32server : server.crc32server }) }}" title="{{ 'RSS' | trans }}"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm1.5 2.5c5.523 0 10 4.477 10 10a1 1 0 1 1-2 0 8 8 0 0 0-8-8 1 1 0 0 1 0-2m0 4a6 6 0 0 1 6 6 1 1 0 1 1-2 0 4 4 0 0 0-4-4 1 1 0 0 1 0-2m.5 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/>
</svg></a>
</h3>
<table>
<tr>
<th class="text-align-left">{{ 'Time' | trans }}</th>
<th class="text-align-center">{{ 'Players' | trans }}</th>
<th class="text-align-center">{{ 'Bots' | trans }}</th>
<th class="text-align-center">{{ 'Total' | trans }}</th>
</tr>
{% for online in server.online %}
<tr>
<td class="text-align-left">{{ online.time | format_datetime }}</td>
<td class="text-align-center">{{ online.players }}</td>
<td class="text-align-center">{{ online.bots }}</td>
<td class="text-align-center">{{ online.total }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
</div>
{% endfor %}
{% endblock %}