diff options
author | Olivier Lamy <olamy@apache.org> | 2012-11-23 16:28:29 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-11-23 16:28:29 +0000 |
commit | 474cd1b61dd56ad3d1c0d2f05a9f47e47e927e6d (patch) | |
tree | efafd0c03c5dbb7dacdd606e3072290c6e5401e3 /archiva-modules/archiva-web/archiva-webapp-js | |
parent | 8fd2aba5e71b4fd6d7a64d9d456dd661c60332e9 (diff) | |
download | archiva-474cd1b61dd56ad3d1c0d2f05a9f47e47e927e6d.tar.gz archiva-474cd1b61dd56ad3d1c0d2f05a9f47e47e927e6d.zip |
[MRM-1714] using LDAP can be configurable with the ui
implements ui part for updating values.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1412943 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webapp-js')
3 files changed, 93 insertions, 1 deletions
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 31559507a..a0c14ee0a 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 @@ -1147,7 +1147,70 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" ko.applyBindings( statisticsReportViewModel, mainContent.get( 0 ) ); ko.applyBindings( healthReportViewModel, mainContent.get( 0 ) ); } - }) + }); + } + + + ArchivaRuntimeConfiguration=function(userManagerImpl){ + this.userManagerImpl=ko.observable(userManagerImpl); + } + + ArchivaRuntimeConfigurationViewModel=function(archivaRuntimeConfiguration){ + this.archivaRuntimeConfiguration=ko.observable(archivaRuntimeConfiguration); + self=this; + + saveArchivaRuntimeConfiguration=function(){ + $.log("saveArchivaRuntimeConfiguration"); + + + clearUserMessages(); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); + $("#repository-group-save" ).button('loading'); + $.ajax("restServices/archivaServices/archivaRuntimeConfigurationService/archivaRuntimeConfiguration", + { + type: "PUT", + contentType: 'application/json', + data:ko.toJSON(self.archivaRuntimeConfiguration), + dataType: 'json', + success: function(data) { + var message=$.i18n.prop('archiva-runtime-configuration.updated'); + displaySuccessMessage(message); + }, + error: function(data) { + var res = $.parseJSON(data.responseText); + displayRestError(res); + }, + complete:function(data){ + removeMediumSpinnerImg(userMessages); + } + } + ); + + } + } + + displayRuntimeConfiguration=function(){ + $.log("displayRuntimeConfiguration"); + var mainContent = $("#main-content"); + mainContent.html(mediumSpinnerImg()); + + + $.ajax("restServices/archivaServices/archivaRuntimeConfigurationService/archivaRuntimeConfiguration", { + type: "GET", + dataType: 'json', + success: function(data) { + var archivaRuntimeConfiguration = mapArchivaRuntimeConfiguration(data); + var archivaRuntimeConfigurationViewModel = new ArchivaRuntimeConfigurationViewModel(archivaRuntimeConfiguration); + mainContent.html( $( "#runtime-configuration-main" ).tmpl( ) ); + ko.applyBindings(archivaRuntimeConfigurationViewModel,$("#runtime-configuration-content" ).get(0)); + } + }); + + } + + mapArchivaRuntimeConfiguration=function(data){ + return new ArchivaRuntimeConfiguration(data.userManagerImpl); } });
\ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index b201776ff..67fe5278c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -195,6 +195,7 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa { text : $.i18n.prop('menu.system-status') , id: "menu-system-status-list-a" , href: "#status" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displaySystemStatus()}}, { text : $.i18n.prop('menu.appearance-configuration') , id: "menu-appearance-list-a" , href: "#appearance" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayAppearanceConfiguration()}}, { text : $.i18n.prop('menu.ui-configuration') , id: "menu-ui-configuration-list-a" , href: "#uiconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayUiConfiguration()}}, + { text : $.i18n.prop('menu.runtime-configuration') , id: "menu-runtime-configuration-list-a" , href: "#runtimeconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRuntimeConfiguration()}}, { text : $.i18n.prop('menu.reports') , id: "menu-report-list-a" , href: "#reports" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayReportsPage()}} ]); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html index 77d2f61d0..918d85617 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html @@ -885,3 +885,31 @@ {{/each}} </tbody> </script> + +<script type="text/html" id="runtime-configuration-main"> + <div class="page-header"> + <h2>${$.i18n.prop('runtime-configuration.title')}</h2> + </div> + <div id="runtime-configuration-content" data-bind='template: {name:"runtime-configuration-content-tmpl"}'> + + </div> +</script> + +<script type="text/html" id="runtime-configuration-content-tmpl"> + <div class="well"> + <form class="form-horizontal" id="runtime-configuration-form-id"> + <fieldset id="form-runtime-configuration"> + <div class="control-group"> + <label for="userManagerImpl" class="control-label"> + ${$.i18n.prop('runtime-configuration.usermanager.label')} + </label> + <div class="controls"> + <input type="text" id="userManagerImpl" name="userManagerImpl" class="input-small required" + data-bind="value: archivaRuntimeConfiguration().userManagerImpl"/> + </div> + </div> + <button data-bind="click: saveArchivaRuntimeConfiguration" class="btn">${$.i18n.prop('save')}</button> + </fieldset> + </form> + </div> +</script> |