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

% content_for 'module' => begin

<div class="card-body">

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

    % if ( stash 'error' ) {
        <br>
        <div class="text-danger">
            <%=  $c->render_to_string(inline => stash 'error') %>
        </div>
    % }

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

    <br>

    <h2><%= l 'bac_CONFIGURE_WORKSTN_BACKUP' %></h2>

    <br>

    <div>
        <%=  $c->render_to_string(inline => (l 'bac_WORKSTN_BACKUP_DESC')) %>
    </div>

    <br>

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

        <div>
            <%= l 'bac_WORKSTN_BACKUP_ENABLED' %>: <%=  $bac_datas->{status} %>
        </div>

        <br>

        <%=  $c->render_to_string(inline => $c->workstnBackupConfig()) %>

        <br>

        <h3><%= l 'bac_WORKSTATION_BACKUP_SETCONF' %></h3>

        <br>
        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                 <%= l 'bac_SELECT_VFS_TYPE' %>
            </div>
            <div class="col-auto">
                % param 'VFSType' => $bac_datas->{vfstype} unless param 'VFSType';
                 <%=  select_field 'VFSType' => $c->get_VFSType_options(), class => "form-select" %>
            </div>
        </div>

        <br>

        <%=  hidden_field 'Function' => $bac_datas->{'function'} . '1' %>

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

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary btn-sm" value="<%=$c->l('NEXT')%>"><%= $btn %></button>
            </div>
        </div>

    </form>

</div>

% end