From 87101453e3f8c97d508877ede84a4f401a5ac13f Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 24 Jan 2012 16:56:36 +0000 Subject: [PATCH] implements schedule of remote index download git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1235353 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/webapp/js/archiva/repositories.js | 35 ++++++++++++++++++- .../js/archiva/templates/repositories.html | 10 ++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index 8304baa0f..0a4a58f09 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -609,7 +609,40 @@ $(function() { } scheduleDownloadRemoteIndex=function(remoteRepository){ - $.log("scheduleDownloadRemoteIndex"); + openDialogConfirm( + function(){ + + var url = "restServices/archivaServices/repositoriesService/scheduleDownloadRemoteIndex?"; + url += "repositoryId="+encodeURIComponent(remoteRepository.id()); + + var now = $("#remoterepository-scan-now").get(0).checked; + + var full = $("#remoterepository-scan-full").get(0).checked; + + url += "&now="+(now==true?"true":"false"); + url += "&fullDownload="+(full==true?"true":"false"); + $.ajax(url, + { + type: "GET", + success: function(data) { + displaySuccessMessage($.i18n.prop("remoterepository.scanned.scheduled",remoteRepository.name())); + + }, + error: function(data) { + var res = $.parseJSON(data.responseText); + displayRestError(res); + }, + complete: function(){ + closeDialogConfirm(); + } + } + ); + + }, + $.i18n.prop("ok"), + $.i18n.prop("cancel"), + $.i18n.prop("remoterepository.scan.confirm",remoteRepository.name()), + $("#remote-repository-scan-modal-tmpl").tmpl(remoteRepository)); } } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html index f6381d800..2862544fb 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html @@ -254,6 +254,7 @@ + + + \ No newline at end of file -- 2.39.5