]> source.dussan.org Git - archiva.git/commitdiff
fix attributes names
authorOlivier Lamy <olamy@apache.org>
Sat, 22 Dec 2012 23:44:25 +0000 (23:44 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 22 Dec 2012 23:44:25 +0000 (23:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1425374 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 8b55134948c80e5e40320c3cc6a052a2defb1ec1..6d3bbca901627d1f751f84739ff53e19aaafade5 100644 (file)
@@ -1160,7 +1160,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
 
 
   RedbackRuntimeConfiguration=function(userManagerImpls,ldapConfiguration,migratedFromRedbackConfiguration,configurationPropertiesEntries
-                                      ,useUsersCache,usersCacheTimeToIdleSeconds,usersCacheTimeToLiveSeconds){
+                                      ,useUsersCache,cacheConfiguration){
     $.log("new RedbackRuntimeConfiguration");
     var self=this;
     this.modified=ko.observable(false);
@@ -1197,11 +1197,9 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
     this.useUsersCache=ko.observable(useUsersCache);
     this.useUsersCache.subscribe(function(newValue){self.modified(true)});
 
-    this.usersCacheTimeToIdleSeconds=ko.observable(usersCacheTimeToIdleSeconds);
-    this.usersCacheTimeToIdleSeconds.subscribe(function(newValue){self.modified(true)});
+    this.usersCacheConfiguration=ko.observable(cacheConfiguration);
+    this.usersCacheConfiguration.subscribe(function(newValue){self.modified(true)});
 
-    this.usersCacheTimeToLiveSeconds=ko.observable(usersCacheTimeToLiveSeconds);
-    this.usersCacheTimeToLiveSeconds.subscribe(function(newValue){self.modified(true)});
 
   }
 
@@ -1212,7 +1210,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
 
     var redbackRuntimeConfiguration =
             new RedbackRuntimeConfiguration(data.userManagerImpls,ldapConfiguration,data.migratedFromRedbackConfiguration,[]
-                    ,data.useUsersCache,data.usersCacheTimeToIdleSeconds,data.usersCacheTimeToLiveSeconds);
+                    ,data.useUsersCache,mapCacheConfiguration(data.usersCacheConfiguration));
 
     $.log("mapRedbackRuntimeConfiguration done");
     var configurationPropertiesEntries = data.configurationPropertiesEntries == null ? []: $.each(data.configurationPropertiesEntries,function(item){
@@ -1499,6 +1497,23 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
 
   }
 
+  CacheConfiguration=function(timeToIdleSeconds,timeToLiveSeconds){
+    var self=this;
+    this.modified=ko.observable(false);
+
+    this.timeToIdleSeconds=ko.observable(timeToIdleSeconds);
+    this.timeToIdleSeconds.subscribe(function(newValue){self.modified(true)});
+
+    this.timeToLiveSeconds=ko.observable(timeToLiveSeconds);
+    this.timeToLiveSeconds.subscribe(function(newValue){self.modified(true)});
 
+  }
+
+  mapCacheConfiguration=function(data){
+    if(!data){
+      return new CacheConfiguration();
+    }
+    return new CacheConfiguration(data.timeToIdleSeconds,data.timeToLiveSeconds);
+  }
 
 });
\ No newline at end of file
index 6543a549fe39c01b66ad5be48bf7af8989fd5883..a76af51117de0e04c976b035c70600bd9a35cc7f 100644 (file)
             <div class="control-group">
               <label class="control-label" for="usersCacheTimeToLiveSeconds">${$.i18n.prop('redback.runtime.usersCacheTimeToLiveSeconds.label')}</label>
               <div class="controls">
-                <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheTimeToLiveSeconds"
+                <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().timeToLiveSeconds"
                        id="usersCacheTimeToLiveSeconds" name="usersCacheTimeToLiveSeconds" />
               </div>
             </div>
             <div class="control-group">
               <label class="control-label" for="usersCacheTimeToIdleSeconds">${$.i18n.prop('redback.runtime.usersCacheTimeToIdleSeconds.label')}</label>
               <div class="controls">
-                <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheTimeToIdleSeconds"
+                <input type="text" class="xlarge required numeric" data-bind="value: redbackRuntimeConfiguration().usersCacheConfiguration().timeToIdleSeconds"
                        id="usersCacheTimeToIdleSeconds" name="usersCacheTimeToIdleSeconds" />
               </div>
             </div>