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. ]%>" />
30 <div class="auth_setting">
31 <div class="line left">
34 GroupName="SelectAuth"
35 Attributes.onclick="$('#configure_basic_auth').hide();$('#configure_oauth2_auth').show();"
38 ForControl="AuthOAuth2"
40 Text="<%[ Use OAuth2 for authorization and authentication ]%>"
43 <div class="line left">
46 GroupName="SelectAuth"
48 Attributes.onclick="$('#configure_oauth2_auth').hide();$('#configure_basic_auth').show();"
51 ForControl="AuthBasic"
53 Text="<%[ Use HTTP Basic authentication ]%>"
57 <div id="configure_basic_auth" style="display: <%=($this->AuthBasic->Checked === true) ? '' : 'none';%>">
59 <div class="text"><com:TLabel ForControl="APIBasicLogin" Text="<%[ API Login: ]%>" /></div>
64 CausesValidation="false"
66 <com:TRequiredFieldValidator
67 CssClass="validator-block"
69 ControlCssClass="invalidate"
70 ControlToValidate="APIBasicLogin"
71 ValidationGroup="Basic"
72 Text="<%[ Please enter API login. ]%>"
77 <div class="text"><com:TLabel ForControl="APIBasicPassword" Text="<%[ API Password: ]%>" /></div>
83 CausesValidation="false"
84 PersistPassword="true"
86 <com:TRequiredFieldValidator
87 CssClass="validator-block"
89 ControlCssClass="invalidate"
90 ControlToValidate="APIBasicPassword"
91 ValidationGroup="Basic"
92 Text="<%[ Please enter API password. ]%>"
97 <div id="configure_oauth2_auth" style="display: <%=($this->AuthOAuth2->Checked === true) ? '' : 'none';%>">
99 <div class="text"><com:TLabel ForControl="APIOAuth2ClientId" Text="<%[ OAuth2 Client ID: ]%>" /></div>
102 ID="APIOAuth2ClientId"
104 CausesValidation="false"
107 <com:TRequiredFieldValidator
108 CssClass="validator-block"
110 ControlCssClass="invalidate"
111 ControlToValidate="APIOAuth2ClientId"
112 ValidationGroup="OAuth2"
113 Text="<%[ Please enter Client ID. ]%>"
115 <com:TRegularExpressionValidator
116 CssClass="validator-block"
118 ControlCssClass="invalidate"
119 ControlToValidate="APIOAuth2ClientId"
120 RegularExpression="<%=OAuth2::CLIENT_ID_PATTERN%>"
121 ValidationGroup="OAuth2"
122 Text="<%[ Invalid Client ID value. Client ID may contain a-z A-Z 0-9 - _ characters. ]%>"
124 <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>
128 <div class="text"><com:TLabel ForControl="APIOAuth2ClientSecret" Text="<%[ OAuth2 Client Secret: ]%>" /></div>
131 ID="APIOAuth2ClientSecret"
133 CausesValidation="false"
136 <com:TRequiredFieldValidator
137 CssClass="validator-block"
139 ControlCssClass="invalidate"
140 ControlToValidate="APIOAuth2ClientSecret"
141 ValidationGroup="OAuth2"
142 Text="<%[ Please enter Client Secret. ]%>"
144 <com:TRegularExpressionValidator
145 CssClass="validator-block"
147 ControlCssClass="invalidate"
148 ControlToValidate="APIOAuth2ClientSecret"
149 RegularExpression="<%=OAuth2::CLIENT_SECRET_PATTERN%>"
150 ValidationGroup="OAuth2"
151 Text="<%[ Invalid Client Secret value. Client Secret may contain any character that is not a whitespace character. ]%>"
153 <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>
157 <div class="text"><com:TLabel ForControl="APIOAuth2RedirectURI" Text="<%[ OAuth2 Redirect URI (example: https://baculumgui:9095/web/redirect): ]%>" /></div>
160 ID="APIOAuth2RedirectURI"
162 CausesValidation="false"
164 <com:TRequiredFieldValidator
165 CssClass="validator-block"
167 ControlCssClass="invalidate"
168 ControlToValidate="APIOAuth2RedirectURI"
169 ValidationGroup="OAuth2"
170 Text="<%[ Please enter Redirect URI. ]%>"
175 <div class="text"><com:TLabel ForControl="APIOAuth2Scope" Text="<%[ OAuth2 scopes (space separated): ]%>" /></div>
180 CausesValidation="false"
183 <com:TRequiredFieldValidator
184 CssClass="validator-block"
186 ControlCssClass="invalidate"
187 ControlToValidate="APIOAuth2Scope"
188 ValidationGroup="OAuth2"
189 Text="<%[ Please enter OAuth2 scopes. ]%>"
193 <div class="line" style="display: <%=$this->getClientMode() ? 'none': 'block'%>">
194 <div class="text"><com:TLabel ForControl="APIOAuth2BconsoleCfgPath" Text="<%[ Dedicated Bconsole config file path: ]%>" /></div>
197 ID="APIOAuth2BconsoleCfgPath"
199 CausesValidation="false"
200 /> <%[ (optional) ]%>
205 <div class="text"><com:TLabel ForControl="APIConnectionTest" Text="<%[ API connection test: ]%>" /></div>
207 <table border="0" cellpadding="1px" id="new_host_status">
209 <td align="center" valign="middle">
210 <com:TActiveButton ID="APIConnectionTest" Text="<%[ test ]%>" CausesValidation="true" OnCallback="connectionAPITest">
211 <prop:ClientSide.OnLoading>
212 $('#<%=$this->APITestResultOk->ClientID%>').hide();
213 $('#<%=$this->APITestResultErr->ClientID%>').hide();
214 $('#<%=$this->APICatalogSupportYes->ClientID%>').hide();
215 $('#<%=$this->APICatalogSupportNo->ClientID%>').hide();
216 $('#<%=$this->APIConsoleSupportYes->ClientID%>').hide();
217 $('#<%=$this->APIConsoleSupportNo->ClientID%>').hide();
218 $('#<%=$this->APIConfigSupportYes->ClientID%>').hide();
219 $('#<%=$this->APIConfigSupportNo->ClientID%>').hide();
220 $('#<%=$this->APITestLoader->ClientID%>').show();
221 </prop:ClientSide.OnLoading>
222 <prop:ClientSide.OnComplete>
223 $('#<%=$this->APITestLoader->ClientID%>').hide();
224 </prop:ClientSide.OnComplete>
228 <com:TActiveLabel ID="APITestLoader" Display="None"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/ajax-loader.gif" alt="<%[ Loading... ]%>" /></com:TActiveLabel>
229 <com:TActiveLabel ID="APITestResultOk" Display="None" CssClass="validate" EnableViewState="false"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="Validate" /> <%[ OK ]%></com:TActiveLabel>
230 <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>
234 <td><%[ Catalog support ]%></td>
236 <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>
237 <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>
241 <td><%[ Console support ]%></td>
243 <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>
244 <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>
248 <td><%[ Config support ]%></td>
250 <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>
251 <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>
257 <div class="line" <%=($this->getForceHostName() ? 'style="display: none;"' : '')%>>
258 <div class="text"><com:TLabel ForControl="APIHostName" Text="<%[ Save as: ]%>" /></div>
260 <com:TActiveTextBox ID="APIHostName" CssClass="textbox" CausesValidation="false" /> <%[ (optional) ]%>
263 <div class="center" style="width: 550px;<%=($this->getShowButtons() ? '' : 'display: none;')%>">
265 Text="<%[ Cancel ]%>"
266 CausesValidation="false"
267 Attributes.onclick="$('#new_host').slideUp(); return false;"
271 ValidationGroup="NewHostGroup"
272 OnCommand="TemplateControl.addNewHost"
273 Text="<%[ Add host ]%>"
274 Attributes.onclick="return fields_validation()"
276 <prop:ClientSide.OnPreDispatch>
277 $('#<%=$this->NewHostAddOk->ClientID%>').hide();
278 $('#<%=$this->NewHostAddError->ClientID%>').hide();
279 $('#<%=$this->NewHostAddExists->ClientID%>').hide();
280 </prop:ClientSide.OnPreDispatch>
281 <prop:ClientSide.OnComplete>
282 var msg_ok = $('#<%=$this->NewHostAddOk->ClientID%>');
283 if (msg_ok.is(':visible')) {
284 $('#new_host').slideUp();
285 setTimeout(function() {
286 $('#<%=$this->NewHostAddOk->ClientID%>').slideUp();
288 $('#new_host_status').find('span').hide();
290 </prop:ClientSide.OnComplete>
294 <script type="text/javascript">
295 var fields_validation = function() {
296 var basic = document.getElementById('<%=$this->AuthBasic->ClientID%>');
297 var oauth2 = document.getElementById('<%=$this->AuthOAuth2->ClientID%>');
298 var validation_group;
299 if (basic.checked === true) {
300 validation_group = 'Basic';
301 } else if (oauth2.checked === true) {
302 validation_group = 'OAuth2';
304 return Prado.Validation.validate(Prado.Validation.getForm(), validation_group);