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.
 
 
 

94 lines
4.6 KiB

{% extends 'default/layout.html.twig' %}
{% block main_content %}
<h2>{{ 'Servers' | trans }}</h2>
<table class="margin-y-8-px">
<tr>
<th class="text-align-center">{{ 'Status' | trans }}</th>
<th class="text-align-left">{{ 'Name' | trans }}</th>
<th class="text-align-left">{{ 'Map' | trans }}</th>
<th class="text-align-left">{{ 'Added' | trans }}</th>
<th class="text-align-left">{{ 'Online' | trans }}</th>
<th class="text-align-center">{{ 'Players' | trans }}</th>
<th class="text-align-center">{{ 'Max' | trans }}</th>
<th class="text-align-center">{{ 'Bots' | trans }}</th>
<th class="text-align-center">{{ 'Actions' | trans }}</th>
</tr>
{% if servers %}
{% for server in servers %}
<tr>
<td class="text-align-center">
{% 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 %}
</td>
<td class="text-align-left">
{% if server.name %}
{{ server.name }}
{% elseif server.info.HostName %}
{{ server.info.HostName }}
{% else %}
#{{ server.crc32server }}
{% endif %}
</td>
<td class="text-align-left">
{{ server.info.Map }}
</td>
<td class="text-align-left">
<span title="{{ server.added | date('r') }}">
{{ server.added | format_ago }}
</span>
</td>
<td class="text-align-left">
<span title="{{ server.online | date('r') }}">
{% if server.status %}
{{ 'now' | trans }}
{% else %}
{{ server.online | format_ago }}
{% endif %}
</span>
</td>
<td class="text-align-center">
{% if server.status %}
{{ server.connections }}{#{{ server.info.Players }}#}
{% else %}
-
{% endif %}
</td>
<td class="text-align-center">
{% if server.status %}
{{ server.info.MaxPlayers }}
{% else %}
-
{% endif %}
</td>
<td class="text-align-center">
{% if server.status %}
{{ server.info.Bots }}
{% else %}
-
{% endif %}
</td>
<td class="text-align-center">
<a href="{{ path('server_index', { crc32server : server.crc32server }) }}" title="{{ 'Stats' | trans }}"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
<path d="M11 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v12h.5a.5.5 0 0 1 0 1H.5a.5.5 0 0 1 0-1H1v-3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3h1V7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v7h1z"/>
</svg></a>
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td class="text-align-center" colspan="9">{{ 'Not found' | trans }}</td>
</tr>
{% endif %}
</table>
{% endblock %}