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"
6 StepStyle.CssClass="steps"
7 HeaderStyle.CssClass="header"
8 NavigationStyle.CssClass="navigation"
9 UseDefaultLayout="false"
11 OnCancelButtonClick="wizardStop"
12 OnCompleteButtonClick="wizardCompleted"
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>
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>
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>
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>
28 <div class="step step-<%=($this->Parent->ActiveStepIndex === 4) ? 'active' : (($this->Parent->ActiveStepIndex === 5) ? 'prev-active' : 'normal')%>">
29 <div><com:TTranslate Text="Authorization" /></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>
34 <div id="title"><%=$this->Parent->ActiveStep->Title%><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 » ]%>" /></div>
40 </prop:StartNavigationTemplate>
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="<%[ « Previous ]%>" />
46 <com:BButton ID="NextButton" CommandName="NextStep" Attributes.onclick="return (wizard_validation) ? wizard_validation() : true;" Text="<%[ Next » ]%>" />
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="<%[ « Previous ]%>" />
53 <com:BButton CommandName="Complete" Text="<%[ Save ]%>" />
55 </prop:FinishNavigationTemplate>
56 <com:TWizardStep ID="Step1" Title="<%[ Step 1 - select language ]%>" StepType="Auto">
58 <div class="text"><com:TLabel ForControl="Lang" Text="<%[ Language: ]%>" /></div>
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. ]%>" />
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>
71 <com:TRadioButton ID="DatabaseNo" GroupName="SelectDatabase" Attributes.onclick="$('#configure_database').hide();" /> <com:TLabel ForControl="DatabaseNo" Text="<%[ No ]%>" />
74 <com:TRadioButton ID="DatabaseYes" GroupName="SelectDatabase" Attributes.onclick="$('#configure_database').show();" /> <com:TLabel ForControl="DatabaseYes" Text="<%[ Yes ]%>" />
76 <div id="configure_database" style="display: <%=($this->DatabaseYes->Checked === true) ? '' : 'none';%>">
77 <com:TActivePanel ID="Step2Content">
79 <div class="text"><com:TLabel ForControl="DBType" Text="<%[ Database type: ]%>" /></div>
81 <com:TActiveDropDownList
86 OnTextChanged="setDBType"
87 CausesValidation="false"
88 OnCallback="renderPanel"
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"
98 ControlToValidate="DBType"
100 ValueToCompare="none"
102 ValidationGroup="DbGroup"
103 Text="<%[ Please select database type. ]%>"
108 <div class="text"><com:TLabel ForControl="DBName" Text="<%[ Database name: ]%>" /></div>
110 <com:TTextBox ID="DBName" CssClass="textbox" />
111 <com:TRequiredFieldValidator
112 CssClass="validator-block"
114 ControlCssClass="invalidate"
115 ControlToValidate="DBName"
116 ValidationGroup="DbGroup"
117 Text="<%[ Please enter database name. ]%>"
122 <div class="text"><com:TLabel ForControl="Login" Text="<%[ Login: ]%>" /></div>
124 <com:TActiveTextBox ID="Login" CssClass="textbox" />
125 <com:TRequiredFieldValidator
127 CssClass="validator-block"
129 ControlCssClass="invalidate"
130 ControlToValidate="Login"
131 ValidationGroup="DbGroup"
132 Text="<%[ Please enter login. ]%>"
137 <div class="text"><com:TLabel ForControl="Password" Text="<%[ Password: ]%>" /></div>
138 <div class="field"><com:TActiveTextBox
142 PersistPassword="true"
146 <div class="text"><com:TLabel ForControl="IP" Text="<%[ IP address (or hostname): ]%>" /></div>
148 <com:TActiveTextBox ID="IP" CssClass="textbox" />
149 <com:TRequiredFieldValidator
151 CssClass="validator-block"
153 ControlCssClass="invalidate"
154 ControlToValidate="IP"
155 ValidationGroup="DbGroup"
156 Text="<%[ Please enter IP address or hostname. ]%>"
161 <div class="text"><com:TLabel ForControl="Port" Text="<%[ Port: ]%>" /></div>
163 <com:TActiveTextBox ID="Port" CssClass="textbox" Width="55px" MaxLength="5" Enabled="false" />
164 <com:TRequiredFieldValidator
166 CssClass="validator-block"
168 ControlCssClass="invalidate"
169 ControlToValidate="Port"
170 ValidationGroup="DbGroup"
171 Text="<%[ Please enter database port. ]%>"
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>
181 <com:TActiveTextBox ID="DBPath" CssClass="textbox" Enabled="false" />
182 <com:TRequiredFieldValidator
185 CssClass="validator-block"
186 ControlCssClass="invalidate"
187 ControlToValidate="DBPath"
188 ValidationGroup="DbGroup"
189 Text="<%[ Please enter database path. ]%>"
194 <div class="text"><com:TLabel ForControl="ConnectionTest" Text="<%[ Connection test: ]%>" /></div>
196 <table border="0" cellpadding="1px">
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>
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>
219 <div style="clear: left"></div>
222 <script type="text/javascript">
223 var wizard_validation = function() {
225 var db = document.getElementById('<%=$this->DatabaseYes->ClientID%>');
227 result = Prado.Validation.validate(Prado.Validation.getForm(), 'DbGroup');
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>
236 <com:TRadioButton ID="ConsoleNo" GroupName="SelectConsole" Attributes.onclick="$('#configure_console').hide();" /> <com:TLabel ForControl="ConsoleNo" Text="<%[ No ]%>" />
239 <com:TRadioButton ID="ConsoleYes" GroupName="SelectConsole" Attributes.onclick="$('#configure_console').show();" /> <com:TLabel ForControl="ConsoleYes" Text="<%[ Yes ]%>" />
241 <div id="configure_console" style="display: <%=($this->ConsoleYes->Checked === true) ? '' : 'none';%>">
243 <div class="text"><com:TLabel ForControl="BconsolePath" Text="<%[ Bconsole binary file path: ]%>" /></div>
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. ]%>" />
250 <div class="text"><com:TLabel ForControl="BconsoleConfigPath" Text="<%[ Bconsole admin config file path: ]%>" /></div>
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. ]%>" />
257 <div class="text"><com:TLabel ForControl="UseSudo" Text="<%[ Use sudo: ]%>" /></div>
259 <com:TCheckBox ID="UseSudo" />
263 <div class="text"><com:TLabel ForControl="BconsoleConnectionTest" Text="<%[ Bconsole connection test: ]%>" /></div>
265 <table border="0" cellpadding="1px">
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>
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>
289 <span><b><%[ NOTE! ]%></b><br /><em><%[ Baculum needs access to bconsole by the web server. ]%></em></span>
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>
296 <com:TRadioButton ID="ConfigNo" GroupName="SelectConfig" Attributes.onclick="$('#configure_config').hide();" /> <com:TLabel ForControl="ConfigNo" Text="<%[ No ]%>" />
299 <com:TRadioButton ID="ConfigYes" GroupName="SelectConfig" Attributes.onclick="$('#configure_config').show();" /> <com:TLabel ForControl="ConfigYes" Text="<%[ Yes ]%>" />
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">
307 <div class="text"><com:TLabel ForControl="BConfigDir" Text="<%[ Directory path for new config files: ]%>" /></div>
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" />
315 <div class="text"><com:TLabel ForControl="BJSONUseSudo" Text="<%[ Use sudo: ]%>" /></div>
317 <com:TCheckBox ID="BJSONUseSudo" />
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>
325 <fieldset class="config_field">
326 <legend>Director</legend>
327 <div class="config_lines">
329 <div class="text"><com:TLabel ForControl="BDirJSONPath" Text="<%[ bdirjson binary file path: ]%>" /></div>
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" />
336 <div class="text"><com:TLabel ForControl="DirCfgPath" Text="<%[ Main Director config file path (usually bacula-dir.conf): ]%>" /></div>
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" />
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>
347 <fieldset class="config_field">
348 <legend>Storage Daemon</legend>
349 <div class="config_lines">
351 <div class="text"><com:TLabel ForControl="BSdJSONPath" Text="<%[ bsdjson binary file path: ]%>" /></div>
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" />
358 <div class="text"><com:TLabel ForControl="SdCfgPath" Text="<%[ Main Storage Daemon config file path (usually bacula-sd.conf): ]%>" /></div>
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" />
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>
369 <fieldset class="config_field">
370 <legend>File Daemon/Client</legend>
371 <div class="config_lines">
373 <div class="text"><com:TLabel ForControl="BFdJSONPath" Text="<%[ bfdjson binary file path: ]%>" /></div>
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" />
380 <div class="text"><com:TLabel ForControl="FdCfgPath" Text="<%[ Main File Daemon config file path (usually bacula-fd.conf): ]%>" /></div>
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" />
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>
391 <fieldset class="config_field">
392 <legend>Bconsole</legend>
393 <div class="config_lines">
395 <div class="text"><com:TLabel ForControl="BBconsJSONPath" Text="<%[ bbconsjson binary file path: ]%>" /></div>
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" />
402 <div class="text"><com:TLabel ForControl="BconsCfgPath" Text="<%[ Admin Bconsole config file path (usually bconsole.conf): ]%>" /></div>
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" />
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>
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>
427 <com:TWizardStep ID="Step5" Title="<%[ Step 5 - authorization to API ]%>" StepType="Auto">
429 <com:TActiveRadioButton
431 GroupName="SelectAuth"
432 Attributes.onclick="$('#configure_basic_auth').hide();$('#configure_oauth2_auth').show();"
433 OnCallback="setOAuth2Validation"
436 ForControl="AuthOAuth2"
437 Text="<%[ Use OAuth2 for authorization and authentication ]%>"
441 <com:TActiveRadioButton
443 GroupName="SelectAuth"
445 Attributes.onclick="$('#configure_oauth2_auth').hide();$('#configure_basic_auth').show();"
446 OnCallback="setBasicValidation"
449 ForControl="AuthBasic"
450 Text="<%[ Use HTTP Basic authentication ]%>"
453 <div id="configure_basic_auth" style="display: <%=($this->AuthBasic->Checked === true) ? '' : 'none';%>">
455 <div class="text"><com:TLabel ForControl="APILogin" Text="<%[ Administration login: ]%>" /></div>
460 CausesValidation="false"
462 <com:TRequiredFieldValidator
463 CssClass="validator-block"
465 ControlCssClass="invalidate"
466 ControlToValidate="APILogin"
467 ValidationGroup="Basic"
468 Text="<%[ Please enter login. ]%>"
470 <com:TRegularExpressionValidator
471 CssClass="validator-block"
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. ]%>"
482 <div class="text"><com:TLabel ForControl="APIPassword" Text="<%[ Administration password: ]%>" /></div>
489 PersistPassword="true"
491 <com:TRequiredFieldValidator
492 CssClass="validator-block"
494 ControlCssClass="invalidate"
495 ControlToValidate="APIPassword"
496 ValidationGroup="Basic"
497 Text="<%[ Please enter password. ]%>"
499 <com:TRegularExpressionValidator
500 CssClass="validator-block"
502 ControlCssClass="invalidate"
503 ControlToValidate="APIPassword"
504 RegularExpression="[\S\s]{5,30}"
505 ValidationGroup="Basic"
506 Text="<%[ Password must be longer than 4 chars. ]%>"
511 <div class="text"><com:TLabel ForControl="RetypeAPIPassword" Text="<%[ Retype administration password: ]%>" /></div>
514 ID="RetypeAPIPassword"
518 PersistPassword="true"
520 <com:TRequiredFieldValidator
521 ID="RetypePasswordRequireValidator"
522 CssClass="validator-block"
524 ControlCssClass="invalidate"
525 ControlToValidate="RetypeAPIPassword"
526 ValidationGroup="Basic"
527 Text="<%[ Please enter retype password. ]%>"
529 <com:TRegularExpressionValidator
530 ID="RetypePasswordRegexpValidator"
531 CssClass="validator-block"
533 ControlCssClass="invalidate"
534 ControlToValidate="RetypeAPIPassword"
535 RegularExpression="[\S\s]{5,30}"
536 ValidationGroup="Basic"
537 Text="<%[ Password must be longer than 4 chars. ]%>"
539 <com:TCompareValidator
540 ID="RetypePasswordCustomValidator"
541 CssClass="validator-block"
543 ControlCssClass="invalidate"
544 ControlToValidate="RetypeAPIPassword"
545 ControlToCompare="APIPassword"
546 ValidationGroup="Basic"
547 Text="<%[ Passwords must be the same. ]%>"
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>
556 <div class="text"><com:TLabel ForControl="APIOAuth2ClientId" Text="<%[ OAuth2 Client ID: ]%>" /></div>
559 ID="APIOAuth2ClientId"
561 CausesValidation="false"
564 <com:TRequiredFieldValidator
565 CssClass="validator-block"
567 ControlCssClass="invalidate"
568 ControlToValidate="APIOAuth2ClientId"
569 ValidationGroup="OAuth2"
570 Text="<%[ Please enter Client ID. ]%>"
572 <com:TRegularExpressionValidator
573 CssClass="validator-block"
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. ]%>"
581 <a href="javascript:void(0)" onclick="document.getElementById('<%=$this->APIOAuth2ClientId->ClientID%>').value = get_random_string('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', 32); return false;"><%[ generate ]%></a>
585 <div class="text"><com:TLabel ForControl="APIOAuth2ClientSecret" Text="<%[ OAuth2 Client Secret: ]%>" /></div>
588 ID="APIOAuth2ClientSecret"
590 CausesValidation="false"
593 <com:TRequiredFieldValidator
594 CssClass="validator-block"
596 ControlCssClass="invalidate"
597 ControlToValidate="APIOAuth2ClientSecret"
598 ValidationGroup="OAuth2"
599 Text="<%[ Please enter Client Secret. ]%>"
601 <com:TRegularExpressionValidator
602 CssClass="validator-block"
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. ]%>"
610 <a href="javascript:void(0)" onclick="document.getElementById('<%=$this->APIOAuth2ClientSecret->ClientID%>').value = get_random_string('ABCDEFabcdef0123456789', 40); return false;"><%[ generate ]%></a>
614 <div class="text"><com:TLabel ForControl="APIOAuth2RedirectURI" Text="<%[ OAuth2 Redirect URI (example: https://baculumgui:9095/web/redirect): ]%>" /></div>
617 ID="APIOAuth2RedirectURI"
619 CausesValidation="false"
621 <com:TRequiredFieldValidator
622 CssClass="validator-block"
624 ControlCssClass="invalidate"
625 ControlToValidate="APIOAuth2RedirectURI"
626 ValidationGroup="OAuth2"
627 Text="<%[ Please enter Redirect URI. ]%>"
632 <div class="text"><com:TLabel ForControl="APIOAuth2Scope" Text="<%[ OAuth2 scopes (space separated): ]%>" /></div>
637 CausesValidation="false"
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"
644 ControlCssClass="invalidate"
645 ControlToValidate="APIOAuth2Scope"
646 ValidationGroup="OAuth2"
647 Text="<%[ Please enter OAuth2 scopes. ]%>"
652 <div class="text"><com:TLabel ForControl="APIOAuth2BconsoleCfgPath" Text="<%[ Dedicated Bconsole config file path: ]%>" /></div>
655 ID="APIOAuth2BconsoleCfgPath"
657 CausesValidation="false"
658 ValidationGroup="OAuth2"
659 /> <%[ (optional) ]%>
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';
673 return Prado.Validation.validate(Prado.Validation.getForm(), validation_group);
677 <com:TWizardStep ID="Step6" Title="<%[ Step 6 - Finish ]%>" StepType="Finish">
679 <legend><%[ Catalog API ]%></legend>
680 <div style="display: <%=($this->DatabaseYes->Checked ? 'block' : 'none')%>">
682 <div class="text"><%[ Database type: ]%></div>
683 <div class="field bold"><%=$this->getDbNameByType($this->DBType->SelectedValue)%></div>
686 <div class="text"><%[ Database name: ]%></div>
687 <div class="field bold"><%=$this->DBName->Text%></div>
690 <div class="text"><%[ Login: ]%></div>
691 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === false ? $this->Login->Text : '-'%></div>
694 <div class="text"><%[ Password: ]%></div>
695 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === false ? preg_replace('/.{1}/', '*', $this->Password->Text) : '-'%></div>
698 <div class="text"><%[ IP address (or hostname): ]%></div>
699 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === false ? $this->IP->Text : '-'%></div>
702 <div class="text"><%[ Database port: ]%></div>
703 <div class="field bold"><%=$this->isSQLiteType($this->DBType->SelectedValue) === false ? $this->Port->Text : '-'%></div>
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>
710 <div style="display: <%=($this->DatabaseNo->Checked ? 'block' : 'none')%>">
712 <div class="text"><%[ Catalog access: ]%></div>
713 <div class="field bold"><%[ Disabled ]%></div>
718 <legend><%[ Console API ]%></legend>
719 <div style="display: <%=($this->ConsoleYes->Checked ? 'block' : 'none')%>">
721 <div class="text"><%[ Bconsole binary file path: ]%></div>
722 <div class="field bold"><%=$this->BconsolePath->Text%></div>
725 <div class="text"><%[ Bconsole admin config file path: ]%></div>
726 <div class="field bold"><%=$this->BconsoleConfigPath->Text%></div>
729 <div class="text"><%[ Use sudo for bconsole requests: ]%></div>
730 <div class="field bold"><%=($this->UseSudo->Checked === true) ? 'yes' : 'no'%></div>
733 <div style="display: <%=($this->ConsoleNo->Checked ? 'block' : 'none')%>">
735 <div class="text"><%[ Console access: ]%></div>
736 <div class="field bold"><%[ Disabled ]%></div>
741 <legend><%[ Config API ]%></legend>
742 <div style="display: <%=($this->ConfigYes->Checked ? 'block' : 'none')%>">
744 <div class="text"><%[ Directory path for new config files: ]%></div>
745 <div class="field bold"><%=$this->BConfigDir->Text%></div>
748 <div class="text"><%[ Use sudo for Bacula JSON tools: ]%></div>
749 <div class="field bold"><%=($this->BJSONUseSudo->Checked === true) ? 'yes' : 'no'%></div>
752 <div class="text"><%[ bdirjson binary file path: ]%></div>
753 <div class="field bold"><%=$this->BDirJSONPath->Text%></div>
756 <div class="text"><%[ Main Director config file path: ]%></div>
757 <div class="field bold"><%=$this->DirCfgPath->Text%></div>
760 <div class="text"><%[ bsdjson binary file path: ]%></div>
761 <div class="field bold"><%=$this->BSdJSONPath->Text%></div>
764 <div class="text"><%[ Main Storage Daemon config file path: ]%></div>
765 <div class="field bold"><%=$this->SdCfgPath->Text%></div>
768 <div class="text"><%[ bfdjson binary file path: ]%></div>
769 <div class="field bold"><%=$this->BFdJSONPath->Text%></div>
772 <div class="text"><%[ Main Client config file path: ]%></div>
773 <div class="field bold"><%=$this->FdCfgPath->Text%></div>
776 <div class="text"><%[ bbconsjson binary file path: ]%></div>
777 <div class="field bold"><%=$this->BBconsJSONPath->Text%></div>
780 <div class="text"><%[ Main Bconsole config file path: ]%></div>
781 <div class="field bold"><%=$this->BconsCfgPath->Text%></div>
784 <div style="display: <%=($this->ConfigNo->Checked ? 'block' : 'none')%>">
786 <div class="text"><%[ Config access: ]%></div>
787 <div class="field bold"><%[ Disabled ]%></div>
792 <legend><%[ Authorization to Baculum REST API ]%></legend>
794 <div class="text"><%[ Authorization type: ]%></div>
795 <div class="field bold">
796 <%=$this->AuthBasic->Checked ? 'HTTP Basic' : ''%>
797 <%=$this->AuthOAuth2->Checked ? 'OAuth2' : ''%>
800 <div style="display: <%=$this->AuthBasic->Checked ? 'block' : 'none'%>">
802 <div class="text"><%[ Administration login: ]%></div>
803 <div class="field bold"><%=$this->APILogin->Text%></div>
806 <div class="text"><%[ Administration password: ]%></div>
807 <div class="field bold"><%=preg_replace('/.{1}/', '*', $this->APIPassword->Text)%></div>
810 <div style="display: <%=$this->AuthOAuth2->Checked ? 'block' : 'none'%>">
812 <div class="text">Client ID:</div>
813 <div class="field bold"><%=$this->APIOAuth2ClientId->Text%></div>
816 <div class="text">Client Secret:</div>
817 <div class="field bold"><%=preg_replace('/.{1}/', '*', $this->APIOAuth2ClientSecret->Text)%></div>
820 <div class="text">Redirect URI:</div>
821 <div class="field bold"><%=$this->APIOAuth2RedirectURI->Text%></div>
824 <div class="text">Scope:</div>
825 <div class="field bold"><%=$this->APIOAuth2Scope->Text%></div>
828 <div class="text"><%[ Dedicated Bconsole config file path: ]%></div>
829 <div class="field bold"><%=!empty($this->APIOAuth2BconsoleCfgPath->Text) ? $this->APIOAuth2BconsoleCfgPath->Text : '-'%></div>
835 <script type="text/javascript">
836 var bjsontools_fields = {
839 test: [$('#<%=$this->BConfigDirTestOk->ClientID%>'), $('#<%=$this->BConfigDirTestErr->ClientID%>')]
842 data: [$('#<%=$this->BDirJSONPath->ClientID%>'), $('#<%=$this->DirCfgPath->ClientID%>')],
843 test: [$('#<%=$this->BDirJSONPathTestOk->ClientID%>'), $('#<%=$this->BDirJSONPathTestErr->ClientID%>')]
846 data: [$('#<%=$this->BSdJSONPath->ClientID%>'), $('#<%=$this->SdCfgPath->ClientID%>')],
847 test: [$('#<%=$this->BSdJSONPathTestOk->ClientID%>'), $('#<%=$this->BSdJSONPathTestErr->ClientID%>')]
850 data: [$('#<%=$this->BFdJSONPath->ClientID%>'), $('#<%=$this->FdCfgPath->ClientID%>')],
851 test: [$('#<%=$this->BFdJSONPathTestOk->ClientID%>'), $('#<%=$this->BFdJSONPathTestErr->ClientID%>')]
854 data: [$('#<%=$this->BBconsJSONPath->ClientID%>'), $('#<%=$this->BconsCfgPath->ClientID%>')],
855 test: [$('#<%=$this->BBconsJSONPathTestOk->ClientID%>'), $('#<%=$this->BBconsJSONPathTestErr->ClientID%>')]
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) {
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]);
886 var valid = (invalid_fields.length === 0 || invalid_fields.length === bjsontools_fields[type].data.length);
887 var is_validating_field_valid = true;
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;
895 bjsontools_hide_test_results(type);
897 if (is_validating_field_valid === true) {
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);
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();