Merge branch 'master' into PROT-9-webservice
[proteocache.git] / webapp / view / reports / IPstatistics.jsp
similarity index 57%
rename from webapp/view/reportIPstatistics.jsp
rename to webapp/view/reports/IPstatistics.jsp
index 2a6c882..b1d06cd 100644 (file)
@@ -4,29 +4,44 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
-<%@page import="java.util.ArrayList"%>
+<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
 
 <html>
-<jsp:include page="fragments/header.jsp" />
+<jsp:include page="../fragments/header.jsp" />
 <body>
        <div class="container">
-               <jsp:include page="fragments/mainmenu.jsp" />
+               <jsp:include page="../fragments/mainmenu.jsp" />
                <spring:url value="/admin/ip/results" var="ipquery" />
+               <spring:url value="/admin/ip/counts/results?JobCounter=${counter}" var="the_query"/>
+
+               <!-- reload and CSV buttons  -->
+               <ul class="nav navbar-nav navbar-right">
+                       <li>
+                       <a href="${the_query}" class="btn btn-default active">Reload</a>
+                       </li>
+                       <c:choose><c:when test="${csvfile != ''}">
+                       <li>
+                       <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
+                       </li>
+                       </c:when></c:choose>
+               </ul>
 
        <div class="panel panel-default">
        <div class="panel-heading">
-               <div style="font-weight:bold;">Jobs Statistics</div>
+               <p style="font-weight:bold;">IP Statistics</p>
        </div>
        <div class="panel-body">
-
+<sec:authorize access="hasRole('ROLE_ADMIN')">
+               <p>Servlet execution time: ${timeExecution} milliseconds</p>
+</sec:authorize>
                <c:choose>
                <c:when test="${njobs == 0}">
                        <p>No IP with at least ${counter} jobs ever launched found</p>
                </c:when>
                <c:otherwise>
-                       <p>${njobs} IP with at least ${counter} jobs ever launched</p>
+                       <p>${njobs} IPs with at least ${counter} jobs ever launched</p>
                        <div class="table-responsive">
-                       <table class="table table-striped table-hover table-bordered">
+                       <table class="table table-striped table-hover table-bordered" id="counts">
                        <thead>
                                <tr>
                                        <th style="text-align: centre">Number of jobs</th>
@@ -49,7 +64,7 @@
        </div>
        </div>
 
-               <jsp:include page="fragments/footer.jsp" />
+               <jsp:include page="../fragments/footer.jsp" />
        </div>
 </body>
 </html>
\ No newline at end of file