From: <ri...@us...> - 2007-11-26 22:35:35
|
Revision: 5992 http://bacula.svn.sourceforge.net/bacula/?rev=5992&view=rev Author: ricozz Date: 2007-11-26 14:35:22 -0800 (Mon, 26 Nov 2007) Log Message: ----------- ebl Add media list to bresto Modified Paths: -------------- trunk/gui/bweb/cgi/bresto.pl trunk/gui/bweb/html/bresto.html trunk/gui/bweb/html/bresto.js trunk/gui/bweb/technotes-2.3 Modified: trunk/gui/bweb/cgi/bresto.pl =================================================================== --- trunk/gui/bweb/cgi/bresto.pl 2007-11-26 22:01:19 UTC (rev 5991) +++ trunk/gui/bweb/cgi/bresto.pl 2007-11-26 22:35:22 UTC (rev 5992) @@ -964,7 +964,7 @@ } elsif ($action eq 'get_media') { my $jobid = join(',', @jobid); - my $fileid = join(',', grep { /^\d+$/ } CGI::param('fileid')); + my $fileid = join(',', grep { /^\d+(,\d+)*$/ } CGI::param('fileid')); my $q=" SELECT DISTINCT VolumeName, Enabled, InChanger @@ -974,7 +974,7 @@ VolumeName, Enabled, Inchanger FROM JobMedia JOIN Media USING (MediaId) WHERE JobId IN ($jobid) - GROUP BY VolumeName, InChanger + GROUP BY VolumeName,Enabled,InChanger ) AS allmedia WHERE File.FileId IN ($fileid) AND File.FileIndex >= allmedia.FirstIndex @@ -982,7 +982,7 @@ "; my $lst = $bvfs->dbh_selectall_arrayref($q); print "["; - print join(',', map { "['$_->[0]',$_->[1]],$_->[2]]" } @$lst); + print join(',', map { "['$_->[0]',$_->[1],$_->[2]]" } @$lst); print "]\n"; } Modified: trunk/gui/bweb/html/bresto.html =================================================================== --- trunk/gui/bweb/html/bresto.html 2007-11-26 22:01:19 UTC (rev 5991) +++ trunk/gui/bweb/html/bresto.html 2007-11-26 22:35:22 UTC (rev 5992) @@ -27,6 +27,7 @@ <div id="div-resto-dlg" style="visibility:hidden;"> <div id="div-resto-form" > +<div id="div-media" ></div> <div id="div-resto-form-bp1"></div> <div id="div-resto-form-bp2"></div> </div> </div> Modified: trunk/gui/bweb/html/bresto.js =================================================================== --- trunk/gui/bweb/html/bresto.js 2007-11-26 22:01:19 UTC (rev 5991) +++ trunk/gui/bweb/html/bresto.js 2007-11-26 22:35:22 UTC (rev 5992) @@ -690,23 +690,85 @@ selectOnFocus:true, width:190 }); +//////////////////////////////////////////////////////////////// + var media_store = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: '/cgi-bin/bweb/bresto.pl', + method: 'GET', + params:{offset:0, limit:50 } + }), + + reader: new Ext.data.ArrayReader({ + }, Ext.data.Record.create([ + {name: 'volumename'}, + {name: 'enabled' }, + {name: 'inchanger' } + ])) + }); + + var media_cm = new Ext.grid.ColumnModel([{ + header: "InChanger", + dataIndex: 'inchanger', + width: 60, + renderer: rd_vol_is_online + }, { + header: "Volume", + id: 'volumename', + dataIndex: 'volumename', + width: 140 + } + ]); + + // create the grid + var media_grid = new Ext.grid.Grid('div-media', { + ds: media_store, + cm: media_cm, + enableDrag: false, + enableDrop: false, + loadMask: true, + width: 200, + enableColLock:false + }); + + media_grid.render(); + + var items = file_selection_store.data.items; + var tab_fileid=new Array(); + var tab_jobid=new Array(); + for(var i=0;i<items.length;i++) { + if (items[i].data['fileid']) { + tab_fileid.push(items[i].data['fileid']); + } + tab_jobid.push(items[i].data['jobid']); + } + var res = tab_fileid.join(","); + var res2 = tab_jobid.join(","); + + media_store.baseParams = init_params({action: 'get_media', jobid: res2, fileid: res}); + media_store.reload(); + +//////////////////////////////////////////////////////////////// fs.fieldset( + {legend:'Media needed'}, + media_grid + ); + fs.fieldset( {legend:'Restore job'}, -// new Ext.form.ComboBox({ -// fieldLabel: 'Replace', -// hiddenName:'replace', -// store: new Ext.data.SimpleStore({ -// fields: ['replace'], -// data : [['always'],['never'],['if newer']] -// }), -// displayField:'replace', -// typeAhead: true, -// mode: 'local', -// triggerAction: 'all', -// emptyText:'never', -// selectOnFocus:true, -// width:190 -// }), + new Ext.form.ComboBox({ + fieldLabel: 'Replace', + hiddenName:'replace', + store: new Ext.data.SimpleStore({ + fields: ['replace'], + data : [['always'],['never'],['if newer']] + }), + displayField:'replace', + typeAhead: true, + mode: 'local', + triggerAction: 'all', + emptyText:'never', + selectOnFocus:true, + width:190 + }), // // new Ext.form.ComboBox({ // fieldLabel: 'job', @@ -754,22 +816,23 @@ var res4 = ';client=' + rclient_combo.getValue() + ';storage=' + storage_combo.getValue() + ';where=' + where_text.getValue(); window.location='/cgi-bin/bweb/bresto.pl?action=restore' + res + res2 + res3 + res4; - } - var dialog = Ext.brestore.dlglaunch; - dialog.addKeyListener(27, dialog.hide, dialog); - dialog.addButton('Submit', launch_restore); - dialog.addButton('Close', dialog.hide, dialog); + } // end launch_restore - var layout = dialog.getLayout(); - layout.beginUpdate(); - layout.add('center', new Ext.ContentPanel('div-resto-form', { - autoCreate:true, title: 'Third Tab', closable:true, background:true})); - layout.endUpdate(); - dialog.show(); + var dialog = Ext.brestore.dlglaunch; + dialog.addKeyListener(27, dialog.hide, dialog); + dialog.addButton('Submit', launch_restore); + dialog.addButton('Close', dialog.hide, dialog); + + var layout = dialog.getLayout(); + layout.beginUpdate(); + layout.add('center', new Ext.ContentPanel('div-resto-form', { + autoCreate:true, title: 'Third Tab', closable:true, background:true})); + layout.endUpdate(); + dialog.show(); - } - } - ]); + } + } + ]); //////////////////////////////////////////////////////////////// Modified: trunk/gui/bweb/technotes-2.3 =================================================================== --- trunk/gui/bweb/technotes-2.3 2007-11-26 22:01:19 UTC (rev 5991) +++ trunk/gui/bweb/technotes-2.3 2007-11-26 22:35:22 UTC (rev 5992) @@ -2,6 +2,7 @@ ebl Fix overview to works with mysql ebl Add date support to bresto ebl Make bresto works with mysql (no DISTINCT ON (c1,c2)) +ebl Add the list of media that will be needed for resto 25Nov07 ebl Use a automatic rediction when launching a new job This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |