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

Diff 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 | View Patch Patch

Revision 1.1 by brianr, Sat Dec 30 15:47:19 2023 UTC Revision 1.5 by brianr, Sat Jan 20 17:11:30 2024 UTC
# Line 1  Line 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  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 17:01:00.000000000 +0000
4  @@ -117,22 +117,41 @@  @@ -140,12 +140,12 @@
5            my $c = shift;
6         my $title = $c->l("dhcpd_SCANNING_NETWORK_TITLE");
7         my $modul = '';
8    -    my $trt   = "NETSCAN";
9    +    my $trt   = "SCAN";
10         $dhcp_data{trt} = $trt;
11         $dhcp_data{"first"} = '';
12    -       # ..... get scan results into dhcp_data
13    -       dhcp_data{"scanresults"} = get_scan_results($c);
14    -    $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       $c->render( template => 'dhcpd' );       $c->render( template => 'dhcpd' );
19   }         }
20      
21    @@ -332,10 +332,10 @@
22            my $c = shift;
23         my $ret = delete_all_leases($c);
24            if ($ret == 'ok') {
25    -               dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
26    +               $dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
27                    do_leases($c);
28            }      
29    -       else {dhcp_data{"error"}=$ret;}
30    +       else {$dhcp_data{"error"}=$ret;}
31         return ;
32     }
33    
34  -  @@ -352,17 +352,17 @@
35  -sub do_winpopup {       # else return "ok"
36  -       #       my $ret = delete_lease($c);
37  -       # call to win pop up          if ($ret == 'ok') {
38  -       #  -               dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
39  +sub netmask2cidr {  +               $dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS";
40                    do_leases($c);
41            }      
42    -       else {dhcp_data{"error"}=$ret;}
43    +       else {$dhcp_data{"error"}=$ret;}
44         return ;
45     }
46    
47     sub get_scan_results {
48          my $c = shift;          my $c = shift;
49  -    my $title = $c->l("dhcpd_GLOBAL_WINPOPUP");          #...do it
50  -    my $modul = '';  -       return "results";
51  -    my $trt   = "WINPOPUP";  +       return Scan_Local_Network($c);
52  -    $dhcp_data{trt} = $trt;   }
53  -    $dhcp_data{"first"} = '';          
54  -       #..... get winpopup details  
55  -    $c->stash( title => $title, modul => $modul, dhcp_data => \%dhcp_data );  @@ -374,13 +374,13 @@
56  -    $c->render( template => 'dhcpd' );  
57  +    #my ($mask, $network) = @_;   sub delete_one_lease {
58  +       my $nmap_sme = esmith::ConfigDB->open('/home/e-smith/db/configuration');          my $c = shift;  
59  +       my $mask = $nmap_sme->get_value('LocalNetmask');  -    # ...do it
60  +       my $network = $nmap_sme->get_prop('InternalInterface','Network');  +       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    @@ -391,6 +391,118 @@
72         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);  +    my @octet = split (/\./, $mask);
138  +    my @bits;  +    my @bits;
139  +    my $binmask;  +    my $binmask;
# Line 47  diff -urN smeserver-dhcpmanager-2.0.4.ol Line 157  diff -urN smeserver-dhcpmanager-2.0.4.ol
157  +    return $cidr;  +    return $cidr;
158  +}  +}
159  +  +
160  +sub dec2bin {  +sub Scan_Local_Network ($) {          
161  +  my $str = unpack("B32", pack("N", shift));  +    
162  +  return $str;  +        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   sub do_scan {  +#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          # call to show scan results  +
169  @@ -140,12 +159,13 @@  +#ok go to use nmap with nmap -T4 -sP network/cidr
170          my $c = shift;  +       my @nmap_output= `/usr/bin/nmap --script smb-os-discovery.nse -p U:137,T:139 $cidr|
171       my $title = $c->l("dhcpd_SCANNING_NETWORK_TITLE");  +                               /bin/grep -Ev "MAC|NetBIOS|OS CPE"| /bin/grep -E "scan|done|Computer|OS"|
172       my $modul = '';  +                               /bin/sed -e 's/Nmap scan/-- Scan/g'|/bin/sed -e 's/done/Done/g'|
173  -    my $trt   = "NETSCAN";  +                               /bin/sed -e 's/Nmap//g'|/bin/sed -e 's/|/  /g'`;
174  +    my $trt   = "SCAN";  +      
175       $dhcp_data{trt} = $trt;  +    my @extracted_output;
176       $dhcp_data{"first"} = '';  +    foreach my $line (@nmap_output) {
177          # ..... get scan results into dhcp_data  +        if ($line =~ m/Scan report for ([\w\.-]+) \(([\d\.\:]+)\)/) {
178  -       dhcp_data{"scanresults"} = get_scan_results($c);  +            my %pair = ('Network' => $1, 'ip' => $2);  # $1 => PC Name, $2 => IP Address
179  -    $c->stash( title => $title, modul => $modul, dhcp_data => \%dhcp_data );  +            push @extracted_output, \%pair;
180  +       $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;  
181  +    }  +    }
182    +    return \@extracted_output;
183    +}
184    +                
185  +  +
 +    close $nmap;  
186  +  +
187  +    return \@result;   #=========================================================================
188   }   # Procedure qui charge le dhcpd.conf
189             # retourne un tableau contenant les informations
190    @@ -536,4 +648,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 @@  
191    
192   1;   1;
193    
# Line 129  diff -urN smeserver-dhcpmanager-2.0.4.ol Line 196  diff -urN smeserver-dhcpmanager-2.0.4.ol
196  +        +      
197  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
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  --- 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    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
200  @@ -0,0 +1,109 @@  @@ -0,0 +1,109 @@
201  +package SrvMngr::I18N::Modules::Dhcpd::en;  +package SrvMngr::I18N::Modules::Dhcpd::en;
202  +use strict;  +use strict;
# Line 242  diff -urN smeserver-dhcpmanager-2.0.4.ol Line 309  diff -urN smeserver-dhcpmanager-2.0.4.ol
309  +1;  +1;
310  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
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  --- 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  +++ 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 17:01:00.000000000 +0000
313  @@ -49,10 +49,8 @@  @@ -49,24 +49,26 @@
314    
315          % if ($dhcp_data->{trt} eq 'LEASES') {          % if ($dhcp_data->{trt} eq 'LEASES') {
316                  %= include 'partials/_dhcpd_leases'                  %= include 'partials/_dhcpd_leases'
317  -       %} elsif ($dhcp_data->{trt} eq 'WINPOPUP') {  -       %} elsif ($dhcp_data->{trt} eq 'WINPOPUP') {
318  -               %= include 'partials/_dhcpd_winpopup'  -               %= include 'partials/_dhcpd_winpopup'
319          %} elsif ($dhcp_data->{trt} eq 'SCAN') {          %} elsif ($dhcp_data->{trt} eq 'SCAN') {
320  -               %= include 'partials/_dhcpd_scan'                  %= include 'partials/_dhcpd_scan'
 +               %= include 'partials/_dhcpd_scanresults'  
321          %} else {                                       #PARAMS          %} 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])$';                  % 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>  -               <table><tr><td>
324  @@ -63,9 +61,12 @@  -               %= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinner()", id=>"scanLeases"
325                  </button>  -               <button class ="btn btn-primary spinnerButtonOverlay"  type = "submit" id="load" style="display:true">
326                  </td><td>  -                 Scanning  <!--%= $c->l('dhcpd_CONNECTED_IP')-->
327                  %= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3'  -                 <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  -               </td><td>  -               </td><td>
332  -               %= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2'  -               %= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2'
333  +               </td>  -               <td>
334  +               <!--  -               </tr>
335                  <td>  +               <table>
336  +               %= button_to $c->l('dhcpd_GLOBAL_WINPOPUP') => '/dhcpd2'  +                       <tr>
337  +               </td>  +                       <td>
338  +               -->  +                               %= button_to $c->l('dhcpd_CONNECTED_IP') => '/dhcpd1', onclick=>"showSpinnerLeases()", id=>"scanLeases"
339                  </tr>  +                               <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    +                               %= button_to $c->l('dhcpd_SCAN_YOUR_NETWORK') => '/dhcpd3', onclick=>"showSpinnerNetwork()", id=>"scanNetwork"
345    +                               <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                  </table>                    </table>  
352                  <hr />                  <hr />
353                    <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  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
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  --- 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  +++ 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
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  @@ -26,7 +26,7 @@  @@ -26,7 +26,7 @@
415                  %= submit_button "$btn", class => 'action'                  %= submit_button "$btn", class => 'action'
416       % end       % end
# Line 297  diff -urN smeserver-dhcpmanager-2.0.4.ol Line 435  diff -urN smeserver-dhcpmanager-2.0.4.ol
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>                                  <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'>  -                       </td><td class = 'sme-border'>
437  +                       </td>  +                       </td>
438  +                       <!-->  +                       <!--
439  +                       <td class = 'sme-border'>  +                       <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>                                  <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>                          </td>
# Line 312  diff -urN smeserver-dhcpmanager-2.0.4.ol Line 450  diff -urN smeserver-dhcpmanager-2.0.4.ol
450  -</div>  -</div>
451  \ No newline at end of file  \ No newline at end of file
452  +</div>  +</div>
453  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
454  --- 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
455  +++ 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 17:08:00.000000000 +0000
456  @@ -0,0 +1,41 @@  @@ -0,0 +1,58 @@
457  +<div id='dhcpd-scanresults'>  +<div id='dhcpd-scan'>
458  +%#= 1/0  +       <table><tr><td>
459  +       %= $c->l('dhcpd_NETWORK_VALUES_FOUND').$dhcp_data->{"cidr"};  +       %= button_to $c->l('dhcpd_REFRESH') => '/dhcpd3', onclick=>"showSpinnerNetwork1()", id=>"scanNetwork1"
460  +       %= form_for '/dhcpd10' => (method => 'POST') => begin  +       <button class ="btn btn-primary spinnerButtonOverlay"  type = "submit" id="loadingNetwork1" style="display:true">
461  +       <br />  +         Scanning  <!--%= $c->l('dhcpd_CONNECTED_IP')-->
462  +       <table class="sme-border table-sort"><thead>  +         <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>  +               <tr>
471  +                               <th class='sme-border'>  +                       <th class='sme-border'>
472  +                               %=l 'dhcpd_NETWORK_NAME'  +                               %=l 'dhcpd_NETWORK_NAME'
473  +                       </th>  +                       </th>
474  +                       <th class='sme-border'>  +                       <th class='sme-border'>
475  +                               %=l 'dhcpd_IP'  +                               %=l 'dhcpd_IP'
476  +                       </th>  +                       </th>
 +                       <th class='sme-border'>  
 +                               %=l 'dhcpd_MAC_ADDRESS'  
 +                       </th>  
 +                       <th class='sme-border'>  
 +                               %=l 'dhcpd_STATUS_CLICK_FOR_WOL'  
 +                       </th>  
477  +               </tr>  +               </tr>
478  +               </thead>  +               </thead>
479  +               <tbody>  +               <tbody>
480  +               % foreach my $line (@$scanresults) {  +        % foreach my $ip (@$scanresults) {
481  +                       % my @thisline = @$line;  +        <tr>
482  +                       <tr>  +                       %= t td => (class => 'sme-border') => $ip->{Network}
483  +                       <td class='sme-border'>  +                       %= t td => (class => 'sme-border') => $ip->{ip}
484  +                       %= "$thisline[4]";  +               </tr>
485  +                       </td>  +               %}
486  +                       <td class='sme-border'>  +               </tbody>
 +                       %= "$thisline[5]";  
 +                       </td>  
 +                       <td class='sme-border'>  
 +                       </td>  
 +                       <td class='sme-border'>  
 +                       </td>  
 +                       </tr>  
 +               %}  
487  +       </table>  +       </table>
488  +    % end  +       %= hidden_field "hiddenmsg"=>"", id=>"hiddenmsg"
489    +       <br />
490  +       %= button_to $c->l('dhcpd_CLICK_HERE_TO_MAIN_PANEL') => '/dhcpd'  +       %= 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>  +</div>
506    +%= 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


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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