From 9943c1c920e1a9ed2dad5c01ed142e2fb7354248 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 13 Dec 2012 20:03:45 +0000 Subject: [PATCH] add buttons to check ldap configuration git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1421466 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/webapp/js/archiva/general-admin.js | 52 +++++++++++++++++++ .../js/templates/archiva/general-admin.html | 8 +++ 2 files changed, 60 insertions(+) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js index 1e40be952..3ebe55aa3 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js @@ -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 + + + + + -- 2.39.5