aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-04-07 12:48:17 +0200
committerKim Alvefur <zash@zash.se>2023-04-07 12:48:17 +0200
commitab15502d8b3f9aace5f16e33a7835abb62eeba97 (patch)
tree408b8352dd8f4bcfe7bf23cda64953b139fb245f /plugins
parent31427da24f5e06893a17d8c5da8be43290ec4479 (diff)
downloadprosody-ab15502d8b3f9aace5f16e33a7835abb62eeba97.tar.gz
prosody-ab15502d8b3f9aace5f16e33a7835abb62eeba97.zip
mod_admin_shell: More dynamic widths calculations
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_shell.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua
index 26060150..302bef9c 100644
--- a/plugins/mod_admin_shell.lua
+++ b/plugins/mod_admin_shell.lua
@@ -815,8 +815,19 @@ available_columns = {
if dir == "incoming" then return "<--"; end
end;
};
- id = { title = "Session ID"; description = "Internal session ID used in logging"; width = 20; key = "id" };
- type = { title = "Type"; description = "Session type"; width = #"c2s_unauthed"; key = "type" };
+ id = {
+ title = "Session ID";
+ description = "Internal session ID used in logging";
+ -- Depends on log16(?) of pointers which may vary over runtime, so + some margin
+ width = math.max(#"c2s", #"s2sin", #"s2sout") + #(tostring({}):match("%x+$")) + 2;
+ key = "id";
+ };
+ type = {
+ title = "Type";
+ description = "Session type";
+ width = math.max(#"c2s_unauthed", #"s2sout_unauthed");
+ key = "type";
+ };
method = {
title = "Method";
description = "Connection method";
@@ -870,7 +881,7 @@ available_columns = {
title = "Encryption";
description = "Encryption algorithm used (TLS cipher suite)";
-- openssl ciphers 'ALL:COMPLEMENTOFALL' | tr : \\n | awk 'BEGIN {n=1} length() > n {n=length()} END {print(n)}'
- width = 30;
+ width = #"ECDHE-ECDSA-CHACHA20-POLY1305";
key = "conn";
mapper = function(conn)
local info = conn and conn.ssl_info and conn:ssl_info();