1 |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm |
2 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2023-12-19 09:44:56.678590486 +0000 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2023-12-19 09:44:56.678590486 +0000 |
3 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2023-12-30 15:31:00.000000000 +0000 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2024-01-20 13:24:00.000000000 +0000 |
4 |
@@ -117,22 +117,41 @@ |
@@ -137,15 +137,16 @@ |
5 |
|
# |
6 |
|
# call to show scan results |
7 |
|
# |
8 |
|
+ my $y = 1/0; |
9 |
|
my $c = shift; |
10 |
|
my $title = $c->l("dhcpd_SCANNING_NETWORK_TITLE"); |
11 |
|
my $modul = ''; |
12 |
|
- my $trt = "NETSCAN"; |
13 |
|
+ my $trt = "SCAN"; |
14 |
|
$dhcp_data{trt} = $trt; |
15 |
|
$dhcp_data{"first"} = ''; |
16 |
|
- # ..... get scan results into dhcp_data |
17 |
|
- dhcp_data{"scanresults"} = get_scan_results($c); |
18 |
|
- $c->stash( title => $title, modul => $modul, dhcp_data => \%dhcp_data ); |
19 |
|
+ # ..... get scan results into stash for passing to html template |
20 |
|
+ my $dhcp_scanresults = get_scan_results($c); |
21 |
|
+ $c->stash( title => $title, modul => $modul, "dhcp_data" => \%dhcp_data, "scanresults" => $dhcp_scanresults); |
22 |
$c->render( template => 'dhcpd' ); |
$c->render( template => 'dhcpd' ); |
23 |
} |
} |
24 |
|
|
25 |
|
@@ -332,10 +333,10 @@ |
26 |
|
my $c = shift; |
27 |
|
my $ret = delete_all_leases($c); |
28 |
|
if ($ret == 'ok') { |
29 |
|
- dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS"; |
30 |
|
+ $dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS"; |
31 |
|
do_leases($c); |
32 |
|
} |
33 |
|
- else {dhcp_data{"error"}=$ret;} |
34 |
|
+ else {$dhcp_data{"error"}=$ret;} |
35 |
|
return ; |
36 |
|
} |
37 |
|
|
38 |
- |
@@ -352,17 +353,17 @@ |
39 |
-sub do_winpopup { |
# else return "ok" |
40 |
- # |
my $ret = delete_lease($c); |
41 |
- # call to win pop up |
if ($ret == 'ok') { |
42 |
- # |
- dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS"; |
43 |
+sub netmask2cidr { |
+ $dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS"; |
44 |
|
do_leases($c); |
45 |
|
} |
46 |
|
- else {dhcp_data{"error"}=$ret;} |
47 |
|
+ else {$dhcp_data{"error"}=$ret;} |
48 |
|
return ; |
49 |
|
} |
50 |
|
|
51 |
|
sub get_scan_results { |
52 |
my $c = shift; |
my $c = shift; |
53 |
- my $title = $c->l("dhcpd_GLOBAL_WINPOPUP"); |
#...do it |
54 |
- my $modul = ''; |
- return "results"; |
55 |
- my $trt = "WINPOPUP"; |
+ return Scan_Local_Network($c); |
56 |
- $dhcp_data{trt} = $trt; |
} |
57 |
- $dhcp_data{"first"} = ''; |
|
58 |
- #..... get winpopup details |
|
59 |
- $c->stash( title => $title, modul => $modul, dhcp_data => \%dhcp_data ); |
@@ -374,13 +375,13 @@ |
60 |
- $c->render( template => 'dhcpd' ); |
|
61 |
+ #my ($mask, $network) = @_; |
sub delete_one_lease { |
62 |
+ my $nmap_sme = esmith::ConfigDB->open('/home/e-smith/db/configuration'); |
my $c = shift; |
63 |
+ my $mask = $nmap_sme->get_value('LocalNetmask'); |
- # ...do it |
64 |
+ my $network = $nmap_sme->get_prop('InternalInterface','Network'); |
+ Perform_Del_Lease($c); |
65 |
|
return "ok"; |
66 |
|
} |
67 |
|
|
68 |
|
sub delete_all_leases { |
69 |
|
my $c = shift; |
70 |
|
- # ...do it |
71 |
|
+ Perform_del_all_Lease($c); |
72 |
|
return "ok"; |
73 |
|
} |
74 |
|
|
75 |
|
@@ -391,6 +392,118 @@ |
76 |
|
return @leases; |
77 |
|
} |
78 |
|
|
79 |
|
+ |
80 |
|
+sub Perform_del_all_Lease ($){ |
81 |
|
+ |
82 |
|
+ system ('/bin/echo "" > /var/lib/dhcpd/dhcpd.leases') ==0 |
83 |
|
+ or die "Error while removing all leases: $!"; |
84 |
|
+ |
85 |
|
+ system ("/sbin/e-smith/signal-event","workgroup-update") == 0 |
86 |
|
+ or die "Error while saving settings: $!"; |
87 |
|
+ |
88 |
|
+ return 'ok'; |
89 |
|
+ exit; |
90 |
|
+} |
91 |
|
+ |
92 |
|
+#=============================================================================== |
93 |
|
+#SUBROUTINE: Perform delete lease |
94 |
|
+#=============================================================================== |
95 |
|
+sub Perform_Del_Lease($){ |
96 |
|
+ |
97 |
|
+ ###Pull CGI object from parameters array |
98 |
|
+ my $c = shift; |
99 |
|
+ |
100 |
|
+ ###Pull entry to delete |
101 |
|
+ my $ip = $c->param('host'); |
102 |
|
+ my $name = $c->param('name'); |
103 |
|
+ my $name_in_file = '/var/lib/dhcpd/dhcpd.leases' ; |
104 |
|
+ my $name_tmp_file = '/var/lib/dhcpd/dhcpd.leases.tmp' ; |
105 |
|
+ my $name_out_file = '/var/lib/dhcpd/dhcpd.leases~' ; |
106 |
|
+ my $del_current = "0" ; |
107 |
|
+ |
108 |
|
+ open(INFILE,"<$name_in_file") || die "Read Error $name_in_file, Read: $!"; |
109 |
|
+ open(OUTFILE,">$name_tmp_file") || die "Write error $name_in_file, Write: $!"; |
110 |
|
+ while (<INFILE>) { |
111 |
|
+ if ( "$_" =~ /lease $ip/ ) { |
112 |
|
+ $del_current = "1" ; |
113 |
|
+ } |
114 |
|
+ if ( $del_current == "0" ) { print OUTFILE "$_" ; } |
115 |
|
+ if ( "$_" =~ /}/ ) { |
116 |
|
+ $del_current = "0" ; |
117 |
|
+ } |
118 |
|
+ } |
119 |
|
+ rename ($name_tmp_file,$name_in_file) ; |
120 |
|
+ system ("/bin/cp","-f","$name_in_file","$name_out_file") ; |
121 |
|
+ close(INFILE); |
122 |
|
+ close(OUTFILE); |
123 |
|
+ |
124 |
|
+ # changed to new sme standard signal-event |
125 |
|
+ system ("/sbin/e-smith/signal-event","workgroup-update") == 0 |
126 |
|
+ or die "Error while saving settings: $!"; |
127 |
|
+ ###Return action message |
128 |
|
+ return $c->l('SUCCESSFULLY_DELETED_THE_CLIENT') . ' (' . $name . '/' . $ip .')'; |
129 |
|
+} |
130 |
|
+ |
131 |
|
+#=============================================================================== |
132 |
|
+#SUBROUTINE: Scan The Local Network |
133 |
|
+#=============================================================================== |
134 |
|
+sub dec2bin { |
135 |
|
+ my $str = unpack("B32", pack("N", shift)); |
136 |
|
+ return $str; |
137 |
|
+} |
138 |
|
+ |
139 |
|
+sub netmask2cidr { |
140 |
|
+ my ($mask, $network) = @_; |
141 |
+ my @octet = split (/\./, $mask); |
+ my @octet = split (/\./, $mask); |
142 |
+ my @bits; |
+ my @bits; |
143 |
+ my $binmask; |
+ my $binmask; |
161 |
+ return $cidr; |
+ return $cidr; |
162 |
+} |
+} |
163 |
+ |
+ |
164 |
+sub dec2bin { |
+sub Scan_Local_Network ($) { |
165 |
+ my $str = unpack("B32", pack("N", shift)); |
+ |
166 |
+ return $str; |
+ my $nmap_sme = esmith::ConfigDB->open('/home/e-smith/db/configuration'); |
167 |
} |
+ my $mask = $nmap_sme->get_value('LocalNetmask'); |
168 |
|
+ my $network = $nmap_sme->get_prop('InternalInterface','Network'); |
169 |
+ |
+ |
170 |
sub do_scan { |
+#we start to calculate the method to find the cidr (we want to use network/cidr with nmap) |
171 |
# |
+ my $cidr = netmask2cidr($mask, $network); |
172 |
# call to show scan results |
+ |
173 |
@@ -140,12 +159,13 @@ |
+#ok go to use nmap with nmap -T4 -sP network/cidr |
174 |
my $c = shift; |
+ my @nmap_output= `/usr/bin/nmap --script smb-os-discovery.nse -p U:137,T:139 $cidr| |
175 |
my $title = $c->l("dhcpd_SCANNING_NETWORK_TITLE"); |
+ /bin/grep -Ev "MAC|NetBIOS|OS CPE"| /bin/grep -E "scan|done|Computer|OS"| |
176 |
my $modul = ''; |
+ /bin/sed -e 's/Nmap scan/-- Scan/g'|/bin/sed -e 's/done/Done/g'| |
177 |
- my $trt = "NETSCAN"; |
+ /bin/sed -e 's/Nmap//g'|/bin/sed -e 's/|/ /g'`; |
178 |
+ my $trt = "SCAN"; |
+ |
179 |
$dhcp_data{trt} = $trt; |
+ my @extracted_output; |
180 |
$dhcp_data{"first"} = ''; |
+ foreach my $line (@nmap_output) { |
181 |
# ..... get scan results into dhcp_data |
+ if ($line =~ m/Scan report for ([\w\.-]+) \(([\d\.\:]+)\)/) { |
182 |
- dhcp_data{"scanresults"} = get_scan_results($c); |
+ my %pair = ('Network' => $1, 'ip' => $2); # $1 => PC Name, $2 => IP Address |
183 |
- $c->stash( title => $title, modul => $modul, dhcp_data => \%dhcp_data ); |
+ push @extracted_output, \%pair; |
184 |
+ $dhcp_data{"cidr"} = netmask2cidr($c); |
+ } |
|
+ my @scanresults = get_scan_results($c); |
|
|
+ $c->stash( title => $title, modul => $modul, dhcp_data => \%dhcp_data, scanresults => @scanresults ); |
|
|
$c->render( template => 'dhcpd' ); |
|
|
} |
|
|
|
|
|
@@ -361,8 +381,30 @@ |
|
|
|
|
|
sub get_scan_results { |
|
|
my $c = shift; |
|
|
- #...do it |
|
|
- return "results"; |
|
|
+ my $cidr = netmask2cidr($c); |
|
|
+ my $res = execute_nmap($cidr); |
|
|
+ return $res; |
|
|
+} |
|
|
+ |
|
|
+sub execute_nmap { |
|
|
+ my ($ip, $port) = @_; |
|
|
+ my @result; |
|
|
+ my $nmapcmd = qq(/usr/bin/nmap --script smb-os-discovery.nse -p U:137,T:139 $ip| \ |
|
|
+ /bin/grep -Ev "MAC|NetBIOS|OS CPE"| /bin/grep -E "scan|done|Computer|OS"| \ |
|
|
+ /bin/sed -e 's/Nmap scan/-- Scan/g'|/bin/sed -e 's/done/Done/g'| \ |
|
|
+ /bin/sed -e 's/Nmap//g'|/bin/sed -e 's/|/ /g'); |
|
|
+ |
|
|
+ open my $nmap, '-|', "$nmapcmd" or die "Can't start nmap: $!"; |
|
|
+ |
|
|
+ while (my $line = <$nmap>) { |
|
|
+ chomp $line; |
|
|
+ my @fields = split /\s+/, $line; |
|
|
+ push @result, \@fields; |
|
185 |
+ } |
+ } |
186 |
|
+ return \@extracted_output; |
187 |
|
+} |
188 |
|
+ |
189 |
+ |
+ |
|
+ close $nmap; |
|
190 |
+ |
+ |
191 |
+ return \@result; |
#========================================================================= |
192 |
} |
# Procedure qui charge le dhcpd.conf |
193 |
|
# retourne un tableau contenant les informations |
194 |
|
@@ -536,4 +649,4 @@ |
|
@@ -498,13 +540,6 @@ |
|
|
return @results; |
|
|
} |
|
|
|
|
|
-sub winpopup{ |
|
|
- my $c = shift; |
|
|
- # Message in $c->param("winpopupmsg") |
|
|
- # .... do it |
|
|
- return TRUE; |
|
|
-} |
|
|
- |
|
|
sub do_wol{ |
|
|
my $c = shift; |
|
|
my $retVal = Perform_Wake_Up($c); |
|
|
@@ -536,4 +571,4 @@ |
|
195 |
|
|
196 |
1; |
1; |
197 |
|
|
200 |
+ |
+ |
201 |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm |
202 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm 1970-01-01 01:00:00.000000000 +0100 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm 1970-01-01 01:00:00.000000000 +0100 |
203 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm 2023-12-30 11:30:00.000000000 +0000 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm 2024-01-20 08:46:00.000000000 +0000 |
204 |
@@ -0,0 +1,109 @@ |
@@ -0,0 +1,109 @@ |
205 |
+package SrvMngr::I18N::Modules::Dhcpd::en; |
+package SrvMngr::I18N::Modules::Dhcpd::en; |
206 |
+use strict; |
+use strict; |
313 |
+1; |
+1; |
314 |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep |
315 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep 2023-12-19 09:44:56.680590493 +0000 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep 2023-12-19 09:44:56.680590493 +0000 |
316 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep 2023-12-30 10:10:00.000000000 +0000 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep 2024-01-20 13:44:00.000000000 +0000 |
317 |
@@ -49,10 +49,8 @@ |
@@ -49,24 +49,26 @@ |
318 |
|
|
319 |
% if ($dhcp_data->{trt} eq 'LEASES') { |
% if ($dhcp_data->{trt} eq 'LEASES') { |
320 |
%= include 'partials/_dhcpd_leases' |
%= include 'partials/_dhcpd_leases' |
321 |
- %} elsif ($dhcp_data->{trt} eq 'WINPOPUP') { |
- %} elsif ($dhcp_data->{trt} eq 'WINPOPUP') { |
322 |
- %= include 'partials/_dhcpd_winpopup' |
- %= include 'partials/_dhcpd_winpopup' |
323 |
%} elsif ($dhcp_data->{trt} eq 'SCAN') { |
%} elsif ($dhcp_data->{trt} eq 'SCAN') { |
324 |
- %= include 'partials/_dhcpd_scan' |
%= include 'partials/_dhcpd_scan' |
|
+ %= include 'partials/_dhcpd_scanresults' |
|
325 |
%} else { #PARAMS |
%} else { #PARAMS |
326 |
% 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])$'; |
% 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])$'; |
327 |
<table><tr><td> |
- <table><tr><td> |
328 |
@@ -63,9 +61,12 @@ |
- %= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinner()", id=>"scanLeases" |
329 |
</button> |
- <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true"> |
330 |
</td><td> |
- Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')--> |
331 |
%= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3' |
- <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> |
332 |
|
- </button> |
333 |
|
- </td><td> |
334 |
|
- %= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3' |
335 |
- </td><td> |
- </td><td> |
336 |
- %= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2' |
- %= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2' |
337 |
+ </td> |
- <td> |
338 |
+ <!-- |
- </tr> |
339 |
<td> |
+ <table> |
340 |
+ %= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2' |
+ <tr> |
341 |
+ </td> |
+ <td> |
342 |
+ --> |
+ %= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinnerLeases()", id=>"scanLeases" |
343 |
</tr> |
+ <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true"> |
344 |
|
+ Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')--> |
345 |
|
+ <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> |
346 |
|
+ </button> |
347 |
|
+ </td><td> |
348 |
|
+ %= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3, onclick=>"showSpinnerNetwork()", id=>"scanNetwork' |
349 |
|
+ <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="loadingNetwork" style="display:true"> |
350 |
|
+ Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')--> |
351 |
|
+ <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> |
352 |
|
+ </button> |
353 |
|
+ </td> |
354 |
|
+ </tr> |
355 |
</table> |
</table> |
356 |
<hr /> |
<hr /> |
357 |
|
<h2> |
358 |
|
@@ -180,10 +182,17 @@ |
359 |
|
|
360 |
|
%= javascript begin |
361 |
|
document.getElementById("load").style.display="none"; |
362 |
|
- function showSpinner(){ |
363 |
|
+ document.getElementById("loadingNetwork").style.display="none"; |
364 |
|
+ |
365 |
|
+ function showSpinnerLeases(){ |
366 |
|
document.getElementById("scanLeases").style.display="none"; |
367 |
|
document.getElementById("load").style.display="inline"; |
368 |
|
} |
369 |
|
+ |
370 |
|
+ function showSpinnerNetwork(){ |
371 |
|
+ document.getElementById("scanNetwork").style.display="none"; |
372 |
|
+ document.getElementById("loadingNetwork").style.display="inline"; |
373 |
|
+ } |
374 |
|
%end |
375 |
|
|
376 |
|
%= stylesheet begin |
377 |
|
@@ -205,7 +214,6 @@ |
378 |
|
border-color: darkgrey; |
379 |
|
border-image: initial; |
380 |
|
} |
381 |
|
- |
382 |
|
%end |
383 |
|
- |
384 |
|
%end |
385 |
|
+1; |
386 |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep |
387 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep 2023-12-19 09:44:56.681590497 +0000 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep 2023-12-19 09:44:56.681590497 +0000 |
388 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep 2023-12-29 15:16:00.000000000 +0000 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep 2024-01-20 11:29:00.000000000 +0000 |
389 |
|
@@ -1,17 +1,17 @@ |
390 |
|
<div id='dhcpd-leases'> |
391 |
|
<table><tr><td> |
392 |
|
- %= button_to $c->l('dhcpd_REFRESH') => '/dhcpd1', onclick=>"showSpinner()", id=>"scanLeases" |
393 |
|
- <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true"> |
394 |
|
- Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')--> |
395 |
|
- <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> |
396 |
|
- </button> |
397 |
|
- |
398 |
|
- </td><td> |
399 |
|
- %= button_to $c->l('dhcpd_REMOVE_ALL_LEASES') => '/dhcpd4' |
400 |
|
- </td> |
401 |
|
- </tr> |
402 |
|
+ %= button_to $c->l('dhcpd_REFRESH') => '/dhcpd1', onclick=>"showSpinnerLeases()", id=>"scanLeases" |
403 |
|
+ <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true"> |
404 |
|
+ Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')--> |
405 |
|
+ <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> |
406 |
|
+ </button> |
407 |
|
+ |
408 |
|
+ </td><td> |
409 |
|
+ %= button_to $c->l('dhcpd_REMOVE_ALL_LEASES') => '/dhcpd4' |
410 |
|
+ </td> |
411 |
|
+ </tr> |
412 |
|
</table> |
413 |
|
- <hr /> |
414 |
|
+ |
415 |
|
% my $btn = l('dhcpd_SAVE/RESTART'); |
416 |
|
%= form_for '/dhcpd10' => (method => 'POST') => begin |
417 |
|
<span class=label> |
418 |
@@ -26,7 +26,7 @@ |
@@ -26,7 +26,7 @@ |
419 |
%= submit_button "$btn", class => 'action' |
%= submit_button "$btn", class => 'action' |
420 |
% end |
% end |
439 |
<a href="/smanager/dhcpd6?trt=DEL&ip=<%= $ip->{ip}%>" onclick="Remove_lease_confirm(event,'<%=$c->l('dhcpd_REMOVE_A_DHCP_LEASE_ACTION')%>',this);"><center><%=l 'dhcpd_REMOVE'%></center></a> |
<a href="/smanager/dhcpd6?trt=DEL&ip=<%= $ip->{ip}%>" onclick="Remove_lease_confirm(event,'<%=$c->l('dhcpd_REMOVE_A_DHCP_LEASE_ACTION')%>',this);"><center><%=l 'dhcpd_REMOVE'%></center></a> |
440 |
- </td><td class = 'sme-border'> |
- </td><td class = 'sme-border'> |
441 |
+ </td> |
+ </td> |
442 |
+ <!--> |
+ <!-- |
443 |
+ <td class = 'sme-border'> |
+ <td class = 'sme-border'> |
444 |
<a href="/smanager/dhcpd8?trt=WIN&ip=<%= $ip->{ip}%>" onclick="Winpop_confirm(event,'<%=$c->l('dhcpd_SENDING_A_WINPOPUP')%>',this);"><center><%=l 'dhcpd_WINPOPUP_ACTION'%></center></a> |
<a href="/smanager/dhcpd8?trt=WIN&ip=<%= $ip->{ip}%>" onclick="Winpop_confirm(event,'<%=$c->l('dhcpd_SENDING_A_WINPOPUP')%>',this);"><center><%=l 'dhcpd_WINPOPUP_ACTION'%></center></a> |
445 |
</td> |
</td> |
454 |
-</div> |
-</div> |
455 |
\ No newline at end of file |
\ No newline at end of file |
456 |
+</div> |
+</div> |
457 |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scanresults.html.ep smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scanresults.html.ep |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scan.html.ep smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scan.html.ep |
458 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scanresults.html.ep 1970-01-01 01:00:00.000000000 +0100 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scan.html.ep 1970-01-01 01:00:00.000000000 +0100 |
459 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scanresults.html.ep 2023-12-30 15:30:00.000000000 +0000 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scan.html.ep 2024-01-20 11:34:00.000000000 +0000 |
460 |
@@ -0,0 +1,41 @@ |
@@ -0,0 +1,49 @@ |
461 |
+<div id='dhcpd-scanresults'> |
+<div id='dhcpd-scan'> |
462 |
+%#= 1/0 |
+ <table><tr><td> |
463 |
+ %= $c->l('dhcpd_NETWORK_VALUES_FOUND').$dhcp_data->{"cidr"}; |
+ %= button_to $c->l('dhcpd_REFRESH') => '/dhcpd3', onclick=>"showSpinnerNetwork()", id=>"scanNetwork" |
464 |
+ %= form_for '/dhcpd10' => (method => 'POST') => begin |
+ <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="loadingNetwork" style="display:true"> |
465 |
+ <br /> |
+ Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')--> |
466 |
+ <table class="sme-border table-sort"><thead> |
+ <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> |
467 |
|
+ </button> |
468 |
|
+ |
469 |
|
+ </td> |
470 |
|
+ </tr> |
471 |
|
+ |
472 |
|
+ </table> |
473 |
|
+ <table class="sme-border table-sort"><thead> |
474 |
+ <tr> |
+ <tr> |
475 |
+ <th class='sme-border'> |
+ <th class='sme-border'> |
476 |
+ %=l 'dhcpd_NETWORK_NAME' |
+ %=l 'dhcpd_NETWORK_NAME' |
477 |
+ </th> |
+ </th> |
478 |
+ <th class='sme-border'> |
+ <th class='sme-border'> |
479 |
+ %=l 'dhcpd_IP' |
+ %=l 'dhcpd_IP' |
480 |
+ </th> |
+ </th> |
|
+ <th class='sme-border'> |
|
|
+ %=l 'dhcpd_MAC_ADDRESS' |
|
|
+ </th> |
|
|
+ <th class='sme-border'> |
|
|
+ %=l 'dhcpd_STATUS_CLICK_FOR_WOL' |
|
|
+ </th> |
|
481 |
+ </tr> |
+ </tr> |
482 |
+ </thead> |
+ </thead> |
483 |
+ <tbody> |
+ <tbody> |
484 |
+ % foreach my $line (@$scanresults) { |
+ % foreach my $ip (@$scanresults) { |
485 |
+ % my @thisline = @$line; |
+ <tr> |
486 |
+ <tr> |
+ %= t td => (class => 'sme-border') => $ip->{Network} |
487 |
+ <td class='sme-border'> |
+ %= t td => (class => 'sme-border') => $ip->{ip} |
488 |
+ %= "$thisline[4]"; |
+ </tr> |
489 |
+ </td> |
+ %} |
490 |
+ <td class='sme-border'> |
+ </tbody> |
|
+ %= "$thisline[5]"; |
|
|
+ </td> |
|
|
+ <td class='sme-border'> |
|
|
+ </td> |
|
|
+ <td class='sme-border'> |
|
|
+ </td> |
|
|
+ </tr> |
|
|
+ %} |
|
491 |
+ </table> |
+ </table> |
492 |
+ % end |
+ %= hidden_field "hiddenmsg"=>"", id=>"hiddenmsg" |
493 |
|
+ <br /> |
494 |
+ %= button_to $c->l('dhcpd_CLICK_HERE_TO_MAIN_PANEL') => '/dhcpd' |
+ %= button_to $c->l('dhcpd_CLICK_HERE_TO_MAIN_PANEL') => '/dhcpd' |
495 |
|
+ |
496 |
|
+ %= javascript begin |
497 |
|
+ function Wol_confirm(event,msg,current){ |
498 |
|
+ const getMAC = /.*MAC\=(.*)\&name.*/; |
499 |
|
+ var MAC = current.href.match(getMAC)[1]; |
500 |
|
+ if (confirm(msg+": MAC: "+MAC)) |
501 |
|
+ { return true;} |
502 |
|
+ else {event.preventDefault();return false;} |
503 |
|
+ } |
504 |
|
+ |
505 |
|
+ |
506 |
|
+ %end |
507 |
|
+ |
508 |
|
+ |
509 |
+</div> |
+</div> |