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
This commit is contained in:
Olivier Lamy 2012-10-16 22:44:28 +00:00
parent 1a9f55d9c4
commit 2879d8775e
1 changed files with 16 additions and 1 deletions

View File

@ -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);