Add the "Reload" and "CSV" buttons
[proteocache.git] / webapp / view / reportIPstatistics.jsp
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
3 <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
4 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
5 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
6 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
7 <%@page import="java.util.ArrayList"%>
8
9 <html>
10 <jsp:include page="fragments/header.jsp" />
11 <body>
12         <div class="container">
13                 <jsp:include page="fragments/mainmenu.jsp" />
14                 <spring:url value="/admin/ip/results" var="ipquery" />
15                 <spring:url value="/admin/ip/counts/results?JobCounter=${counter}" var="the_query"/>
16
17                 <!-- reload and CSV buttons  -->
18                 <ul class="nav navbar-nav navbar-right">
19                         <li>
20                         <a href="${the_query}" class="btn btn-default active">Reload</a>
21                         </li>
22                         <c:choose><c:when test="${csvfile != ''}">
23                         <li>
24                         <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
25                         </li>
26                         </c:when></c:choose>
27                 </ul>
28
29         <div class="panel panel-default">
30         <div class="panel-heading">
31                 <p style="font-weight:bold;">IP Statistics</p>
32         </div>
33         <div class="panel-body">
34
35                 <c:choose>
36                 <c:when test="${njobs == 0}">
37                         <p>No IP with at least ${counter} jobs ever launched found</p>
38                 </c:when>
39                 <c:otherwise>
40                         <p>${njobs} IP with at least ${counter} jobs ever launched</p>
41                         <div class="table-responsive">
42                         <table class="table table-striped table-hover table-bordered" id="counts">
43                         <thead>
44                                 <tr>
45                                         <th style="text-align: centre">Number of jobs</th>
46                                         <th style="text-align: left">IP</th>
47                                 </tr>
48                         </thead>
49                         <tbody>
50                                 <c:forEach items="${results}" var="res">
51                                         <tr>
52                                                 <td>${res.totaljobs}</td>
53                                                 <td><a title="Click to view other jobs" href="${ipquery}?ip=${res.name}&Search=Search">${res.name}</a></td>
54                                         </tr>
55                                 </c:forEach>
56                         </tbody>
57                         </table>
58                         </div>
59                 </c:otherwise>
60                 </c:choose>
61
62         </div>
63         </div>
64
65                 <jsp:include page="fragments/footer.jsp" />
66         </div>
67 </body>
68 </html>