% layout 'AdminLTE', title => "Sme server 2 - proxy";

% content_for 'module' => begin

<div class="card-body">

    % if (config->{debug} == 1) {
        <pre>
            <%= dumper $c->current_route %>
            <%= dumper $prx_datas->{http_proxy_status} %>
            <%= dumper $prx_datas->{smtp_proxy_status} %>
        </pre>
    % }


    <h1><%= $title %></h1>

    <br>

    <%= $modul %>

    <form action="/smanager/hostentriesd" method="POST">

        <br>

        <div>
           <%=l 'prx_HTTP_PROXY_STATUS_DESCRIPTION' %>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%=l 'prx_HTTP_PROXY_STATUS_LABEL' %>
            </div>
            <div class="col-auto">
                    % param 'http_proxy_status' => $prx_datas->{http_proxy_status} unless param 'http_proxy_status';
                    <%= select_field 'http_proxy_status' =>  [[ (l 'ENABLED') => 'enabled'], [ (l 'DISABLED') => 'disabled']], class => "form-select" %>
            </div>
        </div>

        % if ( $prx_datas->{smtp_proxy_status} ) {

            <br>

            <div>
                <%=l 'prx_SMTP_PROXY_STATUS_DESCRIPTION' %>
            </div>

            <br>

            <div class="row g-3 align-items-center">
                <div class="col-md-2">
                    <%=l 'prx_SMTP_PROXY_STATUS_LABEL' %>
                </div>
                <div class="col-auto">
                    % param 'smtp_proxy_status' => $prx_datas->{smtp_proxy_status} unless param 'smtp_proxy_status';
                    <%= select_field 'smtp_proxy_status' => [[ (l 'ENABLED') => 'transparent'], [ (l 'DISABLED') => 'disabled'], [ (l 'prx_BLOCKED') => 'blocked']], default => $prx_datas->{smtp_proxy_status} , class => "form-select" %>
                </div>
            </div>
        % }

        <br>

        % my $btn = l('SAVE');

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
            </div>
        </div>


    </form>

</div>

%end