From 4107c6581fef961d8c2a0eb4b173a869b1b01d90 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 4 May 2009 09:50:59 +0000 Subject: [PATCH] ebl Add View copies option to bresto ebl Tweak command output to add hide/display button git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8792 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/cgi/bresto.pl | 15 ++++++++++++--- gui/bweb/html/bresto.js | 11 +++++++++++ gui/bweb/lang/en/tpl/command.tpl | 10 ++++++---- gui/bweb/lang/es/tpl/command.tpl | 10 ++++++---- gui/bweb/lang/fr/tpl/command.tpl | 10 ++++++---- gui/bweb/lib/Bweb.pm | 12 ++++++++++-- gui/bweb/technotes-3.0 | 3 +++ gui/bweb/tpl/ach_content.tpl | 2 +- gui/bweb/tpl/command.tpl | 10 ++++++---- 9 files changed, 61 insertions(+), 22 deletions(-) diff --git a/gui/bweb/cgi/bresto.pl b/gui/bweb/cgi/bresto.pl index 194598b427..b68e050a21 100755 --- a/gui/bweb/cgi/bresto.pl +++ b/gui/bweb/cgi/bresto.pl @@ -540,9 +540,13 @@ sub dbh_selectrow_arrayref # there will be only one jobid in the array of jobids... sub get_all_file_versions { - my ($self,$pathid,$fileid,$client,$see_all)=@_; + my ($self,$pathid,$fileid,$client,$see_all,$see_copies)=@_; defined $see_all or $see_all=0; + my $backup_type=" AND Job.Type = 'B' "; + if ($see_copies) { + $backup_type=" AND Job.Type IN ('C', 'B') "; + } my @versions; my $query; @@ -558,7 +562,9 @@ sub get_all_file_versions AND File.FileIndex >= JobMedia.FirstIndex AND File.FileIndex <= JobMedia.LastIndex AND JobMedia.MediaId = Media.MediaId - AND Client.Name = '$client'"; + AND Client.Name = '$client' + $backup_type +"; $self->debug($query); my $result = $self->dbh_selectall_arrayref($query); @@ -994,10 +1000,13 @@ if ($action eq 'list_files') { my $vafv = CGI::param('vafv') || 'false'; # view all file versions $vafv = ($vafv eq 'false')?0:1; + my $vcopies = CGI::param('vcopies') || 'false'; # view copies file versions + $vcopies = ($vcopies eq 'false')?0:1; + print "["; #  0 1 2 3 4 5 6 7 8 #($pathid,$fileid,$jobid, $fid, $mtime, $size, $inchanger, $md5, $volname); - my $files = $bvfs->get_all_file_versions($args->{pathid}, $args->{filenameid}, $args->{client}, $vafv); + my $files = $bvfs->get_all_file_versions($args->{pathid}, $args->{filenameid}, $args->{client}, $vafv, $vcopies); print join(',', map { "[ $_->[3], $_->[1], $_->[0], $_->[2], '$_->[8]', $_->[6], '$_->[7]', $_->[5],'" . strftime('%Y-%m-%d %H:%m:%S', localtime($_->[4])) . "']" } @$files); diff --git a/gui/bweb/html/bresto.js b/gui/bweb/html/bresto.js index 89580cb315..2b085add48 100644 --- a/gui/bweb/html/bresto.js +++ b/gui/bweb/html/bresto.js @@ -55,6 +55,7 @@ Ext.brestore.root_path=''; // user location Ext.brestore.media_store; // media store Ext.brestore.option_vosb = false; Ext.brestore.option_vafv = false; +Ext.brestore.option_vcopies = false; Ext.brestore.dlglaunch; Ext.brestore.fpattern; Ext.brestore.use_filerelocation=false; @@ -396,6 +397,7 @@ Ext.onReady(function(){ file_versions_store.load({ params:init_params({action: 'list_versions', vafv: Ext.brestore.option_vafv, + vcopies: Ext.brestore.option_vcopies, pathid: r.json[2], filenameid: r.json[1] }) @@ -703,6 +705,9 @@ Ext.onReady(function(){ if (item.id == 'id_vafv') { Ext.brestore.option_vafv = check; } + if (item.id == 'id_vcopies') { + Ext.brestore.option_vcopies = check; + } } var menu = new Ext.menu.Menu({ @@ -720,6 +725,12 @@ Ext.onReady(function(){ checked: Ext.brestore.option_vafv, checkHandler: sel_option }) + new Ext.menu.CheckItem({ + id: 'id_vafv', + text: 'View copies version', + checked: Ext.brestore.option_vcopies, + checkHandler: sel_option + }) ] }); diff --git a/gui/bweb/lang/en/tpl/command.tpl b/gui/bweb/lang/en/tpl/command.tpl index ce9a9065ca..66488b4613 100644 --- a/gui/bweb/lang/en/tpl/command.tpl +++ b/gui/bweb/lang/en/tpl/command.tpl @@ -1,9 +1,11 @@ +
-

