From c31d0480a1b91cf01a660fd1d9726c6708f7c252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9C=D1=83=D1=84=D0=B0?= =?UTF-8?q?=D0=B7=D0=B0=D0=BB=D0=BE=D0=B2?= <67755036+artemmufazalov@users.noreply.github.com> Date: Fri, 1 Dec 2023 17:58:32 +0300 Subject: [PATCH] feat(ClusterInfo): display groups stats (#598) --- .../ProgressViewer/ProgressViewer.tsx | 2 +- src/containers/Cluster/Cluster.tsx | 2 + .../Cluster/ClusterInfo/ClusterInfo.scss | 19 ++- .../Cluster/ClusterInfo/ClusterInfo.tsx | 128 ++++++++++++++---- .../ClusterInfoSkeleton.tsx | 2 +- src/containers/Cluster/i18n/en.json | 16 +++ src/containers/Cluster/i18n/index.ts | 11 ++ src/containers/Cluster/i18n/ru.json | 16 +++ .../parseGroupsStatsQueryResponse.test.ts | 121 +++++++++++++++++ src/store/reducers/cluster/cluster.ts | 48 ++++++- src/store/reducers/cluster/types.ts | 33 ++++- src/store/reducers/cluster/utils.ts | 88 ++++++++++++ src/types/api/cluster.ts | 3 + 13 files changed, 452 insertions(+), 37 deletions(-) create mode 100644 src/containers/Cluster/i18n/en.json create mode 100644 src/containers/Cluster/i18n/index.ts create mode 100644 src/containers/Cluster/i18n/ru.json create mode 100644 src/store/reducers/cluster/__test__/parseGroupsStatsQueryResponse.test.ts create mode 100644 src/store/reducers/cluster/utils.ts diff --git a/src/components/ProgressViewer/ProgressViewer.tsx b/src/components/ProgressViewer/ProgressViewer.tsx index af433e748..f35ebf519 100644 --- a/src/components/ProgressViewer/ProgressViewer.tsx +++ b/src/components/ProgressViewer/ProgressViewer.tsx @@ -44,7 +44,7 @@ Props description: interface ProgressViewerProps { value?: number | string; capacity?: number | string; - formatValues?: (value?: number, capacity?: number) => (string | undefined)[]; + formatValues?: (value?: number, capacity?: number) => (string | number | undefined)[]; percents?: boolean; className?: string; size?: ProgressViewerSize; diff --git a/src/containers/Cluster/Cluster.tsx b/src/containers/Cluster/Cluster.tsx index 41c91e1b8..52e18bad0 100644 --- a/src/containers/Cluster/Cluster.tsx +++ b/src/containers/Cluster/Cluster.tsx @@ -68,6 +68,7 @@ function Cluster({ loading: clusterLoading, wasLoaded: clusterWasLoaded, error: clusterError, + groupsStats, } = useTypedSelector((state) => state.cluster); const { nodes, @@ -135,6 +136,7 @@ function Cluster({