]> source.dussan.org Git - archiva.git/commitdiff
start work on proxy connector screen
authorOlivier Lamy <olamy@apache.org>
Mon, 30 Jan 2012 14:57:11 +0000 (14:57 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 30 Jan 2012 14:57:11 +0000 (14:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1237693 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html

index 1ed8438225a9c3caf904dbd2c10f177f5998c7bb..6a2660e08defaac51b112181100e872997853aff 100644 (file)
@@ -64,34 +64,30 @@ $(function() {
       //sourceRepoId
       for(i=0;i<self.proxyConnectors().length;i++){
         var curSrcRepo=self.proxyConnectors()[i].sourceRepoId();
+
         var curTarget=self.proxyConnectors()[i].targetRepoId();
-        $.log("curSrcRepo:"+curSrcRepo+",curTarget:"+curTarget);
         var sourceRepo = $.grep(sourcesRepos,
                                 function(srcRepo,idx){
-                                  $.log("grep:"+srcRepo.source);
-                                  $.log("sourcesRepos.length:"+sourcesRepos.length);
                                   for (j=0;j<sourcesRepos.length;j++){
-                                    if (srcRepo.source==curSrcRepo){
+                                    if (srcRepo.source==sourcesRepos[j].source){
                                       return true;
                                     }
                                   }
                                   return false;
                                 }
         );
-        $.log("isArray:"+$.isArray(sourceRepo)+",length:"+sourceRepo.length);
         if (sourceRepo.length>0){
-          $.log("sourceRepo!=null:"+sourceRepo[0]);
           sourceRepo[0].targetRepos.push(curTarget);
         } else {
           $.log("sourceRepo==null:"+curSrcRepo);
           sourcesRepos.push({source:curSrcRepo,targetRepos:[curTarget]});
+        if (sourceRepo!=null){
+          $.log("sourceRepoId:"+curSrcRepo);
+          sourcesRepos.push({source:curSrcRepo,targetRepos:[curTarget]});
+        } else {
+          sourceRepo.targetRepos.push(curTarget);
         }
       }
-
-      $.log("sourcesRepo.length:"+sourcesRepos.length);
-      for(i=0;i<sourcesRepos.length;i++){
-        $.log("sourcesRepos[i]:"+sourcesRepos[i].source+"="+sourcesRepos[i].targetRepos.join(":"));
-      }
     }
   }
 
index 0fde2ad4daac3dde05fae3b729aee9de2f1ab167..7a2445a99c81cfbc05c9f80c70eacc3ab1f9296f 100644 (file)
@@ -20,7 +20,6 @@
   <div class="page-header">
     <h2>${$.i18n.prop('proxy-connectors.list')}</h2>
   </div>
-
   <ul id="proxy-connector-view-tabs" class="tabs">
     <li id="network-proxies-view-tabs-li-grid" class="active">
       <a href="#network-proxies-view" id="network-proxies-view-tabs-a-network-proxies-grid">${$.i18n.prop('network-proxies.grid.tab.title')}</a>
   </ul>
   <div id="network-proxies-view-tabs-content" class="tab-content">
     <div id="network-proxies-view" class="active">
-        <table class="bordered-table zebra-striped" id="networkProxiesTable>
+        <table class="bordered-table zebra-striped" id="networkProxiesTable"
                data-bind="simpleGrid: gridViewModel,simpleGridTemplate:'ko-network-proxies-grid',pageLinksId:'network-proxiesPagination'">
         </table>
         <div id="network-proxiesPagination"></div>
     </div>
     <div id="network-proxies-edit" data-bind='template: {name:"network-proxy-edit-tmpl"}'></div>
   </div>
-
 </script>
\ No newline at end of file