{% extends "layout.twig" %} {% block title %}{{ server.name }}{% endblock %} {% block content %}
{{ server.host }}
| {{ t('clients.name') }} | {{ t('clients.ip') }} | {{ t('clients.status') }} | {{ t('clients.expiration') }} | {{ t('clients.traffic') }} | {{ t('clients.traffic_limit') }} | {{ t('clients.last_handshake') }} | {{ t('clients.actions') }} |
|---|---|---|---|---|---|---|---|
| {{ client.name }} | {{ client.client_ip }} | {% if client.status == 'active' %} {{ t('status.active') }} {% else %} {{ t('status.disabled') }} {% endif %} | {% if client.expires_at %} {% set expires_ts = client.expires_at|date('U') %} {% set now_ts = "now"|date('U') %} {% set diff_days = ((expires_ts - now_ts) / 86400)|round %} {% if diff_days < 0 %} {{ t('clients.expired') }} {% elseif diff_days <= 7 %} {{ diff_days }} {{ t('common.days') }} {% else %} {{ client.expires_at|date('Y-m-d') }} {% endif %} {% else %} {{ t('clients.never_expires') }} {% endif %} |
↑ {{ (client.bytes_sent|default(0) / 1024 / 1024)|number_format(2) }} MB
↓ {{ (client.bytes_received|default(0) / 1024 / 1024)|number_format(2) }} MB
|
{% if client.traffic_limit %} {% set total_traffic = (client.bytes_sent|default(0) + client.bytes_received|default(0)) %} {% set limit_gb = (client.traffic_limit / 1073741824)|number_format(2) %} {% set used_gb = (total_traffic / 1073741824)|number_format(2) %} {% set percentage = ((total_traffic / client.traffic_limit) * 100)|round %} {% if percentage >= 100 %} {{ t('clients.overlimit') }} {% elseif percentage >= 80 %} {{ used_gb }} / {{ limit_gb }} GB ({{ percentage }}%) {% else %} {{ used_gb }} / {{ limit_gb }} GB {% endif %} {% else %} {{ t('clients.unlimited') }} {% endif %} | {% if client.last_handshake %} {{ client.last_handshake }} {% else %} {{ t('clients.never') }} {% endif %} | {{ t('servers.view') }} {% if client.status == 'active' %} {% else %} {% endif %} |