]> source.dussan.org Git - archiva.git/commitdiff
add buttons to check ldap configuration
authorOlivier Lamy <olamy@apache.org>
Thu, 13 Dec 2012 20:03:45 +0000 (20:03 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 13 Dec 2012 20:03:45 +0000 (20:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1421466 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html

index 1e40be9527b85af82bdf9539587d784ffb36409e..3ebe55aa3527f2354c5d3cb0a56e62a757886e1b 100644 (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);
index 7c86a4113682be26f4b3cfa614c945d495527752..ed5b4525325c9190e7c93f43abe75feb6222dd7f 100644 (file)
             <!-- 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>