:

+

:  

-
+ 
+ -
+ + diff --git a/gui/bweb/lang/es/tpl/command.tpl b/gui/bweb/lang/es/tpl/command.tpl index ce9a9065ca..66488b4613 100644 --- a/gui/bweb/lang/es/tpl/command.tpl +++ b/gui/bweb/lang/es/tpl/command.tpl @@ -1,9 +1,11 @@ +
-

:

+

:  

-
+ 
+ -
+ + diff --git a/gui/bweb/lang/fr/tpl/command.tpl b/gui/bweb/lang/fr/tpl/command.tpl index ce9a9065ca..66488b4613 100644 --- a/gui/bweb/lang/fr/tpl/command.tpl +++ b/gui/bweb/lang/fr/tpl/command.tpl @@ -1,9 +1,11 @@ +
-

:

+

:  

-
+ 
+ -
+ + diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index c02cf425ef..6d57df8182 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -806,6 +806,7 @@ sub set_drive { my ($self, $drive, $slot, $tag) = @_; $self->{drive}->[$drive] = $tag || $slot; + $self->{drive_slot}->[$drive] = $slot; $self->{slot}->[$slot] = $tag || 'loaded'; @@ -4482,10 +4483,17 @@ sub update_slots return $self->error("Bad autochanger name"); } - print "
";
+    $self->display({
+	title => "Scanning autochanger content ",
+	name => "update slots",
+        notail => 1,
+    }, "command.tpl");	
     my $b = new Bconsole(pref => $self->{info},timeout => 60,log_stdout => 1);
     $b->update_slots($ach->{name});
-    print "
\n" + + $self->display({ + nohead => 1, + }, "command.tpl"); } sub get_job_log diff --git a/gui/bweb/technotes-3.0 b/gui/bweb/technotes-3.0 index d5f556e275..2ddfe390ad 100644 --- a/gui/bweb/technotes-3.0 +++ b/gui/bweb/technotes-3.0 @@ -1,3 +1,6 @@ +04Apr05 +ebl Add View copies option to bresto +ebl Tweak command output to add hide/display button 29Mar09 ebl add bypool option to btime 09Mar09 diff --git a/gui/bweb/tpl/ach_content.tpl b/gui/bweb/tpl/ach_content.tpl index ac81e69745..70ede3a689 100644 --- a/gui/bweb/tpl/ach_content.tpl +++ b/gui/bweb/tpl/ach_content.tpl @@ -24,7 +24,7 @@ __Autochanger:__ ( __Drives__ + title='__clear I/O__'> __Clear I/O__ diff --git a/gui/bweb/tpl/command.tpl b/gui/bweb/tpl/command.tpl index ce9a9065ca..66488b4613 100644 --- a/gui/bweb/tpl/command.tpl +++ b/gui/bweb/tpl/command.tpl @@ -1,9 +1,11 @@ +
-

:

+

:  

-
+ 
+ -
+ + -- 2.39.5