{% extends 'admin-layout.html' %}



{% block title %}Home | Admin |Hiddify{% endblock %}
{% block body %}

{% macro admin_btn(child,domain) -%}
<div class="btn-group">
    
    <a href="https://{{domain}}/{{hconfig(ConfigEnum.proxy_path,child.id)}}/{{hconfig(ConfigEnum.admin_secret,child.id)}}/admin/"
        class="btn btn-xs btn-{{"success" if child.is_active else "warning"}} orig-link ltr" target="_blank">{{domain}}</a>
</div>
{%- endmacro -%}


<div class="card card-info">
    <div class="card-header">
        <h3 class="card-title">{{_('Childs')}}</h3>
    </div>
    <div class="card-body">
        <table>
            <tr><th></th><th>Status</th><th>{{_("Domain")}}</th></tr>

            %for child in childs
                <tr><td>{{child.id}} </td><td><span class="badge badge-{{"success" if child.is_active else "warning"}}">&nbsp{{icon('solid','check') if child.is_active else icon('solid','triangle-exclamation')}}</span>
                    % if not child.is_active
                    <a href="remove_child" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i></a>
                    %endif
                </td><td>
                    %for d in child.domains
                        {{admin_btn(child,d)}} 
                    %endfor
                </td></tr>
            %endfor
        </table>
    </div>

</div>
{% endblock%}