mirror of https://github.com/apache/archiva.git
[MRM-1580] system status page button to flush all caches.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1299685 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
97a31442ea
commit
1cc0787731
|
@ -72,4 +72,12 @@ public interface SystemStatusService
|
||||||
Boolean clearCache( @PathParam( "key" ) String cacheKey )
|
Boolean clearCache( @PathParam( "key" ) String cacheKey )
|
||||||
throws ArchivaRestServiceException;
|
throws ArchivaRestServiceException;
|
||||||
|
|
||||||
|
@Path( "clearAllCaches" )
|
||||||
|
@GET
|
||||||
|
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
|
||||||
|
@RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
|
||||||
|
Boolean clearAllCaches()
|
||||||
|
throws ArchivaRestServiceException;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,4 +140,14 @@ public class DefaultSystemStatusService
|
||||||
cache.clear();
|
cache.clear();
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean clearAllCaches()
|
||||||
|
throws ArchivaRestServiceException
|
||||||
|
{
|
||||||
|
for ( Cache cache : caches.values() )
|
||||||
|
{
|
||||||
|
cache.clear();
|
||||||
|
}
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,6 +306,8 @@ system-status.caches.grid.header.flush=Flush
|
||||||
system-status.caches.grid.header.key=Cache
|
system-status.caches.grid.header.key=Cache
|
||||||
system-status.caches.flushed=Cache {0} flushed.
|
system-status.caches.flushed=Cache {0} flushed.
|
||||||
system-status.caches.grid.header.size=Size
|
system-status.caches.grid.header.size=Size
|
||||||
|
system-status.caches.flushAll=Flush All Caches
|
||||||
|
system-status.caches.all.flushed=All Caches flushed.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -615,6 +615,18 @@ $(function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flushAllCaches=function(){
|
||||||
|
clearUserMessages();
|
||||||
|
$("#main-content #status_caches").html(smallSpinnerImg());
|
||||||
|
$.ajax("restServices/archivaServices/systemStatusService/clearAllCaches", {
|
||||||
|
type: "GET",
|
||||||
|
success: function(data){
|
||||||
|
displaySuccessMessage( $.i18n.prop("system-status.caches.all.flushed"));
|
||||||
|
displayCacheEntries();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
displaySystemStatus=function(){
|
displaySystemStatus=function(){
|
||||||
screenChange();
|
screenChange();
|
||||||
var mainContent=$("#main-content");
|
var mainContent=$("#main-content");
|
||||||
|
|
|
@ -359,6 +359,9 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script id="status_caches_tmpl" type="text/html">
|
<script id="status_caches_tmpl" type="text/html">
|
||||||
|
<a href="#" class="btn btn-warning" onclick="flushAllCaches()">
|
||||||
|
${$.i18n.prop('system-status.caches.flushAll')}
|
||||||
|
</a>
|
||||||
<table class="table table-condensed">
|
<table class="table table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue