--- a/mod_client_management/mod_client_management.lua Tue Aug 08 17:04:50 2023 +0200
+++ b/mod_client_management/mod_client_management.lua Wed Aug 16 11:17:28 2023 +0200
@@ -437,6 +437,10 @@
return true, "No clients associated with this account";
end
+ local function date_or_time(last_seen)
+ return last_seen and os.date(os.difftime(os.time(), last_seen) >= 86400 and "%Y-%m-%d" or "%H:%M:%S", last_seen);
+ end
+
local colspec = {
{ title = "ID"; key = "id"; width = "1p" };
{
@@ -446,13 +450,18 @@
mapper = user_agent_tostring;
};
{
+ title = "First seen";
+ key = "first_seen";
+ width = math.max(#os.date("%Y-%m-%d"), #os.date("%H:%M:%S"));
+ align = "right";
+ mapper = date_or_time;
+ };
+ {
title = "Last seen";
key = "last_seen";
width = math.max(#os.date("%Y-%m-%d"), #os.date("%H:%M:%S"));
align = "right";
- mapper = function(last_seen)
- return last_seen and os.date(os.difftime(os.time(), last_seen) >= 86400 and "%Y-%m-%d" or "%H:%M:%S", last_seen);
- end;
+ mapper = date_or_time;
};
{
title = "Authentication";