|
@@ -30,6 +30,9 @@ const Brokers: React.FC = () => {
|
|
|
version,
|
|
|
} = useAppSelector(selectStats);
|
|
|
|
|
|
+ let replicas = inSyncReplicasCount ?? 0;
|
|
|
+ replicas += outOfSyncReplicasCount ?? 0;
|
|
|
+
|
|
|
React.useEffect(() => {
|
|
|
dispatch(fetchClusterStats(clusterName));
|
|
|
}, [fetchClusterStats, clusterName]);
|
|
@@ -78,11 +81,35 @@ const Brokers: React.FC = () => {
|
|
|
of {(onlinePartitionCount || 0) + (offlinePartitionCount || 0)}
|
|
|
</Metrics.LightText>
|
|
|
</Metrics.Indicator>
|
|
|
- <Metrics.Indicator label="URP" title="Under replicated partitions">
|
|
|
- {underReplicatedPartitionCount}
|
|
|
+ <Metrics.Indicator
|
|
|
+ label="URP"
|
|
|
+ title="Under replicated partitions"
|
|
|
+ isAlert
|
|
|
+ alertType={
|
|
|
+ underReplicatedPartitionCount === 0 ? 'success' : 'error'
|
|
|
+ }
|
|
|
+ >
|
|
|
+ {underReplicatedPartitionCount === 0 ? (
|
|
|
+ <Metrics.LightText>
|
|
|
+ {underReplicatedPartitionCount}
|
|
|
+ </Metrics.LightText>
|
|
|
+ ) : (
|
|
|
+ <Metrics.RedText>{underReplicatedPartitionCount}</Metrics.RedText>
|
|
|
+ )}
|
|
|
</Metrics.Indicator>
|
|
|
- <Metrics.Indicator label="In Sync Replicas">
|
|
|
- {inSyncReplicasCount}
|
|
|
+ <Metrics.Indicator
|
|
|
+ label="In Sync Replicas"
|
|
|
+ isAlert
|
|
|
+ alertType={inSyncReplicasCount === replicas ? 'success' : 'error'}
|
|
|
+ >
|
|
|
+ {inSyncReplicasCount &&
|
|
|
+ replicas &&
|
|
|
+ inSyncReplicasCount < replicas ? (
|
|
|
+ <Metrics.RedText>{inSyncReplicasCount}</Metrics.RedText>
|
|
|
+ ) : (
|
|
|
+ inSyncReplicasCount
|
|
|
+ )}
|
|
|
+ <Metrics.LightText> of {replicas}</Metrics.LightText>
|
|
|
</Metrics.Indicator>
|
|
|
<Metrics.Indicator label="Out Of Sync Replicas">
|
|
|
{outOfSyncReplicasCount}
|