From: Olivier Lamy Date: Wed, 8 Feb 2012 17:44:26 +0000 (+0000) Subject: [MRM-1576] rewrite proxies connector page X-Git-Tag: archiva-1.4-M3~1348 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=787f50d0168620fe4ba1cfcc6eb09ad4e697f8ec;p=archiva.git [MRM-1576] rewrite proxies connector page fix various observable fields which are array start binding of properties git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242008 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js index 2b3f5e401..6f4a86e2e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js @@ -36,20 +36,23 @@ $(function() { this.proxyId.subscribe(function(newValue){self.modified(true)}); //private List blackListPatterns; - this.blackListPatterns=ko.observableArray(blackListPatterns); + this.blackListPatterns=ko.observableArray(blackListPatterns==null?[]:blackListPatterns); this.blackListPatterns.subscribe(function(newValue){self.modified(true)}); //private List whiteListPatterns; - this.whiteListPatterns=ko.observableArray(whiteListPatterns); + this.whiteListPatterns=ko.observableArray(whiteListPatterns==null?[]:whiteListPatterns); this.whiteListPatterns.subscribe(function(newValue){self.modified(true)}); //private Map policies; - this.policies=ko.observable(policies); + this.policies=ko.observableArray(policies==null?[]:policies); this.policies.subscribe(function(newValue){self.modified(true)}); //private Map properties; - this.properties=ko.observable(properties); - this.properties.subscribe(function(newValue){self.modified(true)}); + this.properties=ko.observableArray(properties==null?[]:properties); + this.properties.subscribe(function(newValue){ + $.log("properties modified"); + self.modified(true); + }); //private boolean disabled = false; this.disabled=ko.observable(disabled); @@ -97,9 +100,10 @@ $(function() { ProxyConnectorViewModel=function(proxyConnector,update,proxyConnectorsViewModel){ var self=this; - this.proxyConnector=ko.observable(proxyConnector); + this.proxyConnector=proxyConnector; this.proxyConnectorsViewModel=proxyConnectorsViewModel; this.update=update; + this.modified=ko.observable(false); getSelectedPolicyOption=function(id){ if (!update){ // we are on add mode so use default option @@ -123,12 +127,24 @@ $(function() { getPolicyOptions=function(id){ var policyInformations=self.proxyConnectorsViewModel.policyInformations(); for(i=0;i
-
+
@@ -114,7 +114,7 @@
+ value: proxyId, optionsCaption: 'direct connection'">
@@ -122,7 +122,7 @@
+ value: sourceRepoId">
@@ -130,7 +130,7 @@
+ value: targetRepoId">
@@ -144,13 +144,36 @@ ${$value.name()} - + {{/each}}
+
+ + + + + + {{each properties()}} + {{var key=$value.key()}} + + + + + + {{/each}} + + + + + + +
${$.i18n.prop('proxy-connector.properties')}
${key}${$value.value()}${$.i18n.prop('delete')}
${$.i18n.prop('add')}
+