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:
noahtalerman 2021-04-14 16:21:00 -07:00 committed by GitHub
parent f9896ace5d
commit 6ebc0a1a08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
};