1- import { CirclePlus , Copy , PlugConnection } from '@gravity-ui/icons' ;
1+ import { CirclePlus , Copy , PlugConnection , Pulse } from '@gravity-ui/icons' ;
22import { Flex , Spin } from '@gravity-ui/uikit' ;
33import copy from 'copy-to-clipboard' ;
44import type { NavigationTreeNodeType } from 'ydb-ui-components' ;
55
66import type { SnippetParams } from '../../../components/ConnectToDB/types' ;
77import type { AppDispatch } from '../../../store' ;
8- import { TENANT_PAGES_IDS , TENANT_QUERY_TABS_ID } from '../../../store/reducers/tenant/constants' ;
9- import { setQueryTab , setTenantPage } from '../../../store/reducers/tenant/tenant' ;
8+ import {
9+ TENANT_DIAGNOSTICS_TABS_IDS ,
10+ TENANT_PAGES_IDS ,
11+ TENANT_QUERY_TABS_ID ,
12+ } from '../../../store/reducers/tenant/constants' ;
13+ import { setDiagnosticsTab , setQueryTab , setTenantPage } from '../../../store/reducers/tenant/tenant' ;
1014import createToast from '../../../utils/createToast' ;
1115import { insertSnippetToEditor } from '../../../utils/monaco/insertSnippet' ;
1216import { transformPath } from '../ObjectSummary/transformPath' ;
@@ -98,6 +102,11 @@ const bindActions = (
98102 }
99103 : undefined ,
100104 getConnectToDBDialog : ( ) => getConnectToDBDialog ?.( { database : params . database } ) ,
105+ goToMonitoring : ( ) => {
106+ dispatch ( setTenantPage ( TENANT_PAGES_IDS . diagnostics ) ) ;
107+ dispatch ( setDiagnosticsTab ( TENANT_DIAGNOSTICS_TABS_IDS . monitoring ) ) ;
108+ setActivePath ( params . path ) ;
109+ } ,
101110 createTable : inputQuery ( createTableTemplate ) ,
102111 createColumnTable : inputQuery ( createColumnTableTemplate ) ,
103112 createAsyncReplication : inputQuery ( createAsyncReplicationTemplate ) ,
@@ -190,6 +199,11 @@ export const getActions =
190199 action : actions . getConnectToDBDialog ,
191200 iconStart : < PlugConnection /> ,
192201 } ;
202+ const monitoringItem = {
203+ text : i18n ( 'actions.monitoring' ) ,
204+ action : actions . goToMonitoring ,
205+ iconStart : < Pulse /> ,
206+ } ;
193207
194208 const createEntitiesSet = [
195209 { text : i18n ( 'actions.createTable' ) , action : actions . createTable } ,
@@ -216,7 +230,7 @@ export const getActions =
216230 } ,
217231 ] ,
218232 } ;
219- const DB_SET : ActionsSet = [ [ copyItem , connectToDBItem ] , createEntitiesSet ] ;
233+ const DB_SET : ActionsSet = [ [ copyItem , connectToDBItem , monitoringItem ] , createEntitiesSet ] ;
220234
221235 const DIR_SET : ActionsSet = [ [ copyItem ] , createEntitiesSet ] ;
222236
0 commit comments