add form for url cache failure setup

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1426862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-12-29 23:59:08 +00:00
parent fad02e0a87
commit 91e2a266ae
3 changed files with 100 additions and 15 deletions

View File

@ -46,6 +46,15 @@ error.500=An error has happened you must contact the administrator to check the
administration.repositories=Repositories Administration administration.repositories=Repositories Administration
runtime.cache.timeToLiveSeconds.label=Time to Live (seconds)
runtime.cache.timeToLiveSeconds.help.title=
runtime.cache.timeToLiveSeconds.help.content=
runtime.cache.timeToIdleSeconds.label=Time to Idle (seconds)
runtime.cache.timeToIdleSeconds.help.title=
runtime.cache.timeToIdleSeconds.help.content=
runtime.cache.maxElementsInMemory.label=Max Elements in memory
runtime.cache.maxElementsOnDisk.label=Max Elements on disk
# managed repositories screen # managed repositories screen
managedrepository.delete.confirm=Delete Managed Repository managedrepository.delete.confirm=Delete Managed Repository
managedrepository.delete.warning.message=Are you sure you want to delete the following managed repository? managedrepository.delete.warning.message=Are you sure you want to delete the following managed repository?
@ -634,13 +643,7 @@ redback.runtime.ldap.checkModification=Verify LDAP changes.
redback.runtime.ldap.checkServer=Verify LDAP configuration on server side. redback.runtime.ldap.checkServer=Verify LDAP configuration on server side.
redback.runtime.useUsersCache.label=Use a cache for users. redback.runtime.useUsersCache.label=Use a cache for users.
redback.runtime.users.cache.title=Users Cache redback.runtime.users.cache.title=Users Cache
redback.runtime.usersCacheTimeToLiveSeconds.label=Time to Live (seconds)
redback.runtime.usersCacheTimeToLiveSeconds.help.title=
redback.runtime.usersCacheTimeToLiveSeconds.help.content=
redback.runtime.usersCacheTimeToIdleSeconds.label=Time to Idle (seconds)
redback.runtime.usersCacheTimeToIdleSeconds.help.title=
redback.runtime.usersCacheTimeToIdleSeconds.help.content=
redback.runtime.maxElementsInMemory.label=Max Elements in memory
redback.runtime.maxElementsOnDisk.label=Max Elements on disk

View File

