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

% content_for 'module' => begin

<div class="card-body">

    % if (config->{debug} == 1) {
    <div>
    (DBG)route: <%= $c->current_route %><br>
    (DBG)ht stat: <%= $prx_datas->{http_proxy_status}%> <br>
    (DBG)sm stat: <%=$prx_datas->{smtp_proxy_status} %>
    </div>
    % }
    <h1><%= $title %></h1>
    <br>
    <%= $modul %>

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

    <form action="/smanager/hostentriesd" method="POST">
    %#= form_for 'proxy' => (method => 'POST') => begin

    <div>
        <div>
            <%=l 'prx_HTTP_PROXY_STATUS_DESCRIPTION' %>
            
            <br><br>
    
            <div>
                <%=l 'prx_HTTP_PROXY_STATUS_LABEL' %>
            </div>
            
            <div>
                % 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']] %>
            </div>
        </div>
    
        % if ( $prx_datas->{smtp_proxy_status} ) {
            <div>
                <%=l 'prx_SMTP_PROXY_STATUS_DESCRIPTION' %>
            <br><br>
            <div>
                <%=l 'prx_SMTP_PROXY_STATUS_LABEL' %>
            </div>
            <div>
                % 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} %>
                <br><br>
            </div>
        % }

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

</div>

%end