Add the "Reload" and "CSV" buttons
[proteocache.git] / webapp / view / reportJobStatistics.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
8 <html>
9 <jsp:include page="fragments/header.jsp" />
10 <body>
11         <div class="container">
12                 <jsp:include page="fragments/mainmenu.jsp" />
13                 <spring:url value="/stat/jobsoneday/results" var="oneday_query" />
14                 <spring:url value="/stat/jobsdaily/results?date1=${date1}&date2=${date2}&option=${option}" var="the_query" />
15
16                 <!-- reload and CSV buttons  -->
17                 <ul class="nav navbar-nav navbar-right">
18                         <li>
19                         <a href="${the_query}" class="btn btn-default active">Reload</a>
20                         </li>
21                         <c:choose><c:when test="${csvfile != ''}">
22                         <li>
23                         <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
24                         </li>
25                         </c:when></c:choose>
26                 </ul>
27
28         <div class="panel panel-default">
29         <div class="panel-heading">
30                 <c:choose>
31                         <c:when test="${option == 'AllDates,off'}">
32                                 <p style="font-weight:bold;">Jobs statistics for the whole period (${ndays} days)</p>
33                         </c:when>
34                         <c:otherwise>
35                                 <p style="font-weight:bold;">
36                                 Jobs statistics for the time period: <c:out value="${date1}" /> to <c:out value="${date2}"/> (${ndays} days)
37                                 </p>
38                         </c:otherwise>
39                 </c:choose>
40         </div>
41
42         <div class="panel-body">
43                 <c:choose>
44                         <c:when test="${result == null}">
45                                 <p>No jobs for this period</p>
46                         </c:when>
47                         <c:otherwise>
48                                 <div class="table-responsive">
49                                 <table class="table table-striped table-hover table-bordered">
50                                         <thead>
51                                                 <tr style="text-align: center">
52                                                         <th rowspan="2" style="text-align: center">Date</th>
53                                                         <th rowspan="2" style="text-align: center">Total number<br/> of jobs</th>
54                                                         <th colspan="5" style="text-align: center">Job Statistics</th>
55                                                 </tr>
56                                                 <tr>
57                                                         <th style="text-align: center">Status "OK"</th>
58                                                         <th style="text-align: center">Status "Stopped"</th>
59                                                         <th style="text-align: center">Status "Internal Error"</th>
60                                                         <th style="text-align: center">Status "Time out"</th>
61                                                 </tr>
62                                         </thead>
63
64                                         <tbody>
65                                                 <tr style="font-weight: bolder;">
66                                                         <td style="text-align: center">Total:</td>
67                                                         <c:set var="total" value="${result.wholeTotal}"/>
68                                                         <td style="text-align: right">${total.total}</td>
69                                                         <td style="text-align: right">${total.totalOK}</td>
70                                                         <td style="text-align: right">${total.totalStopped}</td>
71                                                         <td style="text-align: right">${total.totalError}</td>
72                                                         <td style="text-align: right">${total.totalTimeOut}</td>
73                                                 </tr>
74                                                 <c:forEach items="${result.dateTotal}" var="res">
75                                                         <tr>
76                                                                 <td style="text-align: center">${res.key}</td>
77                                                                 <c:set var="value" value="${res.value}"/>
78                                                                 <td style="text-align: right">${value.total}</td>
79                                                                 <td style="text-align: right"><a href="${oneday_query}?date=${res.key}&status=OK">${value.totalOK}</a></td>
80                                                                 <td style="text-align: right">
81                                                                         <c:choose>
82                                                                         <c:when test="${value.totalStopped == 0}">0</c:when>
83                                                                         <c:otherwise><a href="${oneday_query}?date=${res.key}&status=Stopped">${value.totalStopped}</a></c:otherwise>
84                                                                         </c:choose>
85                                                                 </td>
86                                                                 <td style="text-align: right">
87                                                                         <c:choose>
88                                                                         <c:when test="${value.totalError == 0}">0</c:when>
89                                                                         <c:otherwise><a href="${oneday_query}?date=${res.key}&status=JpredError">${value.totalError}</a></c:otherwise>
90                                                                         </c:choose>
91                                                                 </td>
92                                                                 <td style="text-align: right">
93                                                                         <c:choose>
94                                                                         <c:when test="${value.totalTimeOut == 0}">0</c:when>
95                                                                         <c:otherwise><a href="${oneday_query}?date=${res.key}&status=TimedOut">${value.totalTimeOut}</a></c:otherwise>
96                                                                         </c:choose>
97                                                                 </td>
98                                                         </tr>
99                                                 </c:forEach>
100                                         </tbody>
101                                 </table>
102                                 </div>
103                         </c:otherwise>
104                 </c:choose>
105         </div>
106         </div>
107
108                 <jsp:include page="fragments/footer.jsp" />
109         </div>
110 </body>
111 </html>