@@ -5,21 +5,23 @@ import { Tag } from 'components/common/Tag/Tag.styled';
5
5
import Switch from 'components/common/Switch/Switch' ;
6
6
import { useClusters } from 'lib/hooks/api/clusters' ;
7
7
import { Cluster , ResourceType , ServerStatus } from 'generated-sources' ;
8
- import { ColumnDef } from '@tanstack/react-table' ;
8
+ import { ColumnDef , Row } from '@tanstack/react-table' ;
9
9
import Table , { SizeCell } from 'components/common/NewTable' ;
10
10
import useBoolean from 'lib/hooks/useBoolean' ;
11
- import { clusterNewConfigPath } from 'lib/paths' ;
11
+ import { clusterBrokersPath , clusterNewConfigPath } from 'lib/paths' ;
12
12
import { GlobalSettingsContext } from 'components/contexts/GlobalSettingsContext' ;
13
13
import { ActionCanButton } from 'components/common/ActionComponent' ;
14
14
import { useGetUserInfo } from 'lib/hooks/api/roles' ;
15
15
import { useLocalStoragePersister } from 'components/common/NewTable/ColumnResizer/lib' ;
16
+ import { useNavigate } from 'react-router-dom' ;
16
17
17
18
import * as S from './Dashboard.styled' ;
18
19
import ClusterName from './ClusterName' ;
19
20
import ClusterTableActionsCell from './ClusterTableActionsCell' ;
20
21
21
22
const Dashboard : React . FC = ( ) => {
22
23
const { data } = useGetUserInfo ( ) ;
24
+ const navigate = useNavigate ( ) ;
23
25
const clusters = useClusters ( ) ;
24
26
const { value : showOfflineOnly , toggle } = useBoolean ( false ) ;
25
27
const appInfo = React . useContext ( GlobalSettingsContext ) ;
@@ -92,6 +94,10 @@ const Dashboard: React.FC = () => {
92
94
93
95
const columnSizingPersister = useLocalStoragePersister ( 'KafkaConnect' ) ;
94
96
97
+ const onRowClick = ( row : Row < Cluster > ) => {
98
+ navigate ( clusterBrokersPath ( row . original . name ) ) ;
99
+ } ;
100
+
95
101
return (
96
102
< >
97
103
< PageHeading text = "Dashboard" />
@@ -128,6 +134,7 @@ const Dashboard: React.FC = () => {
128
134
) }
129
135
</ S . Toolbar >
130
136
< Table
137
+ onRowClick = { onRowClick }
131
138
columns = { columns }
132
139
data = { config ?. list }
133
140
enableSorting
0 commit comments