[Netpass-devel] NetPass/www/components/Client BeginScan,1.8,1.9
Brought to you by:
jeffmurphy
From: jeff m. <jef...@us...> - 2005-08-03 01:17:32
|
Update of /cvsroot/netpass/NetPass/www/components/Client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4130 Modified Files: BeginScan Log Message: progress bar bug fix Index: BeginScan =================================================================== RCS file: /cvsroot/netpass/NetPass/www/components/Client/BeginScan,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- BeginScan 8 May 2005 02:35:46 -0000 1.8 +++ BeginScan 3 Aug 2005 01:17:07 -0000 1.9 @@ -46,18 +46,19 @@ my $plugin_total = $parms->{'pitot'}; return if ($plugin_total < 1); - my $progress_bar_width = "500"; #px - my $progress_step_pixel_width = int(($progress_bar_width/$plugin_total)+1); + my $max_iteration = (split('/', $cbm->[2]))[1]; + $max_iteration ||= $plugin_total; + + my $progress_bar_width = "500"; #px same as table width + my $progress_step_pixel_width = int($progress_bar_width/$max_iteration)-2; my $progress_image = '/resources/images/progress.gif'; - $progress_bar_width = $progress_step_pixel_width*$plugin_total; # this evens out the progress bar - $progress_step_pixel_width -= 4; # nessus passes in an array. the 3rd element is basically # "pluginnum/totplugin" so we eval it to get percent done my $percent_done = int(100*(eval($cbm->[2]))); - print qq{<image src="$progress_image" border="0" width="$progress_step_pixel_width" height="10" alt="$percent_done percent">}; + print qq{<image style='margin: 0px 1px 0px 1px; padding: 1px 1px 1px 1px;' src="$progress_image" border="0" width="$progress_step_pixel_width" height="10" alt="$percent_done percent">}; $m->flush_buffer(); }; @@ -112,6 +113,7 @@ goto scan_finished; } + print "\n<!-- PIDS: ", join(',',@$pids), "-->\n"; $nessus->plugin_set(join(';', @$pids)); $nessus->attack($ip); |