Improve front-end view of the website
[proteocache.git] / webapp / view / reportJobStatistics.jsp
diff --git a/webapp/view/reportJobStatistics.jsp b/webapp/view/reportJobStatistics.jsp
new file mode 100644 (file)
index 0000000..e515b73
--- /dev/null
@@ -0,0 +1,95 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
+<%@ 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"%>
+
+<html>
+<jsp:include page="fragments/header.jsp" />
+<body>
+       <div class="container">
+               <jsp:include page="fragments/mainmenu.jsp" />
+               <spring:url value="/stat/oneday" var="onedayquery" />
+
+               <c:choose>
+                       <c:when test="${flag == 'AllDates,off'}">
+                               <p  style="font-weight:bold;">Jobs statistics for the whole period</p>
+                       </c:when>
+                       <c:otherwise>
+                               <p  style="font-weight:bold;">
+                                       Jobs statistics for the time period: <c:out value="${data1}" /> to <c:out value="${data2}"/>
+                               </p>
+                       </c:otherwise>
+               </c:choose>
+               <!-- <h3>For test only! Time execution: ${timeExecution} ms</h3>-->
+               <c:choose>
+
+                       <c:when test="${result == null}">
+                               <p>No jobs for this period</p>
+                       </c:when>
+                       <c:otherwise>
+                               <c:set var="sum" value="0" />
+                               <c:set var="sumOK" value="0" />
+                               <c:set var="sumStopped" value="0" />
+                               <c:set var="sumError" value="0" />
+                               <c:set var="sumTimeOut" value="0" />
+                               <c:forEach items="${result}" var="res">
+                                       <c:set var="tot" value="${res.total}" />
+                                       <c:set var="sum" value="${sum + tot}" />
+                                       <c:set var="totOK" value="${res.totalOK}" />
+                                       <c:set var="sumOK" value="${sumOK + totOK}" />
+                                       <c:set var="totStopped" value="${res.totalStopped}" />
+                                       <c:set var="sumStopped" value="${sumStopped + totStopped}" />
+                                       <c:set var="totError" value="${res.totalError}" />
+                                       <c:set var="sumError" value="${sumError + totError}" />
+                                       <c:set var="totTimeOut" value="${res.totalTimeOut}" />
+                                       <c:set var="sumTimeOut" value="${sumTimeOut + totTimeOut}" />
+                               </c:forEach>
+                               <div class="table-responsive">
+                               <table class="table table-striped table-hover table-bordered">
+                                       <thead>
+                                               <tr style="text-align: center">
+                                                       <th rowspan="2" style="text-align: center">Date</th>
+                                                       <th rowspan="2" style="text-align: center">Total <br/>number of jobs</th>
+                                                       <th colspan="5" style="text-align: center">Number of jobs</th>
+                                               </tr>
+                                               <tr>
+                                                       <th style="text-align: center">Status "OK"</th>
+                                                       <th style="text-align: center">Status "Stopped"</th>
+                                                       <th style="text-align: center">Status "Error"</th>
+                                                       <th style="text-align: center">Status "Time out"</th>
+                                               </tr>
+                                       </thead>
+
+                                       <tbody>
+                                               <tr style="font-weight: bolder;">
+                                                       <td style="text-align: center">Total:</td>
+                                                       <td style="text-align: right">${sum}</td>
+                                                       <td style="text-align: right">${sumOK}</td>
+                                                       <td style="text-align: right">${sumStopped}</td>
+                                                       <td style="text-align: right">${sumError}</td>
+                                                       <td style="text-align: right">${sumTimeOut}</td>
+                                               </tr>
+                                               <c:forEach items="${result}" var="res">
+                                                       <tr>
+                                                               <td style="text-align: center">${res.date}</td>
+                                                               <td style="text-align: right">${res.total}</td>
+                                                               <td style="text-align: right"><a href="${onedayquery}?date=${res.date}">${res.totalOK}</a></td>
+                                                               <td style="text-align: right">${res.totalStopped}</td>
+                                                               <td style="text-align: right">${res.totalError}</td>
+                                                               <td style="text-align: right">${res.totalTimeOut}</td>
+                                                       </tr>
+                                               </c:forEach>
+                                       </tbody>
+                               </table>
+                               </div>
+                       </c:otherwise>
+               </c:choose>
+               <jsp:include page="fragments/footer.jsp" />
+       </div>
+</body>
+</html>
\ No newline at end of file