1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(homepage) move heartbeat logic to backend EE-5317 (#8737)

This commit is contained in:
cmeng 2023-04-06 09:09:22 +12:00 committed by GitHub
parent 8c5edd2c97
commit b00aa68c2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 52 additions and 70 deletions

View file

@ -1,7 +1,6 @@
import { Activity } from 'lucide-react';
import { isoDateFromTimestamp } from '@/portainer/filters/filters';
import { useHasHeartbeat } from '@/react/edge/hooks/useHasHeartbeat';
import { Environment } from '@/react/portainer/environments/types';
import { EnvironmentStatusBadgeItem } from './EnvironmentStatusBadgeItem';
@ -13,14 +12,9 @@ interface Props {
export function EdgeIndicator({
environment,
showLastCheckInDate = false,
}: Props) {
const isValid = useHasHeartbeat(environment);
if (isValid === null) {
return null;
}
const heartbeat = environment.Heartbeat;
const associated = !!environment.EdgeID;
if (!associated) {
@ -40,8 +34,8 @@ export function EdgeIndicator({
className="flex items-center gap-1"
>
<EnvironmentStatusBadgeItem
color={isValid ? 'success' : 'danger'}
icon={isValid ? 'svg-heartbeatup' : 'svg-heartbeatdown'}
color={heartbeat ? 'success' : 'danger'}
icon={heartbeat ? 'svg-heartbeatup' : 'svg-heartbeatdown'}
aria-label="edge-heartbeat"
>
heartbeat