]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/API/Pages/Panel/APIInstallWizard.page
baculum: New Baculum API and Baculum Web
[bacula/bacula] / gui / baculum / protected / API / Pages / Panel / APIInstallWizard.page
1 <%@ MasterClass="Application.API.Layouts.Wizard" Theme="Baculum-v1"%>
2 <com:TContent ID="Wizard">
3         <com:TClientScript ScriptUrl=<%~ ../../JavaScript/misc.js %> />
4         <com:TWizard ID="InstallWizard"
5                 CssClass="wizard"
6                 StepStyle.CssClass="steps"
7                 HeaderStyle.CssClass="header"
8                 NavigationStyle.CssClass="navigation"
9                 UseDefaultLayout="false"
10                 ShowSideBar="false"
11                 OnCancelButtonClick="wizardStop"
12                 OnCompleteButtonClick="wizardCompleted"
13                 >
14                 <prop:HeaderTemplate>
15                         <div>
16                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 0) ? 'first-active' : (($this->Parent->ActiveStepIndex === 1) ? 'first-next-active' : 'first')%>">
17                                         <div><com:TTranslate Text="Language" /></div>
18                                 </div>
19                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 1) ? 'active' : (($this->Parent->ActiveStepIndex === 2) ? 'prev-active' : 'normal')%>">
20                                         <div><com:TTranslate Text="Catalog API" /></div>
21                                 </div>
22                                  <div class="step step-<%=($this->Parent->ActiveStepIndex === 2) ? 'active' : (($this->Parent->ActiveStepIndex === 3) ? 'prev-active' : 'normal')%>">
23                                         <div><com:TTranslate Text="Console API" /></div>
24                                 </div>
25                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 3) ? 'active' : (($this->Parent->ActiveStepIndex === 4) ? 'prev-active' : 'normal')%>">
26                                         <div><com:TTranslate Text="Config API" /></div>
27                                 </div>
28                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 4) ? 'active' : (($this->Parent->ActiveStepIndex === 5) ? 'prev-active' : 'normal')%>">
29                                         <div><com:TTranslate Text="Authorization" /></div>
30                                 </div>
31                                 <div class="step step-<%=($this->Parent->ActiveStepIndex === 5) ? 'last-active' : (($this->Parent->ActiveStepIndex === 6) ? 'last-prev-active' : 'last')%>">
32                                         <div><com:TTranslate Text="Finish" /></div>
33                                 </div>
34                                 <div id="title"><%=$this->Parent->ActiveStep->Title%><div>
35                         </div>
36                 </prop:HeaderTemplate>
37                 <prop:StartNavigationTemplate>
38                                 <com:TPanel CssClass="button-cancel" Visible="<%=$this->getPage()->first_run === false%>"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></com:TPanel>
39                                 <div <%=$this->getPage()->first_run === false ? 'class="button-prev-next"' : ''%>><com:BButton CommandName="NextStep" Text="<%[ Next &raquo; ]%>" /></div>
40                 </prop:StartNavigationTemplate>
41
42                 <prop:StepNavigationTemplate>
43                         <com:TPanel CssClass="button-cancel" Visible="<%=$this->getPage()->first_run === false%>"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></com:TPanel>
44                         <div <%=$this->getPage()->first_run === false ? 'class="button-prev-next"' : ''%>>
45                                 <com:BButton CausesValidation="False" CssClass="bbutton" CommandName="PreviousStep" Text="<%[ &laquo; Previous ]%>" />
46                                 <com:BButton ID="NextButton" CommandName="NextStep" Attributes.onclick="return (wizard_validation) ? wizard_validation() : true;" Text="<%[ Next &raquo; ]%>" />
47                         </div>
48                 </prop:StepNavigationTemplate>
49                 <prop:FinishNavigationTemplate>
50                         <com:TPanel CssClass="button-cancel" Visible="<%=$this->getPage()->first_run === false%>"><com:BButton CommandName="Cancel" Text="<%[ Cancel ]%>" /></com:TPanel>
51                         <div <%=$this->getPage()->first_run === false ? 'class="button-prev-next"' : ''%>>
52                                 <com:BButton CausesValidation="False" CssClass="bbutton" CommandName="PreviousStep" Text="<%[ &laquo; Previous ]%>" />
53                                 <com:BButton CommandName="Complete" Text="<%[ Save ]%>" />
54                         </div>
55                 </prop:FinishNavigationTemplate>
56                 <com:TWizardStep ID="Step1" Title="<%[ Step 1 - select language ]%>" StepType="Auto">
57                         <div class="line">
58                                 <div class="text"><com:TLabel ForControl="Lang" Text="<%[ Language: ]%>" /></div>
59                                 <div class="field">
60                                         <com:TActiveDropDownList ID="Lang" CssClass="textbox" Width="150px" OnTextChanged="setLang" CausesValidation="false" ClientSide.OnComplete="location.reload();">
61                                                 <com:TListItem Value="en" Text="<%[ English ]%>" />
62                                                 <com:TListItem Value="pl" Text="<%[ Polish ]%>" />
63                                         </com:TActiveDropDownList>
64                                         <com:TCompareValidator CssClass="validator-block" Display="Dynamic" ControlToValidate="Lang" DataType="String" ValueToCompare="none" Operator="NotEqual" Text="<%[ Please select language. ]%>" />
65                                 </div>
66                         </div>
67                 </com:TWizardStep>
68                 <com:TWizardStep ID="Step2" Title="<%[ Step 2 - share the Bacula Catalog Database ]%>" StepType="Auto">
69                         <p><%[ Do you want to setup and to share the Bacula Catalog Database access for this API instance? ]%></p>
70                         <div class="line">
71                                 <com:TRadioButton ID="DatabaseNo" GroupName="SelectDatabase" Attributes.onclick="$('#configure_database').hide();" /> <com:TLabel ForControl="DatabaseNo" Text="<%[ No ]%>" />
72                         </div>
73                         <div class="line">
74                                 <com:TRadioButton ID="DatabaseYes" GroupName="SelectDatabase" Attributes.onclick="$('#configure_database').show();" /> <com:TLabel ForControl="DatabaseYes" Text="<%[ Yes ]%>" />
75                         </div>
76                         <div id="configure_database" style="display: <%=($this->DatabaseYes->Checked === true) ? '' : 'none';%>">
77                                 <com:TActivePanel ID="Step2Content">
78                                         <div class="line">
79                                                 <div class="text"><com:TLabel ForControl="DBType" Text="<%[ Database type: ]%>" /></div>
80                                                 <div class="field">
81                                                         <com:TActiveDropDownList
82                                                                 ID="DBType"
83                                                                 CssClass="textbox"
84                                                                 Width="170px"
85                                                                 OnLoad="setDBType"
86                                                                 OnTextChanged="setDBType"
87                                                                 CausesValidation="false"
88                                                                 OnCallback="renderPanel"
89                                                         >
90                                                                 <com:TListItem Value="none" Text="<%[ select database ]%>" />
91                                                                 <com:TListItem Value="pgsql" Text="PostgreSQL" />
92                                                                 <com:TListItem Value="mysql" Text="MySQL" />
93                                                                 <com:TListItem Value="sqlite" Text="SQLite" />
94                                                         </com:TActiveDropDownList>
95                                                         <com:TCompareValidator
96                                                                 CssClass="validator-block"
97                                                                 Display="Dynamic"
98                                                                 ControlToValidate="DBType"
99                                                                 DataType="String"
100                                                                 ValueToCompare="none"
101                                                                 Operator="NotEqual"
102                                                                 ValidationGroup="DbGroup"
103                                                                 Text="<%[ Please select database type. ]%>"
104                                                         />
105                                                 </div>
106                                         </div>
107                                         <div class="line">
108                                                 <div class="text"><com:TLabel ForControl="DBName" Text="<%[ Database name: ]%>" /></div>
109                                                 <div class="field">
110                                                         <com:TTextBox ID="DBName" CssClass="textbox" />
111                                                         <com:TRequiredFieldValidator
112                                                                 CssClass="validator-block"
113                                                                 Display="Dynamic"
114                                                                 ControlCssClass="invalidate"
115                                                                 ControlToValidate="DBName"
116                                                                 ValidationGroup="DbGroup"
117                                                                 Text="<%[ Please enter database name. ]%>"
118                                                         />
119                                                 </div>
120                                         </div>
121                                         <div class="line">
122                                                 <div class="text"><com:TLabel ForControl="Login" Text="<%[ Login: ]%>" /></div>
123                                                 <div class="field">
124                                                         <com:TActiveTextBox ID="Login" CssClass="textbox" />
125                                                         <com:TRequiredFieldValidator
126                                                                 ID="LoginValidator"
127                                                                 CssClass="validator-block"
128                                                                 Display="Dynamic"
129                                                                 ControlCssClass="invalidate"
130                                                                 ControlToValidate="Login"
131                                                                 ValidationGroup="DbGroup"
132                                                                 Text="<%[ Please enter login. ]%>"
133                                                         />
134                                                 </div>
135                                         </div>
136                                         <div class="line">
137                                                 <div class="text"><com:TLabel ForControl="Password" Text="<%[ Password: ]%>" /></div>
138                                                 <div class="field"><com:TActiveTextBox
139                                                         ID="Password"
140                                                         CssClass="textbox"
141                                                         TextMode="Password"
142                                                         PersistPassword="true"
143                                                  /></div>
144                                         </div>
145                                         <div class="line">
146                                                 <div class="text"><com:TLabel ForControl="IP" Text="<%[ IP address (or hostname): ]%>" /></div>
147                                                 <div class="field">
148                                                         <com:TActiveTextBox ID="IP" CssClass="textbox" />
149                                                         <com:TRequiredFieldValidator
150                                                                 ID="IPValidator"
151                                                                 CssClass="validator-block"
152                                                                 Display="Dynamic"
153                                                                 ControlCssClass="invalidate"
154                                                                 ControlToValidate="IP"
155                                                                 ValidationGroup="DbGroup"
156                                                                 Text="<%[ Please enter IP address or hostname. ]%>"
157                                                         />
158                                                 </div>
159                                         </div>
160                                         <div class="line">
161                                                 <div class="text"><com:TLabel ForControl="Port" Text="<%[ Port: ]%>" /></div>
162                                                 <div class="field">
163                                                         <com:TActiveTextBox ID="Port" CssClass="textbox" Width="55px" MaxLength="5" Enabled="false" />
164                                                         <com:TRequiredFieldValidator
165                                                                 ID="PortValidator"
166                                                                 CssClass="validator-block"
167                                                                 Display="Dynamic"
168                                                                 ControlCssClass="invalidate"
169                                                                 ControlToValidate="Port"
170                                                                 ValidationGroup="DbGroup"
171                                                                 Text="<%[ Please enter database port. ]%>"
172                                                         />
173                                                 </div>
174                                         </div>
175                                         <com:TActivePanel
176                                                 ID="DBPathField"
177                                                 CssClass="line"
178                                                 Display="<%=$this->getPage()->first_run === false && !$this->IsCallBack && $this->getPage()->config['db']['type'] == 'sqlite' ? 'Fixed' : $this->DBPathField->Display%>">
179                                                 <div class="text"><com:TLabel ForControl="DBPath" Text="<%[ SQLite database path: ]%>" /></div>
180                                                 <div class="field">
181                                                         <com:TActiveTextBox ID="DBPath" CssClass="textbox" Enabled="false" />
182                                                         <com:TRequiredFieldValidator
183                                                                 ID="DBPathValidator"
184                                                                 Display="Dynamic"
185                                                                 CssClass="validator-block"
186                                                                 ControlCssClass="invalidate"
187                                                                 ControlToValidate="DBPath"
188                                                                 ValidationGroup="DbGroup"
189                                                                 Text="<%[ Please enter database path. ]%>"
190                                                         />
191                                                 </div>
192                                         </com:TActivePanel>
193                                         <div class="line">
194                                                 <div class="text"><com:TLabel ForControl="ConnectionTest" Text="<%[ Connection test: ]%>" /></div>
195                                                 <div class="field">
196                                                         <table border="0" cellpadding="1px">
197                                                                 <tr>
198                                                                         <td align="center" valign="middle">
199                                                                                 <com:TActiveButton ID="ConnectionTest" Text="<%[ test ]%>" CausesValidation="false" OnCallback="connectionDBTest">
200                                                                                         <prop:ClientSide.OnLoading>
201                                                                                                 $('#<%=$this->DbTestResultOk->ClientID%>').hide();
202                                                                                                 $('#<%=$this->DbTestResultErr->ClientID%>').hide();
203                                                                                                 $('#<%=$this->DbTestLoader->ClientID%>').show();
204                                                                                         </prop:ClientSide.OnLoading>
205                                                                                         <prop:ClientSide.OnComplete>
206                                                                                                 $('#<%=$this->DbTestLoader->ClientID%>').hide();
207                                                                                         </prop:ClientSide.OnComplete>
208                                                                                 </com:TActiveButton>
209                                                                         </td>
210                                                                         <td align="center" valign="middle">
211                                                                                 <com:TActiveLabel ID="DbTestLoader" Display="None"><img src="<%=$this->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></com:TActiveLabel>
212                                                                                 <com:TActiveLabel ID="DbTestResultOk" Display="None" CssClass="validate"><img src="<%=$this->getTheme()->getBaseUrl()%>/icon_ok.png" alt="Validate" /> <%[ OK ]%></com:TActiveLabel>
213                                                                                 <com:TActiveLabel ID="DbTestResultErr" Display="None" CssClass="validator-block left"><img src="<%=$this->getTheme()->getBaseUrl()%>/icon_err.png" alt="Invalidate" /> <%[ Connection error ]%></com:TActiveLabel>
214                                                                         </td>
215                                                                 </tr>
216                                                         </table>
217                                                 </div>
218                                         </div>
219                                         <div style="clear: left"></div>
220                                 </com:TActivePanel>
221                         </div>
222                         <script type="text/javascript">
223                                 var wizard_validation = function() {
224                                         var result = true;
225                                         var db = document.getElementById('<%=$this->DatabaseYes->ClientID%>');
226                                         if (db.checked) {
227                                                 result = Prado.Validation.validate(Prado.Validation.getForm(), 'DbGroup');
228                                         }
229                                         return result;
230                                 }
231                         </script>
232                 </com:TWizardStep>
233                 <com:TWizardStep ID="Step3" Title="<%[ Step 3 - share the Bacula Bconsole commands interface ]%>" StepType="Auto">
234                         <p><%[ Do you want to setup and share the Bacula Bconsole interface to execute commands in this API instance? ]%></p>
235                         <div class="line">
236                                 <com:TRadioButton ID="ConsoleNo" GroupName="SelectConsole" Attributes.onclick="$('#configure_console').hide();" /> <com:TLabel ForControl="ConsoleNo" Text="<%[ No ]%>" />
237                         </div>
238                         <div class="line">
239                                 <com:TRadioButton ID="ConsoleYes" GroupName="SelectConsole" Attributes.onclick="$('#configure_console').show();" /> <com:TLabel ForControl="ConsoleYes" Text="<%[ Yes ]%>" />
240                         </div>
241                         <div id="configure_console" style="display: <%=($this->ConsoleYes->Checked === true) ? '' : 'none';%>">
242                                 <div class="line">
243                                         <div class="text"><com:TLabel ForControl="BconsolePath" Text="<%[ Bconsole binary file path: ]%>" /></div>
244                                         <div class="field">
245                                                 <com:TTextBox ID="BconsolePath" CssClass="textbox" CausesValidation="false" />
246                                                 <com:TRequiredFieldValidator CssClass="validator-block" Display="Dynamic" ControlCssClass="invalidate" ControlToValidate="BconsolePath" Text="<%[ Please enter bconsole path. ]%>" />
247                                         </div>
248                                 </div>
249                                 <div class="line">
250                                         <div class="text"><com:TLabel ForControl="BconsoleConfigPath" Text="<%[ Bconsole admin config file path: ]%>" /></div>
251                                         <div class="field">
252                                                 <com:TTextBox ID="BconsoleConfigPath" CssClass="textbox" CausesValidation="false" />
253                                                 <com:TRequiredFieldValidator CssClass="validator-block" Display="Dynamic" ControlCssClass="invalidate" ControlToValidate="BconsoleConfigPath" Text="<%[ Please enter bconsole config file path. ]%>" />
254                                         </div>
255                                 </div>
256                                 <div class="line">
257                                         <div class="text"><com:TLabel ForControl="UseSudo" Text="<%[ Use sudo: ]%>" /></div>
258                                         <div class="field">
259                                                 <com:TCheckBox ID="UseSudo" />
260                                         </div>
261                                 </div>
262                                 <div class="line">
263                                         <div class="text"><com:TLabel ForControl="BconsoleConnectionTest" Text="<%[ Bconsole connection test: ]%>" /></div>
264                                         <div class="field">
265                                                 <table border="0" cellpadding="1px">
266                                                         <tr>
267                                                                 <td  align="center" valign="middle">
268                                                                         <com:TActiveButton ID="BconsoleConnectionTest" Text="<%[ test ]%>" CausesValidation="false" OnCallback="connectionBconsoleTest">
269                                                                                 <prop:ClientSide.OnLoading>
270                                                                                         $('#<%=$this->BconsoleTestResultOk->ClientID%>').hide();
271                                                                                         $('#<%=$this->BconsoleTestResultErr->ClientID%>').hide();
272                                                                                         $('#<%=$this->BconsoleTestLoader->ClientID%>').show();
273                                                                                 </prop:ClientSide.OnLoading>
274                                                                                 <prop:ClientSide.OnComplete>
275                                                                                         $('#<%=$this->BconsoleTestLoader->ClientID%>').hide();
276                                                                                 </prop:ClientSide.OnComplete>
277                                                                         </com:TActiveButton>
278                                                                 </td>
279                                                                 <td align="center" valign="middle">
280                                                                         <com:TActiveLabel ID="BconsoleTestLoader" Display="None"><img src="<%=$this->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></com:TActiveLabel>
281                                                                         <com:TActiveLabel ID="BconsoleTestResultOk" Display="None" CssClass="validate" EnableViewState="false"><img src="<%=$this->getTheme()->getBaseUrl()%>/icon_ok.png" alt="Validate" /> <%[ OK ]%></com:TActiveLabel>
282                                                                         <com:TActiveLabel ID="BconsoleTestResultErr" Display="None" CssClass="validator-block left" EnableViewState="false"><img src="<%=$this->getTheme()->getBaseUrl()%>/icon_err.png" alt="Invalidate" /> <%[ Connection error ]%></com:TActiveLabel>
283                                                                 </td>
284                                                         </tr>
285                                                 </table>
286                                         </div>
287                                 </div>
288                                 <div class="line">
289                                         <span><b><%[ NOTE! ]%></b><br /><em><%[ Baculum needs access to bconsole by the web server. ]%></em></span>
290                                 </div>
291                         </div>
292                 </com:TWizardStep>
293                 <com:TWizardStep ID="Step4" Title="<%[ Step 4 - share the Bacula configuration interface ]%>" StepType="Auto">
294                         <p><%[ Do you want to setup and share the Bacula configuration interface to configure Bacula components via this API instance? ]%></p>
295                         <div class="line">
296                                 <com:TRadioButton ID="ConfigNo" GroupName="SelectConfig" Attributes.onclick="$('#configure_config').hide();" /> <com:TLabel ForControl="ConfigNo" Text="<%[ No ]%>" />
297                         </div>
298                         <div class="line">
299                                 <com:TRadioButton ID="ConfigYes" GroupName="SelectConfig" Attributes.onclick="$('#configure_config').show();" /> <com:TLabel ForControl="ConfigYes" Text="<%[ Yes ]%>" />
300                         </div>
301                         <div id="configure_config" style="display: <%=($this->ConfigYes->Checked === true) ? '' : 'none';%>">
302                                 <div id="config_fields">
303                                         <fieldset class="config_field">
304                                                 <legend><%[ General configuration ]%></legend>
305                                                 <div class="config_lines">
306                                                         <div class="line">
307                                                                 <div class="text"><com:TLabel ForControl="BConfigDir" Text="<%[ Directory path for new config files: ]%>" /></div>
308                                                                 <div class="field">
309                                                                         <com:TRequiredFieldValidator ValidationGroup="ConfigGroup" ControlToValidate="BConfigDir" Display="Dynamic" Text="<%[ Directory path field is required. ]%>" />
310                                                                         <com:TActiveCustomValidator ID="BConfigDirWritableTest" ValidationGroup="ConfigGroup" ControlToValidate="BConfigDir" ErrorMessage="<%[ Provided directory path is not writable by web server. ]%>" ControlCssClass="validation-error" Display="Dynamic" OnServerValidate="testConfigDir" />
311                                                                         <com:TTextBox ID="BConfigDir" CssClass="textbox" />
312                                                                 </div>
313                                                         </div>
314                                                         <div class="line">
315                                                                 <div class="text"><com:TLabel ForControl="BJSONUseSudo" Text="<%[ Use sudo: ]%>" /></div>
316                                                                 <div class="field">
317                                                                         <com:TCheckBox ID="BJSONUseSudo" />
318                                                                 </div>
319                                                         </div>
320                                                 </div>
321                                                 <span class="config_test_loader" style="display: none"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></span>
322                                                 <com:TActiveLabel ID="BConfigDirTestOk" Display="None" CssClass="validate config_test_result" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="<%[ OK ]%>" /> <%[ OK ]%></com:TActiveLabel>
323                                                 <com:TActiveLabel ID="BConfigDirTestErr" Display="None" CssClass="validator left" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="<%[ Error ]%>" /> <%[ Error ]%></com:TActiveLabel>
324                                         </fieldset>
325                                         <fieldset class="config_field">
326                                                 <legend>Director</legend>
327                                                 <div class="config_lines">
328                                                         <div class="line">
329                                                                 <div class="text"><com:TLabel ForControl="BDirJSONPath" Text="<%[ bdirjson binary file path: ]%>" /></div>
330                                                                 <div class="field">
331                                                                         <com:TCustomValidator ValidationGroup="ConfigGroup" ControlToValidate="BDirJSONPath" ClientValidationFunction="bjsontools_validator" Display="Dynamic" Text="<%[ There is required to provide both binary file and config file paths. ]%>" />
332                                                                         <com:TTextBox ID="BDirJSONPath" CssClass="textbox" />
333                                                                 </div>
334                                                         </div>
335                                                         <div class="line">
336                                                                 <div class="text"><com:TLabel ForControl="DirCfgPath" Text="<%[ Main Director config file path (usually bacula-dir.conf): ]%>" /></div>
337                                                                 <div class="field">
338                                                                         <com:TCustomValidator ValidationGroup="ConfigGroup" ControlToValidate="DirCfgPath" ClientValidationFunction="bjsontools_validator" Display="Dynamic" Text="<%[ There is required to provide both binary file and config file paths. ]%>" />
339                                                                         <com:TTextBox ID="DirCfgPath" CssClass="textbox" />
340                                                                 </div>
341                                                         </div>
342                                                 </div>
343                                                 <span class="config_test_loader" style="display: none"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></span>
344                                                 <com:TActiveLabel ID="BDirJSONPathTestOk" Display="None" CssClass="validate config_test_result" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="<%[ OK ]%>" /> <%[ OK ]%></com:TActiveLabel>
345                                                 <com:TActiveLabel ID="BDirJSONPathTestErr" Display="None" CssClass="validator left" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="<%[ Connection error ]%>" /> <%[ Connection error ]%></com:TActiveLabel>
346                                         </fieldset>
347                                         <fieldset class="config_field">
348                                                 <legend>Storage Daemon</legend>
349                                                 <div class="config_lines">
350                                                         <div class="line">
351                                                                 <div class="text"><com:TLabel ForControl="BSdJSONPath" Text="<%[ bsdjson binary file path: ]%>" /></div>
352                                                                 <div class="field">
353                                                                         <com:TCustomValidator ValidationGroup="ConfigGroup" ControlToValidate="BSdJSONPath" ClientValidationFunction="bjsontools_validator" Display="Dynamic" Text="<%[ There is required to provide both binary file and config file paths. ]%>" />
354                                                                         <com:TTextBox ID="BSdJSONPath" CssClass="textbox" />
355                                                                 </div>
356                                                         </div>
357                                                         <div class="line">
358                                                                 <div class="text"><com:TLabel ForControl="SdCfgPath" Text="<%[ Main Storage Daemon config file path (usually bacula-sd.conf): ]%>" /></div>
359                                                                 <div class="field">
360                                                                         <com:TCustomValidator ValidationGroup="ConfigGroup" ControlToValidate="SdCfgPath" ClientValidationFunction="bjsontools_validator" Display="Dynamic" Text="<%[ There is required to provide both binary file and config file paths. ]%>" />
361                                                                         <com:TTextBox ID="SdCfgPath" CssClass="textbox" />
362                                                                 </div>
363                                                         </div>
364                                                 </div>
365                                                 <span class="config_test_loader" style="display: none"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></span>
366                                                 <com:TActiveLabel ID="BSdJSONPathTestOk" Display="None" CssClass="validate config_test_result" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="<%[ OK ]%>" /> <%[ OK ]%></com:TActiveLabel>
367                                                 <com:TActiveLabel ID="BSdJSONPathTestErr" Display="None" CssClass="validator left" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="<%[ Connection error ]%>" /> <%[ Connection error ]%></com:TActiveLabel>
368                                         </fieldset>
369                                         <fieldset class="config_field">
370                                                 <legend>File Daemon/Client</legend>
371                                                 <div class="config_lines">
372                                                         <div class="line">
373                                                                 <div class="text"><com:TLabel ForControl="BFdJSONPath" Text="<%[ bfdjson binary file path: ]%>" /></div>
374                                                                 <div class="field">
375                                                                         <com:TCustomValidator ValidationGroup="ConfigGroup" ControlToValidate="BFdJSONPath" ClientValidationFunction="bjsontools_validator" Display="Dynamic" Text="<%[ There is required to provide both binary file and config file paths. ]%>" />
376                                                                         <com:TTextBox ID="BFdJSONPath" CssClass="textbox" />
377                                                                 </div>
378                                                         </div>
379                                                         <div class="line">
380                                                                 <div class="text"><com:TLabel ForControl="FdCfgPath" Text="<%[ Main File Daemon config file path (usually bacula-fd.conf): ]%>" /></div>
381                                                                 <div class="field">
382                                                                         <com:TCustomValidator ValidationGroup="ConfigGroup" ControlToValidate="FdCfgPath" ClientValidationFunction="bjsontools_validator" Display="Dynamic" Text="<%[ There is required to provide both binary file and config file paths. ]%>" />
383                                                                         <com:TTextBox ID="FdCfgPath" CssClass="textbox" />
384                                                                 </div>
385                                                         </div>
386                                                 </div>
387                                                 <span class="config_test_loader" style="display: none"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></span>
388                                                 <com:TActiveLabel ID="BFdJSONPathTestOk" Display="None" CssClass="validate config_test_result" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="<%[ OK ]%>" /> <%[ OK ]%></com:TActiveLabel>
389                                                 <com:TActiveLabel ID="BFdJSONPathTestErr" Display="None" CssClass="validator left" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="<%[ Connection error ]%>" /> <%[ Connection error ]%></com:TActiveLabel>
390                                         </fieldset>
391                                         <fieldset class="config_field">
392                                                 <legend>Bconsole</legend>
393                                                 <div class="config_lines">
394                                                         <div class="line">
395                                                                 <div class="text"><com:TLabel ForControl="BBconsJSONPath" Text="<%[ bbconsjson binary file path: ]%>" /></div>
396                                                                 <div class="field">
397                                                                         <com:TCustomValidator ValidationGroup="ConfigGroup" ControlToValidate="BBconsJSONPath" ClientValidationFunction="bjsontools_validator" Display="Dynamic" Text="<%[ There is required to provide both binary file and config file paths. ]%>" />
398                                                                         <com:TTextBox ID="BBconsJSONPath" CssClass="textbox" />
399                                                                 </div>
400                                                         </div>
401                                                         <div class="line">
402                                                                 <div class="text"><com:TLabel ForControl="BconsCfgPath" Text="<%[ Admin Bconsole config file path (usually bconsole.conf): ]%>" /></div>
403                                                                 <div class="field">
404                                                                         <com:TCustomValidator ValidationGroup="ConfigGroup" ControlToValidate="BconsCfgPath" ClientValidationFunction="bjsontools_validator" Display="Dynamic" Text="<%[ There is required to provide both binary file and config file paths. ]%>" />
405                                                                         <com:TTextBox ID="BconsCfgPath" CssClass="textbox" />
406                                                                 </div>
407                                                         </div>
408                                                 </div>
409                                                 <span class="config_test_loader" style="display: none"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></span>
410                                                 <com:TActiveLabel ID="BBconsJSONPathTestOk" Display="None" CssClass="validate config_test_result" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="<%[ OK ]%>" /> <%[ OK ]%></com:TActiveLabel>
411                                                 <com:TActiveLabel ID="BBconsJSONPathTestErr" Display="None" CssClass="validator left" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="<%[ Connection error ]%>" /> <%[ Connection error ]%></com:TActiveLabel>
412                                         </fieldset>
413                                         <div class="left button">
414                                                 <com:BActiveButton ID="TestJSONToolsConfig" ValidationGroup="ConfigGroup" Text="<%[ Test configuration ]%>" OnClick="testJSONToolsCfg">
415                                                         <prop:ClientSide.OnLoading>
416                                                                 bjsontools_hide_test_results();
417                                                                 $('.config_test_loader').show();
418                                                         </prop:ClientSide.OnLoading>
419                                                         <prop:ClientSide.OnComplete>
420                                                                 $('.config_test_loader').hide();
421                                                         </prop:ClientSide.OnComplete>
422                                                 </com:BActiveButton>
423                                         </div>
424                                 </div>
425                         </div>
426                 </com:TWizardStep>
427                 <com:TWizardStep ID="Step5" Title="<%[ Step 5 - authorization to API ]%>" StepType="Auto">
428                         <div class="line">
429                                 <com:TActiveRadioButton
430                                         ID="AuthOAuth2"
431                                         GroupName="SelectAuth"
432                                         Attributes.onclick="$('#configure_basic_auth').hide();$('#configure_oauth2_auth').show();"
433                                         OnCallback="setOAuth2Validation"
434                                 />
435                                 <com:TLabel
436                                         ForControl="AuthOAuth2"
437                                         Text="<%[ Use OAuth2 for authorization and authentication ]%>"
438                                 />
439                         </div>
440                         <div class="line">
441                                 <com:TActiveRadioButton
442                                         ID="AuthBasic"
443                                         GroupName="SelectAuth"
444                                         Checked="true"
445                                         Attributes.onclick="$('#configure_oauth2_auth').hide();$('#configure_basic_auth').show();"
446                                         OnCallback="setBasicValidation"
447                                 />
448                                 <com:TLabel
449                                         ForControl="AuthBasic"
450                                         Text="<%[ Use HTTP Basic authentication ]%>"
451                                 />
452                         </div>
453                         <div id="configure_basic_auth" style="display: <%=($this->AuthBasic->Checked === true) ? '' : 'none';%>">
454                                 <div class="line">
455                                         <div class="text"><com:TLabel ForControl="APILogin" Text="<%[ Administration login: ]%>" /></div>
456                                         <div class="field">
457                                                 <com:TTextBox
458                                                         ID="APILogin"
459                                                         CssClass="textbox"
460                                                         CausesValidation="false"
461                                                 />
462                                                 <com:TRequiredFieldValidator
463                                                         CssClass="validator-block"
464                                                         Display="Dynamic"
465                                                         ControlCssClass="invalidate"
466                                                         ControlToValidate="APILogin"
467                                                         ValidationGroup="Basic"
468                                                         Text="<%[ Please enter login. ]%>"
469                                                 />
470                                                 <com:TRegularExpressionValidator
471                                                         CssClass="validator-block"
472                                                         Display="Dynamic"
473                                                         ControlCssClass="invalidate"
474                                                         ControlToValidate="APILogin"
475                                                         ValidationGroup="Basic"
476                                                         RegularExpression="<%=BasicAPIUserConfig::USER_PATTERN%>"
477                                                         Text="<%[ Invalid login value. Login may contain a-z A-Z 0-9 characters. ]%>"
478                                                 />
479                                         </div>
480                                 </div>
481                                 <div class="line">
482                                         <div class="text"><com:TLabel ForControl="APIPassword" Text="<%[ Administration password: ]%>" /></div>
483                                         <div class="field">
484                                                 <com:TTextBox
485                                                         ID="APIPassword"
486                                                         CssClass="textbox"
487                                                         TextMode="Password"
488                                                         MaxLength="30"
489                                                         PersistPassword="true"
490                                                 />
491                                                 <com:TRequiredFieldValidator
492                                                         CssClass="validator-block"
493                                                         Display="Dynamic"
494                                                         ControlCssClass="invalidate"
495                                                         ControlToValidate="APIPassword"
496                                                         ValidationGroup="Basic"
497                                                         Text="<%[ Please enter password. ]%>"
498                                                 />
499                                                 <com:TRegularExpressionValidator
500                                                         CssClass="validator-block"
501                                                         Display="Dynamic"
502                                                         ControlCssClass="invalidate"
503                                                         ControlToValidate="APIPassword"
504                                                         RegularExpression="[\S\s]{5,30}"
505                                                         ValidationGroup="Basic"
506                                                         Text="<%[ Password must be longer than 4 chars. ]%>"
507                                                 />
508                                         </div>
509                                 </div>
510                                 <div class="line">
511                                         <div class="text"><com:TLabel ForControl="RetypeAPIPassword" Text="<%[ Retype administration password: ]%>" /></div>
512                                         <div class="field">
513                                                 <com:TTextBox
514                                                         ID="RetypeAPIPassword"
515                                                         CssClass="textbox"
516                                                         TextMode="Password"
517                                                         MaxLength="30"
518                                                         PersistPassword="true"
519                                                 />
520                                                 <com:TRequiredFieldValidator
521                                                         ID="RetypePasswordRequireValidator"
522                                                         CssClass="validator-block"
523                                                         Display="Dynamic"
524                                                         ControlCssClass="invalidate"
525                                                         ControlToValidate="RetypeAPIPassword"
526                                                         ValidationGroup="Basic"
527                                                         Text="<%[ Please enter retype password. ]%>"
528                                                 />
529                                                 <com:TRegularExpressionValidator
530                                                         ID="RetypePasswordRegexpValidator"
531                                                         CssClass="validator-block"
532                                                         Display="Dynamic"
533                                                         ControlCssClass="invalidate"
534                                                         ControlToValidate="RetypeAPIPassword"
535                                                         RegularExpression="[\S\s]{5,30}"
536                                                         ValidationGroup="Basic"
537                                                         Text="<%[ Password must be longer than 4 chars. ]%>"
538                                                 />
539                                                 <com:TCompareValidator
540                                                         ID="RetypePasswordCustomValidator"
541                                                         CssClass="validator-block"
542                                                         Display="Dynamic"
543                                                         ControlCssClass="invalidate"
544                                                         ControlToValidate="RetypeAPIPassword"
545                                                         ControlToCompare="APIPassword"
546                                                         ValidationGroup="Basic"
547                                                         Text="<%[ Passwords must be the same. ]%>"
548                                                 />
549                                         </div>
550                                 </div>
551                         </div>
552                         <div id="configure_oauth2_auth" style="display: <%=($this->AuthOAuth2->Checked === true) ? '' : 'none';%>">
553                                 <h3><%[ First client registration ]%></h3>
554                                 <h4><%[ Please do not forget to disable HTTP Basic auth in the API web server config. Othwerise OAuth2 will not work. ]%></h4>
555                                 <div class="line">
556                                         <div class="text"><com:TLabel ForControl="APIOAuth2ClientId" Text="<%[ OAuth2 Client ID: ]%>" /></div>
557                                         <div class="field">
558                                                 <com:TTextBox
559                                                         ID="APIOAuth2ClientId"
560                                                         CssClass="textbox"
561                                                         CausesValidation="false"
562                                                         MaxLength="32"
563                                                 />
564                                                 <com:TRequiredFieldValidator
565                                                         CssClass="validator-block"
566                                                         Display="Dynamic"
567                                                         ControlCssClass="invalidate"
568                                                         ControlToValidate="APIOAuth2ClientId"
569                                                         ValidationGroup="OAuth2"
570                                                         Text="<%[ Please enter Client ID. ]%>"
571                                                 />
572                                                 <com:TRegularExpressionValidator
573                                                         CssClass="validator-block"
574                                                         Display="Dynamic"
575                                                         ControlCssClass="invalidate"
576                                                         ControlToValidate="APIOAuth2ClientId"
577                                                         RegularExpression="<%=OAuth2::CLIENT_ID_PATTERN%>"
578                                                         ValidationGroup="OAuth2"
579                                                         Text="<%[ Invalid Client ID value. Client ID may contain a-z A-Z 0-9 - _ characters. ]%>"
580                                                         />
581                                                 <a href="javascript:void(0)" onclick="document.getElementById('<%=$this->APIOAuth2ClientId->ClientID%>').value = get_random_string('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', 32); return false;"><%[ generate ]%></a>
582                                         </div>
583                                 </div>
584                                 <div class="line">
585                                         <div class="text"><com:TLabel ForControl="APIOAuth2ClientSecret" Text="<%[ OAuth2 Client Secret: ]%>" /></div>
586                                         <div class="field">
587                                                 <com:TTextBox
588                                                         ID="APIOAuth2ClientSecret"
589                                                         CssClass="textbox"
590                                                         CausesValidation="false"
591                                                         MaxLength="40"
592                                                 />
593                                                 <com:TRequiredFieldValidator
594                                                         CssClass="validator-block"
595                                                         Display="Dynamic"
596                                                         ControlCssClass="invalidate"
597                                                         ControlToValidate="APIOAuth2ClientSecret"
598                                                         ValidationGroup="OAuth2"
599                                                         Text="<%[ Please enter Client Secret. ]%>"
600                                                 />
601                                                 <com:TRegularExpressionValidator
602                                                         CssClass="validator-block"
603                                                         Display="Dynamic"
604                                                         ControlCssClass="invalidate"
605                                                         ControlToValidate="APIOAuth2ClientSecret"
606                                                         RegularExpression="<%=OAuth2::CLIENT_SECRET_PATTERN%>"
607                                                         ValidationGroup="OAuth2"
608                                                         Text="<%[ Invalid Client Secret value. Client Secret may contain any character that is not a whitespace character. ]%>"
609                                                 />
610                                                 <a href="javascript:void(0)" onclick="document.getElementById('<%=$this->APIOAuth2ClientSecret->ClientID%>').value = get_random_string('ABCDEFabcdef0123456789', 40); return false;"><%[ generate ]%></a>
611                                         </div>
612                                 </div>
613                                 <div class="line">
614                                         <div class="text"><com:TLabel ForControl="APIOAuth2RedirectURI" Text="<%[ OAuth2 Redirect URI (example: https://baculumgui:9095/web/redirect): ]%>" /></div>
615                                         <div class="field">
616                                                 <com:TTextBox
617                                                         ID="APIOAuth2RedirectURI"
618                                                         CssClass="textbox"
619                                                         CausesValidation="false"
620                                                 />
621                                                 <com:TRequiredFieldValidator
622                                                         CssClass="validator-block"
623                                                         Display="Dynamic"
624                                                         ControlCssClass="invalidate"
625                                                         ControlToValidate="APIOAuth2RedirectURI"
626                                                         ValidationGroup="OAuth2"
627                                                         Text="<%[ Please enter Redirect URI. ]%>"
628                                                 />
629                                         </div>
630                                 </div>
631                                 <div class="line">
632                                         <div class="text"><com:TLabel ForControl="APIOAuth2Scope" Text="<%[ OAuth2 scopes (space separated): ]%>" /></div>
633                                         <div class="field">
634                                                 <com:TTextBox
635                                                         ID="APIOAuth2Scope"
636                                                         CssClass="textbox"
637                                                         CausesValidation="false"
638                                                         TextMode="MultiLine"
639                                                 />
640                                                 <a href="javascript:void(0)" onclick="set_scopes('<%=$this->APIOAuth2Scope->ClientID%>'); return false;" style="vertical-align: top"><%[ set all scopes ]%></a>
641                                                 <com:TRequiredFieldValidator
642                                                         CssClass="validator-block"
643                                                         Display="Dynamic"
644                                                         ControlCssClass="invalidate"
645                                                         ControlToValidate="APIOAuth2Scope"
646                                                         ValidationGroup="OAuth2"
647                                                         Text="<%[ Please enter OAuth2 scopes. ]%>"
648                                                 />
649                                         </div>
650                                 </div>
651                                 <div class="line">
652                                         <div class="text"><com:TLabel ForControl="APIOAuth2BconsoleCfgPath" Text="<%[ Dedicated Bconsole config file path: ]%>" /></div>
653                                         <div class="field">
654                                                 <com:TTextBox
655                                                         ID="APIOAuth2BconsoleCfgPath"
656                                                         CssClass="textbox"
657                                                         CausesValidation="false"
658                                                         ValidationGroup="OAuth2"
659                                                 /> <%[ (optional) ]%>
660                                         </div>
661                                 </div>
662                         </div>
663                         <script type="text/javascript">
664                                 var wizard_validation = function() {
665                                         var basic = document.getElementById('<%=$this->AuthBasic->ClientID%>');
666                                         var oauth2 = document.getElementById('<%=$this->AuthOAuth2->ClientID%>');
667                                         var validation_group;
668                                         if (basic.checked === true) {
669                                                 validation_group = 'Basic';
670                                         } else if (oauth2.checked === true) {
671                                                 validation_group = 'OAuth2';
672                                         }
673                                         return Prado.Validation.validate(Prado.Validation.getForm(), validation_group);
674                                 }
675                         </script>
676                 </com:TWizardStep>
677                 <com:TWizardStep ID="Step6" Title="<%[ Step 6 - Finish ]%>" StepType="Finish">
678                         <fieldset>
679                                 <legend><%[ Catalog API ]%></legend>
680                                 <div style="display: <%=($this->DatabaseYes->Checked ? 'block' : 'none')%>">
681                                         <div class="line">
682                                                 <div class="text"><%[ Database type: ]%></div>
683                                                 <div class="field bold"><%=$this->getDbNameByType($this->DBType->SelectedValue)%></div>
684                                         </div>
685                                         <div class="line">
686                                                 <div class="text"><%[ Database name: ]%></div>
687                                                 <div class="field bold"><%=$this->DBName->Text%></div>
688                                         </div>
689                                         <div class="line">
690                                                 <div class="text"><%[ Login: ]%></div>
691                                                 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === false ? $this->Login->Text : '-'%></div>
692                                         </div>
693                                         <div class="line">
694                                                 <div class="text"><%[ Password: ]%></div>
695                                                 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === false ? preg_replace('/.{1}/', '*', $this->Password->Text) : '-'%></div>
696                                         </div>
697                                         <div class="line">
698                                                 <div class="text"><%[ IP address (or hostname): ]%></div>
699                                                 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === false ? $this->IP->Text : '-'%></div>
700                                         </div>
701                                         <div class="line">
702                                                 <div class="text"><%[ Database port: ]%></div>
703                                                 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === false ? $this->Port->Text : '-'%></div>
704                                         </div>
705                                         <div class="line">
706                                                 <div class="text"><%[ Database file path (SQLite only): ]%></div>
707                                                 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === true ? $this->DBPath->Text : '-'%></div>
708                                         </div>
709                                 </div>
710                                 <div style="display: <%=($this->DatabaseNo->Checked ? 'block' : 'none')%>">
711                                         <div class="line">
712                                                 <div class="text"><%[ Catalog access: ]%></div>
713                                                 <div class="field bold"><%[ Disabled ]%></div>
714                                         </div>
715                                 </div>
716                         </fieldset>
717                         <fieldset>
718                                 <legend><%[ Console API ]%></legend>
719                                 <div style="display: <%=($this->ConsoleYes->Checked ? 'block' : 'none')%>">
720                                         <div class="line">
721                                                 <div class="text"><%[ Bconsole binary file path: ]%></div>
722                                                 <div class="field bold"><%=$this->BconsolePath->Text%></div>
723                                         </div>
724                                         <div class="line">
725                                                 <div class="text"><%[ Bconsole admin config file path: ]%></div>
726                                                 <div class="field bold"><%=$this->BconsoleConfigPath->Text%></div>
727                                         </div>
728                                         <div class="line">
729                                                 <div class="text"><%[ Use sudo for bconsole requests: ]%></div>
730                                                 <div class="field bold"><%=($this->UseSudo->Checked === true) ? 'yes' : 'no'%></div>
731                                         </div>
732                                 </div>
733                                 <div style="display: <%=($this->ConsoleNo->Checked ? 'block' : 'none')%>">
734                                         <div class="line">
735                                                 <div class="text"><%[ Console access: ]%></div>
736                                                 <div class="field bold"><%[ Disabled ]%></div>
737                                         </div>
738                                 </div>
739                         </fieldset>
740                         <fieldset>
741                                 <legend><%[ Config API ]%></legend>
742                                 <div style="display: <%=($this->ConfigYes->Checked ? 'block' : 'none')%>">
743                                         <div class="line">
744                                                 <div class="text"><%[ Directory path for new config files: ]%></div>
745                                                 <div class="field bold"><%=$this->BConfigDir->Text%></div>
746                                         </div>
747                                         <div class="line">
748                                                 <div class="text"><%[ Use sudo for Bacula JSON tools: ]%></div>
749                                                 <div class="field bold"><%=($this->BJSONUseSudo->Checked === true) ? 'yes' : 'no'%></div>
750                                         </div>
751                                         <div class="line">
752                                                 <div class="text"><%[ bdirjson binary file path: ]%></div>
753                                                 <div class="field bold"><%=$this->BDirJSONPath->Text%></div>
754                                         </div>
755                                         <div class="line">
756                                                 <div class="text"><%[ Main Director config file path: ]%></div>
757                                                 <div class="field bold"><%=$this->DirCfgPath->Text%></div>
758                                         </div>
759                                         <div class="line">
760                                                 <div class="text"><%[ bsdjson binary file path: ]%></div>
761                                                 <div class="field bold"><%=$this->BSdJSONPath->Text%></div>
762                                         </div>
763                                         <div class="line">
764                                                 <div class="text"><%[ Main Storage Daemon config file path: ]%></div>
765                                                 <div class="field bold"><%=$this->SdCfgPath->Text%></div>
766                                         </div>
767                                         <div class="line">
768                                                 <div class="text"><%[ bfdjson binary file path: ]%></div>
769                                                 <div class="field bold"><%=$this->BFdJSONPath->Text%></div>
770                                         </div>
771                                         <div class="line">
772                                                 <div class="text"><%[ Main Client config file path: ]%></div>
773                                                 <div class="field bold"><%=$this->FdCfgPath->Text%></div>
774                                         </div>
775                                         <div class="line">
776                                                 <div class="text"><%[ bbconsjson binary file path: ]%></div>
777                                                 <div class="field bold"><%=$this->BBconsJSONPath->Text%></div>
778                                         </div>
779                                         <div class="line">
780                                                 <div class="text"><%[ Main Bconsole config file path: ]%></div>
781                                                 <div class="field bold"><%=$this->BconsCfgPath->Text%></div>
782                                         </div>
783                                 </div>
784                                 <div style="display: <%=($this->ConfigNo->Checked ? 'block' : 'none')%>">
785                                         <div class="line">
786                                                 <div class="text"><%[ Config access: ]%></div>
787                                                 <div class="field bold"><%[ Disabled ]%></div>
788                                         </div>
789                                 </div>
790                         </fieldset>
791                         <fieldset>
792                                 <legend><%[ Authorization to Baculum REST API ]%></legend>
793                                 <div class="line">
794                                         <div class="text"><%[ Authorization type: ]%></div>
795                                         <div class="field bold">
796                                                 <%=$this->AuthBasic->Checked ? 'HTTP Basic' : ''%>
797                                                 <%=$this->AuthOAuth2->Checked ? 'OAuth2' : ''%>
798                                         </div>
799                                 </div>
800                                 <div style="display: <%=$this->AuthBasic->Checked ? 'block' : 'none'%>">
801                                         <div class="line">
802                                                 <div class="text"><%[ Administration login: ]%></div>
803                                                 <div class="field bold"><%=$this->APILogin->Text%></div>
804                                         </div>
805                                         <div class="line">
806                                                 <div class="text"><%[ Administration password: ]%></div>
807                                                 <div class="field bold"><%=preg_replace('/.{1}/', '*', $this->APIPassword->Text)%></div>
808                                         </div>
809                                 </div>
810                                 <div style="display: <%=$this->AuthOAuth2->Checked ? 'block' : 'none'%>">
811                                         <div class="line">
812                                                 <div class="text">Client ID:</div>
813                                                 <div class="field bold"><%=$this->APIOAuth2ClientId->Text%></div>
814                                         </div>
815                                         <div class="line">
816                                                 <div class="text">Client Secret:</div>
817                                                 <div class="field bold"><%=preg_replace('/.{1}/', '*', $this->APIOAuth2ClientSecret->Text)%></div>
818                                         </div>
819                                         <div class="line">
820                                                 <div class="text">Redirect URI:</div>
821                                                 <div class="field bold"><%=$this->APIOAuth2RedirectURI->Text%></div>
822                                         </div>
823                                         <div class="line">
824                                                 <div class="text">Scope:</div>
825                                                 <div class="field bold"><%=$this->APIOAuth2Scope->Text%></div>
826                                         </div>
827                                         <div class="line">
828                                                 <div class="text"><%[ Dedicated Bconsole config file path: ]%></div>
829                                                 <div class="field bold"><%=!empty($this->APIOAuth2BconsoleCfgPath->Text) ? $this->APIOAuth2BconsoleCfgPath->Text : '-'%></div>
830                                         </div>
831                                 </div>
832                         </fieldset>
833                 </com:TWizardStep>
834         </com:TWizard>
835 <script type="text/javascript">
836 var bjsontools_fields = {
837         General: {
838                 data: [],
839                 test: [$('#<%=$this->BConfigDirTestOk->ClientID%>'), $('#<%=$this->BConfigDirTestErr->ClientID%>')]
840         },
841         Dir: {
842                 data: [$('#<%=$this->BDirJSONPath->ClientID%>'), $('#<%=$this->DirCfgPath->ClientID%>')],
843                 test: [$('#<%=$this->BDirJSONPathTestOk->ClientID%>'), $('#<%=$this->BDirJSONPathTestErr->ClientID%>')]
844         },
845         Sd: {
846                 data: [$('#<%=$this->BSdJSONPath->ClientID%>'), $('#<%=$this->SdCfgPath->ClientID%>')],
847                 test: [$('#<%=$this->BSdJSONPathTestOk->ClientID%>'), $('#<%=$this->BSdJSONPathTestErr->ClientID%>')]
848         },
849         Fd: {
850                 data: [$('#<%=$this->BFdJSONPath->ClientID%>'), $('#<%=$this->FdCfgPath->ClientID%>')],
851                 test: [$('#<%=$this->BFdJSONPathTestOk->ClientID%>'), $('#<%=$this->BFdJSONPathTestErr->ClientID%>')]
852         },
853         Bcons: {
854                 data: [$('#<%=$this->BBconsJSONPath->ClientID%>'), $('#<%=$this->BconsCfgPath->ClientID%>')],
855                 test: [$('#<%=$this->BBconsJSONPathTestOk->ClientID%>'), $('#<%=$this->BBconsJSONPathTestErr->ClientID%>')]
856         }
857 };
858 var bjsontools_get_field_type = function(field_id) {
859         var field_types = Object.keys(bjsontools_fields);
860         var type, field_type;
861         for (var i = 0; i < field_types.length; i++) {
862                 type = field_types[i];
863                 for (var j = 0; j < bjsontools_fields[type].data.length; j++) {
864                         if (bjsontools_fields[type].data[j][0].id === field_id) {
865                                 field_type = type;
866                                 break;
867                         }
868                 }
869                 if (field_type) {
870                         break;
871                 }
872         }
873         return field_type;
874 };
875 var bjsontools_validator = function(sender, parameter) {
876         var validation_css = 'validation-error';
877         var id_validating_field = sender.control.id;
878         var type = bjsontools_get_field_type(id_validating_field);
879         var invalid_fields = [];
880         for (var i = 0; i < bjsontools_fields[type].data.length; i++) {
881                 bjsontools_fields[type].data[i].removeClass(validation_css);
882                 if (!bjsontools_fields[type].data[i][0].value) {
883                         invalid_fields.push(bjsontools_fields[type].data[i]);
884                 }
885         }
886         var valid = (invalid_fields.length === 0 || invalid_fields.length === bjsontools_fields[type].data.length);
887         var is_validating_field_valid = true;
888         if (!valid) {
889                 for (var i = 0; i < invalid_fields.length; i++) {
890                         invalid_fields[i].addClass(validation_css);
891                         if (invalid_fields[i][0].id === id_validating_field) {
892                                 is_validating_field_valid = false;
893                         }
894                 }
895                 bjsontools_hide_test_results(type);
896         }
897         if (is_validating_field_valid === true) {
898                 valid = true;
899         }
900
901         return valid;
902 };
903
904 // if field_type not given then all test results become hidden
905 var bjsontools_hide_test_results = function(field_type) {
906         var field_types = Object.keys(bjsontools_fields);
907         var type;
908         for (var i = 0; i < field_types.length; i++) {
909                 type = field_types[i];
910                 for (var j = 0; j < bjsontools_fields[type].test.length; j++) {
911                         if (!field_type || field_type === type) {
912                                 bjsontools_fields[type].test[j].hide();
913                         }
914                 }
915         }
916 };
917 </script>
918 </com:TContent>