From: Olivier Lamy Date: Sun, 22 Dec 2013 12:26:05 +0000 (+0000) Subject: [MRM-1750] Add remote repository health check X-Git-Tag: archiva-2.0.0-RC1~67 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1088436a3b04810f92af6f8909d8a13918b3bb1c;p=archiva.git [MRM-1750] Add remote repository health check ui implementation git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1552984 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js index eb590bf6b..eaba06d9c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repositories.js @@ -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){ diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html index 9a6564b41..e3639e47c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html @@ -485,6 +485,7 @@ ${$.i18n.prop('modified')} ${$.i18n.prop('description')} ${$.i18n.prop('remoterepository.downloadremoteindex')} + ${$.i18n.prop('remoterepository.remotecheck')} @@ -531,6 +532,11 @@ + + + weather-severe-alert-16-16.png + + {{/each}}