220 lines
7.0 KiB
Plaintext
220 lines
7.0 KiB
Plaintext
% layout 'default', title => "Sme server 2 - DHCP Manager", share_dir => './';
|
|
|
|
% content_for 'module' => begin
|
|
|
|
<div id="module" class="module dhcpman-panel">
|
|
|
|
% if ($config->{debug} == 1) {
|
|
<p>
|
|
%= dumper $c->current_route
|
|
</p>
|
|
% }
|
|
|
|
<h1><%=$title%></h1>
|
|
%= $modul
|
|
|
|
%if ($dhcp_data->{first}) {
|
|
<br><p>
|
|
%=$c->render_to_string(inline =>$c->l($dhcp_data->{first}))
|
|
</p>
|
|
|
|
%} elsif ($dhcp_data->{success}) {
|
|
<div class='sme-border'>
|
|
<h2> Operation Status Report - success</h2><p>
|
|
<font color=green>
|
|
%= $c->l($dhcp_data->{success});
|
|
</font>
|
|
</p>
|
|
</div>
|
|
|
|
%} elsif ($dhcp_data->{error}) {
|
|
<div class='sme-error'>
|
|
<h2> Operation Status Report - error</h2><p>
|
|
<font color=red>
|
|
%= $c->l($dhcp_data->{error});
|
|
</font>
|
|
</p>
|
|
</div>
|
|
|
|
%} elsif ($dhcp_data->{error}) {
|
|
<div class='sme-warning'>
|
|
<h2> Operation Status Report - warning</h2><p>
|
|
<font color=orange>
|
|
%= $c->l($dhcp_data->{error});
|
|
</font>
|
|
</p>
|
|
</div>
|
|
|
|
%}
|
|
|
|
% if ($dhcp_data->{trt} eq 'LEASES') {
|
|
%= include 'partials/_dhcpd_leases'
|
|
%} elsif ($dhcp_data->{trt} eq 'SCAN') {
|
|
%= include 'partials/_dhcpd_scan'
|
|
%} else { #PARAMS
|
|
% my $ip_regex = '^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$';
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
%= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinnerLeases()", id=>"scanLeases"
|
|
<button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:none">
|
|
Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
|
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
</button>
|
|
</td><td>
|
|
%= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3', onclick=>"showSpinnerNetwork()", id=>"scanNetwork"
|
|
<button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="loadingNetwork" style="display:none">
|
|
Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
|
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<hr />
|
|
<h2>
|
|
%= $c->l("dhcpd_DHCPD_SETTINGS_TITLE")
|
|
</h2>
|
|
% my $btn = l('dhcpd_SAVE/RESTART');
|
|
%= form_for '/dhcpd5' => (method => 'POST') => begin
|
|
<span class=label>
|
|
%=l 'dhcpd_CHECK_CLIENT_STATUS'
|
|
</span><span class=data>
|
|
% param dhcp_check=>$dhcp_data->{"params"}->{"check"};
|
|
%=select_field dhcp_check=>$dhcp_data->{"check"}
|
|
</span><br>
|
|
<br />
|
|
<span class=label>
|
|
%=l 'dhcpd_STATUS_DHCP_SERVER'
|
|
</span><span class=data>
|
|
% param dhcp_enable=>$dhcp_data->{"params"}->{"status"};
|
|
%=select_field dhcp_enable=>$dhcp_data->{"status"}
|
|
</span><br>
|
|
|
|
<span class=label>
|
|
%=l 'dhcpd_DHCP_START'
|
|
</span><span class=data>
|
|
% param dhcp_start=>$dhcp_data->{"params"}->{"start"};
|
|
%=text_field 'dhcp_start',minlength=>'7',maxlength=>"15",size=>"15",placeholder=>"nnn.nnn.nnn.nnn", pattern=>"$ip_regex"
|
|
</span><br>
|
|
|
|
<span class=label>
|
|
%=l 'dhcpd_DHCP_END'
|
|
</span><span class=data>
|
|
% param dhcp_end=>$dhcp_data->{"params"}->{"end"};
|
|
%=text_field 'dhcp_end',minlength=>'7',maxlength=>"15",size=>"15",placeholder=>"nnn.nnn.nnn.nnn", pattern=>"$ip_regex"
|
|
</span><br><br />
|
|
|
|
%= $c->l("dhcpd_CUSTOM_WINSERVER_TITLE");
|
|
<br />
|
|
|
|
<span class=label>
|
|
%=l 'dhcpd_CUSTOM_WINSERVER_STATUS'
|
|
</span><span class=data>
|
|
% param dhcp_winscustom=>$dhcp_data->{"params"}->{"winscustom"};
|
|
%=select_field dhcp_winscustom=>$dhcp_data->{"status"}
|
|
</span><br>
|
|
|
|
<span class=label>
|
|
%=l 'dhcpd_CUSTOM_WINSERVER_ADDRESS'
|
|
</span><span class=data>
|
|
% param dhcp_winsserver=>$dhcp_data->{"smbparams"}->{"WINSServer"};
|
|
%=text_field 'dhcp_winsserver' ,minlength=>'7',maxlength=>"15",size=>"15",placeholder=>"nnn.nnn.nnn.nnn", pattern=>"$ip_regex"
|
|
</span><br><br />
|
|
|
|
%= $c->l("dhcpd_CUSTOM_DNS_TITLE");
|
|
<br />
|
|
<span class=label>
|
|
%=l 'dhcpd_CUSTOM_DNS_STATUS'
|
|
</span><span class=data>
|
|
% param dhcp_dnscustom=>$dhcp_data->{"params"}->{"dnscustom"};
|
|
%=select_field dhcp_dnscustom=>$dhcp_data->{"status"}
|
|
</span><br>
|
|
|
|
<span class=label>
|
|
%=l 'dhcpd_PRIMARY_DNS_ADDRESS'
|
|
</span><span class=data>
|
|
% param dhcp_dns1server=>$dhcp_data->{"params"}->{"dns1server"};
|
|
%=text_field 'dhcp_dns1server' ,minlength=>'7',maxlength=>"15",size=>"15",placeholder=>"nnn.nnn.nnn.nnn", pattern=>"$ip_regex"
|
|
</span><br>
|
|
|
|
<span class=label>
|
|
%=l 'dhcpd_SECONDARY_DNS_ADDRESS'
|
|
</span><span class=data>
|
|
% param dhcp_dns2server=>$dhcp_data->{"params"}->{"dns2server"};
|
|
%=text_field 'dhcp_dns2server' ,minlength=>'7',maxlength=>"15",size=>"15",placeholder=>"nnn.nnn.nnn.nnn", pattern=>"$ip_regex"
|
|
</span><br>
|
|
|
|
<span class=label>
|
|
%=l 'dhcpd_TERTIARY_DNS_ADDRESS'
|
|
</span><span class=data>
|
|
% param dhcp_dns3server=>$dhcp_data->{"params"}->{"dns3server"};
|
|
%=text_field 'dhcp_dns3server' ,minlength=>'7',maxlength=>"15",size=>"15",placeholder=>"nnn.nnn.nnn.nnn", pattern=>"$ip_regex"
|
|
</span><br>
|
|
|
|
%= $c->l("dhcpd_CUSTOM_GATEWAY_TITLE");
|
|
<br />
|
|
<span class=label>
|
|
%=l 'dhcpd_CUSTOM_GATEWAY_STATUS'
|
|
</span><span class=data>
|
|
% param dhcp_gatewaycustom=>$dhcp_data->{"params"}->{"gatewaycustom"};
|
|
%=select_field dhcp_gatewaycustom=>$dhcp_data->{"status"}
|
|
</span><br>
|
|
|
|
<span class=label>
|
|
%=l 'dhcpd_CUSTOM_GATEWAY_ADDRESS'
|
|
</span><span class=data>
|
|
% param dhcp_gateway=>$dhcp_data->{"params"}->{"gateway"};
|
|
%=text_field 'dhcp_gateway' ,minlength=>'7',maxlength=>"15",size=>"15",placeholder=>"nnn.nnn.nnn.nnn", pattern=>"$ip_regex"
|
|
</span><br><br />
|
|
%= $c->l("dhcpd_CUSTOM_LEASETIME_TITLE");
|
|
<br />
|
|
<span class=label>
|
|
%=l 'dhcpd_CUSTOM_LEASETIME'
|
|
</span><span class=data>
|
|
% param dhcp_leasetime=>$dhcp_data->{"params"}->{"leasetime"};
|
|
%=number_field 'dhcp_leasetime'
|
|
</span><br><br />
|
|
%= submit_button "$btn", class => 'action'
|
|
% end
|
|
%}
|
|
|
|
</div>
|
|
|
|
%= javascript begin
|
|
if (document.getElementById("load")){document.getElementById("load").style.display="none";}
|
|
if (document.getElementById("loadingNetwork")){document.getElementById("loadingNetwork").style.display="none";}
|
|
|
|
function showSpinnerLeases(){
|
|
document.getElementById("scanLeases").style.display="none";
|
|
document.getElementById("load").style.display="inline";
|
|
}
|
|
|
|
function showSpinnerNetwork(){
|
|
document.getElementById("scanNetwork").style.display="none";
|
|
document.getElementById("loadingNetwork").style.display="inline";
|
|
}
|
|
%end
|
|
|
|
%= stylesheet begin
|
|
.spinnerButtonOverlay,
|
|
.spinnerButtonOverlay:hover,
|
|
.spinnerButtonOverlay:any-link ,
|
|
.spinnerButtonOverlay:focus ,
|
|
.spinnerButtonOverlay:active {
|
|
appearance: auto;
|
|
user-select: none;
|
|
align-items: flex-start;
|
|
cursor: default;
|
|
box-sizing: border-box;
|
|
background-color: #efefef;
|
|
color: black;
|
|
padding: 1px 6px;
|
|
border-width: 2px;
|
|
border-style: outset;
|
|
border-color: darkgrey;
|
|
border-image: initial;
|
|
}
|
|
%end
|
|
%end
|
|
1;
|