%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-01 15:22:43
%#
<div>

<!-- reetp Move to JS file -->
    <!--
    <script>
        window.onload = function() {
        SelectInput();
    };
    </script>
    -->

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


    <br>

    <!-- reetp  could change this to a form -->

    <!-- <form action="/smanager/letsencryptu" method="POST"> -->

        %# my $btn = l('lets_APPLY');
        %# param 'trt' => $lets_data->{trt} unless param 'trt';
        %#= hidden_field 'trt' => $lets_data->{trt}

        % my $linkbtn = l ('MODIFY');

        %# Inputs etc in here.
        %# reetp Needs some language translations?
        <div class="row g-3 align-items-center">
            <div class="col-md-1">
                <%= l('lets_CONFIG') %>
            </div>
            <div class="col-auto">
                <a href='letsencryptd?trt=PARAMS' class="btn btn-outline-primary btn-sm" role="button"><%= $linkbtn %></a>
            </div>
        </div>

        <br>

        %#= link_to l('lets_CONFIG'), 'letsencryptd?trt=PARAMS' , class=> 'link link2'

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
                <%= l ('lets_CHECK_ALL_DOMAINS') %>
            </div>
            <div class="col-auto">
                <a href='letsencryptd?trt=CHECKALLDOMAINS' class="btn btn-outline-primary btn-sm" role="button"><%= $linkbtn %></a>
            </div>
        </div>

        %#= link_to l('lets_CHECK_ALL_DOMAINS'), 'letsencryptd?trt=CHECKALLDOMAINS' , class=> 'link link3'

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
                <%= l ('lets_CHECK_ALL_ENABLED_DOMAINS') %>
            </div>
            <div class="col-auto">
                <a href='letsencryptd?trt=CHECKALLENABLEDDOMAINS' class="btn btn-outline-primary btn-sm" role="button"><%= $linkbtn %></a>
            </div>
        </div>

        %#= link_to l('lets_CHECK_ALL_ENABLED_DOMAINS'), 'letsencryptd?trt=CHECKALLENABLEDDOMAINS' , class=> 'link link4'


    <!-- </form>  -->


        <br><br>

        <h2><%=l('lets_For_this_Server') %></h2>

        <br>

            <div class="row g-3 align-items-center">
                <div class="col-md-1">
                    <%= l ('lets_Internal_IP') %>
                </div>
                <div class="col-auto">
                    % param 'InternalIP' => $lets_data->{InternalIP} unless param 'InternalIP';
                    %= text_field 'InternalIP', size => '50', class => "" , pattern=>'.*' , placeholder=>'InternalIP', Readonly=>'true'
                </div>
            </div>

            <br>

            <div class="row g-3 align-items-center">
                <div class="col-md-1">
                    <%= l ('lets_External_Interface_IP') %>
                </div>
                <div class="col-auto">
                    % param 'ExternalIP' => $lets_data->{ExternalIP} unless param 'ExternalIP';
                    %= text_field 'ExternalIP', size => '50', class => "" , pattern=>'.*' , placeholder=>'ExternalIP', Readonly=>'true'
                </div>
            </div>

            <br>

            <div class="row g-3 align-items-center">
                <div class="col-md-1">
                    <%= l ('lets_Internet_IP') %>
                </div>
                <div class="col-auto">
                    % param 'InternetIP' => $lets_data->{InternetIP} unless param 'InternetIP';
                    %= text_field 'InternetIP', size => '50', class => "" , pattern=>'.*' , placeholder=>'InternetIP', Readonly=>'true'
                </div>
            </div>

            <br><br>

            <h2><%=l('lets_Current_certificate_details') %></h2>

            <br>

            <div class="row g-3 align-items-center">
                <div class="col-md-1">
                <%= l ('lets_Issuer') %>
                </div>
                <div class="col-auto">
                    % param 'Issuer' => $lets_data->{Issuer} unless param 'Issuer';
                    %= text_field 'Issuer', size => '50', class => "" , pattern=>'.*' , placeholder=>'Issuer', Readonly=>'true'
                </div>
            </div>

            <br>

            <div class="row g-3 align-items-center">
                <div class="col-md-1">
                    <%= l ('lets_Expiry') %>
                </div>
                <div class="col-auto">
                    % param 'Expiry' => $lets_data->{Expiry} unless param 'Expiry';
                    %= text_field 'Expiry', size => '50', class => "" , pattern=>'.*' , placeholder=>'Expiry', Readonly=>'true'
                </div>
            </div>

            <br>

            <div class="row g-3 align-items-center">
                <div class="col-md-1">
                    <%= l ('lets_Not_Before') %>
                </div>
                <div class="col-auto">
                    % param 'NotBefore' => $lets_data->{NotBefore} unless param 'NotBefore';
                    %= text_field 'NotBefore', size => '50', class => "" , pattern=>'.*' , placeholder=>'NotBefore', Readonly=>'true'
                </div>
            </div>

            <br><br>

            <h2 class=""><%=l('lets_List_of_Domains_and_Hosts') %></h2>

            <br>

            % $linkbtn = l 'lets_CHECK';

            <table class="table table-bordered">
                <thead>
                    <tr table-head-row>
                        <th><%= l ('lets_Domain_name_/_HOSTNAME') %></th>
                        <th><%= l ('lets_Brief_description') %></th>
                        <th><%= l ('lets_Content') %></th>
                        <th><%= l ('lets_LABEL_NAMESERVERS') %></th>
                        <th><%= l ('lets_LABEL_POINT') %></th>
                        <th><%= l ('lets_LABEL_LECERT') %></th>
                        <th><%= l ('lets_IS_IN_CERT') %></th>
                        <th><%= l ('lets_CHECK') %></th>
                    </tr>
                </thead>
                <tbody>
                    % my $control_data = $c->stash('DomainList');
                    % foreach my $row (@$control_data) {
                        % my $link = $c->render_to_string(inline=>$row->{'Table1-CHECK'});
                        % my $type = $c->render_to_string(inline=>$row->{'Table1-TYPE'});
                        <tr>
                            % if  ($type eq "Domain\n"){
                                <td><%=$c->render_to_string(inline=>$row->{'Table1-Domain name / HOSTNAME'}) %></td>
                            % }
                            % if ($type eq "Host\n") {
                                <td><i class="bi bi-arrow-return-right"> </i><%=$c->render_to_string(inline=>$row->{'Table1-Domain name / HOSTNAME'}) %></td>
                            % }

                            <td><%=$c->render_to_string(inline=>$row->{'Table1-Brief description'}) %></td>
                            <td><%=$c->render_to_string(inline=>$row->{'Table1-Content'}) %></td>
                            <td><%=$c->render_to_string(inline=>$row->{'Table1-LABEL_NAMESERVERS'}) %></td>
                            <td><%=$c->render_to_string(inline=>$row->{'Table1-LABEL_POINT'}) %></td>
                            <td><%=$c->render_to_string(inline=>$row->{'Table1-LABEL_LECERT'}) %></td>
                            <td><%=$c->render_to_string(inline=>$row->{'Table1-IS_IN_CERT'}) %></td>

                            % if ($link ne "") {
                            <td><a href= "<%= $link %>" class="btn btn-outline-primary btn-sm" role="button" > <%= $linkbtn %></a></td>
                            % } else {
                                <td>&nbsp</td>
                            % }
                        </tr>
                    % }
                </tbody>
            </table>

</div>
