{% set sa_id_str = sa.id | string %} {% set link_info = sub_admin_links.get(sa.id) %} {% set now_str = now_date_str %}
{% if sa.allocation_mode == 'credit' %} {% else %} {% endif %}

{{ sa.username }}

{% if sa.is_active %} Active {% else %} {% if sa.allocation_mode == 'credit' and sa.quota_exceeded %} No Balance {% elif sa.allocation_mode != 'credit' and sa.quota_exceeded %} Quota Exceeded {% elif sa.expiry_date and sa.expiry_date.strftime('%Y-%m-%d') < now_str %} Expired {% else %} Manually Disabled {% endif %} {% endif %} {% if sa.allocation_mode == 'credit' %} Pay-As-You-Go {% endif %}
{% if sa.allocation_mode == 'credit' %}
Wallet Balance {% if sa.currency_unit == 'DOLLAR' %} $ {{ "{:,.4f}".format(sa.wallet_balance).rstrip('0').rstrip('.') }} {% else %} {{ "{:,.0f}".format(sa.wallet_balance) }} T {% endif %}
Total Usage
{{ sa.total_data_used_bytes|format_bytes }}
Rate {% if sa.currency_unit == 'DOLLAR' %} $ {{ "{:,.4f}".format(sa.price_per_gb).rstrip('0').rstrip('.') }} / GB {% else %} {{ "{:,.0f}".format(sa.price_per_gb) }} T / GB {% endif %}
{% else %}
Users {{ user_count }} / {{ sa.max_users_limit if sa.max_users_limit is not none else '∞' }}
Expiry Date {{ sa.expiry_date | jalali_date if sa.expiry_date else 'Unlimited' }}
Data Usage
{{ sa.total_data_used_bytes|format_bytes }} / {{ (sa.total_usage_quota_gb * 1024**3)|format_bytes if sa.total_usage_quota_gb is not none else '∞' }}
{% endif %}
Panel Access
{% if link_info and link_info.is_custom %} Dedicated Domain {% endif %} {% if link_info and link_info.has_custom_path %} /r/{{ link_info.panel_path }} {% endif %}
{% if link_info and link_info.protocol == 'https' %} {% else %} {% endif %}
{% if link_info and link_info.url %} {% endif %}
{% set extra_wg = sa.allowed_wg_instances | from_json | reject('equalto', 'wg1') | list %} {% set singbox_list = sa.allowed_singbox_inbounds | from_json %} {% if sa.allow_openvpn or sa.allow_l2tp or sa.allow_cisco or sa.allow_wg1 or extra_wg or singbox_list %}
Protocols
{% if sa.allow_openvpn %} OpenVPN {% endif %} {% if sa.allow_l2tp %} L2TP {% endif %} {% if sa.allow_cisco %} Cisco {% endif %} {% if sa.allow_wg1 %} WireGuard {% endif %} {% for name in extra_wg %} {{ wg_instance_display_map.get(name, name) if wg_instance_display_map else name }} {% endfor %} {% for tag in singbox_list %} {{ (singbox_inbound_type_map.get(tag, tag) if singbox_inbound_type_map else tag) | upper }}{% if singbox_inbound_port_map and singbox_inbound_port_map.get(tag) %}:{{ singbox_inbound_port_map.get(tag) }}{% endif %} {% endfor %}
{% endif %}