ianperrin / MMM-NetworkScanner

A module for MagicMirror which determines the status of devices on the network based on their MAC or IP address

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

showLastSeen option only shows as 'a few seconds ago'

E3V3A opened this issue · comments

commented

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?

commented

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.

commented

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
commented

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