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
{ 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()}}
]);
{{/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>