From: Eric Bollengier Date: Sat, 14 Jul 2007 16:03:31 +0000 (+0000) Subject: ebl cleanup X-Git-Tag: Release-2.2.0~146 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=11a3f295d5e9be2b0773294d221d1d70b88115e2;p=bacula%2Fbacula ebl cleanup git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5182 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/cgi/bfileview.pl b/gui/bweb/cgi/bfileview.pl index a6ec97bb13..3fa688f2ce 100755 --- a/gui/bweb/cgi/bfileview.pl +++ b/gui/bweb/cgi/bfileview.pl @@ -94,6 +94,8 @@ if (-f "$base_fich/$md5_rep.png" and -f "$base_fich/$md5_rep.tpl") exit 0; } + +# if it's a file, display it if ($fnid and $pathid) { my $attribs = fv_get_file_attribute_from_id($jobid, $pathid, $fnid); @@ -102,17 +104,15 @@ if ($fnid and $pathid) $bweb->display_end(); exit 0; } -} -my $attribs = fv_get_file_attribute($jobid, $where); -if ($attribs->{found}) { - $bweb->display($attribs, 'fv_file_attribs.tpl'); - $bweb->display_end(); - exit 0; -} +} else { -if ($where !~ m!/$!) { - $where = $where . "/" ; + my $attribs = fv_get_file_attribute($jobid, $where); + if ($attribs->{found}) { + $bweb->display($attribs, 'fv_file_attribs.tpl'); + $bweb->display_end(); + exit 0; + } } my $root; @@ -120,7 +120,12 @@ my $root; if ($pathid) { $root = $pathid; $where = fv_get_root_path($pathid); + } else { + if ($where !~ m!/$!) { + $where = $where . "/" ; + } + $root = fv_get_root_pathid($where); } @@ -198,14 +203,14 @@ sub fv_display_rep } } - # 0: name, 1: size, 2: filenameid + # 0: filenameid, 1: filename, 2: size my $files = fv_get_big_files($jobid, $rep, 3*100/$max, $max_file/($level+1)); foreach my $f (@{$files}) { - $ccircle->{base_url} =~ s/pathid=\d+;(filenameid=\d+;)?/pathid=$rep;filenameid=$f->[2];/; - $ccircle->add_part($f->[1] * 100 / $max, - $f->[0], - $f->[0] . "\n" . Bweb::human_size($f->[1])); - $sum += $f->[1]; + $ccircle->{base_url} =~ s/pathid=\d+;(filenameid=\d+;)?/pathid=$rep;filenameid=$f->[0];/; + $ccircle->add_part($f->[2] * 100 / $max, + $f->[1], + $f->[1] . "\n" . Bweb::human_size($f->[2])); + $sum += $f->[2]; } if ($sum < $max) {