MMM-NetworkScanner icon indicating copy to clipboard operation
MMM-NetworkScanner copied to clipboard

showLastSeen option only shows as 'a few seconds ago'

Open E3V3A opened this issue 6 years ago • 3 comments

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?

E3V3A avatar May 04 '18 06:05 E3V3A

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.

E3V3A avatar May 04 '18 08:05 E3V3A

How is the last seen text string constructed? I.e. a few seconds ago.

  1. I would like to get rid of that (since it is redundant) for the devices that are already shown as online.
  2. I would like to change it to:
  • < T sec for new online devices, that has appeared in the last scan interval of T.
  • X min || X hours for others

E3V3A avatar May 09 '18 07:05 E3V3A

@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.

ianperrin avatar May 10 '18 21:05 ianperrin