From 6b7f222e6c1ccc8cece6565883e92bce48535c53 Mon Sep 17 00:00:00 2001 From: Joaquim Rocha Date: Thu, 30 Mar 2023 15:38:19 +0100 Subject: [PATCH] frontend: PodList: Make multi cluster aware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: René Dudfield Co-authored-by: René Dudfield Signed-off-by: Joaquim Rocha --- frontend/src/components/pod/List.tsx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/pod/List.tsx b/frontend/src/components/pod/List.tsx index 7a50b93727..d61be5da65 100644 --- a/frontend/src/components/pod/List.tsx +++ b/frontend/src/components/pod/List.tsx @@ -9,6 +9,7 @@ import { HeadlampEventType, useEventCallback } from '../../redux/headlampEventSl import { LightTooltip, Link, SimpleTableProps } from '../common'; import { StatusLabel, StatusLabelProps } from '../common/Label'; import ResourceListView from '../common/Resource/ResourceListView'; +import { ResourceTableProps } from '../common/Resource/ResourceTable'; export function makePodStatusLabel(pod: Pod) { const phase = pod.status.phase; @@ -71,10 +72,18 @@ export interface PodListProps { hideColumns?: ('namespace' | 'restarts')[]; reflectTableInURL?: SimpleTableProps['reflectInURL']; noNamespaceFilter?: boolean; + clusterErrors?: ResourceTableProps['clusterErrors']; } export function PodListRenderer(props: PodListProps) { - const { pods, error, hideColumns = [], reflectTableInURL = 'pods', noNamespaceFilter } = props; + const { + pods, + error, + hideColumns = [], + reflectTableInURL = 'pods', + noNamespaceFilter, + clusterErrors, + } = props; const { t } = useTranslation(['glossary', 'translation']); return ( @@ -207,13 +216,15 @@ export function PodListRenderer(props: PodListProps) { ]} data={pods} reflectInURL={reflectTableInURL} + clusterErrors={clusterErrors} id="headlamp-pods" /> ); } export default function PodList() { - const [pods, error] = Pod.useList(); + const [pods, error, , , errorsPerCluster] = Pod.useList(); + const dispatchHeadlampEvent = useEventCallback(HeadlampEventType.LIST_VIEW); React.useEffect(() => { @@ -224,5 +235,12 @@ export default function PodList() { }); }, [pods, error]); - return ; + return ( + + ); }