# HG changeset patch # User Kim Alvefur # Date 1680864497 -7200 # Node ID 1612c7f7dd55b6ea0115b28d8085f1386eb4b797 # Parent 93c1590b5951b5ec8b4bd4718ad3a4dd709a0bd5 mod_admin_shell: More dynamic widths calculations diff -r 93c1590b5951 -r 1612c7f7dd55 plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Thu Apr 06 17:07:09 2023 +0200 +++ b/plugins/mod_admin_shell.lua Fri Apr 07 12:48:17 2023 +0200 @@ -815,8 +815,19 @@ 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 @@ 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();