Comparison

mod_client_management/mod_client_management.lua @ 5374:d9397d6a5513

mod_client_management: Show time for recent timestamps in shell command Semi-fuzzy time is nice
author Kim Alvefur <zash@zash.se>
date Wed, 26 Apr 2023 12:42:09 +0200
parent 5373:93d6ed7dc779
child 5516:f25df3af02c1
comparison
equal deleted inserted replaced
5373:93d6ed7dc779 5374:d9397d6a5513
427 end; 427 end;
428 }; 428 };
429 { 429 {
430 title = "Last seen"; 430 title = "Last seen";
431 key = "last_seen"; 431 key = "last_seen";
432 width = 10; 432 width = math.max(#os.date("%Y-%m-%d"), #os.date("%H:%M:%S"));
433 align = "right";
433 mapper = function(last_seen) 434 mapper = function(last_seen)
434 return os.date("%Y-%m-%d", last_seen); 435 return os.date(os.difftime(os.time(), last_seen) >= 86400 and "%Y-%m-%d" or "%H:%M:%S", last_seen);
435 end; 436 end;
436 }; 437 };
437 { 438 {
438 title = "Authentication"; 439 title = "Authentication";
439 key = "active"; 440 key = "active";