@ -558,7 +558,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
var mainContent=$("#main-content"); var mainContent=$("#main-content");
mainContent.html($("#runtime-configuration-screen").tmpl()); mainContent.html($("#runtime-configuration-screen").tmpl());
mainContent.find("#network-configuration-form" ).html(mediumSpinnerImg());
$.ajax("restServices/archivaServices/archivaAdministrationService/getNetworkConfiguration", { $.ajax("restServices/archivaServices/archivaAdministrationService/getNetworkConfiguration", {
type: "GET", type: "GET",
dataType: 'json', dataType: 'json',
@ -566,7 +566,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
var networkConfiguration=new NetworkConfiguration(data.maxTotal,data.maxTotalPerHost,data.usePooling); var networkConfiguration=new NetworkConfiguration(data.maxTotal,data.maxTotalPerHost,data.usePooling);
var networkConfigurationViewModel=new NetworkConfigurationViewModel(networkConfiguration); var networkConfigurationViewModel=new NetworkConfigurationViewModel(networkConfiguration);
ko.applyBindings(networkConfigurationViewModel,mainContent.get(0)); ko.applyBindings(networkConfigurationViewModel,mainContent.find("#network-configuration-form-content").get(0));
var validator = mainContent.find("#network-configuration-edit-form") var validator = mainContent.find("#network-configuration-edit-form")
.validate({ .validate({
showErrors: function(validator, errorMap, errorList) { showErrors: function(validator, errorMap, errorList) {
@ -576,8 +576,36 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
} }
}); });
$.ajax("restServices/archivaServices/archivaRuntimeConfigurationService/archivaRuntimeConfiguration", {
type: "GET",
dataType: 'json',
success: function(data){
var archivaRuntimeConfiguration=mapArchivaRuntimeConfiguration(data);
var archivaRuntimeConfigurationViewModel=new ArchivaRuntimeConfigurationViewModel(archivaRuntimeConfiguration);
ko.applyBindings(archivaRuntimeConfigurationViewModel,mainContent.find("#cache-failure-form").get(0));
}
});
}
ArchivaRuntimeConfigurationViewModel=function(archivaRuntimeConfiguration){
var self=this;
this.archivaRuntimeConfiguration=ko.observable(archivaRuntimeConfiguration);
} }
ArchivaRuntimeConfiguration=function(cacheConfiguration){
this.urlFailureCacheConfiguration=ko.observable(cacheConfiguration);
}
mapArchivaRuntimeConfiguration=function(data){
if(!data){
return null;
}
return new ArchivaRuntimeConfiguration(data.urlFailureCacheConfiguration?mapCacheConfiguration(data.urlFailureCacheConfiguration):null);
}
//--------------------------- //---------------------------
// organisation/appearance configuration part // organisation/appearance configuration part
//--------------------------- //---------------------------

View File

@ -281,9 +281,12 @@
</script> </script>
<script id="runtime-configuration-screen" type="text/html"> <script id="runtime-configuration-screen" type="text/html">
<div class="page-header">
<h2>${$.i18n.prop('archiva-runtime-configuration.title')}</h2>
</div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active" id="network-configuration-form-li"><a href="#network-configuration-form-content" data-toggle="tab">${$.i18n.prop('runtime-configuration.maven.network.title')}</a></li> <li class="active" id="network-configuration-form-li"><a href="#network-configuration-form-content" data-toggle="tab">${$.i18n.prop('runtime-configuration.maven.network.title')}</a></li>
<li id="cache-failure-form-li"><a href="#cache-failure-form-content" data-toggle="tab">${$.i18n.prop('runtime-configuration.cache.failure.title')}</a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@ -293,6 +296,10 @@
</div> </div>
<div id="network-configuration-form" data-bind='template: {name:"network-configuration-form-tmpl"}'></div> <div id="network-configuration-form" data-bind='template: {name:"network-configuration-form-tmpl"}'></div>
</div> </div>
<div class="tab-pane" id="cache-failure-form-content">
<div id="cache-failure-form" data-bind='template: {name:"cache-failure-form-tmpl"}'></div>
</div>
</div> </div>
</script> </script>
@ -326,6 +333,53 @@
</form> </form>
</script> </script>
<script id="cache-failure-form-tmpl" type="text/html">
<div class="well">
<form class="form-horizontal" id="cache-failure-form-id">
<div class="control-group">
<label class="control-label" for="usersCacheTimeToLiveSeconds">${$.i18n.prop('runtime.cache.timeToLiveSeconds.label')}</label>
<div class="controls">
<input type="text" class="xlarge required numeric" data-bind="value: archivaRuntimeConfiguration().urlFailureCacheConfiguration().timeToLiveSeconds"
id="usersCacheTimeToLiveSeconds" name="usersCacheTimeToLiveSeconds" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="usersCacheTimeToIdleSeconds">${$.i18n.prop('runtime.cache.timeToIdleSeconds.label')}</label>
<div class="controls">
<input type="text" class="xlarge required numeric" data-bind="value: archivaRuntimeConfiguration().urlFailureCacheConfiguration().timeToIdleSeconds"
id="usersCacheTimeToIdleSeconds" name="usersCacheTimeToIdleSeconds" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="maxElementsInMemory">${$.i18n.prop('runtime.cache.maxElementsInMemory.label')}</label>
<div class="controls">
<input type="text" class="xlarge required numeric" data-bind="value: archivaRuntimeConfiguration().urlFailureCacheConfiguration().maxElementsInMemory"
id="maxElementsInMemory" name="maxElementsInMemory" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="maxElementsOnDisk">${$.i18n.prop('runtime.cache.maxElementsOnDisk.label')}</label>
<div class="controls">
<input type="text" class="xlarge required numeric" data-bind="value: archivaRuntimeConfiguration().urlFailureCacheConfiguration().maxElementsOnDisk"
id="maxElementsOnDisk" name="maxElementsOnDisk" />
</div>
</div>
</form>
</div>
</script>
<script id="system-status-main" type="text/html"> <script id="system-status-main" type="text/html">
<div class="page-header"> <div class="page-header">
<h4>${$.i18n.prop('system-status.header.version.info')}</h4> <h4>${$.i18n.prop('system-status.header.version.info')}</h4>
@ -1066,7 +1120,7 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usersCacheTimeToLiveSeconds">${$.i18n.prop('redback.runtime.usersCacheTimeToLiveSeconds.label')}</label> <label class="control-label" for="usersCacheTimeToLiveSeconds">${$.i18n.prop('runtime.cache.timeToLiveSeconds.label')}</label>
<div class="controls"> <div class="controls">
<input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().timeToLiveSeconds" <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().timeToLiveSeconds"
id="usersCacheTimeToLiveSeconds" name="usersCacheTimeToLiveSeconds" /> id="usersCacheTimeToLiveSeconds" name="usersCacheTimeToLiveSeconds" />
@ -1074,7 +1128,7 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usersCacheTimeToIdleSeconds">${$.i18n.prop('redback.runtime.usersCacheTimeToIdleSeconds.label')}</label> <label class="control-label" for="usersCacheTimeToIdleSeconds">${$.i18n.prop('runtime.cache.timeToIdleSeconds.label')}</label>
<div class="controls"> <div class="controls">
<input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().timeToIdleSeconds" <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().timeToIdleSeconds"
id="usersCacheTimeToIdleSeconds" name="usersCacheTimeToIdleSeconds" /> id="usersCacheTimeToIdleSeconds" name="usersCacheTimeToIdleSeconds" />
@ -1082,7 +1136,7 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="maxElementsInMemory">${$.i18n.prop('redback.runtime.maxElementsInMemory.label')}</label> <label class="control-label" for="maxElementsInMemory">${$.i18n.prop('runtime.cache.maxElementsInMemory.label')}</label>
<div class="controls"> <div class="controls">
<input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().maxElementsInMemory" <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().maxElementsInMemory"
id="maxElementsInMemory" name="maxElementsInMemory" /> id="maxElementsInMemory" name="maxElementsInMemory" />
@ -1090,7 +1144,7 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="maxElementsOnDisk">${$.i18n.prop('redback.runtime.maxElementsOnDisk.label')}</label> <label class="control-label" for="maxElementsOnDisk">${$.i18n.prop('runtime.cache.maxElementsOnDisk.label')}</label>
<div class="controls"> <div class="controls">
<input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().maxElementsOnDisk" <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().maxElementsOnDisk"
id="maxElementsOnDisk" name="maxElementsOnDisk" /> id="maxElementsOnDisk" name="maxElementsOnDisk" />