6192 |
31 Oct 12 |
nicklas |
1 |
<%-- $Id$ |
6192 |
31 Oct 12 |
nicklas |
2 |
------------------------------------------------------------------ |
6192 |
31 Oct 12 |
nicklas |
Copyright (C) 2006 Nicklas Nordborg |
6192 |
31 Oct 12 |
nicklas |
Copyright (C) 2007 Johan Enell |
6192 |
31 Oct 12 |
nicklas |
5 |
|
6192 |
31 Oct 12 |
nicklas |
6 |
This file is part of BASE - BioArray Software Environment. |
6192 |
31 Oct 12 |
nicklas |
7 |
Available at http://base.thep.lu.se/ |
6192 |
31 Oct 12 |
nicklas |
8 |
|
6192 |
31 Oct 12 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
6192 |
31 Oct 12 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
6192 |
31 Oct 12 |
nicklas |
11 |
as published by the Free Software Foundation; either version 3 |
6192 |
31 Oct 12 |
nicklas |
12 |
of the License, or (at your option) any later version. |
6192 |
31 Oct 12 |
nicklas |
13 |
|
6192 |
31 Oct 12 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
6192 |
31 Oct 12 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
6192 |
31 Oct 12 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6192 |
31 Oct 12 |
nicklas |
17 |
GNU General Public License for more details. |
6192 |
31 Oct 12 |
nicklas |
18 |
|
6192 |
31 Oct 12 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
6192 |
31 Oct 12 |
nicklas |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
6192 |
31 Oct 12 |
nicklas |
21 |
------------------------------------------------------------------ |
6192 |
31 Oct 12 |
nicklas |
22 |
|
6192 |
31 Oct 12 |
nicklas |
23 |
@author Nicklas |
6192 |
31 Oct 12 |
nicklas |
24 |
@version 2.0 |
6192 |
31 Oct 12 |
nicklas |
25 |
--%> |
6192 |
31 Oct 12 |
nicklas |
26 |
<%@ page pageEncoding="UTF-8" session="false" |
6192 |
31 Oct 12 |
nicklas |
27 |
import="net.sf.basedb.core.SessionControl" |
6192 |
31 Oct 12 |
nicklas |
28 |
import="net.sf.basedb.core.DbControl" |
6192 |
31 Oct 12 |
nicklas |
29 |
import="net.sf.basedb.core.Application" |
6192 |
31 Oct 12 |
nicklas |
30 |
import="net.sf.basedb.core.Item" |
6192 |
31 Oct 12 |
nicklas |
31 |
import="net.sf.basedb.core.Group" |
6192 |
31 Oct 12 |
nicklas |
32 |
import="net.sf.basedb.core.Role" |
6192 |
31 Oct 12 |
nicklas |
33 |
import="net.sf.basedb.core.Type" |
6192 |
31 Oct 12 |
nicklas |
34 |
import="net.sf.basedb.core.ItemQuery" |
6192 |
31 Oct 12 |
nicklas |
35 |
import="net.sf.basedb.core.Include" |
6192 |
31 Oct 12 |
nicklas |
36 |
import="net.sf.basedb.core.ItemResultIterator" |
6192 |
31 Oct 12 |
nicklas |
37 |
import="net.sf.basedb.core.ItemResultList" |
6192 |
31 Oct 12 |
nicklas |
38 |
import="net.sf.basedb.core.ItemContext" |
6192 |
31 Oct 12 |
nicklas |
39 |
import="net.sf.basedb.core.Permission" |
6192 |
31 Oct 12 |
nicklas |
40 |
import="net.sf.basedb.core.PluginDefinition" |
6192 |
31 Oct 12 |
nicklas |
41 |
import="net.sf.basedb.core.DiskUsage" |
6192 |
31 Oct 12 |
nicklas |
42 |
import="net.sf.basedb.core.DiskUsageStatistics" |
6192 |
31 Oct 12 |
nicklas |
43 |
import="net.sf.basedb.core.QuotaType" |
6192 |
31 Oct 12 |
nicklas |
44 |
import="net.sf.basedb.core.Location" |
6192 |
31 Oct 12 |
nicklas |
45 |
import="net.sf.basedb.core.query.Orders" |
6192 |
31 Oct 12 |
nicklas |
46 |
import="net.sf.basedb.core.query.Hql" |
6192 |
31 Oct 12 |
nicklas |
47 |
import="net.sf.basedb.core.query.Restrictions" |
6192 |
31 Oct 12 |
nicklas |
48 |
import="net.sf.basedb.core.query.Expressions" |
6192 |
31 Oct 12 |
nicklas |
49 |
import="net.sf.basedb.core.plugin.GuiContext" |
6192 |
31 Oct 12 |
nicklas |
50 |
import="net.sf.basedb.core.plugin.Plugin" |
6192 |
31 Oct 12 |
nicklas |
51 |
import="net.sf.basedb.util.Enumeration" |
6192 |
31 Oct 12 |
nicklas |
52 |
import="net.sf.basedb.clients.web.Base" |
6192 |
31 Oct 12 |
nicklas |
53 |
import="net.sf.basedb.clients.web.ModeInfo" |
6192 |
31 Oct 12 |
nicklas |
54 |
import="net.sf.basedb.clients.web.PermissionUtil" |
6192 |
31 Oct 12 |
nicklas |
55 |
import="net.sf.basedb.clients.web.util.HTML" |
6192 |
31 Oct 12 |
nicklas |
56 |
import="net.sf.basedb.util.Values" |
6192 |
31 Oct 12 |
nicklas |
57 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
6192 |
31 Oct 12 |
nicklas |
58 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
6192 |
31 Oct 12 |
nicklas |
59 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
60 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
6192 |
31 Oct 12 |
nicklas |
61 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
7604 |
25 Feb 19 |
nicklas |
62 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnAction" |
6192 |
31 Oct 12 |
nicklas |
63 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
6192 |
31 Oct 12 |
nicklas |
64 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
6192 |
31 Oct 12 |
nicklas |
65 |
import="java.util.List" |
6192 |
31 Oct 12 |
nicklas |
66 |
import="java.util.Map" |
6192 |
31 Oct 12 |
nicklas |
67 |
%> |
6192 |
31 Oct 12 |
nicklas |
68 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
6192 |
31 Oct 12 |
nicklas |
69 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
6192 |
31 Oct 12 |
nicklas |
70 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
6192 |
31 Oct 12 |
nicklas |
71 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
6192 |
31 Oct 12 |
nicklas |
72 |
<%! |
6192 |
31 Oct 12 |
nicklas |
73 |
private static final Item itemType = Item.DISKUSAGE; |
6192 |
31 Oct 12 |
nicklas |
74 |
private static final String subContext = "perGroup"; |
6192 |
31 Oct 12 |
nicklas |
75 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST, subContext); |
6192 |
31 Oct 12 |
nicklas |
76 |
%> |
6192 |
31 Oct 12 |
nicklas |
77 |
<% |
6192 |
31 Oct 12 |
nicklas |
78 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
6192 |
31 Oct 12 |
nicklas |
79 |
final String ID = sc.getId(); |
6192 |
31 Oct 12 |
nicklas |
80 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, subContext, null, null); |
6192 |
31 Oct 12 |
nicklas |
81 |
final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
6192 |
31 Oct 12 |
nicklas |
82 |
final boolean writePermission = sc.hasPermission(Permission.WRITE, Item.GROUP); |
7595 |
22 Feb 19 |
nicklas |
83 |
final String showStatistics = Values.getString(cc.getSetting("showStatistics"), "full"); |
6192 |
31 Oct 12 |
nicklas |
84 |
|
6192 |
31 Oct 12 |
nicklas |
85 |
final boolean hasLocation = "location".equals(showStatistics) || "full".equals(showStatistics); |
6192 |
31 Oct 12 |
nicklas |
86 |
final boolean hasQuotaType = "quotaType".equals(showStatistics) || "full".equals(showStatistics); |
6192 |
31 Oct 12 |
nicklas |
87 |
|
7954 |
12 May 21 |
nicklas |
88 |
final DbControl dc = sc.newDbControl(":List "+itemType); |
6192 |
31 Oct 12 |
nicklas |
89 |
ItemResultIterator<Group> groups = null; |
6192 |
31 Oct 12 |
nicklas |
90 |
try |
6192 |
31 Oct 12 |
nicklas |
91 |
{ |
7605 |
26 Feb 19 |
nicklas |
92 |
DiskUsageStatistics du = sc.getSessionSetting("diskUsageStatistics"); |
6192 |
31 Oct 12 |
nicklas |
93 |
if (du == null) |
6192 |
31 Oct 12 |
nicklas |
94 |
{ |
6192 |
31 Oct 12 |
nicklas |
95 |
du = DiskUsage.getStatistics(dc); |
6192 |
31 Oct 12 |
nicklas |
96 |
sc.setSessionSetting("diskUsageStatistics", du); |
6192 |
31 Oct 12 |
nicklas |
97 |
} |
6192 |
31 Oct 12 |
nicklas |
98 |
du.setDbControl(dc); |
6192 |
31 Oct 12 |
nicklas |
99 |
List<QuotaType> quotaTypes = du.getQuotaTypes(); |
6192 |
31 Oct 12 |
nicklas |
100 |
|
7914 |
23 Feb 21 |
nicklas |
101 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); |
6192 |
31 Oct 12 |
nicklas |
102 |
try |
6192 |
31 Oct 12 |
nicklas |
103 |
{ |
7914 |
23 Feb 21 |
nicklas |
104 |
final ItemQuery<Group> query = Base.getConfiguredQuery(dc, cc, jspContext, true, Group.getQuery(), mode); |
6192 |
31 Oct 12 |
nicklas |
105 |
query.include(Include.ALL); |
6192 |
31 Oct 12 |
nicklas |
106 |
query.restrict( |
6192 |
31 Oct 12 |
nicklas |
107 |
Restrictions.neq( |
6192 |
31 Oct 12 |
nicklas |
108 |
Hql.property("quota"), null)); |
6192 |
31 Oct 12 |
nicklas |
109 |
groups = query.iterate(dc); |
6192 |
31 Oct 12 |
nicklas |
110 |
} |
6192 |
31 Oct 12 |
nicklas |
111 |
catch (Throwable t) |
6192 |
31 Oct 12 |
nicklas |
112 |
{ |
6192 |
31 Oct 12 |
nicklas |
113 |
cc.setMessage(t.getMessage()); |
6192 |
31 Oct 12 |
nicklas |
114 |
} |
6192 |
31 Oct 12 |
nicklas |
115 |
int numListed = 0; |
7604 |
25 Feb 19 |
nicklas |
116 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
7604 |
25 Feb 19 |
nicklas |
117 |
ExtensionsInvoker<ListColumnAction<Group,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
6192 |
31 Oct 12 |
nicklas |
118 |
%> |
6305 |
09 Aug 13 |
nicklas |
119 |
<base:page title="Disk usage" id="list-groups"> |
6305 |
09 Aug 13 |
nicklas |
120 |
<base:head scripts="table.js,tabcontrol-2.js,~diskusage.js" styles="table.css,toolbar.css,headertabcontrol.css"> |
6192 |
31 Oct 12 |
nicklas |
121 |
<ext:scripts context="<%=jspContext%>" /> |
6192 |
31 Oct 12 |
nicklas |
122 |
<ext:stylesheets context="<%=jspContext%>" /> |
6192 |
31 Oct 12 |
nicklas |
123 |
<style> |
6192 |
31 Oct 12 |
nicklas |
124 |
table.special |
6192 |
31 Oct 12 |
nicklas |
125 |
{ |
6620 |
24 Nov 14 |
nicklas |
126 |
border-width: 1px; |
6620 |
24 Nov 14 |
nicklas |
127 |
margin: 2px; |
6192 |
31 Oct 12 |
nicklas |
128 |
border-collapse: collapse; |
6620 |
24 Nov 14 |
nicklas |
129 |
width: calc(100% - 6px); |
6192 |
31 Oct 12 |
nicklas |
130 |
} |
6192 |
31 Oct 12 |
nicklas |
131 |
table.special td, table.special th |
6192 |
31 Oct 12 |
nicklas |
132 |
{ |
6192 |
31 Oct 12 |
nicklas |
133 |
text-align: right; |
6620 |
24 Nov 14 |
nicklas |
134 |
border-right-width: 1px; |
6620 |
24 Nov 14 |
nicklas |
135 |
border-right-style: dotted; |
6192 |
31 Oct 12 |
nicklas |
136 |
padding: 1px 2px 1px 2px; |
6192 |
31 Oct 12 |
nicklas |
137 |
} |
6192 |
31 Oct 12 |
nicklas |
138 |
</style> |
6192 |
31 Oct 12 |
nicklas |
139 |
</base:head> |
6192 |
31 Oct 12 |
nicklas |
140 |
<base:body> |
6192 |
31 Oct 12 |
nicklas |
141 |
<h1>Disk usage</h1> |
6192 |
31 Oct 12 |
nicklas |
142 |
<t:tabcontrol |
6192 |
31 Oct 12 |
nicklas |
143 |
id="main" |
6192 |
31 Oct 12 |
nicklas |
144 |
subclass="mastertabcontrol content" |
6305 |
09 Aug 13 |
nicklas |
145 |
active="groups"> |
6305 |
09 Aug 13 |
nicklas |
146 |
<t:tab id="overview" title="Overview" data-cmd="Overview" /> |
6305 |
09 Aug 13 |
nicklas |
147 |
<t:tab id="users" title="Per user" data-cmd="ListUsers" /> |
6305 |
09 Aug 13 |
nicklas |
148 |
<t:tab id="groups" title="Per group" data-cmd="ListGroups"> |
6192 |
31 Oct 12 |
nicklas |
149 |
<tbl:table |
6192 |
31 Oct 12 |
nicklas |
150 |
id="groups" |
6192 |
31 Oct 12 |
nicklas |
151 |
columns="<%=cc.getSetting("columns")%>" |
6192 |
31 Oct 12 |
nicklas |
152 |
sortby="<%=cc.getSortProperty()%>" |
6192 |
31 Oct 12 |
nicklas |
153 |
direction="<%=cc.getSortDirection()%>" |
6192 |
31 Oct 12 |
nicklas |
154 |
action="index.jsp" |
6192 |
31 Oct 12 |
nicklas |
155 |
sc="<%=sc%>" |
6192 |
31 Oct 12 |
nicklas |
156 |
item="<%=itemType%>" |
6192 |
31 Oct 12 |
nicklas |
157 |
subcontext="<%=subContext%>" |
6707 |
02 Feb 15 |
nicklas |
158 |
filterrows="<%=cc.getFilterRows()%>" |
6192 |
31 Oct 12 |
nicklas |
159 |
subclass="fulltable" |
7982 |
14 Jun 21 |
nicklas |
160 |
stickyheaders="<%=cc.getSetting("columns.sticky", "name")%>" |
6192 |
31 Oct 12 |
nicklas |
161 |
> |
6192 |
31 Oct 12 |
nicklas |
162 |
<tbl:hidden |
6192 |
31 Oct 12 |
nicklas |
163 |
name="subcontext" |
6192 |
31 Oct 12 |
nicklas |
164 |
value="<%=subContext%>" |
6192 |
31 Oct 12 |
nicklas |
165 |
/> |
6192 |
31 Oct 12 |
nicklas |
166 |
<tbl:columndef |
6192 |
31 Oct 12 |
nicklas |
167 |
id="name" |
6192 |
31 Oct 12 |
nicklas |
168 |
property="name" |
6192 |
31 Oct 12 |
nicklas |
169 |
datatype="string" |
6192 |
31 Oct 12 |
nicklas |
170 |
title="Name" |
6192 |
31 Oct 12 |
nicklas |
171 |
sortable="true" |
6192 |
31 Oct 12 |
nicklas |
172 |
filterable="true" |
6192 |
31 Oct 12 |
nicklas |
173 |
exportable="true" |
6192 |
31 Oct 12 |
nicklas |
174 |
show="always" |
6192 |
31 Oct 12 |
nicklas |
175 |
/> |
6192 |
31 Oct 12 |
nicklas |
176 |
<tbl:columndef |
6192 |
31 Oct 12 |
nicklas |
177 |
id="id" |
6192 |
31 Oct 12 |
nicklas |
178 |
clazz="uniquecol" |
6192 |
31 Oct 12 |
nicklas |
179 |
property="id" |
6192 |
31 Oct 12 |
nicklas |
180 |
datatype="int" |
6192 |
31 Oct 12 |
nicklas |
181 |
title="ID" |
6192 |
31 Oct 12 |
nicklas |
182 |
sortable="true" |
6192 |
31 Oct 12 |
nicklas |
183 |
filterable="true" |
6192 |
31 Oct 12 |
nicklas |
184 |
exportable="true" |
6192 |
31 Oct 12 |
nicklas |
185 |
/> |
6192 |
31 Oct 12 |
nicklas |
186 |
<tbl:columndef |
6192 |
31 Oct 12 |
nicklas |
187 |
id="diskUsage" |
6192 |
31 Oct 12 |
nicklas |
188 |
title="Disk usage summary" |
6192 |
31 Oct 12 |
nicklas |
189 |
show="always" |
6192 |
31 Oct 12 |
nicklas |
190 |
/> |
6192 |
31 Oct 12 |
nicklas |
191 |
<tbl:columndef |
6192 |
31 Oct 12 |
nicklas |
192 |
id="quota" |
6192 |
31 Oct 12 |
nicklas |
193 |
property="quota.name" |
6192 |
31 Oct 12 |
nicklas |
194 |
datatype="string" |
6192 |
31 Oct 12 |
nicklas |
195 |
title="Quota" |
6192 |
31 Oct 12 |
nicklas |
196 |
sortable="true" |
6192 |
31 Oct 12 |
nicklas |
197 |
filterable="true" |
6192 |
31 Oct 12 |
nicklas |
198 |
exportable="true" |
6192 |
31 Oct 12 |
nicklas |
199 |
/> |
6192 |
31 Oct 12 |
nicklas |
200 |
<tbl:columndef |
6192 |
31 Oct 12 |
nicklas |
201 |
id="xt-columns" |
6192 |
31 Oct 12 |
nicklas |
202 |
extensions="<%=columnsInvoker%>" |
6192 |
31 Oct 12 |
nicklas |
203 |
jspcontext="<%=jspContext%>" |
6192 |
31 Oct 12 |
nicklas |
204 |
/> |
6604 |
18 Nov 14 |
nicklas |
205 |
<div class="panelgroup bg-filled-50 bottomborder"> |
6192 |
31 Oct 12 |
nicklas |
206 |
<tbl:toolbar |
6192 |
31 Oct 12 |
nicklas |
207 |
visible="<%=mode.hasToolbar()%>" |
6192 |
31 Oct 12 |
nicklas |
208 |
subclass="bottomborder" |
6192 |
31 Oct 12 |
nicklas |
209 |
> |
6192 |
31 Oct 12 |
nicklas |
210 |
<tbl:button |
6305 |
09 Aug 13 |
nicklas |
211 |
id="btnColumns" |
6192 |
31 Oct 12 |
nicklas |
212 |
image="columns.png" |
6192 |
31 Oct 12 |
nicklas |
213 |
title="Columns…" |
6192 |
31 Oct 12 |
nicklas |
214 |
tooltip="Show, hide and re-order columns" |
6192 |
31 Oct 12 |
nicklas |
215 |
/> |
6192 |
31 Oct 12 |
nicklas |
216 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
217 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
6192 |
31 Oct 12 |
nicklas |
218 |
</tbl:toolbar> |
6192 |
31 Oct 12 |
nicklas |
219 |
<tbl:panel> |
6192 |
31 Oct 12 |
nicklas |
220 |
<tbl:presetselector /> |
6192 |
31 Oct 12 |
nicklas |
221 |
<tbl:navigator |
6192 |
31 Oct 12 |
nicklas |
222 |
page="<%=cc.getPage()%>" |
6192 |
31 Oct 12 |
nicklas |
223 |
rowsperpage="<%=cc.getRowsPerPage()%>" |
6192 |
31 Oct 12 |
nicklas |
224 |
totalrows="<%=groups == null ? 0 : groups.getTotalCount()%>" |
6192 |
31 Oct 12 |
nicklas |
225 |
/> |
6192 |
31 Oct 12 |
nicklas |
226 |
<b>Show summary</b> |
6305 |
09 Aug 13 |
nicklas |
227 |
<span id="changeSummary"> |
6305 |
09 Aug 13 |
nicklas |
228 |
<label><input type="radio" name="showStatistics" value="total" |
6305 |
09 Aug 13 |
nicklas |
229 |
<%="total".equals(showStatistics) ? "checked" : ""%>>Total only</label> |
6305 |
09 Aug 13 |
nicklas |
230 |
<label><input type="radio" name="showStatistics" value="location" |
6305 |
09 Aug 13 |
nicklas |
231 |
<%="location".equals(showStatistics) ? "checked" : ""%>>Per location</label> |
6305 |
09 Aug 13 |
nicklas |
232 |
<label><input type="radio" name="showStatistics" value="quotaType" |
6305 |
09 Aug 13 |
nicklas |
233 |
<%="quotaType".equals(showStatistics) ? "checked" : ""%>>Per quota type</label> |
6305 |
09 Aug 13 |
nicklas |
234 |
<label><input type="radio" name="showStatistics" value="full" |
6305 |
09 Aug 13 |
nicklas |
235 |
<%="full".equals(showStatistics) ? "checked" : ""%>>Full</label> |
6305 |
09 Aug 13 |
nicklas |
236 |
</span> |
6192 |
31 Oct 12 |
nicklas |
237 |
</tbl:panel> |
6192 |
31 Oct 12 |
nicklas |
238 |
</div> |
6192 |
31 Oct 12 |
nicklas |
239 |
|
6192 |
31 Oct 12 |
nicklas |
240 |
<tbl:data> |
6192 |
31 Oct 12 |
nicklas |
241 |
<tbl:headers> |
6192 |
31 Oct 12 |
nicklas |
242 |
<tbl:headerrow> |
7943 |
04 May 21 |
nicklas |
243 |
<tbl:header clazz="row-index bg-filled-100" /> |
6192 |
31 Oct 12 |
nicklas |
244 |
<tbl:columnheaders /> |
6192 |
31 Oct 12 |
nicklas |
245 |
</tbl:headerrow> |
6707 |
02 Feb 15 |
nicklas |
246 |
<% |
6707 |
02 Feb 15 |
nicklas |
247 |
int numFilters = cc.getNumPropertyFilters(); |
6707 |
02 Feb 15 |
nicklas |
248 |
int numRows = cc.getFilterRows(); |
6707 |
02 Feb 15 |
nicklas |
249 |
for (int filterNo = 0; filterNo < numRows; filterNo++) |
6707 |
02 Feb 15 |
nicklas |
250 |
{ |
6707 |
02 Feb 15 |
nicklas |
251 |
boolean lastRow = filterNo == numRows-1; |
6707 |
02 Feb 15 |
nicklas |
252 |
%> |
6707 |
02 Feb 15 |
nicklas |
253 |
<tbl:headerrow> |
7943 |
04 May 21 |
nicklas |
254 |
<tbl:header subclass="row-index bg-filled-100"> |
7943 |
04 May 21 |
nicklas |
255 |
<div class="index-<%=mode.getName()%>"> |
7943 |
04 May 21 |
nicklas |
256 |
<div class="index"></div> |
7943 |
04 May 21 |
nicklas |
257 |
<div class="check"> |
7943 |
04 May 21 |
nicklas |
258 |
<base:icon |
7943 |
04 May 21 |
nicklas |
259 |
subclass="link table-check" |
7943 |
04 May 21 |
nicklas |
260 |
image="check_uncheck.png" |
7943 |
04 May 21 |
nicklas |
261 |
tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" |
7943 |
04 May 21 |
nicklas |
262 |
visible="<%=lastRow && mode.hasCheck()%>" |
7943 |
04 May 21 |
nicklas |
263 |
/> |
7943 |
04 May 21 |
nicklas |
264 |
</div> |
7943 |
04 May 21 |
nicklas |
265 |
<div class="icons"> |
7943 |
04 May 21 |
nicklas |
266 |
<base:icon |
7943 |
04 May 21 |
nicklas |
267 |
subclass="link table-filter-row-action" |
7943 |
04 May 21 |
nicklas |
268 |
image="add.png" |
7943 |
04 May 21 |
nicklas |
269 |
tooltip="Add extra filter row" |
7943 |
04 May 21 |
nicklas |
270 |
visible="<%=lastRow%>" |
7943 |
04 May 21 |
nicklas |
271 |
/><base:icon |
7943 |
04 May 21 |
nicklas |
272 |
subclass="link table-filter-row-action" |
7943 |
04 May 21 |
nicklas |
273 |
image="remove.png" |
7943 |
04 May 21 |
nicklas |
274 |
tooltip="Remove this filter row" |
7943 |
04 May 21 |
nicklas |
275 |
visible="<%=numRows > 1 || numFilters > 0 %>" |
7943 |
04 May 21 |
nicklas |
276 |
data-remove-row="<%=filterNo%>" |
7943 |
04 May 21 |
nicklas |
277 |
/> |
7943 |
04 May 21 |
nicklas |
278 |
</div> |
7943 |
04 May 21 |
nicklas |
279 |
</div> |
6707 |
02 Feb 15 |
nicklas |
280 |
</tbl:header> |
6707 |
02 Feb 15 |
nicklas |
281 |
<tbl:propertyfilter row="<%=filterNo%>" /> |
6707 |
02 Feb 15 |
nicklas |
282 |
</tbl:headerrow> |
6707 |
02 Feb 15 |
nicklas |
283 |
<% |
6707 |
02 Feb 15 |
nicklas |
284 |
} |
6707 |
02 Feb 15 |
nicklas |
285 |
%> |
7913 |
22 Feb 21 |
nicklas |
286 |
<tbl:columnsubtitles /> |
6192 |
31 Oct 12 |
nicklas |
287 |
</tbl:headers> |
6192 |
31 Oct 12 |
nicklas |
288 |
<tbl:rows> |
6192 |
31 Oct 12 |
nicklas |
289 |
<% |
6192 |
31 Oct 12 |
nicklas |
290 |
if (cc.getMessage() != null) |
6192 |
31 Oct 12 |
nicklas |
291 |
{ |
6192 |
31 Oct 12 |
nicklas |
292 |
%> |
6604 |
18 Nov 14 |
nicklas |
293 |
<tbl:panel subclass="bg-filled-50"> |
6192 |
31 Oct 12 |
nicklas |
294 |
<div class="messagecontainer error"><%=cc.getMessage()%></div> |
6192 |
31 Oct 12 |
nicklas |
295 |
</tbl:panel> |
6192 |
31 Oct 12 |
nicklas |
296 |
<% |
6192 |
31 Oct 12 |
nicklas |
297 |
cc.setMessage(null); |
6192 |
31 Oct 12 |
nicklas |
298 |
} |
6192 |
31 Oct 12 |
nicklas |
299 |
int index = cc.getPage()*cc.getRowsPerPage(); |
6192 |
31 Oct 12 |
nicklas |
300 |
int selectedItemId = cc.getId(); |
6192 |
31 Oct 12 |
nicklas |
301 |
if (groups != null) |
6192 |
31 Oct 12 |
nicklas |
302 |
{ |
6192 |
31 Oct 12 |
nicklas |
303 |
while (groups.hasNext()) |
6192 |
31 Oct 12 |
nicklas |
304 |
{ |
6192 |
31 Oct 12 |
nicklas |
305 |
Group item = groups.next(); |
6192 |
31 Oct 12 |
nicklas |
306 |
int itemId = item.getId(); |
6192 |
31 Oct 12 |
nicklas |
307 |
String name = HTML.encodeTags(item.getName()); |
6192 |
31 Oct 12 |
nicklas |
308 |
String tooltip = mode.isSelectionMode() ? |
6192 |
31 Oct 12 |
nicklas |
309 |
"Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
6192 |
31 Oct 12 |
nicklas |
310 |
index++; |
6192 |
31 Oct 12 |
nicklas |
311 |
numListed++; |
6192 |
31 Oct 12 |
nicklas |
312 |
%> |
6192 |
31 Oct 12 |
nicklas |
313 |
<tbl:row> |
7943 |
04 May 21 |
nicklas |
314 |
<tbl:header clazz="row-index bg-filled-100"> |
7943 |
04 May 21 |
nicklas |
315 |
<div class="index-<%=mode.getName()%>"> |
7943 |
04 May 21 |
nicklas |
316 |
<div class="index <%=index>999?"index-smaller":""%>"><%=index%></div> |
7943 |
04 May 21 |
nicklas |
317 |
<div class="check"> |
7943 |
04 May 21 |
nicklas |
318 |
<base:input |
7943 |
04 May 21 |
nicklas |
319 |
type="checkbox" |
7943 |
04 May 21 |
nicklas |
320 |
name="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
321 |
value="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
322 |
title="<%=name%>" |
7943 |
04 May 21 |
nicklas |
323 |
checked="<%=cc.getSelected().contains(itemId)%>" |
7943 |
04 May 21 |
nicklas |
324 |
visible="<%=mode.hasCheck()%>" |
7943 |
04 May 21 |
nicklas |
325 |
/> |
7943 |
04 May 21 |
nicklas |
326 |
<base:input |
7943 |
04 May 21 |
nicklas |
327 |
type="radio" |
7943 |
04 May 21 |
nicklas |
328 |
name="item_id" |
7943 |
04 May 21 |
nicklas |
329 |
value="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
330 |
title="<%=name%>" |
7943 |
04 May 21 |
nicklas |
331 |
checked="<%=selectedItemId == itemId%>" |
7943 |
04 May 21 |
nicklas |
332 |
visible="<%=mode.hasRadio()%>" |
7943 |
04 May 21 |
nicklas |
333 |
/> |
7943 |
04 May 21 |
nicklas |
334 |
</div> |
7943 |
04 May 21 |
nicklas |
335 |
<div class="icons"> |
7943 |
04 May 21 |
nicklas |
336 |
<base:icon |
7943 |
04 May 21 |
nicklas |
337 |
image="deleted.png" |
7943 |
04 May 21 |
nicklas |
338 |
tooltip="This item has been scheduled for deletion" |
7943 |
04 May 21 |
nicklas |
339 |
visible="<%=item.isRemoved()%>" |
7943 |
04 May 21 |
nicklas |
340 |
/> |
7943 |
04 May 21 |
nicklas |
341 |
</div> |
7943 |
04 May 21 |
nicklas |
342 |
</div> |
7943 |
04 May 21 |
nicklas |
343 |
</tbl:header> |
6305 |
09 Aug 13 |
nicklas |
344 |
<tbl:cell column="name"><div |
6305 |
09 Aug 13 |
nicklas |
345 |
class="link auto-init" |
6305 |
09 Aug 13 |
nicklas |
346 |
data-auto-init="item-link" |
6305 |
09 Aug 13 |
nicklas |
347 |
data-item-type="GROUP" |
6305 |
09 Aug 13 |
nicklas |
348 |
data-item-id="<%=itemId%>" |
6305 |
09 Aug 13 |
nicklas |
349 |
data-no-edit="<%=writePermission ? 0 : 1 %>" |
6192 |
31 Oct 12 |
nicklas |
350 |
title="<%=tooltip%>"><%=name%></div></tbl:cell> |
6192 |
31 Oct 12 |
nicklas |
351 |
<tbl:cell column="id"><%=item.getId()%></tbl:cell> |
6192 |
31 Oct 12 |
nicklas |
352 |
<tbl:cell column="diskUsage" style="padding: 0px;"> |
6192 |
31 Oct 12 |
nicklas |
353 |
<% |
6192 |
31 Oct 12 |
nicklas |
354 |
DiskUsageStatistics.Summary summary = du.getSummary(item); |
6192 |
31 Oct 12 |
nicklas |
355 |
long total = summary.getTotal(); |
6192 |
31 Oct 12 |
nicklas |
356 |
if (total > 0 && (hasLocation || hasQuotaType)) |
6192 |
31 Oct 12 |
nicklas |
357 |
{ |
6192 |
31 Oct 12 |
nicklas |
358 |
%> |
6192 |
31 Oct 12 |
nicklas |
359 |
<table class="special bottomborder"> |
6192 |
31 Oct 12 |
nicklas |
360 |
<% |
6192 |
31 Oct 12 |
nicklas |
361 |
if (hasLocation) |
6192 |
31 Oct 12 |
nicklas |
362 |
{ |
6192 |
31 Oct 12 |
nicklas |
363 |
%> |
6620 |
24 Nov 14 |
nicklas |
364 |
<tr class="bottomborder bg-filled-100"> |
6192 |
31 Oct 12 |
nicklas |
365 |
<% |
6192 |
31 Oct 12 |
nicklas |
366 |
if (hasQuotaType) |
6192 |
31 Oct 12 |
nicklas |
367 |
{ |
6192 |
31 Oct 12 |
nicklas |
368 |
%> |
6192 |
31 Oct 12 |
nicklas |
369 |
<th></th> |
6192 |
31 Oct 12 |
nicklas |
370 |
<% |
6192 |
31 Oct 12 |
nicklas |
371 |
} |
6192 |
31 Oct 12 |
nicklas |
372 |
%> |
6192 |
31 Oct 12 |
nicklas |
373 |
<th>Total</th> |
6192 |
31 Oct 12 |
nicklas |
374 |
<td>Primary</td> |
7595 |
22 Feb 19 |
nicklas |
375 |
<td>External</td> |
6192 |
31 Oct 12 |
nicklas |
376 |
<td>Offline</td> |
6192 |
31 Oct 12 |
nicklas |
377 |
</tr> |
6192 |
31 Oct 12 |
nicklas |
378 |
<% |
6192 |
31 Oct 12 |
nicklas |
379 |
} |
6192 |
31 Oct 12 |
nicklas |
380 |
%> |
6620 |
24 Nov 14 |
nicklas |
381 |
<tr class="bottomborder <%=!hasLocation ? "bg-filled-100" : "" %>"> |
6192 |
31 Oct 12 |
nicklas |
382 |
<% |
6192 |
31 Oct 12 |
nicklas |
383 |
if (hasQuotaType) |
6192 |
31 Oct 12 |
nicklas |
384 |
{ |
6192 |
31 Oct 12 |
nicklas |
385 |
%> |
6192 |
31 Oct 12 |
nicklas |
386 |
<th>Total</th> |
6192 |
31 Oct 12 |
nicklas |
387 |
<% |
6192 |
31 Oct 12 |
nicklas |
388 |
} |
6192 |
31 Oct 12 |
nicklas |
389 |
%> |
6192 |
31 Oct 12 |
nicklas |
390 |
<td><%=Values.formatBytes(total)%></td> |
6192 |
31 Oct 12 |
nicklas |
391 |
<% |
6192 |
31 Oct 12 |
nicklas |
392 |
if (hasLocation) |
6192 |
31 Oct 12 |
nicklas |
393 |
{ |
6192 |
31 Oct 12 |
nicklas |
394 |
%> |
6192 |
31 Oct 12 |
nicklas |
395 |
<td><%=Values.formatBytes(summary.getTotal(Location.PRIMARY))%></td> |
7595 |
22 Feb 19 |
nicklas |
396 |
<td><%=Values.formatBytes(summary.getTotal(Location.EXTERNAL))%></td> |
6192 |
31 Oct 12 |
nicklas |
397 |
<td><%=Values.formatBytes(summary.getTotal(Location.OFFLINE))%></td> |
6192 |
31 Oct 12 |
nicklas |
398 |
<% |
6192 |
31 Oct 12 |
nicklas |
399 |
} |
6192 |
31 Oct 12 |
nicklas |
400 |
%> |
6192 |
31 Oct 12 |
nicklas |
401 |
</tr> |
6192 |
31 Oct 12 |
nicklas |
402 |
<% |
6192 |
31 Oct 12 |
nicklas |
403 |
if (hasQuotaType && total > 0) |
6192 |
31 Oct 12 |
nicklas |
404 |
{ |
6192 |
31 Oct 12 |
nicklas |
405 |
for (QuotaType qt : quotaTypes) |
6192 |
31 Oct 12 |
nicklas |
406 |
{ |
6192 |
31 Oct 12 |
nicklas |
407 |
%> |
6192 |
31 Oct 12 |
nicklas |
408 |
<tr> |
6192 |
31 Oct 12 |
nicklas |
409 |
<td><%=HTML.encodeTags(qt.getName())%></td> |
6192 |
31 Oct 12 |
nicklas |
410 |
<td><%=Values.formatBytes(summary.getTotal(qt))%></td> |
6192 |
31 Oct 12 |
nicklas |
411 |
<% |
6192 |
31 Oct 12 |
nicklas |
412 |
if (hasLocation) |
6192 |
31 Oct 12 |
nicklas |
413 |
{ |
6192 |
31 Oct 12 |
nicklas |
414 |
%> |
6192 |
31 Oct 12 |
nicklas |
415 |
<td><%=Values.formatBytes(summary.getTotal(qt, Location.PRIMARY))%></td> |
7595 |
22 Feb 19 |
nicklas |
416 |
<td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.EXTERNAL)) : "n/a"%></td> |
6192 |
31 Oct 12 |
nicklas |
417 |
<td><%=qt.getSystemId().equals(QuotaType.FILE) ? Values.formatBytes(summary.getTotal(qt, Location.OFFLINE)) : "n/a"%></td> |
6192 |
31 Oct 12 |
nicklas |
418 |
<% |
6192 |
31 Oct 12 |
nicklas |
419 |
} |
6192 |
31 Oct 12 |
nicklas |
420 |
%> |
6192 |
31 Oct 12 |
nicklas |
421 |
</tr> |
6192 |
31 Oct 12 |
nicklas |
422 |
<% |
6192 |
31 Oct 12 |
nicklas |
423 |
} |
6192 |
31 Oct 12 |
nicklas |
424 |
} |
6192 |
31 Oct 12 |
nicklas |
425 |
%> |
6192 |
31 Oct 12 |
nicklas |
426 |
</table> |
6192 |
31 Oct 12 |
nicklas |
427 |
<% |
6192 |
31 Oct 12 |
nicklas |
428 |
} |
6192 |
31 Oct 12 |
nicklas |
429 |
else |
6192 |
31 Oct 12 |
nicklas |
430 |
{ |
6192 |
31 Oct 12 |
nicklas |
431 |
%> |
6192 |
31 Oct 12 |
nicklas |
432 |
<%=Values.formatBytes(total)%> |
6192 |
31 Oct 12 |
nicklas |
433 |
<% |
6192 |
31 Oct 12 |
nicklas |
434 |
} |
6192 |
31 Oct 12 |
nicklas |
435 |
if (total > 0) |
6192 |
31 Oct 12 |
nicklas |
436 |
{ |
6192 |
31 Oct 12 |
nicklas |
437 |
%> |
6192 |
31 Oct 12 |
nicklas |
438 |
<base:icon image="gonext.png" |
6305 |
09 Aug 13 |
nicklas |
439 |
subclass="link auto-init" |
6305 |
09 Aug 13 |
nicklas |
440 |
data-auto-init="view-details" |
6305 |
09 Aug 13 |
nicklas |
441 |
data-item-type="GROUP" |
6305 |
09 Aug 13 |
nicklas |
442 |
data-item-id="<%=itemId %>">View details</base:icon> |
6192 |
31 Oct 12 |
nicklas |
443 |
<% |
6192 |
31 Oct 12 |
nicklas |
444 |
} |
6192 |
31 Oct 12 |
nicklas |
445 |
%> |
6192 |
31 Oct 12 |
nicklas |
446 |
</tbl:cell> |
6192 |
31 Oct 12 |
nicklas |
447 |
<tbl:cell column="quota" |
6192 |
31 Oct 12 |
nicklas |
448 |
><base:propertyvalue |
6192 |
31 Oct 12 |
nicklas |
449 |
item="<%=item%>" |
6192 |
31 Oct 12 |
nicklas |
450 |
property="quota" |
6192 |
31 Oct 12 |
nicklas |
451 |
enableEditLink="<%=mode.hasEditLink()%>" |
6192 |
31 Oct 12 |
nicklas |
452 |
enablePropertyLink="<%=mode.hasPropertyLink()%>" |
6192 |
31 Oct 12 |
nicklas |
453 |
/></tbl:cell> |
6192 |
31 Oct 12 |
nicklas |
454 |
<tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
6192 |
31 Oct 12 |
nicklas |
455 |
<tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> |
6192 |
31 Oct 12 |
nicklas |
456 |
<tbl:cell column="xt-columns" /> |
6192 |
31 Oct 12 |
nicklas |
457 |
</tbl:xt-cells> |
6192 |
31 Oct 12 |
nicklas |
458 |
</tbl:row> |
6192 |
31 Oct 12 |
nicklas |
459 |
<% |
6192 |
31 Oct 12 |
nicklas |
460 |
} |
6192 |
31 Oct 12 |
nicklas |
461 |
} |
6192 |
31 Oct 12 |
nicklas |
462 |
if (numListed == 0) |
6192 |
31 Oct 12 |
nicklas |
463 |
{ |
6192 |
31 Oct 12 |
nicklas |
464 |
%> |
6604 |
18 Nov 14 |
nicklas |
465 |
<tbl:panel subclass="bg-filled-50"> |
6192 |
31 Oct 12 |
nicklas |
466 |
<div class="messagecontainer note"> |
6192 |
31 Oct 12 |
nicklas |
467 |
<%=groups == null || groups.getTotalCount() == 0 ? "No groups were found" : "No groups on this page. Please select another page!" %> |
6192 |
31 Oct 12 |
nicklas |
468 |
</div> |
6192 |
31 Oct 12 |
nicklas |
469 |
</tbl:panel> |
6192 |
31 Oct 12 |
nicklas |
470 |
<% |
6192 |
31 Oct 12 |
nicklas |
471 |
} |
6192 |
31 Oct 12 |
nicklas |
472 |
%> |
6192 |
31 Oct 12 |
nicklas |
473 |
</tbl:rows> |
6192 |
31 Oct 12 |
nicklas |
474 |
</tbl:data> |
6192 |
31 Oct 12 |
nicklas |
475 |
</tbl:table> |
6192 |
31 Oct 12 |
nicklas |
476 |
</t:tab> |
6192 |
31 Oct 12 |
nicklas |
477 |
</t:tabcontrol> |
6192 |
31 Oct 12 |
nicklas |
478 |
|
6192 |
31 Oct 12 |
nicklas |
479 |
</base:body> |
6192 |
31 Oct 12 |
nicklas |
480 |
</base:page> |
6192 |
31 Oct 12 |
nicklas |
481 |
<% |
6192 |
31 Oct 12 |
nicklas |
482 |
} |
6192 |
31 Oct 12 |
nicklas |
483 |
finally |
6192 |
31 Oct 12 |
nicklas |
484 |
{ |
6192 |
31 Oct 12 |
nicklas |
485 |
if (groups != null) groups.close(); |
6192 |
31 Oct 12 |
nicklas |
486 |
if (dc != null) dc.close(); |
6192 |
31 Oct 12 |
nicklas |
487 |
} |
6192 |
31 Oct 12 |
nicklas |
488 |
%> |