Comparison

mod_client_management/mod_client_management.lua @ 5606:da69496180e7

mod_client_management: Fix traceback if no last seen timestamp available
author Kim Alvefur <zash@zash.se>
date Fri, 14 Jul 2023 16:09:43 +0200
parent 5604:5ade45d93908
child 5607:c799b460f9f0
comparison
equal deleted inserted replaced
5605:b496ebc12aed 5606:da69496180e7
449 title = "Last seen"; 449 title = "Last seen";
450 key = "last_seen"; 450 key = "last_seen";
451 width = math.max(#os.date("%Y-%m-%d"), #os.date("%H:%M:%S")); 451 width = math.max(#os.date("%Y-%m-%d"), #os.date("%H:%M:%S"));
452 align = "right"; 452 align = "right";
453 mapper = function(last_seen) 453 mapper = function(last_seen)
454 return os.date(os.difftime(os.time(), last_seen) >= 86400 and "%Y-%m-%d" or "%H:%M:%S", last_seen); 454 return last_seen and os.date(os.difftime(os.time(), last_seen) >= 86400 and "%Y-%m-%d" or "%H:%M:%S", last_seen);
455 end; 455 end;
456 }; 456 };
457 { 457 {
458 title = "Authentication"; 458 title = "Authentication";
459 key = "active"; 459 key = "active";