Diff

mod_audit/mod_audit.lua @ 5322:eb832553d635

mod_audit: Use proportional columns in table output
author Matthew Wild <mwild1@gmail.com>
date Fri, 07 Apr 2023 13:09:51 +0100
parent 5321:d02f465e2aff
child 5323:400ffa842576
line wrap: on
line diff
--- a/mod_audit/mod_audit.lua	Fri Apr 07 13:09:31 2023 +0100
+++ b/mod_audit/mod_audit.lua	Fri Apr 07 13:09:51 2023 +0100
@@ -151,13 +151,13 @@
 
 	local colspec = {
 		{ title = "Date", key = "when", width = 19, mapper = function (when) return os.date("%Y-%m-%d %R:%S", when); end };
-		{ title = "Source", key = "source", width = 18 };
-		{ title = "Event", key = "event_type", width = 22 };
+		{ title = "Source", key = "source", width = "2p" };
+		{ title = "Event", key = "event_type", width = "2p" };
 	};
 
 	if not arg.global then
 		table.insert(colspec, {
-			title = "User", key = "username", width = 30,
+			title = "User", key = "username", width = "2p",
 			mapper = function (user)
 				if user == "@" then return ""; end
 				if user:sub(-#host-1, -1) == ("@"..host) then
@@ -168,7 +168,7 @@
 
 		if attach_ips then
 			table.insert(colspec, {
-				title = "IP", key = "ip", width = "28";
+				title = "IP", key = "ip", width = "2p";
 			});
 		end
 		if attach_location then