import { MainMenuService , EMainMenu } from '@cloudbeaver/core-app' ; import { Bootstrap , injectable } from '@cloudbeaver/core-di' ; import { CommonDialogService } from '@cloudbeaver/core-dialogs' ; import { ServerConfigResource } from '@cloudbeaver/core-root' ; import { CustomConnectionDialog } from './CustomConnection/CustomConnectionDialog' ; @ injectable ( ) export class CustomConnectionPluginBootstrap extends Bootstrap { constructor ( private mainMenuService , private commonDialogService , private serverConfigResource ) { super ( ) ; } register ( ) { this . mainMenuService . registerMenuItem ( EMainMenu . mainMenuConnectionsPanel , { id : 'сustomConnection' , order : 2 , title : 'app_shared_connectionMenu_custom' , isHidden : ( ) => ! this . serverConfigResource . data ?. supportsCustomConnections , onClick : ( ) => this . openConnectionsDialog ( ) , } ) ; } load ( ) { } private async openConnectionsDialog ( ) { await this . commonDialogService . open ( CustomConnectionDialog , null ) ; } }