1 <div id="new_host_status" class="center">
2 <com:TActiveLabel ID="NewHostAddOk" Display="None" CssClass="validate" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="Validate" /> <strong><%[ Host added successfully. ]%></strong></com:TActiveLabel>
3 <com:TActiveLabel ID="NewHostAddError" Display="None" CssClass="validator" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="" /> <strong><%[ Problem during save to config file. Please check host config file permission. ]%></strong></com:TActiveLabel>
4 <com:TActiveLabel ID="NewHostAddExists" Display="None" CssClass="validator" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="" /> <strong><%[ Given host already exists in config file. ]%></strong></com:TActiveLabel>
6 <div id="new_host" style="display: none">
8 <div class="text"><com:TLabel ForControl="APIProtocol" Text="<%[ Protocol: ]%>" /></div>
10 <com:TActiveDropDownList ID="APIProtocol" CssClass="textbox" Width="150px" CausesValidation="false">
11 <com:TListItem Value="http" Text="HTTP" />
12 <com:TListItem Value="https" Text="HTTPS" Selected="true"/>
13 </com:TActiveDropDownList>
17 <div class="text"><com:TLabel ForControl="APIAddress" Text="<%[ IP Address/Hostname: ]%>" /></div>
19 <com:TActiveTextBox ID="APIAddress" CssClass="textbox" CausesValidation="false" />
20 <com:TRequiredFieldValidator ValidationGroup="NewHostGroup" CssClass="validator-block" Display="Dynamic" ControlCssClass="invalidate" ControlToValidate="APIAddress" Text="<%[ Please enter API address. ]%>" />
24 <div class="text"><com:TLabel ForControl="APIPort" Text="<%[ Port: ]%>" /></div>
26 <com:TActiveTextBox ID="APIPort" CssClass="textbox" CausesValidation="false" Text="9096" Width="70px" />
27 <com:TRequiredFieldValidator ValidationGroup="NewHostGroup" CssClass="validator-block" Display="Dynamic" ControlCssClass="invalidate" ControlToValidate="APIPort" Text="<%[ Please enter API port. ]%>" />
33 GroupName="SelectAuth"
34 Attributes.onclick="$('#configure_basic_auth').hide();$('#configure_oauth2_auth').show();"
37 ForControl="AuthOAuth2"
39 Text="<%[ Use OAuth2 for authorization and authentication ]%>"
45 GroupName="SelectAuth"
47 Attributes.onclick="$('#configure_oauth2_auth').hide();$('#configure_basic_auth').show();"
50 ForControl="AuthBasic"
52 Text="<%[ Use HTTP Basic authentication ]%>"
55 <div id="configure_basic_auth" style="display: <%=($this->AuthBasic->Checked === true) ? '' : 'none';%>">
57 <div class="text"><com:TLabel ForControl="APIBasicLogin" Text="<%[ API Login: ]%>" /></div>
62 CausesValidation="false"
64 <com:TRequiredFieldValidator
65 CssClass="validator-block"
67 ControlCssClass="invalidate"
68 ControlToValidate="APIBasicLogin"
69 ValidationGroup="Basic"
70 Text="<%[ Please enter API login. ]%>"
75 <div class="text"><com:TLabel ForControl="APIBasicPassword" Text="<%[ API Password: ]%>" /></div>
81 CausesValidation="false"
82 PersistPassword="true"
84 <com:TRequiredFieldValidator
85 CssClass="validator-block"
87 ControlCssClass="invalidate"
88 ControlToValidate="APIBasicPassword"
89 ValidationGroup="Basic"
90 Text="<%[ Please enter API password. ]%>"
95 <div id="configure_oauth2_auth" style="display: <%=($this->AuthOAuth2->Checked === true) ? '' : 'none';%>">
97 <div class="text"><com:TLabel ForControl="APIOAuth2ClientId" Text="<%[ OAuth2 Client ID: ]%>" /></div>
100 ID="APIOAuth2ClientId"
102 CausesValidation="false"
105 <com:TRequiredFieldValidator
106 CssClass="validator-block"
108 ControlCssClass="invalidate"
109 ControlToValidate="APIOAuth2ClientId"
110 ValidationGroup="OAuth2"
111 Text="<%[ Please enter Client ID. ]%>"
113 <com:TRegularExpressionValidator
114 CssClass="validator-block"
116 ControlCssClass="invalidate"
117 ControlToValidate="APIOAuth2ClientId"
118 RegularExpression="<%=OAuth2::CLIENT_ID_PATTERN%>"
119 ValidationGroup="OAuth2"
120 Text="<%[ Invalid Client ID value. Client ID may contain a-z A-Z 0-9 - _ characters. ]%>"
122 <a style="display: <%=$this->getClientMode() ? 'none': 'inline'%>" href="javascript:void(0)" onclick="document.getElementById('<%=$this->APIOAuth2ClientId->ClientID%>').value = get_random_string('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', 32); return false;"><%[ generate ]%></a>
126 <div class="text"><com:TLabel ForControl="APIOAuth2ClientSecret" Text="<%[ OAuth2 Client Secret: ]%>" /></div>
129 ID="APIOAuth2ClientSecret"
131 CausesValidation="false"
134 <com:TRequiredFieldValidator
135 CssClass="validator-block"
137 ControlCssClass="invalidate"
138 ControlToValidate="APIOAuth2ClientSecret"
139 ValidationGroup="OAuth2"
140 Text="<%[ Please enter Client Secret. ]%>"
142 <com:TRegularExpressionValidator
143 CssClass="validator-block"
145 ControlCssClass="invalidate"
146 ControlToValidate="APIOAuth2ClientSecret"
147 RegularExpression="<%=OAuth2::CLIENT_SECRET_PATTERN%>"
148 ValidationGroup="OAuth2"
149 Text="<%[ Invalid Client Secret value. Client Secret may contain any character that is not a whitespace character. ]%>"
151 <a style="display: <%=$this->getClientMode() ? 'none': 'inline'%>" href="javascript:void(0)" onclick="document.getElementById('<%=$this->APIOAuth2ClientSecret->ClientID%>').value = get_random_string('ABCDEFabcdef0123456789', 40); return false;"><%[ generate ]%></a>
155 <div class="text"><com:TLabel ForControl="APIOAuth2RedirectURI" Text="<%[ OAuth2 Redirect URI (example: https://baculumgui:9095/web/redirect): ]%>" /></div>
158 ID="APIOAuth2RedirectURI"
160 CausesValidation="false"
162 <com:TRequiredFieldValidator
163 CssClass="validator-block"
165 ControlCssClass="invalidate"
166 ControlToValidate="APIOAuth2RedirectURI"
167 ValidationGroup="OAuth2"
168 Text="<%[ Please enter Redirect URI. ]%>"
173 <div class="text"><com:TLabel ForControl="APIOAuth2Scope" Text="<%[ OAuth2 scopes (space separated): ]%>" /></div>
178 CausesValidation="false"
181 <com:TRequiredFieldValidator
182 CssClass="validator-block"
184 ControlCssClass="invalidate"
185 ControlToValidate="APIOAuth2Scope"
186 ValidationGroup="OAuth2"
187 Text="<%[ Please enter OAuth2 scopes. ]%>"
191 <div class="line" style="display: <%=$this->getClientMode() ? 'none': 'block'%>">
192 <div class="text"><com:TLabel ForControl="APIOAuth2BconsoleCfgPath" Text="<%[ Dedicated Bconsole config file path: ]%>" /></div>
195 ID="APIOAuth2BconsoleCfgPath"
197 CausesValidation="false"
198 /> <%[ (optional) ]%>
203 <div class="text"><com:TLabel ForControl="APIConnectionTest" Text="<%[ API connection test: ]%>" /></div>
205 <table border="0" cellpadding="1px" id="new_host_status">
207 <td align="center" valign="middle">
208 <com:TActiveButton ID="APIConnectionTest" Text="<%[ test ]%>" CausesValidation="true" OnCallback="connectionAPITest">
209 <prop:ClientSide.OnLoading>
210 $('#<%=$this->APITestResultOk->ClientID%>').hide();
211 $('#<%=$this->APITestResultErr->ClientID%>').hide();
212 $('#<%=$this->APICatalogSupportYes->ClientID%>').hide();
213 $('#<%=$this->APICatalogSupportNo->ClientID%>').hide();
214 $('#<%=$this->APIConsoleSupportYes->ClientID%>').hide();
215 $('#<%=$this->APIConsoleSupportNo->ClientID%>').hide();
216 $('#<%=$this->APIConfigSupportYes->ClientID%>').hide();
217 $('#<%=$this->APIConfigSupportNo->ClientID%>').hide();
218 $('#<%=$this->APITestLoader->ClientID%>').show();
219 </prop:ClientSide.OnLoading>
220 <prop:ClientSide.OnComplete>
221 $('#<%=$this->APITestLoader->ClientID%>').hide();
222 </prop:ClientSide.OnComplete>
226 <com:TActiveLabel ID="APITestLoader" Display="None"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></com:TActiveLabel>
227 <com:TActiveLabel ID="APITestResultOk" Display="None" CssClass="validate" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="Validate" /> <%[ OK ]%></com:TActiveLabel>
228 <com:TActiveLabel ID="APITestResultErr" Display="None" CssClass="validator-block" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="Invalidate" /> <%[ Connection error ]%></com:TActiveLabel>
232 <td><%[ Catalog support ]%></td>
234 <com:TActiveLabel ID="APICatalogSupportYes" Display="None" CssClass="validate" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="Validate" /> <strong><%[ Supported ]%></strong></com:TActiveLabel>
235 <com:TActiveLabel ID="APICatalogSupportNo" Display="None" CssClass="validator-info" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_close.png" alt="" /> <strong><%[ Not supported ]%></strong></com:TActiveLabel>
239 <td><%[ Console support ]%></td>
241 <com:TActiveLabel ID="APIConsoleSupportYes" Display="None" CssClass="validate" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="Validate" /> <strong><%[ Supported ]%></strong></com:TActiveLabel>
242 <com:TActiveLabel ID="APIConsoleSupportNo" Display="None" CssClass="validator-info" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_close.png" alt="" /> <strong><%[ Not supported ]%></strong></com:TActiveLabel>
246 <td><%[ Config support ]%></td>
248 <com:TActiveLabel ID="APIConfigSupportYes" Display="None" CssClass="validate" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="Validate" /> <strong><%[ Supported ]%></strong></com:TActiveLabel>
249 <com:TActiveLabel ID="APIConfigSupportNo" Display="None" CssClass="validator-info" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_close.png" alt="" /> <strong><%[ Not supported ]%></strong></com:TActiveLabel>
255 <div class="line" <%=($this->getForceHostName() ? 'style="display: none;"' : '')%>>
256 <div class="text"><com:TLabel ForControl="APIHostName" Text="<%[ Save as: ]%>" /></div>
258 <com:TActiveTextBox ID="APIHostName" CssClass="textbox" CausesValidation="false" /> <%[ (optional) ]%>
261 <div class="center" style="width: 550px;<%=($this->getShowButtons() ? '' : 'display: none;')%>">
263 Text="<%[ Cancel ]%>"
264 CausesValidation="false"
265 Attributes.onclick="$('#new_host').slideUp(); return false;"
269 ValidationGroup="NewHostGroup"
270 OnCommand="TemplateControl.addNewHost"
271 Text="<%[ Add host ]%>"
272 Attributes.onclick="return fields_validation()"
274 <prop:ClientSide.OnPreDispatch>
275 $('#<%=$this->NewHostAddOk->ClientID%>').hide();
276 $('#<%=$this->NewHostAddError->ClientID%>').hide();
277 $('#<%=$this->NewHostAddExists->ClientID%>').hide();
278 </prop:ClientSide.OnPreDispatch>
279 <prop:ClientSide.OnComplete>
280 var msg_ok = $('#<%=$this->NewHostAddOk->ClientID%>');
281 if (msg_ok.is(':visible')) {
282 $('#new_host').slideUp();
283 setTimeout(function() {
284 $('#<%=$this->NewHostAddOk->ClientID%>').slideUp();
286 $('#new_host_status').find('span').hide();
288 </prop:ClientSide.OnComplete>
292 <script type="text/javascript">
293 var fields_validation = function() {
294 var basic = document.getElementById('<%=$this->AuthBasic->ClientID%>');
295 var oauth2 = document.getElementById('<%=$this->AuthOAuth2->ClientID%>');
296 var validation_group;
297 if (basic.checked === true) {
298 validation_group = 'Basic';
299 } else if (oauth2.checked === true) {
300 validation_group = 'OAuth2';
302 return Prado.Validation.validate(Prado.Validation.getForm(), validation_group);