Skip to content

Commit

Permalink
frontend: Add pod metrics to owned pods section
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksandr Dubenko <[email protected]>
  • Loading branch information
sniok committed Dec 10, 2024
1 parent 0ece0f3 commit 37b420d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/components/common/Resource/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { KubeObject } from '../../../lib/k8s/KubeObject';
import { KubeObjectInterface } from '../../../lib/k8s/KubeObject';
import { KubeObjectClass } from '../../../lib/k8s/KubeObject';
import Pod, { KubePod, KubeVolume } from '../../../lib/k8s/pod';
import { METRIC_REFETCH_INTERVAL_MS, PodMetrics } from '../../../lib/k8s/PodMetrics';
import { createRouteURL, RouteURLProps } from '../../../lib/router';
import { getThemeName } from '../../../lib/themes';
import { localeDate, useId } from '../../../lib/util';
Expand Down Expand Up @@ -976,6 +977,10 @@ export function OwnedPodsSection(props: OwnedPodsSectionProps) {
};

const [pods, error] = Pod.useList(queryData);
const { items: podMetrics } = PodMetrics.useList({
...queryData,
refetchInterval: METRIC_REFETCH_INTERVAL_MS,
});
const onlyOneNamespace = !!resource.metadata.namespace || resource.kind === 'Namespace';
const hideNamespaceFilter = onlyOneNamespace || noSearch;

Expand All @@ -984,6 +989,7 @@ export function OwnedPodsSection(props: OwnedPodsSectionProps) {
hideColumns={hideColumns || onlyOneNamespace ? ['namespace'] : undefined}
pods={pods}
error={error}
metrics={podMetrics}
noNamespaceFilter={hideNamespaceFilter}
/>
);
Expand Down

0 comments on commit 37b420d

Please sign in to comment.