aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-10-16 22:44:28 +0000
committerOlivier Lamy <olamy@apache.org>2012-10-16 22:44:28 +0000
commit2879d8775eef2f0b645d328a8c881d808de1b605 (patch)
tree1d493e8a78d13684f10ee5febfacea6809c459cb
parent1a9f55d9c48a1901fe73f59748f386609c3d379b (diff)
downloadarchiva-2879d8775eef2f0b645d328a8c881d808de1b605.tar.gz
archiva-2879d8775eef2f0b645d328a8c881d808de1b605.zip
fix available proxy connectors in proxy connectors screen
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1399030 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js
index 615134e69..efcbda1db 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js
@@ -175,10 +175,25 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra
var self=this;
this.proxyConnectorRule=proxyConnectorRule;
this.proxyConnectorRulesViewModel=proxyConnectorRulesViewModel;
- this.availableProxyConnectors=proxyConnectorRulesViewModel.proxyConnectors;
+ this.availableProxyConnectors=ko.observableArray([]);
this.availableProxyConnectors.id="availableProxyConnectors";
this.update=update;
+
+ $.each(this.proxyConnectorRulesViewModel.proxyConnectors(), function(idx, value) {
+ $.log(idx + ': ' + value.sourceRepoId() +":"+value.targetRepoId());
+ var available=true;
+ // is it in proxyConnectorRule.proxyConnectors
+ $.each(self.proxyConnectorRule.proxyConnectors(),function(index,proxyConnector){
+ if(value.sourceRepoId()==proxyConnector.sourceRepoId() && value.targetRepoId()==proxyConnector.targetRepoId()){
+ available=false;
+ }
+ });
+ if(available==true){
+ self.availableProxyConnectors.push(value);
+ }
+ });
+
proxyConnectorMoved=function(arg){
$.log("repositoryMoved:"+arg.sourceIndex+" to " + arg.targetIndex);
self.proxyConnectorRule.modified(true);