mod_admin_shell: Make IP column thinner if IPv6 is disabled
authorKim Alvefur <zash@zash.se>
Fri, 07 Apr 2023 13:09:00 +0200
changeset 13047 d4f7118d1531
parent 13046 0f05804e974d
child 13048 5bd272095388
mod_admin_shell: Make IP column thinner if IPv6 is disabled IPv6 addresses can be pretty long, so if they can be more compact, that's nice. But nobody would disable IPv6, would they?
plugins/mod_admin_shell.lua
--- a/plugins/mod_admin_shell.lua	Fri Apr 07 13:07:00 2023 +0200
+++ b/plugins/mod_admin_shell.lua	Fri Apr 07 13:09:00 2023 +0200
@@ -852,7 +852,7 @@
 	ip = {
 		title = "IP address";
 		description = "IP address the session connected from";
-		width = #"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff";
+		width = module:get_option_boolean("use_ipv6", true) and #"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" or #"198.051.100.255";
 		key = "ip";
 	};
 	status = {