/[smecontribs]/rpms/smeserver-dhcpmanager/contribs10/smeserver-dhcpmanager-2.0.4-Yet-more-changes-for-SM2-panels.patch
ViewVC logotype

Contents of /rpms/smeserver-dhcpmanager/contribs10/smeserver-dhcpmanager-2.0.4-Yet-more-changes-for-SM2-panels.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Sat Jan 20 14:09:56 2024 UTC (3 months, 3 weeks ago) by brianr
Branch: MAIN
Changes since 1.3: +425 -21 lines
*** empty log message ***

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
2 --- 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 2024-01-20 13:24:00.000000000 +0000
4 @@ -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' );
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 # else return "ok"
40 my $ret = delete_lease($c);
41 if ($ret == 'ok') {
42 - dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
43 + $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;
53 #...do it
54 - return "results";
55 + return Scan_Local_Network($c);
56 }
57
58
59 @@ -374,13 +375,13 @@
60
61 sub delete_one_lease {
62 my $c = shift;
63 - # ...do it
64 + 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);
142 + my @bits;
143 + my $binmask;
144 + my $binoct;
145 + my $bitcount=0;
146 +
147 + foreach (@octet) {
148 + $binoct = dec2bin($_);
149 + $binmask = $binmask . substr $binoct, -8;
150 + }
151 +
152 + # let's count the 1s
153 + @bits = split (//,$binmask);
154 + foreach (@bits) {
155 + if ($_ eq "1") {
156 + $bitcount++;
157 + }
158 + }
159 +
160 + my $cidr = $network . "/" . $bitcount;
161 + return $cidr;
162 +}
163 +
164 +sub Scan_Local_Network ($) {
165 +
166 + 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 +#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 +
173 +#ok go to use nmap with nmap -T4 -sP network/cidr
174 + my @nmap_output= `/usr/bin/nmap --script smb-os-discovery.nse -p U:137,T:139 $cidr|
175 + /bin/grep -Ev "MAC|NetBIOS|OS CPE"| /bin/grep -E "scan|done|Computer|OS"|
176 + /bin/sed -e 's/Nmap scan/-- Scan/g'|/bin/sed -e 's/done/Done/g'|
177 + /bin/sed -e 's/Nmap//g'|/bin/sed -e 's/|/ /g'`;
178 +
179 + my @extracted_output;
180 + foreach my $line (@nmap_output) {
181 + if ($line =~ m/Scan report for ([\w\.-]+) \(([\d\.\:]+)\)/) {
182 + my %pair = ('Network' => $1, 'ip' => $2); # $1 => PC Name, $2 => IP Address
183 + push @extracted_output, \%pair;
184 + }
185 + }
186 + return \@extracted_output;
187 +}
188 +
189 +
190 +
191 #=========================================================================
192 # Procedure qui charge le dhcpd.conf
193 # retourne un tableau contenant les informations
194 @@ -536,4 +649,4 @@
195
196 1;
197
198 -
199 \ No newline at end of file
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
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
203 +++ 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 @@
205 +package SrvMngr::I18N::Modules::Dhcpd::en;
206 +use strict;
207 +use warnings;
208 +use utf8;
209 +use Mojo::Base 'SrvMngr::I18N';
210 +
211 +use SrvMngr::I18N::Modules::General::en;
212 +
213 +my %lexicon = (
214 + 'dhcpd_ACTION' => 'Action',
215 + 'dhcpd_ACTIVE_DEVICE' => 'Active Device',
216 + 'dhcpd_ALL_OF_THEM' => 'All of them',
217 + 'dhcpd_CHECK_CLIENT_STATUS' => 'Always check the status of computers (Disabled is much faster)',
218 + 'dhcpd_CLEAN_ALL_DHCPLEASES' => 'You may want to clean the dhcpd.leases',
219 + 'dhcpd_CLICK_HERE_TO_MAIN_PANEL' => 'Return to the main panel',
220 + 'dhcpd_CONNECTED_IP' => 'Show DHCP Clients',
221 + 'dhcpd_CUSTOM_DNS_STATUS' => 'Custom DNS',
222 + 'dhcpd_CUSTOM_DNS_TITLE' => 'Enable custom DNS servers.',
223 + 'dhcpd_CUSTOM_GATEWAY_ADDRESS' => 'Gateway address',
224 + 'dhcpd_CUSTOM_GATEWAY_STATUS' => 'Custom gateway',
225 + 'dhcpd_CUSTOM_GATEWAY_TITLE' => 'Enable a custom gateway address.',
226 + 'dhcpd_CUSTOM_LEASETIME' => 'Custom lease time',
227 + 'dhcpd_CUSTOM_LEASETIME_TITLE' => 'Set the lease time (default is 86400 seconds).',
228 + 'dhcpd_CUSTOM_WINSERVER_ADDRESS' => 'WINS Server address',
229 + 'dhcpd_CUSTOM_WINSERVER_STATUS' => 'WINS Server',
230 + 'dhcpd_CUSTOM_WINSERVER_TITLE' => 'Enable a WINS Server.',
231 + 'dhcpd_DHCPD_SETTING_ERRORS' => 'DHCPd Settings ERRORS',
232 + 'dhcpd_DHCPD_SETTINGS_TITLE' => 'DHCP server settings',
233 + 'dhcpd_DHCPD_TITLE' => 'DHCP Manager',
234 + 'dhcpd_DHCP_END' => 'DHCP End',
235 + 'dhcpd_DHCP manager' => 'DHCP Manager',
236 + 'dhcpd_DHCP_RANGE_MUST_NOT_INCLUDE_SERVER_IP' =>'Incorrect range of IPs, the range of IP address allocation must not include the server address, Update unsuccessfull',
237 + 'dhcpd_DHCP_RANGE_WITH_BAD_IP' => 'Incorrect IP in the DHCP range, Update unsuccessfull',
238 + 'dhcpd_DHCP_START' => 'DHCP Start',
239 + 'dhcpd_DHCP_START_GREATER_DHCP_END_ERRORS' =>'Incorrect range of IPs, the DHCP Start is greater than the DHCP End , Update unsuccessfull',
240 + 'dhcpd_DISABLED' => 'Disabled',
241 + 'dhcpd_DNS_SERVER_WITH_BAD_IP' => 'Incorrect IP for DNS servers, Update unsuccessfull',
242 + 'dhcpd_DO_YOU_WANT_TO_SENT' => 'Do you want to send this message to',
243 + 'dhcpd_ENABLED' => 'Enabled',
244 + 'dhcpd_END_DATE' => 'End Date',
245 + 'dhcpd_ERROR_WHILE_REMOVING_ALL_LEASES' => 'Error while removing all dhcpd Leases',
246 + 'dhcpd_ERROR_WHILE_SAVING_SETTINGS' => 'Error while saving settings',
247 + 'dhcpd_GATEWAY_BAD_IP' => 'Incorrect IP for Gateway, Update unsuccessfull',
248 + 'dhcpd_GLOBAL_WINPOPUP' => 'Send Global Netsend WinPopup',
249 + 'dhcpd_GLOBAL_WINPOPUP_TITLE' => 'Send a global WinPopup with the Net send protocol',
250 + 'dhcpd_IP' => 'Ip Address',
251 + 'dhcpd_MAC_ADDRESS' => 'MAC Address',
252 + 'dhcpd_MANAGING_DHCP_CLIENT' => 'Managing DHCP clients',
253 + 'dhcpd_NETWORK_NAME' => 'Network Name',
254 + 'dhcpd_NETWORK_VALUES_FOUND' => 'Please wait .... Your subnet and your netmask appear to be :',
255 + 'dhcpd_NO_CONNECTED_COMPUTERS' => 'There are no connected computers',
256 + 'dhcpd_NOT_CHECKED' => 'Not Checked...',
257 + 'dhcpd_PRIMARY_DNS_ADDRESS' => 'Primary DNS',
258 + 'dhcpd_REFRESH_CONNECTED_IP_LIST' => 'You may want to refresh this list ?',
259 + 'dhcpd_REFRESH' => 'Refresh the list',
260 + 'dhcpd_REMOVE_ACTION' => 'Remove...',
261 + 'dhcpd_REMOVE_A_DHCP_LEASE_ACTION' => 'You are about to remove a client from the dhcpd.leases file.',
262 + 'dhcpd_REMOVE_A_DHCP_LEASE' => 'Remove a DHCP lease',
263 + 'dhcpd_ARE_YOU_SURE' => 'are you sure ?',
264 + 'dhcpd_REMOVE_A_DHCP_LEASE_TITLE' => 'Removing a DHCP Lease',
265 + 'dhcpd_REMOVE_ALL_LEASES_ACTION' => 'Remove all dhcpd leases',
266 + 'dhcpd_REMOVE_ALL_LEASES' => 'Remove all leases',
267 + 'dhcpd_REMOVE_DHCP_LEASE_TITLE' => 'Removing all DHCP Lease',
268 + 'dhcpd_REMOVE_DHCP_LEASE_WARNING' => 'Remove all entries in dhcpd.leases may cause issues',
269 + 'dhcpd_REMOVE' => 'Remove',
270 + 'dhcpd_SAVE/RESTART' => 'Save/Restart',
271 + 'dhcpd_SAVE_TITLE' => 'After changing settings above, you must save and restart dhcpd.',
272 + 'dhcpd_SCANNING_NETWORK_TITLE' => 'Scanning your network, the time needed depends on your subnet mask',
273 + 'dhcpd_SCAN_YOUR_NETWORK' => 'Scan your network',
274 + 'dhcpd_SCAN_YOUR_NETWORK_TITLE' => 'Scan your network to show active devices :',
275 + 'dhcpd_SECONDARY_DNS_ADDRESS' => 'Secondary DNS',
276 + 'dhcpd_SENDING_A_WINPOPUP' => 'Sending a WinPopup',
277 + 'dhcpd_SENDING_A_WINPOPUP_TO' => 'You are about to send a WinPopup to ',
278 + 'dhcpd_SEND_WINPOPUP_TO' => 'Send a WinPopup to',
279 + 'dhcpd_SHOW_CONNECTED_IP_TITLE' => 'Show all devices connected to the dhcpd server :',
280 + 'dhcpd_START_DATE' => 'Start Date',
281 + 'dhcpd_STATUS_CLICK_FOR_WOL' => 'Status - click for WOL',
282 + 'dhcpd_STATUS_DHCP_SERVER' => 'State of DHCPD',
283 + 'dhcpd_STATUS_REPORT' => 'Operation status report :',
284 + 'dhcpd_SUCCESSFULLY_CLIENT_WOL_REQUEST' =>'Successfull request to wake up the client. The computer may take time to wake up.',
285 + 'dhcpd_SUCCESSFULLY_DELETED_THE_CLIENT' => 'Successfully deleted the client in dhcpd.leases : ',
286 + 'dhcpd_SUCCESSFULLY_REMOVED_ALL_LEASES' => 'Successfully deleted all leases.',
287 + 'dhcpd_SUCCESSFULLY_SAVED_SETTINGS' => 'Successfully saved settings',
288 + 'dhcpd_SUCCESSFULLY_SENT_MESSAGE' => 'Successfully sent message popup to',
289 + 'dhcpd_TERTIARY_DNS_ADDRESS' => 'Tertiary DNS',
290 + 'dhcpd_WAKE_UP_ACTION' => '<font color="red">Wake-Up...</font>',
291 + 'dhcpd_WAKE_UP' => 'Wake UP',
292 + 'dhcpd_WAKING_A_REMOTE_COMPUTER_ACTION' => 'Are you sure you want to wake on lan the client : ',
293 + 'dhcpd_WAKING_A_REMOTE_COMPUTER_TITLE' => 'Waking Up a remote computer',
294 + 'dhcpd_WAKING_A_REMOTE_COMPUTER' => 'You are about to wake up a remote computer.',
295 + 'dhcpd_WARNING_NO_WINPOPUP_GARANTY' =>'Warning, there is no guarantee that the popup will appear on the remote computer.',
296 + 'dhcpd_WINPOPUP_ACTION' => 'WinPopup...',
297 + 'dhcpd_WINSSERVER_BAD_IP' => 'Incorrect IP for WINS Server, Update unsuccessfull',
298 + 'dhcpd_WRITE_YOUR_MESSAGE' => 'Write your message here',
299 + 'dhcpd_YOUR_MESSAGE' => 'Your message',
300 + 'dhcpd_REMOVE_DHCP_LEASE_WARNING2' => 'The lease file is a log-structured file - whenever a lease changes, the
301 + contents of that lease are written to the end of the file. This means that it is entirely possible for there to be two
302 + or more declarations of the same lease in the lease file at the same
303 + time. In that case, the instance of that particular lease that
304 + appears last in the file is the one that is in effect.',
305 +);
306 +
307 +our %Lexicon = (
308 + %{ SrvMngr::I18N::Modules::General::en::Lexicon },
309 + %lexicon
310 +);
311 +
312 +
313 +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
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
316 +++ 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,24 +49,26 @@
318
319 % if ($dhcp_data->{trt} eq 'LEASES') {
320 %= include 'partials/_dhcpd_leases'
321 - %} elsif ($dhcp_data->{trt} eq 'WINPOPUP') {
322 - %= include 'partials/_dhcpd_winpopup'
323 %} elsif ($dhcp_data->{trt} eq 'SCAN') {
324 %= include 'partials/_dhcpd_scan'
325 %} 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])$';
327 - <table><tr><td>
328 - %= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinner()", id=>"scanLeases"
329 - <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true">
330 - Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
331 - <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>
336 - %= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2'
337 - <td>
338 - </tr>
339 + <table>
340 + <tr>
341 + <td>
342 + %= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinnerLeases()", id=>"scanLeases"
343 + <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>
356 <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
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
388 +++ 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 @@
419 %= submit_button "$btn", class => 'action'
420 % end
421 <br>
422 - <table class="sme-border table-sort"><tbody>
423 + <table class="sme-border table-sort"><thead>
424 <tr>
425 <th class='sme-border'>
426 %=l 'dhcpd_IP'
427 @@ -50,6 +50,8 @@
428 %=l 'dhcpd_ACTION'
429 </th>
430 </tr>
431 + </thead>
432 + <tbody>
433 % foreach my $ip (@$leases) {
434 <tr>
435 %= t td => (class => 'sme-border') => $ip->{ip}
436 @@ -66,9 +68,12 @@
437 %= t td => (class => 'sme-border') => $ip->{mac}
438 <td class = 'sme-border'>
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>
440 - </td><td class = 'sme-border'>
441 + </td>
442 + <!--
443 + <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>
445 </td>
446 + -->
447 </tr>
448 %}
449 </tbody>
450 @@ -110,4 +115,4 @@
451 %end
452
453
454 -</div>
455 \ No newline at end of file
456 +</div>
457 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_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_scan.html.ep 2024-01-20 11:34:00.000000000 +0000
460 @@ -0,0 +1,49 @@
461 +<div id='dhcpd-scan'>
462 + <table><tr><td>
463 + %= button_to $c->l('dhcpd_REFRESH') => '/dhcpd3', onclick=>"showSpinnerNetwork()", id=>"scanNetwork"
464 + <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="loadingNetwork" style="display:true">
465 + Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
466 + <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>
475 + <th class='sme-border'>
476 + %=l 'dhcpd_NETWORK_NAME'
477 + </th>
478 + <th class='sme-border'>
479 + %=l 'dhcpd_IP'
480 + </th>
481 + </tr>
482 + </thead>
483 + <tbody>
484 + % foreach my $ip (@$scanresults) {
485 + <tr>
486 + %= t td => (class => 'sme-border') => $ip->{Network}
487 + %= t td => (class => 'sme-border') => $ip->{ip}
488 + </tr>
489 + %}
490 + </tbody>
491 + </table>
492 + %= hidden_field "hiddenmsg"=>"", id=>"hiddenmsg"
493 + <br />
494 + %= 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>

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed