if (!scalar(@jobid) and $args->{qdate} and $args->{client}) {
@jobid = $bvfs->set_job_ids_for_date($args->{client}, $args->{qdate});
-print join(",", $args->{qdate}, $args->{client}, @jobid), "\n";
-
}
$bvfs->set_curjobids(@jobid);
-
$bvfs->set_limits($args->{limit}, $args->{offset});
print CGI::header('application/x-javascript');
} elsif ($action eq 'list_versions') {
+ my $vafv = CGI::param('vafv') || 'false'; # view all file versions
+ $vafv = ($vafv 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}, 1);
+ my $files = $bvfs->get_all_file_versions($args->{pathid}, $args->{filenameid}, $args->{client}, $vafv);
print join(',',
map { "[ $_->[3], $_->[1], $_->[0], $_->[2], '$_->[8]', $_->[6], '$_->[7]', $_->[5], $_->[4] ]" }
@$files);
Ext.namespace('Ext.brestore');
-Ext.brestore.jobid=0;
-Ext.brestore.client='';
-Ext.brestore.path='';
-Ext.brestore.root_path='';
+Ext.brestore.jobid=0; // selected jobid
+Ext.brestore.jobdate=''; // selected date
+Ext.brestore.client=''; // selected client
+Ext.brestore.path=''; // current path (without user location)
+Ext.brestore.root_path=''; // user location
+
+Ext.brestore.option_vosb = false;
+Ext.brestore.option_vafv = false;
function get_node_path(node)
}
+function init_params(baseParams)
+{
+ baseParams['client']= Ext.brestore.client;
+
+ if (Ext.brestore.option_vosb) {
+ baseParams['jobid'] = Ext.brestore.jobid;
+ } else {
+ baseParams['date'] = Ext.brestore.jobdate;
+ }
+ return baseParams;
+}
+
+
function ext_init()
{
//////////////////////////////////////////////////////////////:
var Tree = Ext.tree;
var tree_loader = new Ext.tree.TreeLoader({
- baseParams:{}, //action:'list_dirs', pathid:103, jobid:9 },
+ baseParams:{},
dataUrl:'/cgi-bin/bweb/bresto.pl'
});
Ext.brestore.path = get_node_path(node);
file_store.removeAll();
- file_store.load({params:{action: 'list_files',
- jobid:Ext.brestore.jobid,
- node:node.id}
+ file_versions_store.removeAll();
+ file_store.load({params:init_params({action: 'list_files',
+ node:node.id})
});
return true;
});
proxy: new Ext.data.HttpProxy({
url: '/cgi-bin/bweb/bresto.pl',
method: 'GET',
- params:{action: 'list_files', offset:0, limit:50 }
+ params:{}
}),
reader: new Ext.data.ArrayReader({
// TODO: selection only when using dblclick
files_grid.selModel.on('rowselect', function(e,i,r) {
Ext.brestore.filename = r.json[3];
- file_versions_store.load({params:{action: 'list_versions',
- client: Ext.brestore.client,
- pathid: r.json[2],
- filenameid: r.json[1]
- }
+ file_versions_store.load({params:init_params({action: 'list_versions',
+ vafv: Ext.brestore.option_vafv,
+ pathid: r.json[2],
+ filenameid: r.json[1]
+ })
});
return true;
});
}
return true;
-
-// var sm=grid.getSelectionModel();
-// var rows=sm.getSelections();
-// var cindex=dd.getDragData(e).rowIndex;
-// for(i = 0; i < rows.length; i++) {
-// rowData=ds.getById(rows[i].id);
-// if(!this.copy)
-// ds.remove(ds.getById(rows[i].id));
-// ds.insert(cindex,rowData);
-// };
- }
- });
+ }});
file_selection_grid.on('enddrag', function(dd,e) {
emptyText:'Select a job...',
selectOnFocus:true,
forceSelection: true,
- width:300
+ width:350
});
job_combo.on('select', function(e,c) {
// TODO: choose between date and jobid here (with a toolbar bp ?)
Ext.brestore.jobid = c.json[0];
+ Ext.brestore.jobdate = c.json[1];
Ext.brestore.root_path='';
root.setText("Root");
- tree_loader.baseParams = { action:'list_dirs',
- init:1,
- jobid:Ext.brestore.jobid };
+ tree_loader.baseParams = init_params({init:1, action: 'list_dirs'});
root.reload();
});
+////////////////////////////////////////////////////////////////
+
+ function sel_option(item, check)
+ {
+ if (item.id == 'id_vosb') {
+ Ext.brestore.option_vosb = check;
+ }
+ if (item.id == 'id_vafv') {
+ Ext.brestore.option_vafv = check;
+ }
+ }
+
+ var menu = new Ext.menu.Menu({
+ id: 'div-main-menu',
+ items: [
+ new Ext.menu.CheckItem({
+ id: 'id_vosb',
+ text: 'View only selected backup',
+ checked: Ext.brestore.option_vosb,
+ checkHandler: sel_option
+ }),
+ new Ext.menu.CheckItem({
+ id: 'id_vafv',
+ text: 'View all file versions',
+ checked: Ext.brestore.option_vafv,
+ checkHandler: sel_option
+ })
+ ]
+ });
////////////////////////////////////////////////////////////////:
// create the primary toolbar
});
var tb = new Ext.Toolbar('div-toolbar', [
- client_combo,
+ client_combo,
job_combo,
'-',
{
var where = where_field.getValue();
Ext.brestore.root_path=where;
root.setText(where);
- tree_loader.baseParams = { action:'list_dirs',
- jobid:Ext.brestore.jobid,
- path: where };
+ tree_loader.baseParams = init_params({ action:'list_dirs', path: where });
root.reload();
}
},
- where_field
+ where_field,
+ '-',
+ {
+ cls: 'x-btn-text-icon bmenu', // icon and text class
+ text:'Options',
+ menu: menu // assign menu by instance
+ }
]);
////////////////////////////////////////////////////////////////
fitToFrame: true, autoCreate:true,closable: false
}));
layout.add('south', new Ext.ContentPanel('div-file-selection', {
- toolbar: tb2,resizeEl:'div-container',
+ toolbar: tb2,resizeEl:'div-file-selection',
fitToFrame: true, autoCreate:true,closable: false
}));
layout.add('east', new Ext.ContentPanel('div-file-versions', {