fixed Execution time report
[proteocache.git] / webapp / view / reports / TimeExecution.jsp
index 2411b12..face3d7 100644 (file)
        </div>
        
        <div class="panel-body">
-               <c:set var="sum" value="0" />
-               <c:forEach items="${result}" var="res" varStatus="loop">
-                       <c:choose>
-                               <c:when test="${loop.last}">
-                                       <c:forEach items="${res.timeTotalExec}" var="total">
-                                               <c:set var="sum" value="${sum + total}" />
-                                       </c:forEach>
-                               </c:when>
-                       </c:choose>
-               </c:forEach>
-
-               <p>There are ${sum} jobs in total</p>
-
-               <table class="table table-striped table-hover table-bordered">
-                       <thead>
+               <c:choose>
+                       <c:when test="${result == null}">
+                               <p>No jobs for this period</p>
+                       </c:when>
+               <c:otherwise>
+                       <div class="table-responsive">
+                       <table class="table table-striped table-hover table-bordered">
+                               <thead>
                                <tr>
                                        <th style="text-align: center; width: 150px">Date</th>
                                        <th style="text-align: center; width: 150px">Total</th>
                                </tr>
                        </thead>
                        <tbody>
-                               <c:forEach items="${result}" var="res" varStatus="loop">
-                                       <c:choose>
-                                               <c:when test="${loop.last}">
-                                                       <tr style="font-weight: bolder;">
-                                                               <td style="text-align: right">Total numbers:</td>
-                                                               <c:set var="alldaytotal" value="0"/>
-                                                               <c:forEach items="${res.timeTotalExec}" var="total">
-                                                                       <c:set var="alldaytotal" value="${alldaytotal + total}"/>
-                                                               </c:forEach>
-                                                               <td style="text-align: right">${alldaytotal}</td>
-                                                               <c:forEach items="${res.timeTotalExec}" var="total">
-                                                                       <td style="text-align: right">${total}</td>
-                                                               </c:forEach>
-                                                       </tr>
-                                               </c:when>
-                                       </c:choose>
-                               </c:forEach>
+                               <tr style="font-weight: bolder;">
+                                                       <td style="text-align: center">Total:</td>
+                                                       <c:set var="total" value="${result.wholeTotal}"/>
+                                                       <td style="text-align: right">${total.total}</td>
+                                                       <td style="text-align: right">${total.total0_30s}</td>
+                                                       <td style="text-align: right">${total.total30_60s}</td>
+                                                       <td style="text-align: right">${total.total1_2m}</td>
+                                                       <td style="text-align: right">${total.total2_10m}</td>
+                                                       <td style="text-align: right">${total.total10m}</td>
+                               </tr>
 
-                               <c:forEach items="${result}" var="res" varStatus="loop">
-                                       <c:choose>
-                                               <c:when test="${not loop.last}">
+                               <c:forEach items="${result.dateTotal}" var="res">
                                                        <tr>
-                                                               <td style="text-align: center">${res.date}</td>
-                                                               <c:set var="daytotal" value="0"/>
-                                                               <c:forEach items="${res.timeRez}" var="time">
-                                                                       <c:set var="daytotal" value="${daytotal + time}"/>
-                                                               </c:forEach>
-                                                               <td style="text-align: right">${daytotal}</td>
-                                                               <c:forEach items="${res.timeRez}" var="time">
-                                                                       <td style="text-align: right">${time}</td>
-                                                               </c:forEach>
+                                                               <td style="text-align: center">${res.key}</td>
+                                                               <c:set var="value" value="${res.value}"/>
+                                                               <td style="text-align: right">${value.total}</td>
+                                                               <td style="text-align: right">${value.total0_30s}</td>
+                                                               <td style="text-align: right">${value.total30_60s}</td>
+                                                               <td style="text-align: right">${value.total1_2m}</td>
+                                                               <td style="text-align: right">${value.total2_10m}</td>
+                                                               <td style="text-align: right">${value.total10m}</td>
                                                        </tr>
-                                               </c:when>
-                                       </c:choose>
-                               </c:forEach>
+                                               </c:forEach>
                        </tbody>
                </table>
+               </div>
+               </c:otherwise>
+               </c:choose>
        </div>
        </div>