add buttons to check ldap configuration

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1421466 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-12-13 20:03:45 +00:00
parent 6ccf27b7d1
commit 9943c1c920
2 changed files with 60 additions and 0 deletions

View File

@ -1262,6 +1262,58 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
}
}
checkLdapServerConfiguration=function(){
$.log("checkLdapServerConfiguration");
clearUserMessages();
var userMessages=$("#user-messages");
userMessages.html(mediumSpinnerImg());
$.log("checkChangedLdapConfiguration");
$.ajax("restServices/archivaServices/archivaRuntimeConfigurationService/checkLdapConnection",
{
type: "GET",
success: function(data) {
var message=$.i18n.prop('archiva-runtime-configuration.ldap.verified');
displaySuccessMessage(message);
},
error: function(data) {
var res = $.parseJSON(data.responseText);
displayRestError(res);
},
complete:function(data){
removeMediumSpinnerImg(userMessages);
//$("#archiva-runtime-configuration-save" ).button('reset');
}
}
);
}
checkChangedLdapConfiguration=function(){
clearUserMessages();
var userMessages=$("#user-messages");
userMessages.html(mediumSpinnerImg());
$.log("checkChangedLdapConfiguration");
$.ajax("restServices/archivaServices/archivaRuntimeConfigurationService/checkLdapConnection",
{
type: "POST",
contentType: 'application/json',
data:ko.toJSON(self.archivaRuntimeConfiguration().ldapConfiguration),
dataType: 'json',
success: function(data) {
var message=$.i18n.prop('archiva-runtime-configuration.ldap.verified');
displaySuccessMessage(message);
},
error: function(data) {
var res = $.parseJSON(data.responseText);
displayRestError(res);
},
complete:function(data){
removeMediumSpinnerImg(userMessages);
//$("#archiva-runtime-configuration-save" ).button('reset');
}
}
);
}
for(var i= 0;i<archivaRuntimeConfiguration.userManagerImpls().length;i++){
var id=archivaRuntimeConfiguration.userManagerImpls()[i];
$.log("id:"+id);

View File

@ -992,6 +992,14 @@
<!-- TODO extraPropertiesEntries -->
</fieldset>
</form>
<button data-bind="click: checkChangedLdapConfiguration,css:{ 'btn-warning': archivaRuntimeConfiguration().ldapConfiguration().modified() },
enabled: archivaRuntimeConfiguration().ldapConfiguration().modified()"
id="ldap-configuration-check-modification"class="btn">${$.i18n.prop('redback.runtime.ldap.checkModification')}</button>
<button data-bind="click: checkLdapServerConfiguration"
id="ldap-configuration-check-server"class="btn">${$.i18n.prop('redback.runtime.ldap.checkServer')}</button>
</div>
</div>