]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Web/Pages/RestoreWizard.page
d4d5bfdd6292eb5e7d9932bd12e57a9b7f547409
[bacula/bacula] / gui / baculum / protected / Web / Pages / RestoreWizard.page
1 <%@ MasterClass="Application.Web.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                         </com:TActivePanel>
95                 </com:TWizardStep>
96                 <com:TWizardStep ID="Step3" Title="<%[ Step 3 - select files to restore ]%>" StepType="Auto">
97                         <table id="restore-browser">
98                                 <tr>
99                                         <td rowspan="2">
100                                                 <div id="restore-browser-files-loading" style="display: none"></div>
101                                                 <div id="restore-browser-files">
102                                                         <com:TActiveDataGrid
103                                                                 ID="DataGridFiles"
104                                                                 AutoGenerateColumns="false"
105                                                                 CellPadding="2px"
106                                                                 HeaderStyle.CssClass="file-browser-header"
107                                                                 CssClass="file-browser-detail"
108                                                                 ItemStyle.CssClass="file-browser-element"
109                                                                 DataKeyField="fileid">
110                                                                         <prop:EmptyTemplate>
111                                                                                 <div class="file-browser-watermark" style="padding: 150px 10px">
112                                                                                         <%[ It seems that there is no files for choosing or file records in database for this job has been purged (file retention period expired) ]%>
113                                                                                 </div>
114                                                                         </prop:EmptyTemplate>
115                                                                         <com:TActiveTemplateColumn ID="PathField">
116                                                                                 <prop:ItemTemplate>
117                                                                                         <com:TDraggable ID="FileElementLeft" Revert="false" Handle="<%=$this->FileElementLeft->ClientID%>" Ghosting="true" CssClass="draggable">
118                                                                                                 <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']) : '/'%>
119                                                                                                                 <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()->excluded_elements_from_add)%>" Text="<%[ Add ]%>" />
120                                                                                         </com:TDraggable>
121                                                                                         <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']%>">
122                                                                                                 <prop:ClientSide.OnLoading>
123                                                                                                         document.getElementById('restore-browser-files-loading').style.display = 'block';
124                                                                                                 </prop:ClientSide.OnLoading>
125                                                                                                 <prop:ClientSide.OnComplete>
126                                                                                                         document.getElementById('restore-browser-files-loading').style.display = 'none';
127                                                                                                 </prop:ClientSide.OnComplete>
128                                                                                         </com:TCallback>
129                                                                                         <script type="text/javascript">
130                                                                                                 document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('mouseup', function(event) {
131                                                                                                         var el = event.target || event.srcElement;
132                                                                                                         if (el) {
133                                                                                                             el.style.position = 'static';
134                                                                                                             el.style.top = '-1px';
135                                                                                                             el.style.left = '-1px';
136                                                                                                         }
137                                                                                                         var fel = document.getElementById('<%=$this->FileElementLeft->ClientID%>');
138                                                                                                         fel.style.position = 'static';
139                                                                                                         fel.style.top = '-1px';
140                                                                                                         fel.style.left = '-1px';
141                                                                                                 });
142                                                                                                 
143                                                                                                 document.getElementById('<%=$this->FileElementLeft->ClientID%>').addEventListener('click', function(event) {
144                                                                                                         var el = event.target || event.srcElement;
145                                                                                                         var vposition = el.style.left;
146                                                                                                         if(vposition == null || vposition == '0px'){
147                                                                                                                 event.stop();
148                                                                                                         } else {
149                                                                                                                 var request = <%=$this->FileElementCall->ActiveControl->Javascript %>;
150                                                                                                                 request.dispatch();
151                                                                                                         }
152                                                                                                 });
153                                                                                         </script>
154                                                                                 </prop:ItemTemplate>
155                                                                         </com:TActiveTemplateColumn>
156                                                         </com:TActiveDataGrid>
157                                                 </div>
158                                         </td>
159                                         <td>
160                                                 <div id="restore-browser-versions">
161                                                         <com:TActiveDataGrid
162                                                                 ID="VersionsDataGrid"
163                                                                 ShowHeader="false"
164                                                                 AutoGenerateColumns="false"
165                                                                 CellPadding="2px"
166                                                                 CssClass="file-browser-detail"
167                                                                 ItemStyle.CssClass="file-browser-element"
168                                                                 DataKeyField="fileid"
169                                                         >
170                                                                 <prop:EmptyTemplate>
171                                                                         <div class="file-browser-watermark">
172                                                                                 <%[ For see a file versions please click file on the left files browser. ]%>
173                                                                         </div>
174                                                                 </prop:EmptyTemplate>
175                                                                 <com:TActiveTemplateColumn>
176                                                                         <prop:ItemTemplate>
177                                                                                 <com:TDraggable ID="FileElementToRestore" Revert="false" Handle="<%=$this->FileElementToRestore->ClientID%>" Ghosting="true" CssClass="draggable" Style="float: left">
178                                                                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
179                                                                                         <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']) : ''%>
180                                                                                 </com:TDraggable>
181                                                                                 <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 ]%>"/>
182                                                                                 <script type="text/javascript">
183                                                                                         $('#<%=$this->FileElementToRestore->ClientID%>').on('mouseup', function(event) {
184                                                                                                 var el = event.target || event.srcElement;
185                                                                                                 if (el) {
186                                                                                                         el.style.position = 'static';
187                                                                                                         el.style.top = 0;
188                                                                                                         el.style.left = 0;
189                                                                                                 }
190                                                                                                 var fetr = document.getElementById('<%=$this->FileElementToRestore->ClientID%>');
191                                                                                                 fetr.style.position = 'static';
192                                                                                                 fetr.style.top = 0;
193                                                                                                 fetr.style.left = 0;
194                                                                                         });
195                                                                                 </script>
196                                                                         </prop:ItemTemplate>
197                                                                 </com:TActiveTemplateColumn>
198                                                         </com:TActiveDataGrid>
199                                                         </div>
200                                         </td>
201                                 </tr>
202                                 <tr>
203                                         <td style="vertical-align: bottom;">
204                                                 <div id="restore-browser-selected">
205                                                         <com:TDropContainer ID="SelectedVersionsDropper" Height="100%" Width="100%"
206                                                                 AcceptCssClass="draggable"
207                                                                 OnDrop="addFileToRestore"
208                                                                 OnCallback="refreshSelectedFiles"
209                                                                 >
210                                                                         <com:TActiveDataGrid
211                                                                                 ID="SelectedVersionsDataGrid"
212                                                                                 ShowHeader="false"
213                                                                                 AutoGenerateColumns="false"
214                                                                                 CellPadding="2px"
215                                                                                 CssClass="file-browser-detail"
216                                                                                 ItemStyle.CssClass="file-browser-element"
217                                                                                 DataKeyField="fileid"
218                                                                         >
219                                                                         <prop:EmptyTemplate>
220                                                                                 <div class="file-browser-watermark" style="padding: 50px 10px">
221                                                                                         <%[ 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 ]%>
222                                                                                 </div>
223                                                                         </prop:EmptyTemplate>
224                                                                                 <com:TActiveTemplateColumn>
225                                                                                         <prop:ItemTemplate>
226                                                                                                         <com:TPanel ID="FileElement" Style="clear: both">
227                                                                                                                 <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'] : ''%>"/>
228                                                                                                                 <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/<%=($this->getParent()->Data['type'] == 'dir' ? 'directory-icon' : 'file-icon')%>.png" alt="<%=$this->getParent()->Data['type'] == 'dir' ? 'directory' : 'file'%>" />
229                                                                                                                 <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']) : ''%>
230                                                                                                         </com:TPanel>
231                                                                                         </prop:ItemTemplate>
232                                                                                 </com:TActiveTemplateColumn>
233                                                                         </com:TActiveDataGrid>
234                                                                 </com:TDropContainer>
235                                                 </div>
236                                         </td>
237                                 </tr>
238                         </table>
239                 </com:TWizardStep>
240                 <com:TWizardStep ID="Step4" Title="<%[ Step 4 - select destination for restore ]%>" StepType="Auto">
241                         <div class="line">
242                                 <div class="text"><com:TLabel ForControl="RestoreClient" Text="<%[ Restore to client: ]%>" /></div>
243                                 <div class="field">
244                                         <com:TActiveDropDownList ID="RestoreClient" CssClass="textbox" OnLoad="setRestoreClients" CausesValidation="false" />
245                                 </div>
246                         </div>
247                         <div class="line">
248                                 <div class="text"><com:TLabel ForControl="RestorePath" Text="<%[ Restore to directory: ]%>" /></div>
249                                 <div class="field"><com:TTextBox ID="RestorePath" CssClass="textbox" Width="350px" Text="/tmp/restore" /></div>
250                         </div>
251                 </com:TWizardStep>
252                 <com:TWizardStep ID="Step5" Title="<%[ Step 5 - options for restore ]%>" StepType="Auto">
253                         <div class="line">
254                                 <div class="text"><com:TLabel ForControl="RestoreJob" Text="<%[ Restore job: ]%>" /></div>
255                                 <div class="field">
256                                         <com:TActiveDropDownList ID="RestoreJob" CssClass="textbox" Width="350px" CausesValidation="false" />
257                                 </div>
258                         </div>
259                         <div class="line">
260                                 <div class="text"><com:TLabel ForControl="ReplaceFiles" Text="<%[ Replace files: ]%>" /></div>
261                                 <div class="field">
262                                         <com:TDropDownList ID="ReplaceFiles" CssClass="textbox" Width="350px" CausesValidation="false">
263                                                 <com:TListItem Value="never" Text="<%[ do not replace files ]%>" />
264                                                 <com:TListItem Value="ifolder" Text="<%[ if files from restore are older]%>" />
265                                                 <com:TListItem Value="ifnewer" Text="<%[ if files from restore are newer]%>" />
266                                                 <com:TListItem Value="always" Text="<%[ always replace files ]%>" />
267                                         </com:TDropDownList>
268                                 </div>
269                         </div>
270                         <div class="line">
271                                 <div class="text"><com:TLabel ForControl="RestoreJobPriority" Text="<%[ Restore job priority: ]%>" /></div>
272                                 <div class="field">
273                                         <com:TTextBox ID="RestoreJobPriority" CssClass="textbox" CausesValidation="false" Width="60px" MaxLength="5" Text="10" />
274                                 </div>
275                         </div>
276                 </com:TWizardStep>
277                 <com:TWizardStep ID="Step6" Title="<%[ Step 6 - Finish ]%>" StepType="Finish">
278                         <fieldset>
279                                 <legend><%[ Source parameters ]%></legend>
280                                 <div class="line">
281                                         <div class="text"><%[ Backup data from client: ]%></div>
282                                         <div class="field bold"><%=$this->BackupClientName->SelectedValue%></div>
283                                 </div>
284                                 <div class="line">
285                                         <div class="text"><%[ Backup selection method: ]%></div>
286                                         <div class="field bold">
287                                                 <com:TLabel Text="<%[ Only selected backup ]%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
288                                                 <com:TLabel Text="<%[ Group most recent backups ]%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
289                                         </div>
290                                 </div>
291                                 <div class="line">
292                                         <div class="text"><%[ Backup for restore: ]%></div>
293                                         <div class="field bold">
294                                                 <com:TLabel Text="<%=@$this->getModule('api')->get(array('jobs', $this->BackupToRestore->SelectedValue))->output->job%>" Visible="<%=$this->OnlySelectedBackupSelection->Checked%>" />
295                                                 <com:TLabel Text="<%=$this->GroupBackupToRestore->SelectedValue%>" Visible="<%=$this->GroupBackupSelection->Checked%>" />
296                                         </div>
297                                 </div>
298                                 <com:TPanel Visible="<%=$this->GroupBackupSelection->Checked%>">
299                                         <div class="line">
300                                                 <div class="text"><%[ FileSet for restore: ]%></div>
301                                                 <div class="field bold"><%=$this->GroupBackupFileSet->SelectedValue%></div>
302                                         </div>
303                                 </com:TPanel>
304                         </fieldset>
305                         <fieldset>
306                                 <legend><%[ Files for restore ]%></legend>
307                                 <div class="line">
308                                         <div class="text"><%[ Selected directories count: ]%></div>
309                                         <div class="field bold"><%=isset($this->getRestoreElements(true)->dirid) ? count($this->getRestoreElements(true)->dirid) : '0'%></div>
310                                 </div>
311                                 <div class="line">
312                                         <div class="text"><%[ Selected files count: ]%></div>
313                                         <div class="field bold"><%=isset($this->getRestoreElements(true)->fileid) ? count($this->getRestoreElements(true)->fileid) : '0'%></div>
314                                 </div>
315                         </fieldset>
316                         <fieldset>
317                                 <legend><%[ Destination parameters ]%></legend>
318                                 <div class="line">
319                                         <div class="text"><%[ Restore to client: ]%></div>
320                                         <div class="field bold"><%=$this->RestoreClient->SelectedValue%></div>
321                                 </div>
322                                 <div class="line">
323                                         <div class="text"><%[ Restore to path: ]%></div>
324                                         <div class="field bold"><%=$this->RestorePath->Text%></div>
325                                 </div>
326                         </fieldset>
327                         <fieldset>
328                                 <legend><%[ Restore job options ]%></legend>
329                                 <div class="line">
330                                         <div class="text"><%[ Restore job: ]%></div>
331                                         <div class="field bold"><%=$this->RestoreJob->Text%></div>
332                                 </div>
333                                 <div class="line">
334                                         <div class="text"><%[ Replace files: ]%></div>
335                                         <div class="field bold">
336                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'never'%>" Text="<%[ do not replace files ]%>"/>
337                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifolder'%>" Text="<%[ if files from restore are older]%>"/>
338                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'ifnewer'%>" Text="<%[ if files from restore are newer]%>"/>
339                                                 <com:TLabel Visible="<%=$this->ReplaceFiles->SelectedValue == 'always'%>" Text="<%[ always replace files ]%>"/>
340                                         </div>
341                                 </div>
342                                 <div class="line">
343                                         <div class="text"><%[ Restore job priority: ]%></div>
344                                         <div class="field bold"><%=$this->RestoreJobPriority->Text%></div>
345                                 </div>
346                         </fieldset>
347                 </com:TWizardStep>
348         </com:TWizard>
349 </com:TContent>