Commit d8faa6fc authored by Michael Ritter's avatar Michael Ritter
Browse files

Use the group summary to display count/size information

parent 4b92557a
...@@ -326,6 +326,7 @@ public class CollectionCountContext implements ServletContextListener { ...@@ -326,6 +326,7 @@ public class CollectionCountContext implements ServletContextListener {
try { try {
queryCollection(c); queryCollection(c);
GroupSummaryContext.updateGroup(c.getGroup());
} finally { } finally {
lock.unlock(); lock.unlock();
} }
......
...@@ -210,6 +210,7 @@ public class StatusServlet extends EntityManagerServlet { ...@@ -210,6 +210,7 @@ public class StatusServlet extends EntityManagerServlet {
request.setAttribute(PAGE_STATES, ImmutableList.copyOf(CStateBean.values())); request.setAttribute(PAGE_STATES, ImmutableList.copyOf(CStateBean.values()));
request.setAttribute(PAGE_COUNT, count); request.setAttribute(PAGE_COUNT, count);
request.setAttribute(PAGE_NUMBER, pb); request.setAttribute(PAGE_NUMBER, pb);
request.setAttribute("groups", GroupSummaryContext.summaries);
if (hasJson(request)) { if (hasJson(request)) {
dispatcher = request.getRequestDispatcher("status-json.jsp"); dispatcher = request.getRequestDispatcher("status-json.jsp");
} else if (hasCsv(request)) { } else if (hasCsv(request)) {
......
...@@ -186,25 +186,22 @@ ...@@ -186,25 +186,22 @@
</thead> </thead>
<c:set var="count" value="0" /> <c:set var="count" value="0" />
<jsp:useBean id="today" class="java.util.Date"/> <jsp:useBean id="today" class="java.util.Date"/>
<c:set var="counttotal" value="0" />
<c:set var="sizetotal" value="0" />
<c:forEach var="item" items="${collections}"> <c:forEach var="item" items="${collections}">
<c:if test="${currgroup != item.collection.group && item.collection.group != null}"> <c:if test="${currgroup != item.collection.group && item.collection.group != null}">
<script type="text/javascript"> <c:set var="group" value="${item.collection.group}"/>
myp=document.getElementById("group${currgroup}"); <c:set var="group_count" value="${groups[group].count}"/>
if (myp != null) <c:set var="size" value="${groups[group].size}"/>
{
myp.innerHTML='${counttotal} / <c:choose><c:when test="${sizetotal > 0}"><d:FileSize value="${sizetotal}" /></c:when><c:otherwise>0 B</c:otherwise></c:choose>';
}
</script>
<tr> <tr>
<td class="groupheader" colspan="3" onclick="toggleVisibility('spexpand${item.collection.group}','inline'); toggleVisibility('sphide${item.collection.group}','inline');"> <td class="groupheader" colspan="3" onclick="toggleVisibility('spexpand${group}','inline'); toggleVisibility('sphide${group}','inline');">
<span onclick="showGroup('grouptr${item.collection.group}')" id="spexpand${item.collection.group}" style="display:none;float: left;width: 25px;" >[+]</span> <span onclick="showGroup('grouptr${group}')" id="spexpand${group}" style="display:none;float: left;width: 25px;" >[+]</span>
<span onclick="hideGroup('grouptr${item.collection.group}')" id="sphide${item.collection.group}" style="display:inline;float: left;width: 25px;" >[-]</span> <span onclick="hideGroup('grouptr${group}')" id="sphide${group}" style="display:inline;float: left;width: 25px;" >[-]</span>
${item.collection.group} ${group}
</td>
<td class="groupheader" colspan="3" id="group${group}">
${group_count} /<c:choose><c:when test="${size > 0}"><d:FileSize value="${size}" /></c:when><c:otherwise>0 B</c:otherwise></c:choose>
</td> </td>
<td class="groupheader" colspan="3" id="group${item.collection.group}"></td>
</tr> </tr>
<c:set var="counttotal" value="0" /> <c:set var="counttotal" value="0" />
<c:set var="sizetotal" value="0" /> <c:set var="sizetotal" value="0" />
...@@ -271,13 +268,7 @@ ...@@ -271,13 +268,7 @@
</tr> </tr>
<c:set var="count" value="${count + 1}" /> <c:set var="count" value="${count + 1}" />
<c:set var="currgroup" value="${item.collection.group}" /> <c:set var="currgroup" value="${item.collection.group}" />
<c:set var="counttotal" value="${counttotal + item.totalFiles}" />
<c:set var="sizetotal" value="${sizetotal + item.totalSize}" />
</c:forEach> </c:forEach>
<script type="text/javascript">
myp=document.getElementById("group${currgroup}");
myp.innerHTML='${counttotal} / <c:choose><c:when test="${sizetotal > 0}"><d:FileSize value="${sizetotal}" /></c:when><c:otherwise>0 B</c:otherwise></c:choose>';
</script>
<tr><td colspan="5"><br/><d:Auth role="Collection Modify" showUnauthenticated="true"><a href="ManageCollection">Add Collection</a></d:Auth> &nbsp;&nbsp;&nbsp&nbsp;&nbsp; <tr><td colspan="5"><br/><d:Auth role="Collection Modify" showUnauthenticated="true"><a href="ManageCollection">Add Collection</a></d:Auth> &nbsp;&nbsp;&nbsp&nbsp;&nbsp;
<d:Auth role="Audit"> <d:Auth role="Audit">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment