mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Handle hosts that have not had details updated in "Hosts" table (#642)
- Render "Never" in the "Last fetched" column if the value of `detail_updated_at` is improbable. Resolves #639
This commit is contained in:
parent
f9896ace5d
commit
6ebc0a1a08
1 changed files with 7 additions and 0 deletions
|
|
@ -291,6 +291,13 @@ export const humanHostMemory = (bytes: number): string => {
|
|||
};
|
||||
|
||||
export const humanHostDetailUpdated = (detailUpdated: string): string => {
|
||||
// Handles the case when a host has checked in to Fleet but
|
||||
// its details haven't been updated.
|
||||
// July 28, 2016 is the date of the initial commit to kolide/fleet.
|
||||
if (detailUpdated < "2016-07-28T00:00:00Z") {
|
||||
return "Never";
|
||||
}
|
||||
|
||||
return moment(detailUpdated).fromNow();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue