aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-09-27 13:56:10 +0000
committerOlivier Lamy <olamy@apache.org>2011-09-27 13:56:10 +0000
commit9b1ab5d366a7872ba23797c1396a4d95d6a2a24e (patch)
tree72a7dc276da41783600dc208e9d775b0a04a669f
parent3283a043d1f822e58e70dfdb2dca405cb41d5189 (diff)
downloadarchiva-9b1ab5d366a7872ba23797c1396a4d95d6a2a24e.tar.gz
archiva-9b1ab5d366a7872ba23797c1396a4d95d6a2a24e.zip
trigger download remote index call in async mode
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1176386 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRemoteRepository.jsp42
1 files changed, 24 insertions, 18 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRemoteRepository.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRemoteRepository.jsp
index e946446ff..8ab2b1eb5 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRemoteRepository.jsp
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRemoteRepository.jsp
@@ -19,12 +19,14 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %>
<html>
<head>
<title>Admin: Edit Remote Repository</title>
<s:head/>
+ <script type="text/javascript" src="<c:url value='/js/jquery-1.6.1.min.js'/>"></script>
</head>
<body>
@@ -42,28 +44,32 @@
<s:submit value="Update Repository"/>
</s:form>
<redback:ifAuthorized permission="archiva-run-indexer">
- <s:form method="post" action="editRemoteRepository!downloadRemoteIndex" namespace="/admin" validate="false"
- onsubmit="javascript:downloadRemote();">
- <s:hidden name="repoid"/>
- <s:checkbox name="now" label="Now" />
- <s:checkbox name="fullDownload" label="Full download"/>
- <s:submit value="download Remote Index" onclick="javascript:downloadRemote();"/>
- </s:form>
+ <form id="downloadRemoteForm" name="downloadRemoteForm">
+ <input type="hidden" value="${repoid}" id="repoid"/>
+ Now: <input type="checkbox" name="now"/><br/>
+ Full download: <input type="checkbox" name="fullDownload" /><br/>
+ <input type="button" onclick="downloadRemote();" value="Download Remote Index" />
+
+ </form>
</redback:ifAuthorized>
- <script type="text/javascript">
- document.getElementById("editRemoteRepository_repository_name").focus();
- function downloadRemote() {
- $.ajax({
- url: "test.html",
- success: function(){
- alert("ok");
- }
- });
- }
- </script>
</div>
+<script type="text/javascript">
+ function downloadRemote() {
+
+ $.ajax({
+ url: "${pageContext.request.contextPath}/restServices/archivaServices/repositoriesService/scheduleDownloadRemoteIndex",
+ data: "repositoryId="+document.getElementById("downloadRemoteForm").repoid.value+"&now="+document.getElementById("downloadRemoteForm").now.value+"&fullDownload="+document.getElementById("downloadRemoteForm").fullDownload.value ,
+ error: function(){
+ alert('error');
+ }
+ });
+ return false;
+ }
+ document.getElementById("editRemoteRepository_repository_name").focus();
+
+</script>
</body>
</html> \ No newline at end of file