MMM-NetworkScanner
MMM-NetworkScanner copied to clipboard
showLastSeen option only shows as 'a few seconds ago'
Currently, when using the showLastSeen
option, your entire lists, shows:
a few seconds ago
, which is redundant, IMO.
Instead, it would be preferred that the last seen is:
- only shown for devices that are were not present in the last scan, but within the
keepAlive
interval. - is shown in minutes, or something like:
2 min ago
.
I realize this may be dependent on showOffline
.
@ianperrin What do you think?
I just noticed that when using both: showOffline
and showLastSeen
, the last seen is not shown for offline devices...which kind of defeats the purpose. That also causes the table columns for the device name to be misaligned.
How is the last seen text string constructed? I.e. a few seconds ago
.
- I would like to get rid of that (since it is redundant) for the devices that are already shown as online.
- I would like to change it to:
-
< T sec
for new online devices, that has appeared in the last scan interval ofT
. -
X min
||X hours
for others
@E3V3A - it looks like there are some issues with the way the last seen time is calculated. I’ll need to trace the code for this at some point.
The value should be updated each time the device is found online and then displayed in a format relative to the current time using the moment library.
Once the value is being correctly set, the display should work in a similar way to how you’ve suggested.