You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2013/12/22 13:26:05 UTC

svn commit: r1552984 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js: archiva/admin/repository/maven2/repositories.js templates/archiva/repositories.html

Author: olamy
Date: Sun Dec 22 12:26:05 2013
New Revision: 1552984

URL: http://svn.apache.org/r1552984
Log:
[MRM-1750] Add remote repository health check
ui implementation

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

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js?rev=1552984&r1=1552983&r2=1552984&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js Sun Dec 22 12:26:05 2013
@@ -1217,12 +1217,31 @@ function(jquery,i18n,jqueryTmpl,bootstra
               ],
               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){

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html?rev=1552984&r1=1552983&r2=1552984&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html Sun Dec 22 12:26:05 2013
@@ -485,6 +485,7 @@
     <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>
@@ -531,6 +532,11 @@
                 </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>