]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Pages/RestoreWizard.page
baculum: Support for mobile web browsers in restore wizard
[bacula/bacula] / gui / baculum / protected / Pages / RestoreWizard.page
1 <%@ MasterClass="Application.Layouts.Wizard" Theme="Baculum-v1"%>
2 <com:TContent ID="Wizard">
3         <com:TWizard ID="RestoreWizard"
4                 CssClass="wizard"
5                 StepStyle.CssClass="steps"
6                 HeaderStyle.CssClass="header"
7                 NavigationStyle.CssClass="navigation"
8                 UseDefaultLayout="false"
9                 ShowSideBar="false"
10                 OnCancelButtonClick="wizardStop"
11                 OnCompleteButtonClick="wizardCompleted"
12                 >
13                 <prop:HeaderTemplate>
14                         <div>
15                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 0) ? 'first-active' : (($this->Parent->ActiveStepIndex === 1) ? 'first-next-active' : 'first')%>">
16                                         <div><com:TTranslate Text="Client" /></div>
17                                 </div>
18                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 1) ? 'active' : (($this->Parent->ActiveStepIndex === 2) ? 'prev-active' : 'normal')%>">
19                                         <div><com:TTranslate Text="Backup" /></div>
20                                 </div>
21                                  <div class="step step-<%=($this->Parent->ActiveStepIndex === 2) ? 'active' : (($this->Parent->ActiveStepIndex === 3) ? 'prev-active' : 'normal')%>">
22                                         <div><com:TTranslate Text="Files" /></div>
23                                 </div>
24                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 3) ? 'active' : (($this->Parent->ActiveStepIndex === 4) ? 'prev-active' : 'normal')%>">
25                                         <div><com:TTranslate Text="Where" /></div>
26                                 </div>
27                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 4) ? 'active' : (($this->Parent->ActiveStepIndex === 5) ? 'prev-active' : 'normal')%>">
28                                         <div><com:TTranslate Text="Options" /></div>
29                                 </div>
30                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 5) ? 'last-active' : (($this->Parent->ActiveStepIndex === 6) ? 'last-prev-active' : 'last')%>">
31                                         <div><com:TTranslate Text="Run" /></div>
32                                 </div>
33                                 <div id="title"><%=$this->Parent->ActiveStep->Title%><div>
34                         </div>
35                 </prop:HeaderTemplate>
36                 <prop:StartNavigationTemplate>
37                                 <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
38                                 <div class="button-prev-next"><com:BButton CommandName="NextStep" Text="<%[ Next &raquo; ]%>" /></div>
39                 </prop:StartNavigationTemplate>
40
41                 <prop:StepNavigationTemplate>
42                         <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
43                         <div class="button-prev-next">
44                                 <com:BButton CausesValidation="False" CssClass="bbutton" CommandName="PreviousStep" Text="<%[ &laquo; Previous ]%>" />
45                                 <com:BButton ID="NextButton" CommandName="NextStep" Text="<%[ Next &raquo; ]%>" Visible="<%=($this->getPage()->RestoreWizard->ActiveStepIndex != 1 || ($this->getPage()->RestoreWizard->ActiveStepIndex == 1 && $this->getPage()->BackupToRestore->ItemCount > 0))%>" />
46                         </div>
47                 </prop:StepNavigationTemplate>
48                  
49                 <prop:FinishNavigationTemplate>
50                         <div class="button-cancel"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></div>
51                         <div class="button-prev-next">
52                         <com:BButton CausesValidation="False" CssClass="bbutton" CommandName="PreviousStep" Text="<%[ &laquo; Previous ]%>" />
53                         <com:BButton CommandName="Complete" Text="<%[ Run restore ]%>" />
54                         </div>
55                 </prop:FinishNavigationTemplate>
56                 <com:TWizardStep ID="Step1" Title="<%[ Step 1 - select source backup client ]%>" StepType="Auto">
57                         <div class="line">
58                                 <div class="text"><com:TLabel ForControl="BackupClientName" Text="<%[ Backup from client: ]%>" /></div>
59                                 <div class="field">
60                                         <com:TActiveDropDownList ID="BackupClientName" CssClass="textbox" Width="350px" OnLoad="setBackupClients" OnTextChanged="setJobs" CausesValidation="false" />
61                                         <com:TCompareValidator CssClass="validator" Display="Dynamic" ControlToValidate="BackupClientName" DataType="String" ValueToCompare="none" Operator="NotEqual" Text="<%[ Please select language. ]%>" />
62                                 </div>
63                         </div>
64                 </com:TWizardStep>
65                 <com:TWizardStep ID="Step2" Title="<%[ Step 2 - select backup to restore ]%>" StepType="Auto">
66                         <com:TLabel  Text="<%[ There is no backup for restore. Please go to previous step and select another client for restore or proceed backups for the client selected in previous step. ]%>" CssClass="validation-error-summary" Visible="<%=($this->BackupToRestore->ItemCount == 0 && $this->GroupBackupToRestore->ItemCount == 0)%>"/>
67                         <div class="line" style="margin-top: 15px">
68                                 <div class="text"><com:TLabel Text="<%[ Backup selection method: ]%>" /></div>
69                                 <div class="field">
70                                         <com:TActiveRadioButton ID="OnlySelectedBackupSelection" GroupName="BackupSelection" Checked="true" OnCheckedChanged="setBackupSelection" /> <com:TLabel ForControl="OnlySelectedBackupSelection" Text="<%[ Only selected backup ]%>" />
71                                         <com:TActiveRadioButton ID="GroupBackupSelection" GroupName="BackupSelection" OnCheckedChanged="setBackupSelection" /> <com:TLabel ForControl="GroupBackupSelection" Text="<%[ Group most recent backups ]%>" /></div>
72                         </div>
73                         <com:TActivePanel ID="BackupToRestoreField">
74                                 <div class="line">
75                                         <div class="text"><com:TLabel ForControl="BackupToRestore" Text="<%[ Backup for restore: ]%>" /></div>
76                                         <div class="field">
77                                                 <com:TActiveDropDownList ID="BackupToRestore" CssClass="textbox" Width="350px" CausesValidation="false" OnTextChanged="resetFileBrowser" />
78                                         </div>
79                                 </div>
80                         </com:TActivePanel>
81                         <com:TActivePanel ID="GroupBackupToRestoreField" Display="None">
82                                 <div class="line">
83                                         <div class="text"><com:TLabel ForControl="GroupBackupToRestore" Text="<%[ Backup for restore: ]%>" /></div>
84                                         <div class="field">
85                                                 <com:TActiveDropDownList ID="GroupBackupToRestore" CssClass="textbox" Width="350px" CausesValidation="false" />
86                                         </div>
87                                 </div>
88                                 <div class="line">
89                                         <div class="text"><com:TLabel ForControl="GroupBackupFileSet" Text="<%[ FileSet resource: ]%>" /></div>
90                                         <div class="field">
91                                                 <com:TActiveDropDownList ID="GroupBackupFileSet" CssClass="textbox" Width="350px" CausesValidation="false" />
92                                         </div>
93                                 </div>
94                                 <div class="line">
95                                         <div class="text"><com:TLabel ForControl="GroupBackupStorage" Text="<%[ Storage resource: ]%>" /></div>
96                                         <div class="field">
97                                                 <com:TActiveDropDownList ID="GroupBackupStorage" OnInit="setStorage" CssClass="textbox" Width="350px" CausesValidation="false" />
98                                         </div>
99                                 </div>
100                                 <div class="line">
101                                         <div class="text"><com:TLabel ForControl="GroupBackupPool" Text="<%[ Pool resource: ]%>" /></div>
102                                         <div class="field">
103                                                 <com:TActiveDropDownList ID="GroupBackupPool" OnInit="setPool" CssClass="textbox" Width="350px" CausesValidation="false" />
104                                         </div>
105                                 </div>
106                         </com:TActivePanel>
107                 </com:TWizardStep>
108                 <com:TWizardStep ID="Step3" Title="<%[ Step 3 - select files to restore ]%>" StepType="Auto">
109                         <table id="restore-browser">
110                                 <tr>
111                                         <td rowspan="2">
112                                                 <div id="restore-browser-files-loading" style="display: none"></div>
113                                                 <div id="restore-browser-files">
114                                                         <com:TActiveDataGrid
115                                                                 ID="DataGridFiles"
116                                                                 AutoGenerateColumns="false"
117                                                                 CellPadding="2px"
118                                                                 HeaderStyle.CssClass="file-browser-header"
119                                                                 CssClass="file-browser-detail"
120                                                                 ItemStyle.CssClass="file-browser-element"
121                                                                 DataKeyField="fileid">
122                                                                         <prop:EmptyTemplate>
123                                                                                 <div class="file-browser-watermark" style="padding: 150px 10px">
124                                                                                         <%[ It seems that there is no files for choosing or file records in database for this job has been purged (file retention period expired) ]%>
125                                                                                 </div>
126                                                                         </prop:EmptyTemplate>
127                                                                         <com:TActiveTemplateColumn ID="PathField">
128                                                                                 <prop:ItemTemplate>
129                                                                                         <com:TDraggable ID="FileElementLeft" Revert="false" Handle="<%=$this->FileElementLeft->ClientID%>" Ghosting="true" CssClass="draggable">
130                                                                                                 <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file' %>" /> <%=($this->getParent()->Data['name'] != '/') ? preg_replace('/\/$/', '', $this->getParent()->Data['name']) : '/'%>
131                                                                                                                 <com:TActiveLinkButton CssClass="link" Style="float: right;" OnCallback="Page.addFileToRestore" ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : null%>" ActiveControl.EnableUpdate="false" Visible="<%=!in_array($this->getParent()->Data['name'], $this->getPage()->excludedElementsFromAdd)%>" Text="<%[ Add ]%>" />
132                                                                                         </com:TDraggable>
133                                                                                         <com:TCallback ID="FileElementCall" OnCallback="Page.getVersions" ActiveControl.CallbackParameter="<%=$this->getParent()->Data['name'] . '|' . @$this->getParent()->Data['pathid'] . '|' . @$this->getParent()->Data['filenameid'] . '|' . @$this->getParent()->Data['jobid']%>">
134                                                                                                 <prop:ClientSide.OnLoading>
135                                                                                                         $('restore-browser-files-loading').show();
136                                                                                                 </prop:ClientSide.OnLoading>
137                                                                                                 <prop:ClientSide.OnComplete>
138                                                                                                         $('restore-browser-files-loading').hide();
139                                                                                                 </prop:ClientSide.OnComplete>
140                                                                                         </com:TCallback>
141                                                                                         <script type="text/javascript">
142                                                                                                 document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('mouseup', function(event) {
143                                                                                                         event.findElement('div').setStyle({'position' : 'static', 'top' : '-1px', 'left' : '-1px'});
144                                                                                                         $('<%=$this->FileElementLeft->ClientID%>').setStyle({'position' : 'static', 'top' : '-1px', 'left' : '-1px'});
145                                                                                                 });
146                                                                                                 
147                                                                                                 document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('click', function(event) {
148                                                                                                         var el = event.target || event.srcElement;
149                                                                                                         var vposition = $(el).getStyle('left');
150                                                                                                         if(vposition == null || vposition == '0px'){
151                                                                                                                 event.stop();
152                                                                                                         } else {
153                                                                                                                 var request = <%=$this->FileElementCall->ActiveControl->Javascript %>;
154                                                                                                                 request.dispatch();
155                                                                                                         }
156                                                                                                 });
157                                                                                         </script>
158                                                                                 </prop:ItemTemplate>
159                                                                         </com:TActiveTemplateColumn>
160                                                         </com:TActiveDataGrid>
161                                                 </div>
162                                         </td>
163                                         <td>
164                                                 <div id="restore-browser-versions">
165                                                         <com:TActiveDataGrid
166                                                                 ID="VersionsDataGrid"
167                                                                 ShowHeader="false"
168                                                                 AutoGenerateColumns="false"
169                                                                 CellPadding="2px"
170                                                                 CssClass="file-browser-detail"
171                                                                 ItemStyle.CssClass="file-browser-element"
172                                                                 DataKeyField="fileid"
173                                                         >
174                                                                 <prop:EmptyTemplate>
175                                                                         <div class="file-browser-watermark">
176                                                                                 <%[ For see a file versions please click file on the left files browser. ]%>
177                                                                         </div>
178                                                                 </prop:EmptyTemplate>
179                                                                 <com:TActiveTemplateColumn>
180                                                                         <prop:ItemTemplate>
181                                                                                 <com:TDraggable ID="FileElementToRestore" Revert="false" Handle="<%=$this->FileElementToRestore->ClientID%>" Ghosting="true" CssClass="draggable" Style="float: left">
182                                                                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
183                                                                                         <com:TLabel Text="<%=$this->getParent()->Data['name']%>" Width="50%" /> <%=is_array($this->getParent()->Data['lstat']) && array_key_exists('mtime', $this->getParent()->Data['lstat']) ? date("Y-m-d H:i:s", $this->getParent()->Data['lstat']['mtime']) : ''%>
184                                                                                 </com:TDraggable>
185                                                                                 <com:TActiveLinkButton CssClass="link" Style="float: right;" OnCallback="Page.addFileToRestore" ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : false%>" ActiveControl.EnableUpdate="false" Text="<%[ Add ]%>"/>
186                                                                                 <script type="text/javascript">
187                                                                                         $('<%=$this->FileElementToRestore->ClientID%>').observe('mouseup', function(event) {
188                                                                                                 event.findElement('div').setStyle({'position' : 'static', 'top' : '0', 'left' : '0'});
189                                                                                                 $('<%=$this->FileElementToRestore->ClientID%>').setStyle({'position' : 'static', 'top' : '0', 'left' : '0'});
190                                                                                         });
191                                                                                 </script>
192                                                                         </prop:ItemTemplate>
193                                                                 </com:TActiveTemplateColumn>
194                                                         </com:TActiveDataGrid>
195                                                         </div>
196                                         </td>
197                                 </tr>
198                                 <tr>
199                                         <td style="vertical-align: bottom;">
200                                                 <div id="restore-browser-selected">
201                                                         <com:TDropContainer ID="SelectedVersionsDropper" Height="100%" Width="100%"
202                                                                 AcceptCssClass="draggable"
203                                                                 OnDrop="addFileToRestore"
204                                                                 OnCallback="refreshSelectedFiles"
205                                                                 >
206                                                                         <com:TActiveDataGrid
207                                                                                 ID="SelectedVersionsDataGrid"
208                                                                                 ShowHeader="false"
209                                                                                 AutoGenerateColumns="false"
210                                                                                 CellPadding="2px"
211                                                                                 CssClass="file-browser-detail"
212                                                                                 ItemStyle.CssClass="file-browser-element"
213                                                                                 DataKeyField="fileid"
214                                                                         >
215                                                                         <prop:EmptyTemplate>
216                                                                                 <div class="file-browser-watermark" style="padding: 50px 10px">
217                                                                                         <%[ For add a file to restore please click 'Add' link or drag a file from frame on left or from above frame and drop it here ]%>
218                                                                                 </div>
219                                                                         </prop:EmptyTemplate>
220                                                                                 <com:TActiveTemplateColumn>
221                                                                                         <prop:ItemTemplate>
222                                                                                                         <com:TPanel ID="FileElement" Style="clear: both">
223                                                                                                                 <com:TActiveImageButton ImageUrl="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_close.png" Style="float: right; vertical-align: text-bottom;margin: 3px;" OnCallback="Page.removeSelectedFile" ActiveControl.CallbackParameter="<%=isset($this->getParent()->Data['fileid']) ? $this->getParent()->Data['fileid'] : ''%>"/>
224                                                                                                                 <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
225                                                                                                                 <com:TLabel Text="<%=$this->getParent()->Data['name']%>" /> <%=is_array($this->getParent()->Data['lstat']) && array_key_exists('mtime', $this->getParent()->Data['lstat']) ? date("Y-m-d H:i:s", $this->getParent()->Data['lstat']['mtime']) : ''%>
226                                                                                                         </com:TPanel>
227                                                                                         </prop:ItemTemplate>
228                                                                                 </com:TActiveTemplateColumn>
229                                                                         </com:TActiveDataGrid>
230                                                                 </com:TDropContainer>
231                                                 </div>
232                                         </td>
233                                 </tr>
234                         </table>
235                 </com:TWizardStep>
236                 <com:TWizardStep ID="Step4" Title="<%[ Step 4 - select destination for restore ]%>" StepType="Auto">
237                         <div class="line">
238                                 <div class="text"><com:TLabel ForControl="RestoreClient" Text="<%[ Restore to client: ]%>" /></div>
239                                 <div class="field">
240                                         <com:TActiveDropDownList ID="RestoreClient" CssClass="textbox" OnLoad="setRestoreClients" CausesValidation="false" />
241                                 </div>
242                         </div>
243                         <div class="line">
244                                 <div class="text"><com:TLabel ForControl="RestorePath" Text="<%[ Restore to directory: ]%>" /></div>
245                                 <div class="field"><com:TTextBox ID="RestorePath" CssClass="textbox" Width="350px" Text="/tmp/restore" /></div>
246                         </div>
247                 </com:TWizardStep>
248                 <com:TWizardStep ID="Step5" Title="<%[ Step 5 - options for restore ]%>" StepType="Auto">
249                         <div class="line">
250                                 <div class="text"><com:TLabel ForControl="ReplaceFiles" Text="<%[ Replace files: ]%>" /></div>
251                                 <div class="field">
252                                         <com:TDropDownList ID="ReplaceFiles" CssClass="textbox" Width="350px" OnLoad="setRestoreClients" CausesValidation="false">
253                                                 <com:TListItem Value="never" Text="<%[ do not replace files ]%>" />
254                                                 <com:TListItem Value="ifolder" Text="<%[ if files from restore are older]%>" />
255                                                 <com:TListItem Value="ifnewer" Text="<%[ if files from restore are newer]%>" />
256                                                 <com:TListItem Value="always" Text="<%[ always replace files ]%>" />
257                                         </com:TDropDownList>
258                                 </div>
259                         </div>
260                         <div class="line">
261                                 <div class="text"><com:TLabel ForControl="RestoreJobPriority" Text="<%[ Restore job priority: ]%>" /></div>
262                                 <div class="field">
263                                         <com:TTextBox ID="RestoreJobPriority" CssClass="textbox" CausesValidation="false" Width="60px" MaxLength="5" Text="10" />
264                                 </div>
265                         </div>
266                 </com:TWizardStep>
267                 <com:TWizardStep ID="Step6" Title="<%[ Step 6 - Finish ]%>" StepType="Finish">
268                         <fieldset>
269                                 <legend><%[ Source parameters ]%></legend>
270                                 <div class="line">
271                                         <div class="text"><%[ Backup data from client: ]%></div>
272                                         <div class="field bold"><%=$this->getModule('api')->get(array('clients', $this->BackupClientName->SelectedValue))->output->name%></div>
273                                 </div>
274                                 <div class="line">
275                                         <div class="text"><%[ Backup selection method: ]%></div>
276                                         <div class="field bold">
277                                                 <com:TLabel Text="<%[ Only selected backup ]%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
278                                                 <com:TLabel Text="<%[ Group most recent backups ]%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
279                                         </div>
280                                 </div>
281                                 <div class="line">
282                                         <div class="text"><%[ Backup for restore: ]%></div>
283                                         <div class="field bold">
284                                                 <com:TLabel Text="<%=@$this->getModule('api')->get(array('jobs', $this->BackupToRestore->SelectedValue))->output->job%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
285                                                 <com:TLabel Text="<%=$this->GroupBackupToRestore->SelectedValue%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
286                                         </div>
287                                 </div>
288                                 <com:TPanel Visible="<%=$this->GroupBackupSelection->Checked%>">
289                                         <div class="line">
290                                                 <div class="text"><%[ FileSet for restore: ]%></div>
291                                                 <div class="field bold"><%=$this->GroupBackupFileSet->SelectedValue%></div>
292                                         </div>
293                                 </com:TPanel>
294                         </fieldset>
295                         <fieldset>
296                                 <legend><%[ Files for restore ]%></legend>
297                                 <div class="line">
298                                         <div class="text"><%[ Selected directories count: ]%></div>
299                                         <div class="field bold"><%=isset($this->getRestoreElements(true)->dirid) ? count($this->getRestoreElements(true)->dirid) : '0'%></div>
300                                 </div>
301                                 <div class="line">
302                                         <div class="text"><%[ Selected files count: ]%></div>
303                                         <div class="field bold"><%=isset($this->getRestoreElements(true)->fileid) ? count($this->getRestoreElements(true)->fileid) : '0'%></div>
304                                 </div>
305                         </fieldset>
306                         <fieldset>
307                                 <legend><%[ Destination parameters ]%></legend>
308                                 <div class="line">
309                                         <div class="text"><%[ Restore to client: ]%></div>
310                                         <div class="field bold"><%=$this->getModule('api')->get(array('clients', $this->RestoreClient->SelectedValue))->output->name%></div>
311                                 </div>
312                                 <div class="line">
313                                         <div class="text"><%[ Restore to path: ]%></div>
314                                         <div class="field bold"><%=$this->RestorePath->Text%></div>
315                                 </div>
316                         </fieldset>
317                         <fieldset>
318                                 <legend><%[ Restore job options ]%></legend>
319                                 <div class="line">
320                                         <div class="text"><%[ Replace files: ]%></div>
321                                         <div class="field bold">
322                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'never'%>" Text="<%[ do not replace files ]%>"/>
323                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifolder'%>" Text="<%[ if files from restore are older]%>"/>
324                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifnewer'%>" Text="<%[ if files from restore are newer]%>"/>
325                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'always'%>" Text="<%[ always replace files ]%>"/>
326                                         </div>
327                                 </div>
328                                 <div class="line">
329                                         <div class="text"><%[ Restore job priority: ]%></div>
330                                         <div class="field bold"><%=$this->RestoreJobPriority->Text%></div>
331                                 </div>
332                         </fieldset>
333                 </com:TWizardStep>
334         </com:TWizard>
335 </com:TContent>