From 3b0083244d5879e7e8cc7d527502663e142fd034 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Wed, 20 Nov 2024 19:16:19 +0100 Subject: [PATCH] OF-2729: Ipv6-related admin console tweaks Adding a 'family type' in the S2S session overview, that signals if a connection to a remote domain is using IPv4 or IPv6 (or both). Layout of the table is done better by the browser than our guestimates based on width. --- .../main/resources/openfire_i18n.properties | 1 + .../resources/openfire_i18n_nl.properties | 1 + .../main/webapp/server-session-details.jsp | 40 +++++++++---------- .../src/main/webapp/server-session-row.jspf | 37 ++++++++++++++--- .../main/webapp/server-session-summary.jsp | 3 +- 5 files changed, 55 insertions(+), 27 deletions(-) diff --git a/i18n/src/main/resources/openfire_i18n.properties b/i18n/src/main/resources/openfire_i18n.properties index 7017cf18ff..291a4e6f8e 100644 --- a/i18n/src/main/resources/openfire_i18n.properties +++ b/i18n/src/main/resources/openfire_i18n.properties @@ -1778,6 +1778,7 @@ server.session.summary.not_session=No Sessions server.session.summary.last_update=List last updated server.session.label.host=Host server.session.label.connection=Connection +server.session.label.protocol=Protocol server.session.label.creation=Creation Date server.session.label.last_active=Last Activity server.session.label.close_connect=Close Connection diff --git a/i18n/src/main/resources/openfire_i18n_nl.properties b/i18n/src/main/resources/openfire_i18n_nl.properties index ba9e4906b0..0e25ad5b53 100644 --- a/i18n/src/main/resources/openfire_i18n_nl.properties +++ b/i18n/src/main/resources/openfire_i18n_nl.properties @@ -1609,6 +1609,7 @@ server.session.summary.not_session=Geen sessies server.session.summary.last_update=Lijst laatst ge�pdate server.session.label.host=Computernaam server.session.label.connection=Verbinding +server.session.label.protocol=Protocol server.session.label.creation=Aangemaakt server.session.label.last_active=Laatste activiteit server.session.label.close_connect=Verbinding sluiten diff --git a/xmppserver/src/main/webapp/server-session-details.jsp b/xmppserver/src/main/webapp/server-session-details.jsp index 3f7fe644fc..4783c7dc24 100644 --- a/xmppserver/src/main/webapp/server-session-details.jsp +++ b/xmppserver/src/main/webapp/server-session-details.jsp @@ -261,22 +261,22 @@ - + - + - - - - - - - + + + + + + + - -
+ An encrypted connection @@ -299,7 +299,7 @@ + @@ -326,17 +326,17 @@ - + - + - - - - - - - + + + + + + + diff --git a/xmppserver/src/main/webapp/server-session-row.jspf b/xmppserver/src/main/webapp/server-session-row.jspf index e26178a86e..a7a2c93dbc 100644 --- a/xmppserver/src/main/webapp/server-session-row.jspf +++ b/xmppserver/src/main/webapp/server-session-row.jspf @@ -4,9 +4,9 @@ <%@ page import="org.jivesoftware.openfire.session.IncomingServerSession, org.jivesoftware.util.JiveGlobals, org.jivesoftware.util.StringUtils, - java.net.URLEncoder, java.util.Calendar, java.util.Date"%> + <%@ page import="java.net.*" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> @@ -65,19 +65,44 @@ - + <% } else if (inSessions.isEmpty() && !outSessions.isEmpty()) { %> - + <% } else { %> - + <% } %> + <% + final boolean hasIPv4 = inSessions.stream().anyMatch(s-> { + try { + return InetAddress.getByName(s.getHostAddress()) instanceof Inet4Address; + } catch (UnknownHostException e) { + return false; + } + }); + final boolean hasIPv6 = inSessions.stream().anyMatch(s-> { + try { + return InetAddress.getByName(s.getHostAddress()) instanceof Inet6Address; + } catch (UnknownHostException e) { + return false; + } + }); + %> + <% if (hasIPv4 && hasIPv6) { %> + + <% } else if (hasIPv4) { %> + + <% } else if (hasIPv6) { %> + + <% } else { %> + + <% } %> <% Date creationDate = null; Date lastActiveDate = null; @@ -128,10 +153,10 @@ %> - - diff --git a/xmppserver/src/main/webapp/server-session-summary.jsp b/xmppserver/src/main/webapp/server-session-summary.jsp index 2bb53cd3e7..fa4df2578f 100644 --- a/xmppserver/src/main/webapp/server-session-summary.jsp +++ b/xmppserver/src/main/webapp/server-session-summary.jsp @@ -170,6 +170,7 @@ + @@ -180,7 +181,7 @@ if (domainNames.isEmpty()) { %> -
<fmt:message key='server.session.connection.incoming' /> <fmt:message key='server.session.connection.outgoing' /> <fmt:message key='server.session.connection.both' /> + <%= creationDateString %> + <%= lastActivityString %>  
+