Changeset 7818 for trunk/www/views/devices/view_device.jsp
- Timestamp:
- Jun 8, 2020, 8:21:32 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/views/devices/view_device.jsp
r7816 r7818 34 34 import="net.sf.basedb.core.plugin.Plugin" 35 35 import="net.sf.basedb.core.Project" 36 import="net.sf.basedb.core.Session" 37 import="net.sf.basedb.core.ItemQuery" 38 import="net.sf.basedb.core.ItemResultList" 39 import="net.sf.basedb.core.query.Orders" 40 import="net.sf.basedb.core.query.Hql" 36 41 import="net.sf.basedb.util.GeoLocation" 37 42 import="net.sf.basedb.util.Values" … … 79 84 String title = null; 80 85 final UserDevice device = UserDevice.getById(dc, itemId); 81 finalString mapURL = GeoLocation.getURLToMap(device.getLocationLatitude(), device.getLocationLongitude());86 String mapURL = GeoLocation.getURLToMap(device.getLocationLatitude(), device.getLocationLongitude()); 82 87 final boolean writePermission = device.hasPermission(Permission.WRITE); 83 88 final boolean deletePermission = device.hasPermission(Permission.DELETE); … … 204 209 </table> 205 210 </div> 211 212 <% 213 ItemQuery<Session> sessionQuery = device.getSessions(); 214 sessionQuery.order(Orders.desc(Hql.property("loginTime"))); 215 sessionQuery.setMaxResults(10); 216 ItemResultList<Session> sessions = sessionQuery.list(dc); 217 %> 218 <base:section 219 id="sessions" 220 title="<%="Recent sessions with this device (max 10)"%>" 221 context="<%=cc%>" 222 > 223 <% 224 if (sessions.size() == 0) 225 { 226 %> 227 <div class="messagecontainer note"> 228 There are no registered sessions with this device. 229 </div> 230 <% 231 } 232 else 233 { 234 %> 235 <tbl:table 236 id="tbl.sessions" 237 columns="all" 238 > 239 <tbl:columndef 240 id="loginTime" 241 title="Login time" 242 /> 243 <tbl:columndef 244 id="logoutTime" 245 title="Logout time" 246 /> 247 <tbl:columndef 248 id="authenticationMethod" 249 title="Authentication method" 250 /> 251 <tbl:columndef 252 id="impersonated" 253 title="Impersonated" 254 /> 255 <tbl:columndef 256 id="remoteId" 257 title="Remote ID" 258 /> 259 <tbl:columndef 260 id="location" 261 title="Location" 262 /> 263 <tbl:columndef 264 id="comment" 265 title="Comment" 266 /> 267 <tbl:data> 268 <tbl:headers> 269 <tbl:headerrow> 270 <tbl:columnheaders /> 271 </tbl:headerrow> 272 </tbl:headers> 273 <tbl:rows> 274 <% 275 for (Session item : sessions) 276 { 277 %> 278 <tbl:row> 279 <tbl:cell column="loginTime"><%=dateTimeFormatter.format(item.getLoginTime())%></tbl:cell> 280 <tbl:cell column="logoutTime"><%=dateTimeFormatter.format(item.getLogoutTime())%></tbl:cell> 281 <tbl:cell column="authenticationMethod"><%=HTML.encodeTags(item.getAuthenticationMethod())%></tbl:cell> 282 <tbl:cell column="impersonated"><%=item.getImpersonated()%></tbl:cell> 283 <tbl:cell column="remoteId"><%=HTML.encodeTags(item.getRemoteId())%></tbl:cell> 284 <tbl:cell column="location"><%=HTML.encodeTags(item.getLocation())%> 285 <% mapURL = GeoLocation.getURLToMap(item.getLocationLatitude(), item.getLocationLongitude()); %> 286 <base:icon href="<%=mapURL%>" image="map.png" tooltip="Show map" visible="<%=mapURL != null %>"/> 287 </tbl:cell> 288 <tbl:cell column="comment"><%=HTML.encodeTags(item.getLoginComment())%></tbl:cell> 289 </tbl:row> 290 <% 291 } 292 %> 293 </tbl:rows> 294 </tbl:data> 295 </tbl:table> 296 <% 297 } 298 %> 299 </base:section> 300 301 206 302 </t:tab> 207 303 </t:tabcontrol>
Note: See TracChangeset
for help on using the changeset viewer.