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

Annotation 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.5 - (hide annotations) (download)
Sat Jan 20 17:11:30 2024 UTC (3 months, 3 weeks ago) by brianr
Branch: MAIN
Changes since 1.4: +22 -17 lines
*** empty log message ***

1 brianr 1.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 brianr 1.5 +++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2024-01-20 17:01:00.000000000 +0000
4     @@ -140,12 +140,12 @@
5 brianr 1.4 my $c = shift;
6     my $title = $c->l("dhcpd_SCANNING_NETWORK_TITLE");
7     my $modul = '';
8     - my $trt = "NETSCAN";
9     + my $trt = "SCAN";
10 brianr 1.1 $dhcp_data{trt} = $trt;
11     $dhcp_data{"first"} = '';
12 brianr 1.4 - # ..... get scan results into dhcp_data
13 brianr 1.1 - dhcp_data{"scanresults"} = get_scan_results($c);
14 brianr 1.4 - $c->stash( title => $title, modul => $modul, dhcp_data => \%dhcp_data );
15     + # ..... get scan results into stash for passing to html template
16     + my $dhcp_scanresults = get_scan_results($c);
17     + $c->stash( title => $title, modul => $modul, "dhcp_data" => \%dhcp_data, "scanresults" => $dhcp_scanresults);
18 brianr 1.1 $c->render( template => 'dhcpd' );
19     }
20 brianr 1.4
21 brianr 1.5 @@ -332,10 +332,10 @@
22 brianr 1.2 my $c = shift;
23     my $ret = delete_all_leases($c);
24     if ($ret == 'ok') {
25     - dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
26 brianr 1.3 + $dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
27 brianr 1.2 do_leases($c);
28     }
29     - else {dhcp_data{"error"}=$ret;}
30     + else {$dhcp_data{"error"}=$ret;}
31     return ;
32     }
33    
34 brianr 1.5 @@ -352,17 +352,17 @@
35 brianr 1.2 # else return "ok"
36     my $ret = delete_lease($c);
37     if ($ret == 'ok') {
38     - dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
39 brianr 1.3 + $dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
40 brianr 1.2 do_leases($c);
41     }
42     - else {dhcp_data{"error"}=$ret;}
43     + else {$dhcp_data{"error"}=$ret;}
44     return ;
45     }
46 brianr 1.1
47 brianr 1.4 sub get_scan_results {
48     my $c = shift;
49     #...do it
50     - return "results";
51     + return Scan_Local_Network($c);
52     }
53    
54    
55 brianr 1.5 @@ -374,13 +374,13 @@
56 brianr 1.4
57     sub delete_one_lease {
58     my $c = shift;
59     - # ...do it
60     + Perform_Del_Lease($c);
61     return "ok";
62     }
63    
64     sub delete_all_leases {
65     my $c = shift;
66     - # ...do it
67     + Perform_del_all_Lease($c);
68     return "ok";
69     }
70    
71 brianr 1.5 @@ -391,6 +391,118 @@
72 brianr 1.4 return @leases;
73     }
74    
75     +
76     +sub Perform_del_all_Lease ($){
77     +
78     + system ('/bin/echo "" > /var/lib/dhcpd/dhcpd.leases') ==0
79     + or die "Error while removing all leases: $!";
80     +
81     + system ("/sbin/e-smith/signal-event","workgroup-update") == 0
82     + or die "Error while saving settings: $!";
83     +
84     + return 'ok';
85     + exit;
86     +}
87     +
88     +#===============================================================================
89     +#SUBROUTINE: Perform delete lease
90     +#===============================================================================
91     +sub Perform_Del_Lease($){
92     +
93     + ###Pull CGI object from parameters array
94     + my $c = shift;
95     +
96     + ###Pull entry to delete
97     + my $ip = $c->param('host');
98     + my $name = $c->param('name');
99     + my $name_in_file = '/var/lib/dhcpd/dhcpd.leases' ;
100     + my $name_tmp_file = '/var/lib/dhcpd/dhcpd.leases.tmp' ;
101     + my $name_out_file = '/var/lib/dhcpd/dhcpd.leases~' ;
102     + my $del_current = "0" ;
103     +
104     + open(INFILE,"<$name_in_file") || die "Read Error $name_in_file, Read: $!";
105     + open(OUTFILE,">$name_tmp_file") || die "Write error $name_in_file, Write: $!";
106     + while (<INFILE>) {
107     + if ( "$_" =~ /lease $ip/ ) {
108     + $del_current = "1" ;
109     + }
110     + if ( $del_current == "0" ) { print OUTFILE "$_" ; }
111     + if ( "$_" =~ /}/ ) {
112     + $del_current = "0" ;
113     + }
114     + }
115     + rename ($name_tmp_file,$name_in_file) ;
116     + system ("/bin/cp","-f","$name_in_file","$name_out_file") ;
117     + close(INFILE);
118     + close(OUTFILE);
119     +
120     + # changed to new sme standard signal-event
121     + system ("/sbin/e-smith/signal-event","workgroup-update") == 0
122     + or die "Error while saving settings: $!";
123     + ###Return action message
124     + return $c->l('SUCCESSFULLY_DELETED_THE_CLIENT') . ' (' . $name . '/' . $ip .')';
125     +}
126     +
127     +#===============================================================================
128     +#SUBROUTINE: Scan The Local Network
129     +#===============================================================================
130     +sub dec2bin {
131     + my $str = unpack("B32", pack("N", shift));
132     + return $str;
133     +}
134     +
135     +sub netmask2cidr {
136     + my ($mask, $network) = @_;
137     + my @octet = split (/\./, $mask);
138     + my @bits;
139     + my $binmask;
140     + my $binoct;
141     + my $bitcount=0;
142     +
143     + foreach (@octet) {
144     + $binoct = dec2bin($_);
145     + $binmask = $binmask . substr $binoct, -8;
146     + }
147     +
148     + # let's count the 1s
149     + @bits = split (//,$binmask);
150     + foreach (@bits) {
151     + if ($_ eq "1") {
152     + $bitcount++;
153     + }
154     + }
155     +
156     + my $cidr = $network . "/" . $bitcount;
157     + return $cidr;
158     +}
159     +
160     +sub Scan_Local_Network ($) {
161     +
162     + my $nmap_sme = esmith::ConfigDB->open('/home/e-smith/db/configuration');
163     + my $mask = $nmap_sme->get_value('LocalNetmask');
164     + my $network = $nmap_sme->get_prop('InternalInterface','Network');
165     +
166     +#we start to calculate the method to find the cidr (we want to use network/cidr with nmap)
167     + my $cidr = netmask2cidr($mask, $network);
168     +
169     +#ok go to use nmap with nmap -T4 -sP network/cidr
170     + my @nmap_output= `/usr/bin/nmap --script smb-os-discovery.nse -p U:137,T:139 $cidr|
171     + /bin/grep -Ev "MAC|NetBIOS|OS CPE"| /bin/grep -E "scan|done|Computer|OS"|
172     + /bin/sed -e 's/Nmap scan/-- Scan/g'|/bin/sed -e 's/done/Done/g'|
173     + /bin/sed -e 's/Nmap//g'|/bin/sed -e 's/|/ /g'`;
174     +
175     + my @extracted_output;
176     + foreach my $line (@nmap_output) {
177     + if ($line =~ m/Scan report for ([\w\.-]+) \(([\d\.\:]+)\)/) {
178     + my %pair = ('Network' => $1, 'ip' => $2); # $1 => PC Name, $2 => IP Address
179     + push @extracted_output, \%pair;
180     + }
181     + }
182     + return \@extracted_output;
183     +}
184     +
185     +
186     +
187     #=========================================================================
188     # Procedure qui charge le dhcpd.conf
189     # retourne un tableau contenant les informations
190 brianr 1.5 @@ -536,4 +648,4 @@
191 brianr 1.1
192     1;
193    
194     -
195     \ No newline at end of file
196     +
197 brianr 1.4 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
198     --- 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
199     +++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Dhcpd/en.pm 2024-01-20 08:46:00.000000000 +0000
200     @@ -0,0 +1,109 @@
201     +package SrvMngr::I18N::Modules::Dhcpd::en;
202     +use strict;
203     +use warnings;
204     +use utf8;
205     +use Mojo::Base 'SrvMngr::I18N';
206     +
207     +use SrvMngr::I18N::Modules::General::en;
208     +
209     +my %lexicon = (
210     + 'dhcpd_ACTION' => 'Action',
211     + 'dhcpd_ACTIVE_DEVICE' => 'Active Device',
212     + 'dhcpd_ALL_OF_THEM' => 'All of them',
213     + 'dhcpd_CHECK_CLIENT_STATUS' => 'Always check the status of computers (Disabled is much faster)',
214     + 'dhcpd_CLEAN_ALL_DHCPLEASES' => 'You may want to clean the dhcpd.leases',
215     + 'dhcpd_CLICK_HERE_TO_MAIN_PANEL' => 'Return to the main panel',
216     + 'dhcpd_CONNECTED_IP' => 'Show DHCP Clients',
217     + 'dhcpd_CUSTOM_DNS_STATUS' => 'Custom DNS',
218     + 'dhcpd_CUSTOM_DNS_TITLE' => 'Enable custom DNS servers.',
219     + 'dhcpd_CUSTOM_GATEWAY_ADDRESS' => 'Gateway address',
220     + 'dhcpd_CUSTOM_GATEWAY_STATUS' => 'Custom gateway',
221     + 'dhcpd_CUSTOM_GATEWAY_TITLE' => 'Enable a custom gateway address.',
222     + 'dhcpd_CUSTOM_LEASETIME' => 'Custom lease time',
223     + 'dhcpd_CUSTOM_LEASETIME_TITLE' => 'Set the lease time (default is 86400 seconds).',
224     + 'dhcpd_CUSTOM_WINSERVER_ADDRESS' => 'WINS Server address',
225     + 'dhcpd_CUSTOM_WINSERVER_STATUS' => 'WINS Server',
226     + 'dhcpd_CUSTOM_WINSERVER_TITLE' => 'Enable a WINS Server.',
227     + 'dhcpd_DHCPD_SETTING_ERRORS' => 'DHCPd Settings ERRORS',
228     + 'dhcpd_DHCPD_SETTINGS_TITLE' => 'DHCP server settings',
229     + 'dhcpd_DHCPD_TITLE' => 'DHCP Manager',
230     + 'dhcpd_DHCP_END' => 'DHCP End',
231     + 'dhcpd_DHCP manager' => 'DHCP Manager',
232     + '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',
233     + 'dhcpd_DHCP_RANGE_WITH_BAD_IP' => 'Incorrect IP in the DHCP range, Update unsuccessfull',
234     + 'dhcpd_DHCP_START' => 'DHCP Start',
235     + 'dhcpd_DHCP_START_GREATER_DHCP_END_ERRORS' =>'Incorrect range of IPs, the DHCP Start is greater than the DHCP End , Update unsuccessfull',
236     + 'dhcpd_DISABLED' => 'Disabled',
237     + 'dhcpd_DNS_SERVER_WITH_BAD_IP' => 'Incorrect IP for DNS servers, Update unsuccessfull',
238     + 'dhcpd_DO_YOU_WANT_TO_SENT' => 'Do you want to send this message to',
239     + 'dhcpd_ENABLED' => 'Enabled',
240     + 'dhcpd_END_DATE' => 'End Date',
241     + 'dhcpd_ERROR_WHILE_REMOVING_ALL_LEASES' => 'Error while removing all dhcpd Leases',
242     + 'dhcpd_ERROR_WHILE_SAVING_SETTINGS' => 'Error while saving settings',
243     + 'dhcpd_GATEWAY_BAD_IP' => 'Incorrect IP for Gateway, Update unsuccessfull',
244     + 'dhcpd_GLOBAL_WINPOPUP' => 'Send Global Netsend WinPopup',
245     + 'dhcpd_GLOBAL_WINPOPUP_TITLE' => 'Send a global WinPopup with the Net send protocol',
246     + 'dhcpd_IP' => 'Ip Address',
247     + 'dhcpd_MAC_ADDRESS' => 'MAC Address',
248     + 'dhcpd_MANAGING_DHCP_CLIENT' => 'Managing DHCP clients',
249     + 'dhcpd_NETWORK_NAME' => 'Network Name',
250     + 'dhcpd_NETWORK_VALUES_FOUND' => 'Please wait .... Your subnet and your netmask appear to be :',
251     + 'dhcpd_NO_CONNECTED_COMPUTERS' => 'There are no connected computers',
252     + 'dhcpd_NOT_CHECKED' => 'Not Checked...',
253     + 'dhcpd_PRIMARY_DNS_ADDRESS' => 'Primary DNS',
254     + 'dhcpd_REFRESH_CONNECTED_IP_LIST' => 'You may want to refresh this list ?',
255     + 'dhcpd_REFRESH' => 'Refresh the list',
256     + 'dhcpd_REMOVE_ACTION' => 'Remove...',
257     + 'dhcpd_REMOVE_A_DHCP_LEASE_ACTION' => 'You are about to remove a client from the dhcpd.leases file.',
258     + 'dhcpd_REMOVE_A_DHCP_LEASE' => 'Remove a DHCP lease',
259     + 'dhcpd_ARE_YOU_SURE' => 'are you sure ?',
260     + 'dhcpd_REMOVE_A_DHCP_LEASE_TITLE' => 'Removing a DHCP Lease',
261     + 'dhcpd_REMOVE_ALL_LEASES_ACTION' => 'Remove all dhcpd leases',
262     + 'dhcpd_REMOVE_ALL_LEASES' => 'Remove all leases',
263     + 'dhcpd_REMOVE_DHCP_LEASE_TITLE' => 'Removing all DHCP Lease',
264     + 'dhcpd_REMOVE_DHCP_LEASE_WARNING' => 'Remove all entries in dhcpd.leases may cause issues',
265     + 'dhcpd_REMOVE' => 'Remove',
266     + 'dhcpd_SAVE/RESTART' => 'Save/Restart',
267     + 'dhcpd_SAVE_TITLE' => 'After changing settings above, you must save and restart dhcpd.',
268     + 'dhcpd_SCANNING_NETWORK_TITLE' => 'Scanning your network, the time needed depends on your subnet mask',
269     + 'dhcpd_SCAN_YOUR_NETWORK' => 'Scan your network',
270     + 'dhcpd_SCAN_YOUR_NETWORK_TITLE' => 'Scan your network to show active devices :',
271     + 'dhcpd_SECONDARY_DNS_ADDRESS' => 'Secondary DNS',
272     + 'dhcpd_SENDING_A_WINPOPUP' => 'Sending a WinPopup',
273     + 'dhcpd_SENDING_A_WINPOPUP_TO' => 'You are about to send a WinPopup to ',
274     + 'dhcpd_SEND_WINPOPUP_TO' => 'Send a WinPopup to',
275     + 'dhcpd_SHOW_CONNECTED_IP_TITLE' => 'Show all devices connected to the dhcpd server :',
276     + 'dhcpd_START_DATE' => 'Start Date',
277     + 'dhcpd_STATUS_CLICK_FOR_WOL' => 'Status - click for WOL',
278     + 'dhcpd_STATUS_DHCP_SERVER' => 'State of DHCPD',
279     + 'dhcpd_STATUS_REPORT' => 'Operation status report :',
280     + 'dhcpd_SUCCESSFULLY_CLIENT_WOL_REQUEST' =>'Successfull request to wake up the client. The computer may take time to wake up.',
281     + 'dhcpd_SUCCESSFULLY_DELETED_THE_CLIENT' => 'Successfully deleted the client in dhcpd.leases : ',
282     + 'dhcpd_SUCCESSFULLY_REMOVED_ALL_LEASES' => 'Successfully deleted all leases.',
283     + 'dhcpd_SUCCESSFULLY_SAVED_SETTINGS' => 'Successfully saved settings',
284     + 'dhcpd_SUCCESSFULLY_SENT_MESSAGE' => 'Successfully sent message popup to',
285     + 'dhcpd_TERTIARY_DNS_ADDRESS' => 'Tertiary DNS',
286     + 'dhcpd_WAKE_UP_ACTION' => '<font color="red">Wake-Up...</font>',
287     + 'dhcpd_WAKE_UP' => 'Wake UP',
288     + 'dhcpd_WAKING_A_REMOTE_COMPUTER_ACTION' => 'Are you sure you want to wake on lan the client : ',
289     + 'dhcpd_WAKING_A_REMOTE_COMPUTER_TITLE' => 'Waking Up a remote computer',
290     + 'dhcpd_WAKING_A_REMOTE_COMPUTER' => 'You are about to wake up a remote computer.',
291     + 'dhcpd_WARNING_NO_WINPOPUP_GARANTY' =>'Warning, there is no guarantee that the popup will appear on the remote computer.',
292     + 'dhcpd_WINPOPUP_ACTION' => 'WinPopup...',
293     + 'dhcpd_WINSSERVER_BAD_IP' => 'Incorrect IP for WINS Server, Update unsuccessfull',
294     + 'dhcpd_WRITE_YOUR_MESSAGE' => 'Write your message here',
295     + 'dhcpd_YOUR_MESSAGE' => 'Your message',
296     + 'dhcpd_REMOVE_DHCP_LEASE_WARNING2' => 'The lease file is a log-structured file - whenever a lease changes, the
297     + contents of that lease are written to the end of the file. This means that it is entirely possible for there to be two
298     + or more declarations of the same lease in the lease file at the same
299     + time. In that case, the instance of that particular lease that
300     + appears last in the file is the one that is in effect.',
301     +);
302     +
303     +our %Lexicon = (
304     + %{ SrvMngr::I18N::Modules::General::en::Lexicon },
305     + %lexicon
306     +);
307     +
308     +
309     +1;
310 brianr 1.1 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
311     --- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep 2023-12-19 09:44:56.680590493 +0000
312 brianr 1.5 +++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/dhcpd.html.ep 2024-01-20 17:01:00.000000000 +0000
313 brianr 1.4 @@ -49,24 +49,26 @@
314    
315     % if ($dhcp_data->{trt} eq 'LEASES') {
316     %= include 'partials/_dhcpd_leases'
317     - %} elsif ($dhcp_data->{trt} eq 'WINPOPUP') {
318     - %= include 'partials/_dhcpd_winpopup'
319     %} elsif ($dhcp_data->{trt} eq 'SCAN') {
320     %= include 'partials/_dhcpd_scan'
321     %} else { #PARAMS
322     % 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])$';
323     - <table><tr><td>
324     - %= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinner()", id=>"scanLeases"
325     - <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true">
326     - Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
327     - <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
328     - </button>
329     - </td><td>
330     - %= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3'
331 brianr 1.1 - </td><td>
332     - %= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2'
333 brianr 1.4 - <td>
334     - </tr>
335     + <table>
336     + <tr>
337     + <td>
338     + %= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinnerLeases()", id=>"scanLeases"
339     + <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true">
340     + Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
341     + <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
342     + </button>
343     + </td><td>
344 brianr 1.5 + %= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3', onclick=>"showSpinnerNetwork()", id=>"scanNetwork"
345 brianr 1.4 + <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="loadingNetwork" style="display:true">
346     + Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
347     + <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
348     + </button>
349     + </td>
350     + </tr>
351 brianr 1.1 </table>
352     <hr />
353 brianr 1.4 <h2>
354     @@ -180,10 +182,17 @@
355    
356     %= javascript begin
357     document.getElementById("load").style.display="none";
358     - function showSpinner(){
359     + document.getElementById("loadingNetwork").style.display="none";
360     +
361     + function showSpinnerLeases(){
362     document.getElementById("scanLeases").style.display="none";
363     document.getElementById("load").style.display="inline";
364     }
365     +
366     + function showSpinnerNetwork(){
367     + document.getElementById("scanNetwork").style.display="none";
368     + document.getElementById("loadingNetwork").style.display="inline";
369     + }
370     %end
371    
372     %= stylesheet begin
373     @@ -205,7 +214,6 @@
374     border-color: darkgrey;
375     border-image: initial;
376     }
377     -
378     %end
379     -
380     %end
381     +1;
382 brianr 1.1 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
383     --- 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
384 brianr 1.4 +++ 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
385     @@ -1,17 +1,17 @@
386     <div id='dhcpd-leases'>
387     <table><tr><td>
388     - %= button_to $c->l('dhcpd_REFRESH') => '/dhcpd1', onclick=>"showSpinner()", id=>"scanLeases"
389     - <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true">
390     - Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
391     - <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
392     - </button>
393     -
394     - </td><td>
395     - %= button_to $c->l('dhcpd_REMOVE_ALL_LEASES') => '/dhcpd4'
396     - </td>
397     - </tr>
398     + %= button_to $c->l('dhcpd_REFRESH') => '/dhcpd1', onclick=>"showSpinnerLeases()", id=>"scanLeases"
399     + <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="load" style="display:true">
400     + Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
401     + <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
402     + </button>
403     +
404     + </td><td>
405     + %= button_to $c->l('dhcpd_REMOVE_ALL_LEASES') => '/dhcpd4'
406     + </td>
407     + </tr>
408     </table>
409     - <hr />
410     +
411     % my $btn = l('dhcpd_SAVE/RESTART');
412     %= form_for '/dhcpd10' => (method => 'POST') => begin
413     <span class=label>
414 brianr 1.1 @@ -26,7 +26,7 @@
415     %= submit_button "$btn", class => 'action'
416     % end
417     <br>
418     - <table class="sme-border table-sort"><tbody>
419     + <table class="sme-border table-sort"><thead>
420     <tr>
421     <th class='sme-border'>
422     %=l 'dhcpd_IP'
423     @@ -50,6 +50,8 @@
424     %=l 'dhcpd_ACTION'
425     </th>
426     </tr>
427     + </thead>
428     + <tbody>
429     % foreach my $ip (@$leases) {
430     <tr>
431     %= t td => (class => 'sme-border') => $ip->{ip}
432     @@ -66,9 +68,12 @@
433     %= t td => (class => 'sme-border') => $ip->{mac}
434     <td class = 'sme-border'>
435     <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>
436     - </td><td class = 'sme-border'>
437     + </td>
438 brianr 1.2 + <!--
439 brianr 1.1 + <td class = 'sme-border'>
440     <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>
441     </td>
442     + -->
443     </tr>
444     %}
445     </tbody>
446 brianr 1.3 @@ -110,4 +115,4 @@
447 brianr 1.1 %end
448    
449    
450     -</div>
451     \ No newline at end of file
452     +</div>
453 brianr 1.4 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
454     --- 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
455 brianr 1.5 +++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_scan.html.ep 2024-01-20 17:08:00.000000000 +0000
456     @@ -0,0 +1,58 @@
457 brianr 1.4 +<div id='dhcpd-scan'>
458     + <table><tr><td>
459 brianr 1.5 + %= button_to $c->l('dhcpd_REFRESH') => '/dhcpd3', onclick=>"showSpinnerNetwork1()", id=>"scanNetwork1"
460     + <button class ="btn btn-primary spinnerButtonOverlay" type = "submit" id="loadingNetwork1" style="display:true">
461 brianr 1.4 + Scanning <!--%= $c->l('dhcpd_CONNECTED_IP')-->
462     + <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
463     + </button>
464     +
465     + </td>
466     + </tr>
467     +
468     + </table>
469     + <table class="sme-border table-sort"><thead>
470     + <tr>
471     + <th class='sme-border'>
472     + %=l 'dhcpd_NETWORK_NAME'
473     + </th>
474     + <th class='sme-border'>
475     + %=l 'dhcpd_IP'
476     + </th>
477     + </tr>
478     + </thead>
479     + <tbody>
480     + % foreach my $ip (@$scanresults) {
481     + <tr>
482     + %= t td => (class => 'sme-border') => $ip->{Network}
483     + %= t td => (class => 'sme-border') => $ip->{ip}
484     + </tr>
485     + %}
486     + </tbody>
487     + </table>
488     + %= hidden_field "hiddenmsg"=>"", id=>"hiddenmsg"
489     + <br />
490     + %= button_to $c->l('dhcpd_CLICK_HERE_TO_MAIN_PANEL') => '/dhcpd'
491     +
492     + %= javascript begin
493     + function Wol_confirm(event,msg,current){
494     + const getMAC = /.*MAC\=(.*)\&name.*/;
495     + var MAC = current.href.match(getMAC)[1];
496     + if (confirm(msg+": MAC: "+MAC))
497     + { return true;}
498     + else {event.preventDefault();return false;}
499     + }
500     +
501     +
502     + %end
503     +
504     +
505     +</div>
506 brianr 1.5 +%= javascript begin
507     + document.getElementById("loadingNetwork1").style.display="none";
508     +
509     + function showSpinnerNetwork1(){
510     + document.getElementById("scanNetwork1").style.display="none";
511     + document.getElementById("loadingNetwork1").style.display="inline";
512     + }
513     +
514     +%end

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