]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1750] Add remote repository health check
authorOlivier Lamy <olamy@apache.org>
Sun, 22 Dec 2013 12:26:05 +0000 (12:26 +0000)
committerOlivier Lamy <olamy@apache.org>
Sun, 22 Dec 2013 12:26:05 +0000 (12:26 +0000)
ui implementation

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1552984 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html

index eb590bf6b836c7f1f70e7ad07b40e86541a5b354..eaba06d9c279d9b4609f04f658a23cf6cbce5012 100644 (file)
@@ -1217,12 +1217,31 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
               ],
               pageSize: 5,
               gridUpdateCallBack: function(){
-                //$("#main-content" ).find("#remote-repositories-table").find("[title]").tooltip();
+                $.log("remote repositories gridUpdateCallBack");
+
+
+                mainContent.find(".remote-check").each(function( index ) {
+                  var repoId = $( this ).attr("id");
+                  console.log( index + ": " + repoId);
+                  $.ajax({
+                           url: "restServices/archivaServices/remoteRepositoriesService/checkRemoteConnectivity/"+repoId.substringAfterFirst("remote-check-"),
+                           type: "GET",
+                           success: function(result){
+                             if(result="true"){
+                               mainContent.find("img[id='"+repoId+"']").attr("src", "images/weather-clear.png" )
+                             } else {
+                               mainContent.find("img[id='"+repoId+"']").attr("src", "images/weather-severe-alert-16-16.png" )
+                             }
+                           }
+                         })
+                });
+
+
               }
             });
             var mainContent = $("#main-content");
             ko.applyBindings(remoteRepositoriesViewModel,mainContent.find("#remote-repositories-view").get(0));
-            mainContent.find("#remote-repositories-pills #remote-repositories-view-a").tab('show')
+            mainContent.find("#remote-repositories-pills #remote-repositories-view-a").tab('show');
             removeMediumSpinnerImg(mainContent.find("#remote-repositories-content"));
             activatePopoverDoc();
             if(successFnRemoteRepositories){
index 9a6564b419b559daa8bd3d673e3ce2351284edfc..e3639e47c2bbfe51b5f2b43af2c00df8e675d0b0 100644 (file)
     <th>${$.i18n.prop('modified')}</th>
     <th>${$.i18n.prop('description')}</th>
     <th>${$.i18n.prop('remoterepository.downloadremoteindex')}</th>
+    <th>${$.i18n.prop('remoterepository.remotecheck')}</th>
   </tr>
   </thead>
   <tbody>
                 </span>
       </a>
     </td>
+    <td>
+      <img class="remote-check" id="remote-check-${row.id()}" src="images/small-spinner.gif"/>
+      weather-severe-alert-16-16.png
+
+    </td>
   </tr>
   {{/each}}
   </tbody>