diff --git a/frontend/src/components/Brokers/Brokers.tsx b/frontend/src/components/Brokers/Brokers.tsx index 07706a4471..b272cd9f77 100644 --- a/frontend/src/components/Brokers/Brokers.tsx +++ b/frontend/src/components/Brokers/Brokers.tsx @@ -3,6 +3,8 @@ import { ClusterId, BrokerMetrics, ZooKeeperStatus } from 'types'; import useInterval from 'lib/hooks/useInterval'; import formatBytes from 'lib/utils/formatBytes'; import cx from 'classnames'; +import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper'; +import Indicator from 'components/common/Dashboard/Indicator'; interface Props extends BrokerMetrics { clusterId: string; @@ -43,126 +45,74 @@ const Topics: React.FC = ({ const [minDiskUsageValue, minDiskUsageSize] = formatBytes(minDiskUsage); const [maxDiskUsageValue, maxDiskUsageSize] = formatBytes(maxDiskUsage); + const zkOnline = zooKeeperStatus === ZooKeeperStatus.online; + return (
-
-
Uptime
-
-
-
-

Total Brokers

-

{brokerCount}

-
-
-
-
-

Active Controllers

-

{activeControllers}

-
-
-
-
-

Zookeeper Status

-

- {zooKeeperStatus === ZooKeeperStatus.online ? ( - Online - ) : ( - Offline - )} -

-
-
-
-
+

Brokers overview

-
-
Partitions
-
-
-
-

Online

-

- - {onlinePartitionCount} - - of {onlinePartitionCount + offlinePartitionCount} -

-
-
-
-
-

Under Replicated

-

{underReplicatedPartitionCount}

-
-
-
-
-

In Sync Replicas

-

Soon

-
-
-
-
-

Out of Sync Replicas

-

Soon

-
-
-
-
+ + + {brokerCount} + + + {activeControllers} + + + + {zkOnline ? 'Online' : 'Offline'} + + + -
-
Disk
-
-
-
-

Max usage

-

- {maxDiskUsageValue} - {maxDiskUsageSize} -

-
-
-
-
-

Min Usage

-

- {minDiskUsageValue} - {minDiskUsageSize} -

-
-
-
-
-

Distribution

-

{diskUsageDistribution}

-
-
-
-
+ + + + {onlinePartitionCount} + + of {onlinePartitionCount + offlinePartitionCount} + + + {underReplicatedPartitionCount} + + + + Soon + + + + + Soon + + + -
-
System
-
-
-
-

Network pool usage

-

- {Math.round(networkPoolUsage * 10000) / 100} - % -

-
-
-
-
-

Request pool usage

-

- {Math.round(requestPoolUsage * 10000) / 100} - % -

-
-
-
-
+ + + {maxDiskUsageValue} + {maxDiskUsageSize} + + + {minDiskUsageValue} + {minDiskUsageValue} + + + + {diskUsageDistribution} + + + + + + + {Math.round(networkPoolUsage * 10000) / 100} + % + + + {Math.round(requestPoolUsage * 10000) / 100} + % + +
); } diff --git a/frontend/src/components/common/Dashboard/Indicator.tsx b/frontend/src/components/common/Dashboard/Indicator.tsx new file mode 100644 index 0000000000..f1b136da14 --- /dev/null +++ b/frontend/src/components/common/Dashboard/Indicator.tsx @@ -0,0 +1,21 @@ +import React from 'react'; + +interface Props { + title: string; +} + +const Indicator: React.FC = ({ + title, + children, +}) => { + return ( +
+
+

{title}

+

{children}

+
+
+ ); +} + +export default Indicator; diff --git a/frontend/src/components/common/Dashboard/MetricsWrapper.tsx b/frontend/src/components/common/Dashboard/MetricsWrapper.tsx new file mode 100644 index 0000000000..cc305939d1 --- /dev/null +++ b/frontend/src/components/common/Dashboard/MetricsWrapper.tsx @@ -0,0 +1,23 @@ +import React from 'react'; + +interface Props { + title: string; +} + +const MetricsWrapper: React.FC = ({ + title, + children, +}) => { + return ( +
+
+ {title} +
+
+ {children} +
+
+ ); +} + +export default MetricsWrapper;