7407 |
05 Oct 17 |
nicklas |
1 |
<%-- $Id $ |
7407 |
05 Oct 17 |
nicklas |
2 |
------------------------------------------------------------------ |
7407 |
05 Oct 17 |
nicklas |
Copyright (C) 2017 Nicklas Nordborg |
7407 |
05 Oct 17 |
nicklas |
4 |
|
7407 |
05 Oct 17 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
7407 |
05 Oct 17 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
7407 |
05 Oct 17 |
nicklas |
7 |
|
7407 |
05 Oct 17 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
7407 |
05 Oct 17 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
7407 |
05 Oct 17 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
7407 |
05 Oct 17 |
nicklas |
11 |
of the License, or (at your option) any later version. |
7407 |
05 Oct 17 |
nicklas |
12 |
|
7407 |
05 Oct 17 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
7407 |
05 Oct 17 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7407 |
05 Oct 17 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7407 |
05 Oct 17 |
nicklas |
16 |
GNU General Public License for more details. |
7407 |
05 Oct 17 |
nicklas |
17 |
|
7407 |
05 Oct 17 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
7407 |
05 Oct 17 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
7407 |
05 Oct 17 |
nicklas |
20 |
------------------------------------------------------------------ |
7407 |
05 Oct 17 |
nicklas |
21 |
|
7407 |
05 Oct 17 |
nicklas |
22 |
@author Nicklas |
7407 |
05 Oct 17 |
nicklas |
23 |
--%> |
7407 |
05 Oct 17 |
nicklas |
24 |
<%@ page pageEncoding="UTF-8" session="false" |
7407 |
05 Oct 17 |
nicklas |
25 |
import="net.sf.basedb.core.SessionControl" |
7407 |
05 Oct 17 |
nicklas |
26 |
import="net.sf.basedb.core.DbControl" |
7407 |
05 Oct 17 |
nicklas |
27 |
import="net.sf.basedb.core.Item" |
7407 |
05 Oct 17 |
nicklas |
28 |
import="net.sf.basedb.core.Include" |
7407 |
05 Oct 17 |
nicklas |
29 |
import="net.sf.basedb.core.User" |
7407 |
05 Oct 17 |
nicklas |
30 |
import="net.sf.basedb.core.UserDevice" |
7407 |
05 Oct 17 |
nicklas |
31 |
import="net.sf.basedb.core.Type" |
7407 |
05 Oct 17 |
nicklas |
32 |
import="net.sf.basedb.core.ItemQuery" |
7407 |
05 Oct 17 |
nicklas |
33 |
import="net.sf.basedb.core.ItemResultIterator" |
7407 |
05 Oct 17 |
nicklas |
34 |
import="net.sf.basedb.core.ItemContext" |
7407 |
05 Oct 17 |
nicklas |
35 |
import="net.sf.basedb.core.Nameable" |
7407 |
05 Oct 17 |
nicklas |
36 |
import="net.sf.basedb.core.Permission" |
7407 |
05 Oct 17 |
nicklas |
37 |
import="net.sf.basedb.core.PluginDefinition" |
7407 |
05 Oct 17 |
nicklas |
38 |
import="net.sf.basedb.core.plugin.GuiContext" |
7407 |
05 Oct 17 |
nicklas |
39 |
import="net.sf.basedb.core.plugin.Plugin" |
7407 |
05 Oct 17 |
nicklas |
40 |
import="net.sf.basedb.clients.web.Base" |
7407 |
05 Oct 17 |
nicklas |
41 |
import="net.sf.basedb.clients.web.ModeInfo" |
7407 |
05 Oct 17 |
nicklas |
42 |
import="net.sf.basedb.clients.web.PermissionUtil" |
7407 |
05 Oct 17 |
nicklas |
43 |
import="net.sf.basedb.clients.web.util.HTML" |
7414 |
12 Oct 17 |
nicklas |
44 |
import="net.sf.basedb.util.GeoLocation" |
7407 |
05 Oct 17 |
nicklas |
45 |
import="net.sf.basedb.util.Values" |
7407 |
05 Oct 17 |
nicklas |
46 |
import="net.sf.basedb.util.formatter.Formatter" |
7407 |
05 Oct 17 |
nicklas |
47 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
7407 |
05 Oct 17 |
nicklas |
48 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
7407 |
05 Oct 17 |
nicklas |
49 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
7407 |
05 Oct 17 |
nicklas |
50 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
7407 |
05 Oct 17 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
7604 |
25 Feb 19 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnAction" |
7407 |
05 Oct 17 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
7407 |
05 Oct 17 |
nicklas |
55 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
7407 |
05 Oct 17 |
nicklas |
56 |
import="java.util.Date" |
7407 |
05 Oct 17 |
nicklas |
57 |
import="java.util.Iterator" |
7407 |
05 Oct 17 |
nicklas |
58 |
import="java.util.List" |
7407 |
05 Oct 17 |
nicklas |
59 |
import="java.util.Map" |
7407 |
05 Oct 17 |
nicklas |
60 |
%> |
7407 |
05 Oct 17 |
nicklas |
61 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
7407 |
05 Oct 17 |
nicklas |
62 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
7407 |
05 Oct 17 |
nicklas |
63 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
7407 |
05 Oct 17 |
nicklas |
64 |
<%! |
7407 |
05 Oct 17 |
nicklas |
65 |
private static final Item itemType = Item.USERDEVICE; |
7407 |
05 Oct 17 |
nicklas |
66 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
7407 |
05 Oct 17 |
nicklas |
67 |
%> |
7407 |
05 Oct 17 |
nicklas |
68 |
<% |
7407 |
05 Oct 17 |
nicklas |
69 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
7407 |
05 Oct 17 |
nicklas |
70 |
final String ID = sc.getId(); |
7407 |
05 Oct 17 |
nicklas |
71 |
final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType); |
7407 |
05 Oct 17 |
nicklas |
72 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
7407 |
05 Oct 17 |
nicklas |
73 |
|
7407 |
05 Oct 17 |
nicklas |
74 |
final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
7407 |
05 Oct 17 |
nicklas |
75 |
final String callback = request.getParameter("callback"); |
7407 |
05 Oct 17 |
nicklas |
76 |
final String title = mode.generateTitle("device", "devices"); |
7954 |
12 May 21 |
nicklas |
77 |
final DbControl dc = sc.newDbControl(":List "+itemType); |
7407 |
05 Oct 17 |
nicklas |
78 |
ItemResultIterator<UserDevice> devices = null; |
7407 |
05 Oct 17 |
nicklas |
79 |
try |
7407 |
05 Oct 17 |
nicklas |
80 |
{ |
7982 |
14 Jun 21 |
nicklas |
81 |
final User user = User.getById(dc, sc.getLoggedInUserId()); |
7407 |
05 Oct 17 |
nicklas |
82 |
|
7407 |
05 Oct 17 |
nicklas |
83 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
7407 |
05 Oct 17 |
nicklas |
84 |
Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
7407 |
05 Oct 17 |
nicklas |
85 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
7914 |
23 Feb 21 |
nicklas |
86 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); |
7407 |
05 Oct 17 |
nicklas |
87 |
try |
7407 |
05 Oct 17 |
nicklas |
88 |
{ |
7982 |
14 Jun 21 |
nicklas |
89 |
final ItemQuery<UserDevice> query = Base.getConfiguredQuery(dc, cc, jspContext, true, UserDevice.getQuery(null), mode); |
7407 |
05 Oct 17 |
nicklas |
90 |
devices = query.iterate(dc); |
7407 |
05 Oct 17 |
nicklas |
91 |
} |
7407 |
05 Oct 17 |
nicklas |
92 |
catch (Throwable t) |
7407 |
05 Oct 17 |
nicklas |
93 |
{ |
7407 |
05 Oct 17 |
nicklas |
94 |
t.printStackTrace(); |
7407 |
05 Oct 17 |
nicklas |
95 |
cc.setMessage(t.getMessage()); |
7407 |
05 Oct 17 |
nicklas |
96 |
} |
7407 |
05 Oct 17 |
nicklas |
97 |
int numListed = 0; |
7604 |
25 Feb 19 |
nicklas |
98 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
7604 |
25 Feb 19 |
nicklas |
99 |
ExtensionsInvoker<ListColumnAction<UserDevice,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
7407 |
05 Oct 17 |
nicklas |
100 |
%> |
7407 |
05 Oct 17 |
nicklas |
101 |
<base:page title="<%=title==null ? "Devices" : title%>" type="<%=mode.getPageType()%>" id="list-page"> |
7407 |
05 Oct 17 |
nicklas |
102 |
<base:head scripts="table.js,~devices.js" styles="table.css,toolbar.css"> |
7407 |
05 Oct 17 |
nicklas |
103 |
<ext:scripts context="<%=jspContext%>" /> |
7407 |
05 Oct 17 |
nicklas |
104 |
<ext:stylesheets context="<%=jspContext%>" /> |
7407 |
05 Oct 17 |
nicklas |
105 |
</base:head> |
7407 |
05 Oct 17 |
nicklas |
106 |
|
7407 |
05 Oct 17 |
nicklas |
107 |
<base:body> |
7407 |
05 Oct 17 |
nicklas |
108 |
<h1><%=title==null ? "Devices" : title%></h1> |
7407 |
05 Oct 17 |
nicklas |
109 |
<div class="content"> |
7407 |
05 Oct 17 |
nicklas |
110 |
<tbl:table |
7407 |
05 Oct 17 |
nicklas |
111 |
id="devices" |
7407 |
05 Oct 17 |
nicklas |
112 |
columns="<%=cc.getSetting("columns")%>" |
7407 |
05 Oct 17 |
nicklas |
113 |
sortby="<%=cc.getSortProperty()%>" |
7407 |
05 Oct 17 |
nicklas |
114 |
direction="<%=cc.getSortDirection()%>" |
7407 |
05 Oct 17 |
nicklas |
115 |
action="index.jsp" |
7407 |
05 Oct 17 |
nicklas |
116 |
sc="<%=sc%>" |
7407 |
05 Oct 17 |
nicklas |
117 |
item="<%=itemType%>" |
7407 |
05 Oct 17 |
nicklas |
118 |
filterrows="<%=cc.getFilterRows()%>" |
7407 |
05 Oct 17 |
nicklas |
119 |
subclass="fulltable" |
7982 |
14 Jun 21 |
nicklas |
120 |
stickyheaders="<%=cc.getSetting("columns.sticky", "name")%>" |
7407 |
05 Oct 17 |
nicklas |
121 |
> |
7407 |
05 Oct 17 |
nicklas |
122 |
<tbl:hidden |
7407 |
05 Oct 17 |
nicklas |
123 |
name="mode" |
7407 |
05 Oct 17 |
nicklas |
124 |
value="<%=mode.getName()%>" |
7407 |
05 Oct 17 |
nicklas |
125 |
/> |
7407 |
05 Oct 17 |
nicklas |
126 |
<tbl:hidden |
7407 |
05 Oct 17 |
nicklas |
127 |
name="callback" |
7407 |
05 Oct 17 |
nicklas |
128 |
value="<%=callback%>" |
7407 |
05 Oct 17 |
nicklas |
129 |
skip="<%=callback == null%>" |
7407 |
05 Oct 17 |
nicklas |
130 |
/> |
7407 |
05 Oct 17 |
nicklas |
131 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
132 |
id="name" |
7407 |
05 Oct 17 |
nicklas |
133 |
property="name" |
7407 |
05 Oct 17 |
nicklas |
134 |
datatype="string" |
7407 |
05 Oct 17 |
nicklas |
135 |
title="Name" |
7407 |
05 Oct 17 |
nicklas |
136 |
sortable="true" |
7407 |
05 Oct 17 |
nicklas |
137 |
filterable="true" |
7407 |
05 Oct 17 |
nicklas |
138 |
exportable="true" |
7407 |
05 Oct 17 |
nicklas |
139 |
show="always" |
7407 |
05 Oct 17 |
nicklas |
140 |
/> |
7407 |
05 Oct 17 |
nicklas |
141 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
142 |
id="id" |
7407 |
05 Oct 17 |
nicklas |
143 |
clazz="uniquecol" |
7407 |
05 Oct 17 |
nicklas |
144 |
property="id" |
7407 |
05 Oct 17 |
nicklas |
145 |
datatype="int" |
7407 |
05 Oct 17 |
nicklas |
146 |
title="ID" |
7407 |
05 Oct 17 |
nicklas |
147 |
sortable="true" |
7407 |
05 Oct 17 |
nicklas |
148 |
filterable="true" |
7407 |
05 Oct 17 |
nicklas |
149 |
exportable="true" |
7407 |
05 Oct 17 |
nicklas |
150 |
/> |
7407 |
05 Oct 17 |
nicklas |
151 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
152 |
id="client" |
7407 |
05 Oct 17 |
nicklas |
153 |
property="client.name" |
7407 |
05 Oct 17 |
nicklas |
154 |
datatype="string" |
7407 |
05 Oct 17 |
nicklas |
155 |
title="Client application" |
7407 |
05 Oct 17 |
nicklas |
156 |
sortable="true" |
7407 |
05 Oct 17 |
nicklas |
157 |
filterable="true" |
7407 |
05 Oct 17 |
nicklas |
158 |
exportable="true" |
7407 |
05 Oct 17 |
nicklas |
159 |
/> |
7407 |
05 Oct 17 |
nicklas |
160 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
161 |
id="user" |
7407 |
05 Oct 17 |
nicklas |
162 |
property="user.name" |
7407 |
05 Oct 17 |
nicklas |
163 |
datatype="string" |
7407 |
05 Oct 17 |
nicklas |
164 |
title="User" |
7407 |
05 Oct 17 |
nicklas |
165 |
sortable="true" |
7407 |
05 Oct 17 |
nicklas |
166 |
filterable="true" |
7407 |
05 Oct 17 |
nicklas |
167 |
exportable="true" |
7407 |
05 Oct 17 |
nicklas |
168 |
/> |
7407 |
05 Oct 17 |
nicklas |
169 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
170 |
id="userAgent" |
7407 |
05 Oct 17 |
nicklas |
171 |
property="userAgent" |
7407 |
05 Oct 17 |
nicklas |
172 |
datatype="string" |
7407 |
05 Oct 17 |
nicklas |
173 |
title="User agent" |
7407 |
05 Oct 17 |
nicklas |
174 |
sortable="true" |
7407 |
05 Oct 17 |
nicklas |
175 |
filterable="true" |
7407 |
05 Oct 17 |
nicklas |
176 |
exportable="true" |
7407 |
05 Oct 17 |
nicklas |
177 |
/> |
7407 |
05 Oct 17 |
nicklas |
178 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
179 |
id="entryDate" |
7407 |
05 Oct 17 |
nicklas |
180 |
property="entryDate" |
7407 |
05 Oct 17 |
nicklas |
181 |
datatype="date" |
7407 |
05 Oct 17 |
nicklas |
182 |
title="Registered" |
7407 |
05 Oct 17 |
nicklas |
183 |
sortable="true" |
7407 |
05 Oct 17 |
nicklas |
184 |
filterable="true" |
7407 |
05 Oct 17 |
nicklas |
185 |
exportable="true" |
7407 |
05 Oct 17 |
nicklas |
186 |
formatter="<%=dateFormatter%>" |
7407 |
05 Oct 17 |
nicklas |
187 |
/> |
7407 |
05 Oct 17 |
nicklas |
188 |
<tbl:columndef |
7816 |
05 Jun 20 |
nicklas |
189 |
id="verified" |
7816 |
05 Jun 20 |
nicklas |
190 |
property="verified" |
7816 |
05 Jun 20 |
nicklas |
191 |
datatype="boolean" |
7816 |
05 Jun 20 |
nicklas |
192 |
title="Is verified" |
7816 |
05 Jun 20 |
nicklas |
193 |
sortable="true" |
7816 |
05 Jun 20 |
nicklas |
194 |
filterable="true" |
7816 |
05 Jun 20 |
nicklas |
195 |
exportable="true" |
7816 |
05 Jun 20 |
nicklas |
196 |
/> |
7816 |
05 Jun 20 |
nicklas |
197 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
198 |
id="lastUsed" |
7407 |
05 Oct 17 |
nicklas |
199 |
property="lastUsed" |
7407 |
05 Oct 17 |
nicklas |
200 |
datatype="timestamp" |
7407 |
05 Oct 17 |
nicklas |
201 |
title="Last used" |
7407 |
05 Oct 17 |
nicklas |
202 |
sortable="true" |
7407 |
05 Oct 17 |
nicklas |
203 |
filterable="true" |
7407 |
05 Oct 17 |
nicklas |
204 |
exportable="true" |
7407 |
05 Oct 17 |
nicklas |
205 |
formatter="<%=dateTimeFormatter%>" |
7407 |
05 Oct 17 |
nicklas |
206 |
/> |
7407 |
05 Oct 17 |
nicklas |
207 |
<tbl:columndef |
7411 |
10 Oct 17 |
nicklas |
208 |
id="lastRemoteId" |
7411 |
10 Oct 17 |
nicklas |
209 |
property="lastRemoteId" |
7411 |
10 Oct 17 |
nicklas |
210 |
datatype="string" |
7411 |
10 Oct 17 |
nicklas |
211 |
title="Last remote ID" |
7411 |
10 Oct 17 |
nicklas |
212 |
sortable="true" |
7411 |
10 Oct 17 |
nicklas |
213 |
filterable="true" |
7411 |
10 Oct 17 |
nicklas |
214 |
exportable="true" |
7411 |
10 Oct 17 |
nicklas |
215 |
/> |
7411 |
10 Oct 17 |
nicklas |
216 |
<tbl:columndef |
7414 |
12 Oct 17 |
nicklas |
217 |
id="location" |
7414 |
12 Oct 17 |
nicklas |
218 |
property="location" |
7414 |
12 Oct 17 |
nicklas |
219 |
datatype="string" |
7414 |
12 Oct 17 |
nicklas |
220 |
title="Location" |
7414 |
12 Oct 17 |
nicklas |
221 |
sortable="true" |
7414 |
12 Oct 17 |
nicklas |
222 |
filterable="true" |
7414 |
12 Oct 17 |
nicklas |
223 |
exportable="true" |
7414 |
12 Oct 17 |
nicklas |
224 |
/> |
7414 |
12 Oct 17 |
nicklas |
225 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
226 |
id="description" |
7407 |
05 Oct 17 |
nicklas |
227 |
property="description" |
7407 |
05 Oct 17 |
nicklas |
228 |
datatype="string" |
7407 |
05 Oct 17 |
nicklas |
229 |
title="Description" |
7407 |
05 Oct 17 |
nicklas |
230 |
sortable="true" |
7407 |
05 Oct 17 |
nicklas |
231 |
filterable="true" |
7407 |
05 Oct 17 |
nicklas |
232 |
exportable="true" |
7407 |
05 Oct 17 |
nicklas |
233 |
/> |
7407 |
05 Oct 17 |
nicklas |
234 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
235 |
id="permission" |
7407 |
05 Oct 17 |
nicklas |
236 |
title="Permission" |
7407 |
05 Oct 17 |
nicklas |
237 |
/> |
7407 |
05 Oct 17 |
nicklas |
238 |
<tbl:columndef |
7407 |
05 Oct 17 |
nicklas |
239 |
id="xt-columns" |
7407 |
05 Oct 17 |
nicklas |
240 |
extensions="<%=columnsInvoker%>" |
7407 |
05 Oct 17 |
nicklas |
241 |
jspcontext="<%=jspContext%>" |
7407 |
05 Oct 17 |
nicklas |
242 |
/> |
7407 |
05 Oct 17 |
nicklas |
243 |
<div class="panelgroup bg-filled-50 bottomborder"> |
7407 |
05 Oct 17 |
nicklas |
244 |
<tbl:toolbar |
7407 |
05 Oct 17 |
nicklas |
245 |
subclass="bottomborder" |
7407 |
05 Oct 17 |
nicklas |
246 |
visible="<%=mode.hasToolbar()%>" |
7407 |
05 Oct 17 |
nicklas |
247 |
> |
7407 |
05 Oct 17 |
nicklas |
248 |
<tbl:button |
7407 |
05 Oct 17 |
nicklas |
249 |
id="btnDeleteItems" |
7407 |
05 Oct 17 |
nicklas |
250 |
image="delete.png" |
7407 |
05 Oct 17 |
nicklas |
251 |
title="Delete" |
7407 |
05 Oct 17 |
nicklas |
252 |
tooltip="Delete the selected items" |
7407 |
05 Oct 17 |
nicklas |
253 |
/> |
7407 |
05 Oct 17 |
nicklas |
254 |
<tbl:button |
7407 |
05 Oct 17 |
nicklas |
255 |
id="btnColumns" |
7407 |
05 Oct 17 |
nicklas |
256 |
image="columns.png" |
7407 |
05 Oct 17 |
nicklas |
257 |
title="Columns…" |
7407 |
05 Oct 17 |
nicklas |
258 |
tooltip="Show, hide and re-order columns" |
7407 |
05 Oct 17 |
nicklas |
259 |
/> |
7407 |
05 Oct 17 |
nicklas |
260 |
<tbl:button |
7407 |
05 Oct 17 |
nicklas |
261 |
id="btnExport" |
7407 |
05 Oct 17 |
nicklas |
262 |
data-plugin-type="EXPORT" |
7407 |
05 Oct 17 |
nicklas |
263 |
image="export.png" |
7407 |
05 Oct 17 |
nicklas |
264 |
title="Export…" |
7407 |
05 Oct 17 |
nicklas |
265 |
tooltip="Export data" |
7407 |
05 Oct 17 |
nicklas |
266 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
7407 |
05 Oct 17 |
nicklas |
267 |
/> |
7407 |
05 Oct 17 |
nicklas |
268 |
<tbl:button |
7407 |
05 Oct 17 |
nicklas |
269 |
id="btnRunPlugin" |
7407 |
05 Oct 17 |
nicklas |
270 |
data-plugin-type="OTHER" |
7407 |
05 Oct 17 |
nicklas |
271 |
image="runplugin.png" |
7407 |
05 Oct 17 |
nicklas |
272 |
title="Run plugin…" |
7407 |
05 Oct 17 |
nicklas |
273 |
tooltip="Run a plugin" |
7407 |
05 Oct 17 |
nicklas |
274 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
7407 |
05 Oct 17 |
nicklas |
275 |
/> |
7407 |
05 Oct 17 |
nicklas |
276 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
277 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
7407 |
05 Oct 17 |
nicklas |
278 |
</tbl:toolbar> |
7407 |
05 Oct 17 |
nicklas |
279 |
<tbl:panel> |
7407 |
05 Oct 17 |
nicklas |
280 |
<tbl:presetselector /> |
7407 |
05 Oct 17 |
nicklas |
281 |
<tbl:navigator |
7407 |
05 Oct 17 |
nicklas |
282 |
page="<%=cc.getPage()%>" |
7407 |
05 Oct 17 |
nicklas |
283 |
rowsperpage="<%=cc.getRowsPerPage()%>" |
7407 |
05 Oct 17 |
nicklas |
284 |
totalrows="<%=devices == null ? 0 : devices.getTotalCount()%>" |
7407 |
05 Oct 17 |
nicklas |
285 |
visible="<%=mode.hasNavigator()%>" |
7407 |
05 Oct 17 |
nicklas |
286 |
/> |
7407 |
05 Oct 17 |
nicklas |
287 |
</tbl:panel> |
7407 |
05 Oct 17 |
nicklas |
288 |
</div> |
7407 |
05 Oct 17 |
nicklas |
289 |
<tbl:data> |
7407 |
05 Oct 17 |
nicklas |
290 |
<tbl:headers> |
7407 |
05 Oct 17 |
nicklas |
291 |
<tbl:headerrow> |
7943 |
04 May 21 |
nicklas |
292 |
<tbl:header clazz="row-index bg-filled-100" /> |
7407 |
05 Oct 17 |
nicklas |
293 |
<tbl:columnheaders /> |
7407 |
05 Oct 17 |
nicklas |
294 |
</tbl:headerrow> |
7407 |
05 Oct 17 |
nicklas |
295 |
<% |
7407 |
05 Oct 17 |
nicklas |
296 |
int numFilters = cc.getNumPropertyFilters(); |
7407 |
05 Oct 17 |
nicklas |
297 |
int numRows = cc.getFilterRows(); |
7407 |
05 Oct 17 |
nicklas |
298 |
for (int filterNo = 0; filterNo < numRows; filterNo++) |
7407 |
05 Oct 17 |
nicklas |
299 |
{ |
7407 |
05 Oct 17 |
nicklas |
300 |
boolean lastRow = filterNo == numRows-1; |
7407 |
05 Oct 17 |
nicklas |
301 |
%> |
7407 |
05 Oct 17 |
nicklas |
302 |
<tbl:headerrow> |
7943 |
04 May 21 |
nicklas |
303 |
<tbl:header subclass="row-index bg-filled-100"> |
7943 |
04 May 21 |
nicklas |
304 |
<div class="index-<%=mode.getName()%>"> |
7943 |
04 May 21 |
nicklas |
305 |
<div class="index"></div> |
7943 |
04 May 21 |
nicklas |
306 |
<div class="check"> |
7943 |
04 May 21 |
nicklas |
307 |
<base:icon |
7943 |
04 May 21 |
nicklas |
308 |
subclass="link table-check" |
7943 |
04 May 21 |
nicklas |
309 |
image="check_uncheck.png" |
7943 |
04 May 21 |
nicklas |
310 |
tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" |
7943 |
04 May 21 |
nicklas |
311 |
visible="<%=lastRow && mode.hasCheck()%>" |
7943 |
04 May 21 |
nicklas |
312 |
/> |
7943 |
04 May 21 |
nicklas |
313 |
</div> |
7943 |
04 May 21 |
nicklas |
314 |
<div class="icons"> |
7943 |
04 May 21 |
nicklas |
315 |
<base:icon |
7943 |
04 May 21 |
nicklas |
316 |
subclass="link table-filter-row-action" |
7943 |
04 May 21 |
nicklas |
317 |
image="add.png" |
7943 |
04 May 21 |
nicklas |
318 |
tooltip="Add extra filter row" |
7943 |
04 May 21 |
nicklas |
319 |
visible="<%=lastRow%>" |
7943 |
04 May 21 |
nicklas |
320 |
/><base:icon |
7943 |
04 May 21 |
nicklas |
321 |
subclass="link table-filter-row-action" |
7943 |
04 May 21 |
nicklas |
322 |
image="remove.png" |
7943 |
04 May 21 |
nicklas |
323 |
tooltip="Remove this filter row" |
7943 |
04 May 21 |
nicklas |
324 |
visible="<%=numRows > 1 || numFilters > 0 %>" |
7943 |
04 May 21 |
nicklas |
325 |
data-remove-row="<%=filterNo%>" |
7943 |
04 May 21 |
nicklas |
326 |
/> |
7943 |
04 May 21 |
nicklas |
327 |
</div> |
7943 |
04 May 21 |
nicklas |
328 |
</div> |
7407 |
05 Oct 17 |
nicklas |
329 |
</tbl:header> |
7407 |
05 Oct 17 |
nicklas |
330 |
<tbl:propertyfilter row="<%=filterNo%>" /> |
7407 |
05 Oct 17 |
nicklas |
331 |
</tbl:headerrow> |
7407 |
05 Oct 17 |
nicklas |
332 |
<% |
7407 |
05 Oct 17 |
nicklas |
333 |
} |
7407 |
05 Oct 17 |
nicklas |
334 |
%> |
7913 |
22 Feb 21 |
nicklas |
335 |
<tbl:columnsubtitles /> |
7407 |
05 Oct 17 |
nicklas |
336 |
</tbl:headers> |
7407 |
05 Oct 17 |
nicklas |
337 |
<tbl:rows> |
7407 |
05 Oct 17 |
nicklas |
338 |
<% |
7407 |
05 Oct 17 |
nicklas |
339 |
if (cc.getMessage() != null) |
7407 |
05 Oct 17 |
nicklas |
340 |
{ |
7407 |
05 Oct 17 |
nicklas |
341 |
%> |
7407 |
05 Oct 17 |
nicklas |
342 |
<tbl:panel subclass="bg-filled-50"> |
7407 |
05 Oct 17 |
nicklas |
343 |
<div class="messagecontainer error"><%=cc.getMessage()%></div> |
7407 |
05 Oct 17 |
nicklas |
344 |
</tbl:panel> |
7407 |
05 Oct 17 |
nicklas |
345 |
<% |
7407 |
05 Oct 17 |
nicklas |
346 |
cc.setMessage(null); |
7407 |
05 Oct 17 |
nicklas |
347 |
} |
7407 |
05 Oct 17 |
nicklas |
348 |
int index = cc.getPage()*cc.getRowsPerPage(); |
7407 |
05 Oct 17 |
nicklas |
349 |
int selectedItemId = cc.getId(); |
7407 |
05 Oct 17 |
nicklas |
350 |
if (devices != null) |
7407 |
05 Oct 17 |
nicklas |
351 |
{ |
7408 |
06 Oct 17 |
nicklas |
352 |
int currentDeviceId = sc.getDeviceId(); |
7407 |
05 Oct 17 |
nicklas |
353 |
while (devices.hasNext()) |
7407 |
05 Oct 17 |
nicklas |
354 |
{ |
7407 |
05 Oct 17 |
nicklas |
355 |
UserDevice item = devices.next(); |
7407 |
05 Oct 17 |
nicklas |
356 |
int itemId = item.getId(); |
7407 |
05 Oct 17 |
nicklas |
357 |
|
7407 |
05 Oct 17 |
nicklas |
358 |
boolean deletePermission = item.hasPermission(Permission.DELETE); |
7407 |
05 Oct 17 |
nicklas |
359 |
boolean writePermission = item.hasPermission(Permission.WRITE); |
7407 |
05 Oct 17 |
nicklas |
360 |
String tooltip = mode.isSelectionMode() ? |
7407 |
05 Oct 17 |
nicklas |
361 |
"Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
7407 |
05 Oct 17 |
nicklas |
362 |
String name = HTML.encodeTags(item.getName()); |
7407 |
05 Oct 17 |
nicklas |
363 |
index++; |
7407 |
05 Oct 17 |
nicklas |
364 |
numListed++; |
7407 |
05 Oct 17 |
nicklas |
365 |
%> |
7407 |
05 Oct 17 |
nicklas |
366 |
<tbl:row> |
7943 |
04 May 21 |
nicklas |
367 |
<tbl:header clazz="row-index bg-filled-100"> |
7943 |
04 May 21 |
nicklas |
368 |
<div class="index-<%=mode.getName()%>"> |
7943 |
04 May 21 |
nicklas |
369 |
<div class="index <%=index>999?"index-smaller":""%>"><%=index%></div> |
7943 |
04 May 21 |
nicklas |
370 |
<div class="check"> |
7943 |
04 May 21 |
nicklas |
371 |
<base:input |
7943 |
04 May 21 |
nicklas |
372 |
type="checkbox" |
7943 |
04 May 21 |
nicklas |
373 |
name="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
374 |
value="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
375 |
title="<%=name%>" |
7943 |
04 May 21 |
nicklas |
376 |
checked="<%=cc.getSelected().contains(itemId)%>" |
7943 |
04 May 21 |
nicklas |
377 |
visible="<%=mode.hasCheck()%>" |
7943 |
04 May 21 |
nicklas |
378 |
/> |
7943 |
04 May 21 |
nicklas |
379 |
<base:input |
7943 |
04 May 21 |
nicklas |
380 |
type="radio" |
7943 |
04 May 21 |
nicklas |
381 |
name="item_id" |
7943 |
04 May 21 |
nicklas |
382 |
value="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
383 |
title="<%=name%>" |
7943 |
04 May 21 |
nicklas |
384 |
checked="<%=selectedItemId == itemId%>" |
7943 |
04 May 21 |
nicklas |
385 |
visible="<%=mode.hasRadio()%>" |
7943 |
04 May 21 |
nicklas |
386 |
/> |
7943 |
04 May 21 |
nicklas |
387 |
</div> |
7943 |
04 May 21 |
nicklas |
388 |
<div class="icons"> |
7943 |
04 May 21 |
nicklas |
389 |
<base:icon |
7943 |
04 May 21 |
nicklas |
390 |
image="star.png" |
7943 |
04 May 21 |
nicklas |
391 |
tooltip="This is the current device" |
7943 |
04 May 21 |
nicklas |
392 |
visible="<%=itemId == currentDeviceId%>" |
7943 |
04 May 21 |
nicklas |
393 |
/> |
7943 |
04 May 21 |
nicklas |
394 |
</div> |
7943 |
04 May 21 |
nicklas |
395 |
</div> |
7943 |
04 May 21 |
nicklas |
396 |
</tbl:header> |
7407 |
05 Oct 17 |
nicklas |
397 |
<tbl:cell column="name"><div |
7407 |
05 Oct 17 |
nicklas |
398 |
class="link table-item" |
7407 |
05 Oct 17 |
nicklas |
399 |
data-item-id="<%=itemId%>" |
7407 |
05 Oct 17 |
nicklas |
400 |
data-no-edit="<%=writePermission ? 0 : 1 %>" |
7407 |
05 Oct 17 |
nicklas |
401 |
tabindex="0" |
7407 |
05 Oct 17 |
nicklas |
402 |
title="<%=tooltip%>"><%=name%></div></tbl:cell> |
7407 |
05 Oct 17 |
nicklas |
403 |
<tbl:cell column="id"><%=item.getId()%></tbl:cell> |
7407 |
05 Oct 17 |
nicklas |
404 |
<tbl:cell column="user" |
7407 |
05 Oct 17 |
nicklas |
405 |
><base:propertyvalue |
7407 |
05 Oct 17 |
nicklas |
406 |
item="<%=item%>" |
7407 |
05 Oct 17 |
nicklas |
407 |
property="user" |
7407 |
05 Oct 17 |
nicklas |
408 |
enableEditLink="<%=mode.hasEditLink()%>" |
7407 |
05 Oct 17 |
nicklas |
409 |
enablePropertyLink="<%=mode.hasPropertyLink()%>" |
7407 |
05 Oct 17 |
nicklas |
410 |
/></tbl:cell> |
7407 |
05 Oct 17 |
nicklas |
411 |
<tbl:cell column="client" |
7407 |
05 Oct 17 |
nicklas |
412 |
><base:propertyvalue |
7407 |
05 Oct 17 |
nicklas |
413 |
item="<%=item%>" |
7407 |
05 Oct 17 |
nicklas |
414 |
property="client" |
7407 |
05 Oct 17 |
nicklas |
415 |
enableEditLink="<%=mode.hasEditLink()%>" |
7407 |
05 Oct 17 |
nicklas |
416 |
enablePropertyLink="<%=mode.hasPropertyLink()%>" |
7407 |
05 Oct 17 |
nicklas |
417 |
/></tbl:cell> |
7407 |
05 Oct 17 |
nicklas |
418 |
<tbl:cell column="userAgent"><%=HTML.encodeTags(item.getUserAgent())%></tbl:cell> |
7407 |
05 Oct 17 |
nicklas |
419 |
<tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" /> |
7816 |
05 Jun 20 |
nicklas |
420 |
<tbl:cell column="verified" value="<%=item.isVerified() ? "Yes" : "No"%>" /> |
7407 |
05 Oct 17 |
nicklas |
421 |
<tbl:cell column="lastUsed" value="<%=item.getLastUsed()%>" /> |
7411 |
10 Oct 17 |
nicklas |
422 |
<tbl:cell column="lastRemoteId"><%=HTML.encodeTags(item.getLastRemoteId())%></tbl:cell> |
7414 |
12 Oct 17 |
nicklas |
423 |
<tbl:cell column="location"><%=HTML.encodeTags(item.getLocation())%> |
7414 |
12 Oct 17 |
nicklas |
424 |
<% String mapURL = GeoLocation.getURLToMap(item.getLocationLatitude(), item.getLocationLongitude()); %> |
7414 |
12 Oct 17 |
nicklas |
425 |
<base:icon href="<%=mapURL%>" image="map.png" tooltip="Show map" visible="<%=mapURL != null %>"/> |
7414 |
12 Oct 17 |
nicklas |
426 |
</tbl:cell> |
7407 |
05 Oct 17 |
nicklas |
427 |
<tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
7407 |
05 Oct 17 |
nicklas |
428 |
<tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> |
7407 |
05 Oct 17 |
nicklas |
429 |
<tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> |
7407 |
05 Oct 17 |
nicklas |
430 |
<tbl:cell column="xt-columns" /> |
7407 |
05 Oct 17 |
nicklas |
431 |
</tbl:xt-cells> |
7407 |
05 Oct 17 |
nicklas |
432 |
</tbl:row> |
7407 |
05 Oct 17 |
nicklas |
433 |
<% |
7407 |
05 Oct 17 |
nicklas |
434 |
} |
7407 |
05 Oct 17 |
nicklas |
435 |
} |
7407 |
05 Oct 17 |
nicklas |
436 |
if (numListed == 0) |
7407 |
05 Oct 17 |
nicklas |
437 |
{ |
7407 |
05 Oct 17 |
nicklas |
438 |
%> |
7407 |
05 Oct 17 |
nicklas |
439 |
<tbl:panel subclass="bg-filled-50"> |
7407 |
05 Oct 17 |
nicklas |
440 |
<div class="messagecontainer note"> |
7407 |
05 Oct 17 |
nicklas |
441 |
<%=devices == null || devices.getTotalCount() == 0 ? "No devices were found" : "No devices on this page. Please select another page!" %> |
7407 |
05 Oct 17 |
nicklas |
442 |
</div> |
7407 |
05 Oct 17 |
nicklas |
443 |
</tbl:panel> |
7407 |
05 Oct 17 |
nicklas |
444 |
<% |
7407 |
05 Oct 17 |
nicklas |
445 |
} |
7407 |
05 Oct 17 |
nicklas |
446 |
%> |
7407 |
05 Oct 17 |
nicklas |
447 |
</tbl:rows> |
7407 |
05 Oct 17 |
nicklas |
448 |
</tbl:data> |
7407 |
05 Oct 17 |
nicklas |
449 |
</tbl:table> |
7407 |
05 Oct 17 |
nicklas |
450 |
</div> |
7407 |
05 Oct 17 |
nicklas |
451 |
|
7407 |
05 Oct 17 |
nicklas |
452 |
<base:buttongroup subclass="dialogbuttons"> |
7407 |
05 Oct 17 |
nicklas |
453 |
<base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
7407 |
05 Oct 17 |
nicklas |
454 |
<base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
7407 |
05 Oct 17 |
nicklas |
455 |
<base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
7407 |
05 Oct 17 |
nicklas |
456 |
</base:buttongroup> |
7407 |
05 Oct 17 |
nicklas |
457 |
|
7407 |
05 Oct 17 |
nicklas |
458 |
</base:body> |
7407 |
05 Oct 17 |
nicklas |
459 |
</base:page> |
7407 |
05 Oct 17 |
nicklas |
460 |
<% |
7407 |
05 Oct 17 |
nicklas |
461 |
} |
7407 |
05 Oct 17 |
nicklas |
462 |
finally |
7407 |
05 Oct 17 |
nicklas |
463 |
{ |
7407 |
05 Oct 17 |
nicklas |
464 |
if (devices != null) devices.close(); |
7407 |
05 Oct 17 |
nicklas |
465 |
if (dc != null) dc.close(); |
7407 |
05 Oct 17 |
nicklas |
466 |
} |
7407 |
05 Oct 17 |
nicklas |
467 |
%> |