%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-01-20 16:21:33 
%#
<div>
    <script>
        window.onload = function() {
        SelectInput(); 
    };

    </script>
    % if (config->{debug} == 1) {
        <pre>
            %= dumper $nut_data
        </pre>
    % }

    % my $btn = l('nut_APPLY');
    %= form_for "nutupsu" => (method => 'POST') => begin
        % param 'trt' => $nut_data->{trt} unless param 'trt';
        %= hidden_field 'trt' => $nut_data->{trt}
        %# Inputs etc in here.

        <h2 class=""><%=l('nut_Manage_Nutups-config_settings:')%></h2>
    
        <p>
        <span class="">
            %=l('nut_Nut_status')
        </span>
        <span class="">
            %# my @status_options = [['Disabled' => 'disabled'], ['Enabled' => 'enabled']];
            %# param 'status' => $nut_data->{status} unless param 'status';

            % my @status_options = selected_field([['Disabled' => 'disabled'], ['Enabled' => 'enabled']], $nut_data->{status});
            %= select_field 'status' => @status_options, class => "", id => ""
        <br>
        </span>
        </p>
    
        <p>
        <span class="">
            %=l('nut_Nut_mode')
        </span>
        <span class="">
            % my @Nutmode_options = [['Standalone' => 'standalone'], ['Net Server' => 'netserver'], ['Net Client ' => 'netclient']];
            % param 'Nutmode' => $nut_data->{Nutmode} unless param 'Nutmode';
            %= select_field 'Nutmode' => @Nutmode_options, class => "", id => ""
        <br>
        </span>
        </p>
    
        <div class="">
            <h2 class=""><%=l('nut_if_Net_Server')%></h2>
        
            <p>
            <span class="">
                %=l('nut_MasterUPS_UPSNAME@IP')
            </span>
            <span class="">
                % param 'MasterUPS_Name' => $nut_data->{MasterUPS_Name} unless param 'MasterUPS_Name';
                %= text_field 'MasterUPS_Name', size => '50', class => "" , pattern=>'.*' , placeholder=>'ups@localhost'
            <br>
            </span>
            </p>

            <p>
            <span class="">
                %=l('nut_MasterUPS_Password')
            </span>
            <span class="">
                % param 'MasterUPS_Password' => $nut_data->{MasterUPS_Password} unless param 'MasterUPS_Password';
                %=password_field 'MasterUPS_Password', class => ""
            </span>
            </p>

            <p>
            <span class="">
                %=l('nut_UPS_Model')
            </span>
            <span class="">
                % my @UPS_Model_options = $c->get_model_options();
                % param 'UPS_Model' => $nut_data->{UPS_Model} unless param 'UPS_Model';
                %= select_field 'UPS_Model' => \@UPS_Model_options, class => "", id => ""
            <br>
            </span></p>

            <p><span class="">
                %=l('nut_UPS_Device')
            </span><span class="">
                % param 'UPS_Device' => $nut_data->{UPS_Device} unless param 'UPS_Device';
                %= text_field 'UPS_Device', size => '50', class => "" , pattern=>'.*' , placeholder=>'auto (for usb)'
            <br></span></p>
        </div>
        
        <div class="">
            <h2 class=""><%=l('nut_if_Net_Client')%></h2>
            <p>
            <span class="">
                %=l('nut_SlaveUPS_UPSNAME@IP')
            </span>
            <span class="">
                % param 'SlaveUPS_Name' => $nut_data->{SlaveUPS_Name} unless param 'SlaveUPS_Name';
                %= text_field 'SlaveUPS_Name', size => '50', class => "" , pattern=>'.*' , placeholder=>'upsname@IP'
            <br>
            </span>
            </p>
        
            <p>
            <span class="">
                %=l('nut_SlaveUPS_Password')
            </span>
            <span class="">
                % param 'SlaveUPS_Password' => $nut_data->{SlaveUPS_Password} unless param 'SlaveUPS_Password';
                %=password_field 'SlaveUPS_Password', class => ""
            </span>
            </p>
        </div>
    
        <div class="">
`           <h2 class=""><%=l('nut_if_genericups')%></h2>
            <p>
            <span class="">
                %=l('nut_UPS_Generic_Type')
            </span>
            <span class="">
                % param 'UPS_gen_Type' => $nut_data->{UPS_gen_Type} unless param 'UPS_gen_Type';
                %= text_field 'UPS_gen_Type', size => '50', class => "" , pattern=>'.*' , placeholder=>'UPS_gen_Type'
            <br>
            </span>
            </p>
        
            <p>
            <span class="">
                %=l('nut_UPS_Generic_Manufacturer')
            </span>
            <span class="">
                % param 'UPS_gen_Mfr' => $nut_data->{UPS_gen_Mfr} unless param 'UPS_gen_Mfr';
                %= text_field 'UPS_gen_Mfr', size => '50', class => "" , pattern=>'.*' , placeholder=>'UPS_gen_Mfr'
            <br>
            </span>
            </p>
        
            <p>
            <span class="">
                %=l('nut_UPS_Generic_Model')
            </span>
            <span class="">
                % param 'UPS_gen_Model' => $nut_data->{UPS_gen_Model} unless param 'UPS_gen_Model';
                %= text_field 'UPS_gen_Model', size => '50', class => "" , pattern=>'.*' , placeholder=>'UPS_gen_Model'
            <br>
            </span>
            </p>
`       </div>
            
        <span class="">
            %= submit_button l('nut_Save'), class => ""
        </span>
    

        
    
        %# Probably finally by a submit.
    %end    
</div>