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 2012/01/24 17:56:36 UTC

svn commit: r1235353 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva: repositories.js templates/repositories.html

Author: olamy
Date: Tue Jan 24 16:56:36 2012
New Revision: 1235353

URL: http://svn.apache.org/viewvc?rev=1235353&view=rev
Log:
implements schedule of remote index download

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

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js?rev=1235353&r1=1235352&r2=1235353&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js Tue Jan 24 16:56:36 2012
@@ -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));
     }
   }
 

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html?rev=1235353&r1=1235352&r2=1235353&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html Tue Jan 24 16:56:36 2012
@@ -254,6 +254,7 @@
     </div>
   </div>
 </script>
+
 <script id="managed-repository-location-warning-tmpl" type='text/x-jquery-tmpl'>
   <div>
     <a class="close" href="#">&#215;</a>
@@ -428,4 +429,13 @@
       <button data-bind="click: save" class="btn">${$.i18n.prop('save')}</button>
       <button data-bind="click: displayGrid" class="btn">${$.i18n.prop('cancel')}</button>
     </form>
+</script>
+
+<script id="remote-repository-scan-modal-tmpl" type='text/x-jquery-tmpl'>
+    <div>
+      ${$.i18n.prop('remoterepository.scan.now')}: <input type="checkbox" id="remoterepository-scan-now">
+    </div>
+    <div>
+      ${$.i18n.prop('remoterepository.scan.full')}: <input type="checkbox" id="remoterepository-scan-full">
+    </div>
 </script>
\ No newline at end of file