@@ -5,21 +5,23 @@ import { Tag } from 'components/common/Tag/Tag.styled';
55import Switch from 'components/common/Switch/Switch' ;
66import { useClusters } from 'lib/hooks/api/clusters' ;
77import { Cluster , ResourceType , ServerStatus } from 'generated-sources' ;
8- import { ColumnDef } from '@tanstack/react-table' ;
8+ import { ColumnDef , Row } from '@tanstack/react-table' ;
99import Table , { SizeCell } from 'components/common/NewTable' ;
1010import useBoolean from 'lib/hooks/useBoolean' ;
11- import { clusterNewConfigPath } from 'lib/paths' ;
11+ import { clusterBrokersPath , clusterNewConfigPath } from 'lib/paths' ;
1212import { GlobalSettingsContext } from 'components/contexts/GlobalSettingsContext' ;
1313import { ActionCanButton } from 'components/common/ActionComponent' ;
1414import { useGetUserInfo } from 'lib/hooks/api/roles' ;
1515import { useLocalStoragePersister } from 'components/common/NewTable/ColumnResizer/lib' ;
16+ import { useNavigate } from 'react-router-dom' ;
1617
1718import * as S from './Dashboard.styled' ;
1819import ClusterName from './ClusterName' ;
1920import ClusterTableActionsCell from './ClusterTableActionsCell' ;
2021
2122const Dashboard : React . FC = ( ) => {
2223 const { data } = useGetUserInfo ( ) ;
24+ const navigate = useNavigate ( ) ;
2325 const clusters = useClusters ( ) ;
2426 const { value : showOfflineOnly , toggle } = useBoolean ( false ) ;
2527 const appInfo = React . useContext ( GlobalSettingsContext ) ;
@@ -92,6 +94,10 @@ const Dashboard: React.FC = () => {
9294
9395 const columnSizingPersister = useLocalStoragePersister ( 'KafkaConnect' ) ;
9496
97+ const onRowClick = ( row : Row < Cluster > ) => {
98+ navigate ( clusterBrokersPath ( row . original . name ) ) ;
99+ } ;
100+
95101 return (
96102 < >
97103 < PageHeading text = "Dashboard" />
@@ -128,6 +134,7 @@ const Dashboard: React.FC = () => {
128134 ) }
129135 </ S . Toolbar >
130136 < Table
137+ onRowClick = { onRowClick }
131138 columns = { columns }
132139 data = { config ?. list }
133140 enableSorting
0 commit comments