From 348f8c652d3636c390855ea9e4520bca4ebf677b Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Wed, 9 Sep 2026 20:15:44 +0200 Subject: [PATCH] OF-3365: Fix client session table Fixes the rendering of data on the table below the client session details, showing all sessions for the same user. I've also replaced the stale background-color-based legend with style-based indicator. (cherry picked from commit 8ec5ee8ce747047bd5a033b8a428d04f51d572b9) --- .../main/resources/openfire_i18n.properties | 1 + .../resources/openfire_i18n_nl.properties | 1 + .../src/main/webapp/session-details.jsp | 49 +++++++++---------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/i18n/src/main/resources/openfire_i18n.properties b/i18n/src/main/resources/openfire_i18n.properties index 8a7fc88d06..88a8e89bdf 100644 --- a/i18n/src/main/resources/openfire_i18n.properties +++ b/i18n/src/main/resources/openfire_i18n.properties @@ -1843,6 +1843,7 @@ session.details.version=Client Version session.details.if_presence=Presence (if authenticated) session.details.clientip=Client IP session.details.close_connect=Close Connection +session.details.session_detail_current_index=Session {0} session.details.session_detail=Current session details above. session.details.back_button=Back to Summary session.details.node=Cluster Node diff --git a/i18n/src/main/resources/openfire_i18n_nl.properties b/i18n/src/main/resources/openfire_i18n_nl.properties index 33c3123ba0..9463b9d8b7 100644 --- a/i18n/src/main/resources/openfire_i18n_nl.properties +++ b/i18n/src/main/resources/openfire_i18n_nl.properties @@ -1710,6 +1710,7 @@ session.details.version=Client Versie session.details.if_presence=Status informatie (indien aangemeld) session.details.clientip=Client IP session.details.close_connect=Verbinding verbreken +session.details.session_detail_current_index=Sessie {0} session.details.session_detail=Informatie over de huidige sessie staat hierboven. session.details.back_button=Terug naar overzicht session.details.node=Node diff --git a/xmppserver/src/main/webapp/session-details.jsp b/xmppserver/src/main/webapp/session-details.jsp index e452d0f772..a8c05107dc 100644 --- a/xmppserver/src/main/webapp/session-details.jsp +++ b/xmppserver/src/main/webapp/session-details.jsp @@ -125,11 +125,8 @@ } // See if there are multiple sessions for this user: - Collection sessions = null; - int sessionCount = sessionManager.getSessionCount(address.getNode()); - if (!isAnonymous && sessionCount > 1) { - sessions = sessionManager.getSessions(address); - } + final Collection sessions = sessionManager.getSessions(isAnonymous ? address : address.asBareJID()); + final int sessionCount = sessions.size(); // Number dateFormatter for all numbers on this page: NumberFormat numFormatter = NumberFormat.getNumberInstance(); @@ -667,39 +664,41 @@ - <% int count = 0; + <% pageContext.setAttribute("showName", true); + pageContext.setAttribute("showResource", false); + pageContext.setAttribute("showVersion", true); + pageContext.setAttribute("showClusterNode", true); + pageContext.setAttribute("showStatus", true); + pageContext.setAttribute("showPresence", true); + pageContext.setAttribute("showRxTx", true); + pageContext.setAttribute("showIp", true); + + int count = 0; + int currentIndex = 0; String linkURL = "session-details.jsp"; for (ClientSession sess : sessions) { count++; boolean current = sess.getAddress().equals(address); + if (current) { + currentIndex = count; + } %> <%@ include file="session-row.jspf" %> - <% } %> + <% } + pageContext.setAttribute("currentIndex", currentIndex); + %>
- - - - - -
- -
- - -
-
- -
- -   = - -
+ + + + + = <% } %>