Changeset 138
- Timestamp:
- 05/09/06 17:15:26 (3 years ago)
- Files:
-
- trunk/webmin/lbs/cron/edit_cron.cgi (modified) (1 diff)
- trunk/webmin/lbs/cron/index.cgi (modified) (1 diff)
- trunk/webmin/lbs/cron/save_cron.cgi (modified) (1 diff)
- trunk/webmin/lbs/debian/changelog (modified) (1 diff)
- trunk/webmin/lbs/delete.cgi (modified) (1 diff)
- trunk/webmin/lbs/help/imgbase.fr.html (modified) (1 diff)
- trunk/webmin/lbs/help/imgbase.html (modified) (2 diffs)
- trunk/webmin/lbs/help/index.html (modified) (1 diff)
- trunk/webmin/lbs/imgbase.cgi (modified) (2 diffs)
- trunk/webmin/lbs/lang/en (modified) (1 diff)
- trunk/webmin/lbs/lang/fr (modified) (1 diff)
- trunk/webmin/lbs/lbs.pl (modified) (6 diffs)
- trunk/webmin/lbs/log.cgi (modified) (3 diffs)
- trunk/webmin/lbs/lrs-admin (added)
- trunk/webmin/lbs/module.info (modified) (1 diff)
- trunk/webmin/lbs/rename.cgi (modified) (2 diffs)
- trunk/webmin/lbs/tmpl/en/basetolocal.tpl (added)
- trunk/webmin/lbs/tmpl/fr/basetolocal.tpl (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/webmin/lbs/cron/edit_cron.cgi
r44 r138 73 73 $job->{'command'} =~ s/\\%/\0/g; 74 74 $job->{'command'} =~ s/$config{'wake'}\s+//g; 75 $job->{'command'} =~ s/>\/dev\/null//g; 75 76 @lines = split(/%/ , $job->{'command'}); 76 77 if ($in{ext_cmd} ne "") { trunk/webmin/lbs/cron/index.cgi
r44 r138 78 78 local $cmd = $job->{'command'}; 79 79 $cmd =~ s/$config{'wake'}/Wake On Lan, /; 80 $cmd =~ s/>.dev.null//; 80 81 $cmd =~ s/\\%/\0/g; $cmd =~ s/%.*$//; 81 82 $cmd =~ s/\0/%/g; trunk/webmin/lbs/cron/save_cron.cgi
r44 r138 38 38 $in{cmd} =~ s/%/\\%/g; 39 39 $in{cmd} =~ s/[\n\r ]+/ /g; 40 $in{cmd} = $config{'wake'}." ".$in{'cmd'} ;40 $in{cmd} = $config{'wake'}." ".$in{'cmd'}." >/dev/null"; 41 41 $job->{'active'} = $in{'active'}; 42 42 $job->{'command'} = $in{'cmd'}; trunk/webmin/lbs/debian/changelog
r130 r138 1 webmin-lbs (2.6. 3) stable; urgency=low1 webmin-lbs (2.6.4) stable; urgency=low 2 2 3 3 * New release. trunk/webmin/lbs/delete.cgi
r92 r138 96 96 $mesg = text("msg_delete_ok",$name,$mac); 97 97 lbs_common::print_header( $text{'tit_delete'}, "index", $VERSION); 98 lbs_common::print_html_tabs(['system_backup', "delete_machine"]); 98 lbs_common::print_html_tabs(['system_backup', "delete_machine"]); 99 100 # delete for other modules 101 # ...will be moved to lbs_common soon 102 foreach my $mod ("lbs", "lrs-inventory", "backuppc") { 103 if (-x "../$mod/lrs-admin") { 104 system("unset SERVER_SOFTWARE;unset SERVER_NAME;unset GATEWAY_INTERFACE;unset REQUEST_METHOD;unset SCRIPT_FILENAME;unset QUERY_STRING;../$mod/lrs-admin remove $mac $name >/dev/null"); 105 } 106 } 99 107 100 108 print "<h2>$mesg</h2>\n" ; trunk/webmin/lbs/help/imgbase.fr.html
r4 r138 37 37 de configuration des machines utilisatrices. 38 38 </li> 39 <li><b>Conv en Locale</b><br> 40 Permet de convertir une image partagée en image locale, si elle n'est 41 pas utilisée par plus d'un client. 42 </li> 39 43 </ul> 40 44 trunk/webmin/lbs/help/imgbase.html
r4 r138 19 19 20 20 <p> 21 The <b>Used by</b> column is useful to know which host(s) are currently 22 using a particular image in its boot menu. 23 Note that each host name (if any) in this column is a link to this host 24 local images configuration. 25 </p> 26 27 <p> 21 28 In the <b>Remove</b> column are links to completely erase one or more images. 22 29 Note that you can't remove an image if it is currently used in a host's boot … … 26 33 27 34 <p> 28 The <b>Used by</b> column is useful to know which host(s) are currently 29 using a particular image in its boot menu. 30 Note that each host name (if any) in this column is a link to this host 31 local images configuration. 35 The <b>Conv to Local</b> column allow you to convert a shared image 36 to a local one if it's not used by more than one client. 32 37 </p> trunk/webmin/lbs/help/index.html
r4 r138 12 12 On <b>LRS</b> homepage, an array of <b>registered hosts</b> is displayed. 13 13 It contains a list of all hosts which have been registered on the LRS server. 14 Each hostname in the <b>name column </b> is a link on its b>boot menu</b>14 Each hostname in the <b>name column </b> is a link on its <b>boot menu</b> 15 15 configuration. 16 16 trunk/webmin/lbs/imgbase.cgi
r4 r138 26 26 27 27 # ... and vars 28 use vars qw (%access %config %in %lbsconf %text $VERSION );28 use vars qw (%access %config %in %lbsconf %text $VERSION $current_lang); 29 29 lbs_common::init_lbs_conf() or exit(0) ; 30 30 … … 85 85 footer("", $text{'index'}) ; 86 86 87 } elsif (exists($in{'imgtolocal'}) and exists($in{'apply'}) and exists($in{'image'})) { 88 89 # move the data 90 my $from = $lbs_home . "/imgbase/". $in{'image'}; 91 my $to = $lbs_home . "/images/". lbs_common::mac_remove_columns($in{'imgtolocal'}); 92 93 # new name 94 my $lref = &read_file_lines($to."/COPYNUM"); 95 96 my $nextref = $$lref[0]; 97 $nextref =~ s/[^0-9]+//; 98 $$lref[0] = ($nextref + 1); # increment COPYNUM 99 &flush_file_lines(); 100 101 if ( -l $to."/".$in{'image'} ) { 102 # the shared image is in the menu 103 unlink($to."/".$in{'image'}); 104 system("mv $from $to ; cd $to ; mv ".$in{'image'}." Local-$nextref"); 105 # modify header.lst* 106 foreach my $name ("/header.lst", "/header.lst.wol") { 107 my $href = &read_file_lines($to.$name); 108 for (@$href) { 109 s/=$in{'image'}\//=Local-$nextref\//; 110 s/=$in{'image'}$/=Local-$nextref/; 111 } 112 &flush_file_lines(); 113 } 114 115 } else { 116 # the shared image is not in any menu 117 system("mv $from $to ; cd $to ; mv ".$in{'image'}." Local-$nextref"); 118 } 119 120 redirect("imgbase.cgi") ; 121 exit(0) ; 122 123 124 } elsif (exists($in{'imgtolocal'})) { 125 126 my $options; 127 my %einfo; 128 129 my $etherfile = $lbs_home . "/etc/ether" ; 130 etherLoad($etherfile, \%einfo) or error( lbsGetError() ) ; 131 132 # the header 133 lbs_common::print_header( $text{'tit_imgbase'}, "imgbase", $VERSION); 134 lbs_common::print_html_tabs(['list_of_machines', 'shared_images']); 135 136 if (exists($in{'mac'})) { 137 my $name = etherGetNameByMac(\%einfo, $in{'mac'}); 138 $options = "<option value=\"$in{mac}\">$name</option>"; 139 } else { 140 my @all = etherGetNames(\%einfo); 141 foreach my $n (@all) { 142 my $mac = etherGetMacByName(\%einfo, $n); 143 $options .= "<option value=\"$mac\">$n</option>\n"; 144 } 145 } 146 147 # then the main part 148 my $t = new Qtpl("./tmpl/$current_lang/basetolocal.tpl"); 149 $t->assign('IMAGE', $in{'imgtolocal'}); 150 $t->assign('OPTIONS', $options); 151 $t->parse('all'); 152 $t->out('all'); 153 154 # end of tabs 155 lbs_common::print_end_menu(); 156 lbs_common::print_end_menu(); 157 # footer 158 lbs_common::footer("", $text{'index'}) ; 159 87 160 } else { # show images array 88 161 imgBaseUsage($lbs_home, \%busage) or error(lbsGetError()) ; trunk/webmin/lbs/lang/en
r93 r138 68 68 lab_commands=Commandss 69 69 lab_comments=Comments 70 lab_convtolocal=Conv. to Local 70 71 lab_copyfile=Enter the name of the copy of $1 71 72 lab_createfile=Enter the name of the file to create trunk/webmin/lbs/lang/fr
r93 r138 68 68 lab_commands=Commandes 69 69 lab_comments=Commentaires 70 lab_convtolocal=Conv. en Locale 70 71 lab_copyfile=Indiquez le nom de la copie de $1 71 72 lab_createfile=Indiquez le nom du fichier à créer trunk/webmin/lbs/lbs.pl
r134 r138 58 58 my $etherfile = $lbs_home . "/etc/ether" ; 59 59 my $img_base = $lbs_home."/imgbase"; 60 my ($busage, $btitle,$bdesc,$bstat,$imgdir) = @_ ;61 my (@lol, @lsdel, @lsused, @lsdesc, @lstitle, @sizes,@burn,@details) ;60 my ($busage, $btitle, $bdesc, $bstat, $imgdir) = @_ ; 61 my (@lol, @lsdel, @lsused, @lsdesc, @lstitle, @sizes, @burn, @details, @lsconv) ; 62 62 my %tabattr ; 63 63 … … 65 65 etherLoad($etherfile, \%einfo) or error( lbsGetError() ) ; 66 66 67 my $delicon; # « delete » icon 68 my @images; 67 my ($delicon, $mvicon, $delref, $mvref, $mvmac, @images); 69 68 my @toprow = ( 70 69 $text{'lab_baseimg'}, … … 74 73 $text{'lab_size'}, 75 74 $text{'lab_rm'}, 75 $text{'lab_convtolocal'}, 76 76 $text{'lab_burn'}, 77 77 $text{'lab_details'}, … … 82 82 my $size = scalar(@ls); 83 83 my @uls=(); 84 my $first = $ls[0]; 84 85 85 86 push @images, $k ; 86 87 if (not $size) { # if there are no images attached 87 88 $mvmac = ""; 89 if ($size == 0 && $k ne "Base-0") { # if there are no images attached 88 90 $delicon = "trash.gif"; 91 $mvicon = "up1.gif"; 92 $delref = "<a href=\"imgbase.cgi?imgbase=".urlize($k)."\">"; 93 $mvref = "<a href=\"imgbase.cgi?imgtolocal=".urlize($k)."\">"; 89 94 @uls = ( $text{"lab_none"} ) ; 90 95 } else { # else we built an anchor list 91 96 $delicon = "cross.gif"; 97 $mvicon = "cross.gif"; 98 $delref = ""; 99 $mvref = ""; 92 100 foreach my $i (@ls) 93 101 { … … 98 106 } 99 107 } 108 109 if ($size == 1 && $k ne "Base-0") { 110 my $sname = $first; 111 $sname =~ s/.*\///; 112 $mvicon = "up1.gif"; 113 $mvref = "<a href=\"imgbase.cgi?imgtolocal=".urlize($k). 114 "&mac=".etherGetMacByName(\%einfo, $first)."\">"; 115 } 100 116 101 117 push @lsused, "<small>" . join("<br>", @uls) . "</small>" ;# which we attach with som "<br>" between each 102 118 103 119 push @lsdel, 104 "<center>" 105 ."<a href=\"imgbase.cgi?imgbase=" 106 .urlize($k) 107 ."\">" 108 ."<img src=\"images/$delicon\" " 120 "<center>$delref<img src=\"images/$delicon\" " 109 121 ."border=no alt=\"" 110 122 .$text{'lab_rm'} 123 ." $k\"></a></center>" ; 124 125 push @lsconv, 126 "<center>$mvref<img src=\"images/$mvicon\" " 127 ."border=no alt=\"" 128 .$text{'lab_convtolocal'} 111 129 ." $k\"></a></center>" ; 112 130 … … 129 147 } 130 148 131 push @lol, [ @images ],[ @lstitle ],[ @lsdesc ],[ @lsused ], [@sizes],[ @lsdel ], [@ burn], [@details] ;149 push @lol, [ @images ],[ @lstitle ],[ @lsdesc ],[ @lsused ], [@sizes],[ @lsdel ], [@lsconv], [@burn], [@details] ; 132 150 lbs_common::lolRotate(\@lol) ; 133 151 trunk/webmin/lbs/log.cgi
r107 r138 138 138 ); 139 139 140 if ($log =~ /([0-9A- E:]+) backup started \((.*)\)/) {140 if ($log =~ /([0-9A-F:]+) backup started \((.*)\)/) { 141 141 # add backup progress info 142 142 my $name = $2; … … 153 153 } 154 154 155 if ($log =~ /([0-9A- E:]+) restoration started \((.*)\)/) {155 if ($log =~ /([0-9A-F:]+) restoration started \((.*)\)/) { 156 156 # add restoration progress info 157 157 my $name = $2; … … 165 165 } 166 166 167 if ($log =~ /([0-9A- E:]+) postinstall started/) {167 if ($log =~ /([0-9A-F:]+) postinstall started/) { 168 168 # add restoration progress info 169 169 my $name = $2; trunk/webmin/lbs/module.info
r130 r138 7 7 8 8 depends=0.94 lbs_common proc at 9 version=2.6. 39 version=2.6.4 trunk/webmin/lbs/rename.cgi
r132 r138 84 84 $t =~ s|[^a-z0-9\.\-\+]|_|gi; # translate unauthorized characters into underscores 85 85 86 if ($t eq "") { error($text{'err_name_mandat'}); } 87 86 88 # group parsing: 87 89 chomp($g); # remove leading and trailing spaces … … 109 111 # rename for other modules 110 112 # ...will be moved to lbs_common soon 111 foreach my $mod ("l rs-inventory", "backuppc") {113 foreach my $mod ("lbs", "lrs-inventory", "backuppc") { 112 114 if (-x "../$mod/lrs-admin") { 113 115 system("unset SERVER_SOFTWARE;unset SERVER_NAME;unset GATEWAY_INTERFACE;unset REQUEST_METHOD;unset SCRIPT_FILENAME;unset QUERY_STRING;../$mod/lrs-admin rename $mac $old $t >/dev/null");
