Edit template for controller - Refine params copy and bring DB opens up to spec with UTF8
This commit is contained in:
74
output/Hostentries/AdminLTE/_hos_list.html.new.ep
Normal file
74
output/Hostentries/AdminLTE/_hos_list.html.new.ep
Normal file
@@ -0,0 +1,74 @@
|
||||
<div>
|
||||
|
||||
% my $btn = l("hos_ADD_HOSTNAME");
|
||||
|
||||
<form action="/smanager/hostentriesd" method="POST">
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
|
||||
</div>
|
||||
</div>
|
||||
<%= hidden_field "trt" => $hos_datas->{trt} %>
|
||||
</form>
|
||||
|
||||
% my %dom_hos = %{$dom_hosts};
|
||||
% foreach my $domain ( sort ( keys %dom_hos ) ) {
|
||||
|
||||
<br>
|
||||
<%= $c->l("hos_CURRENT_HOSTNAMES_FOR_LOCAL_DOMAIN", $domain); %>
|
||||
<br>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr class="">
|
||||
<th class="col-sm"><%= l "Hostname" %></th>
|
||||
<th class="col-auto"><%= l "Location" %></th>
|
||||
<th class="col-auto"><%= l "IP_ADDRESS_OR_FQDN" %></th>
|
||||
<th class="col-auto"><%= l "hos_ETHERNET_ADDRESS" %></th>
|
||||
<th class="col-auto"><%= l "COMMENT" %></th>
|
||||
<th class="align-middle" colspan="2"><%= l "ACTION" %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
% foreach (@{$dom_hos{$domain}{"HOSTS"}}) {
|
||||
<tr>
|
||||
<td><%= $_->{"HostName"}; %></td>
|
||||
<td><%= $_->{"HostType"}; %></td>
|
||||
<td><%= $_->{"IP"}; %></td>
|
||||
<td><%= $_->{"MACAddress"}; %></td>
|
||||
<td><%= $_->{"Comment"}; %></td>
|
||||
|
||||
% my ($actionModify, $actionRemove) = " ";
|
||||
% my $static = $_->{"static"} || "no";
|
||||
% if ($static ne "yes") {
|
||||
%my $modify_text = l("MODIFY"); # Localized text
|
||||
%my $csrf_token = "TOKEN"; # CSRF token for security
|
||||
%my $hostentries_name = $_->{"HostName"}; # hostentries name extracted from the data structure
|
||||
%$actionModify = qq{
|
||||
% <a href="hostentriesd?CsrfDef=$csrf_token&trt=UPD&Hostname=$hostentries_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$modify_text" >
|
||||
% $modify_text
|
||||
% </button>
|
||||
% </a>
|
||||
%};
|
||||
%my $remove_text = l("REMOVE"); # Localized text
|
||||
%$csrf_token = "TOKEN"; # CSRF token for security
|
||||
%#my $hostentries_name = $_->{"HostName"}; # hostentries name extracted from the data structure
|
||||
%$actionRemove = qq{
|
||||
% <a href="hostentriesd?CsrfDef=$csrf_token&trt=DEL&Hostname=$hostentries_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$remove_text" >
|
||||
% $remove_text
|
||||
% </button>
|
||||
% </a>
|
||||
%};
|
||||
% }
|
||||
<td class="align-middle"><%= $c->render_to_string(inline => $actionModify) %></td>
|
||||
<td class="align-middle"><%= $c->render_to_string(inline => $actionRemove) %></td>
|
||||
|
||||
</tr>
|
||||
% }
|
||||
</tbody>
|
||||
</table>
|
||||
% }
|
||||
</div>
|
92
output/Hostentries/AdminLTE/_hos_upd.html.new.ep
Normal file
92
output/Hostentries/AdminLTE/_hos_upd.html.new.ep
Normal file
@@ -0,0 +1,92 @@
|
||||
<div>
|
||||
|
||||
% my $btn = l("NEXT");
|
||||
|
||||
<form action="/smanager/hostentriesd" method="POST">
|
||||
|
||||
% if ( $hos_datas->{trt} eq "ADD" ) {
|
||||
<h2><%=l "hos_CREATE_TITLE" %></h2>
|
||||
% } else {
|
||||
<h2><%=l "hos_MODIFY_TITLE" %></h2>
|
||||
% $btn = l("MODIFY");
|
||||
% }
|
||||
|
||||
<div>
|
||||
<%= l "Hostname_DESCRIPTION" %>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<%=l "Hostname" %>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
% if ( $hos_datas->{trt} eq "ADD" ) {
|
||||
% param "Name" => $hos_datas->{name} unless param "Name";
|
||||
<%= text_field "Name" %>
|
||||
% } else {
|
||||
<%= hidden_field "Name" => $hos_datas->{name} %>
|
||||
<%= $hos_datas->{name} %>
|
||||
% }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<%= l "DOMAIN" %>
|
||||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
% if ( $hos_datas->{trt} eq "ADD" ) {
|
||||
% param "Domain" => $hos_datas->{domain} unless param "Domain";
|
||||
<%= select_field "Domain", $c->domains_list() %>
|
||||
% } else {
|
||||
<%= hidden_field "Domain" => $hos_datas->{domain} %>
|
||||
<%= $hos_datas->{domain} %>
|
||||
% }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputHostComment" class="col-form-label"><%= $c->l("COMMENT", ""); %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
% param "Comment" => $hos_datas->{comment} unless param "Comment";
|
||||
<input type="text" name="Comment" id="inputHostComment" class="form-control" aria-describedby="inputHostComment" value="<%= $hos_datas->{comment} %>">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<%=l "LOCATION" %>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
% param "Hosttype" => $hos_datas->{hosttype} unless param "Hosttype";
|
||||
<%= select_field "Hosttype", $c->hosttype_list(), class => "form-select"; %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= hidden_field "trt" => $hos_datas->{trt} %>
|
||||
<%= hidden_field "Hostname" => $hos_datas->{hostname} %>
|
||||
<%= hidden_field "Internalip" => $hos_datas->{internalip} %>
|
||||
<%= hidden_field "Externalip" => $hos_datas->{externalip} %>
|
||||
<%= hidden_field "Macaddress" => $hos_datas->{macaddress} %>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user