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

% content_for 'module' => begin

<div class="card-body">

    %if (config->{debug} == 1) {
        <div>
            (DBG)route: <%= $c->current_route %><br>
        </div>
    % }

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

    <br>

    <%= $notif %>

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


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

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

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="LogFileSelect" class="col-form-label"><%=l 'log_LOG_FILE_SELECT_DESC' %></label>
            </div>
            <div class="col-auto">
                % param 'Filename' => 'messages';
                <!-- select_field 'Filename' => [['toto'], ['tata']], class => "" -->
                %= select_field 'Filename' => $c->findlogFiles(), class => "form-select", id => "LogFileSelect"
            </div>
        </div>

        <br>

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

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="LogFilterPattern" class="col-form-label"><%= l 'log_FILTER_PATTERN_LABEL' %></label>
            </div>
            <div class="col-auto">
                 <input type="text" name="Matchpattern" id="LogFilterPattern" class="form-control" aria-describedby="LogFilterPattern">
            </div>
        </div>


        <br>

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

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="LogHighlightpattern" class="col-form-label"><%= l 'log_MATCH_PATTERN_LABEL' %></label>
            </div>
            <div class="col-auto">
                 <input type="text" name="Highlightpattern" id="LogHighlightpattern" class="form-control" aria-describedby="LogHighlightpattern">
            </div>
        </div>

        <br>

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

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="LogOperation" class="col-form-label"><%= l 'log_OP_LABEL' %></label>
            </div>
            <div class="col-auto">
                %if ($log_datas->{'default_op'} eq 'download') {
                    % param 'Operation' => 'download';
                % }
                %= select_field 'Operation' => [[(l 'log_VIEW') => 'view'],[(l 'DOWNLOAD') => 'download']], class => "form-select", id => "LogOperation"
            </div>
        </div>

        <br>

        <div>
            <%= l 'log_END_DESC' %>
        </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>

    </form>

</div>

%end
