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 9b8b13ee2..f1a26c1c9 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 @@ -346,27 +346,33 @@ $(function() { } getProxyConnector=function(sourceRepoId,targetRepoId){ - var proxyConnector=$.grep(self.proxyConnectors(), + var proxyConnectors=$.grep(self.proxyConnectors(), function(proxyConnector,idx){ return proxyConnector.sourceRepoId()==sourceRepoId - && proxyConnector.targetRepoId==targetRepoId; + && proxyConnector.targetRepoId()==targetRepoId; } ); - var res = ($.isArray(proxyConnector) && proxyConnector.length>0) ? proxyConnector[0]:new ProxyConnector(); + var res = ($.isArray(proxyConnectors) && proxyConnectors.length>0) ? proxyConnectors[0]:new ProxyConnector(); return res; } - showSettings=function(proxyConnector,targetContentStartId, targetImgStartId){ - //proxyConnector=getProxyConnector(proxyConnector.sourceRepoId(),proxyConnector.targetRepoId()); - var targetContent = $( (targetContentStartId?targetContentStartId:"#proxy-connectors-grid-remoterepo-settings-content-") - +proxyConnector.sourceRepoId()+"-"+proxyConnector.targetRepoId()); - targetContent.html(""); - targetContent.append($("#proxy-connectors-remote-settings-popover-tmpl") - .tmpl({ - proxyConnectorsViewModel: self, - proxyConnector:ko.toJS(proxyConnector) - })); + showSettings=function(proxyConnector,targetContentStartId, targetImgStartId,theProxyConnectorsViewModel){ + $.log("proxyConnector:"+proxyConnector.sourceRepoId()+":"+proxyConnector.targetRepoId()); + var id = (targetContentStartId?targetContentStartId:"#proxy-connectors-grid-remoterepo-settings-content-") + +proxyConnector.sourceRepoId()+"-"+proxyConnector.targetRepoId(); + var targetContent = $(id); + targetContent.html(""); + + var tmplHtml = $("#proxy-connectors-remote-settings-popover-tmpl") + .tmpl({ + proxyConnectorsViewModel: self, + proxyConnector:ko.toJS(proxyConnector) + } ).html(); + + $.log("tmpl:"+tmplHtml); + targetContent.append(tmplHtml); + $.log("showSettings#targetContent:"+id+","+targetContent.length+","+targetContent.attr("id")+",html:"+targetContent.html()); var targetImg = $((targetImgStartId?targetImgStartId:"#proxy-connectors-grid-remoterepo-settings-edit-") +proxyConnector.sourceRepoId()+"-"+proxyConnector.targetRepoId()); targetImg.attr("data-content",targetContent.html()); @@ -381,6 +387,11 @@ $(function() { } + this.displaySettings=function(sourceRepoId,targetRepoId,targetContentStartId, targetImgStartId){ + var proxyConnector=getProxyConnector(sourceRepoId,targetRepoId); + showSettings(proxyConnector,targetContentStartId,targetImgStartId); + } + this.findPolicyInformationName=function(id){ for(i=0;i
+
+ +