Add the "Reload" and "CSV" buttons
[proteocache.git] / webapp / view / reportTimeExecution.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/exectime/results?date1=${date1}&date2=${date2}&option=${option}" var="the_query" />
14
15         <!-- reload and CSV buttons -->
16         <ul class="nav navbar-nav navbar-right">
17                 <li>
18                 <a href="${the_query}" class="btn btn-default active">Reload</a>
19                 </li>
20                 <c:choose><c:when test="${csvfile != ''}">
21                 <li>
22                 <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CVS</a>
23                 </li>
24                 </c:when></c:choose>
25         </ul>
26
27         <!-- main data loop  -->
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;">Time execution for the whole period (${ndays} days)</p>
33                         </c:when>
34                         <c:otherwise>
35                                 <p style="font-weight:bold;">Time execution for the interval: ${date1} - ${date2} (${ndays} days)</p>
36                         </c:otherwise>
37                 </c:choose>
38         </div>
39         
40         <div class="panel-body">
41                 <c:set var="sum" value="0" />
42                 <c:forEach items="${result}" var="res" varStatus="loop">
43                         <c:choose>
44                                 <c:when test="${loop.last}">
45                                         <c:forEach items="${res.timeTotalExec}" var="total">
46                                                 <c:set var="sum" value="${sum + total}" />
47                                         </c:forEach>
48                                 </c:when>
49                         </c:choose>
50                 </c:forEach>
51
52                 <p>There are ${sum} jobs in total</p>
53
54                 <table class="table table-striped table-hover table-bordered">
55                         <thead>
56                                 <tr>
57                                         <th style="text-align: center; width: 150px">Date</th>
58                                         <th style="text-align: center; width: 150px">Total</th>
59                                         <th style="text-align: center; width: 150px">0 - 30 s</th>
60                                         <th style="text-align: center; width: 150px">30 - 60 s</th>
61                                         <th style="text-align: center; width: 150px">1 - 2 min</th>
62                                         <th style="text-align: center; width: 150px">2 - 10 min</th>
63                                         <th style="text-align: center; width: 150px">more then 10 min</th>
64                                 </tr>
65                         </thead>
66                         <tbody>
67                                 <c:forEach items="${result}" var="res" varStatus="loop">
68                                         <c:choose>
69                                                 <c:when test="${loop.last}">
70                                                         <tr style="font-weight: bolder;">
71                                                                 <td style="text-align: right">Total numbers:</td>
72                                                                 <c:set var="alldaytotal" value="0"/>
73                                                                 <c:forEach items="${res.timeTotalExec}" var="total">
74                                                                         <c:set var="alldaytotal" value="${alldaytotal + total}"/>
75                                                                 </c:forEach>
76                                                                 <td style="text-align: right">${alldaytotal}</td>
77                                                                 <c:forEach items="${res.timeTotalExec}" var="total">
78                                                                         <td style="text-align: right">${total}</td>
79                                                                 </c:forEach>
80                                                         </tr>
81                                                 </c:when>
82                                         </c:choose>
83                                 </c:forEach>
84
85                                 <c:forEach items="${result}" var="res" varStatus="loop">
86                                         <c:choose>
87                                                 <c:when test="${not loop.last}">
88                                                         <tr>
89                                                                 <td style="text-align: center">${res.date}</td>
90                                                                 <c:set var="daytotal" value="0"/>
91                                                                 <c:forEach items="${res.timeRez}" var="time">
92                                                                         <c:set var="daytotal" value="${daytotal + time}"/>
93                                                                 </c:forEach>
94                                                                 <td style="text-align: right">${daytotal}</td>
95                                                                 <c:forEach items="${res.timeRez}" var="time">
96                                                                         <td style="text-align: right">${time}</td>
97                                                                 </c:forEach>
98                                                         </tr>
99                                                 </c:when>
100                                         </c:choose>
101                                 </c:forEach>
102                         </tbody>
103                 </table>
104         </div>
105         </div>
106
107         <jsp:include page="fragments/footer.jsp" />
108         </div>
109 </body>
110 </html>