/
vshmidt
/
cloudbeaver
Обзор
Документация
Войти
/
vshmidt
/
cloudbeaver
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
devel
webapp/packages/plugin-tools-panel/src/PluginBootstrap.ts
47 строк
2 KB
Alexey Potsetsuev
dbeaver/pro#6744 fix: elements order (#3706)
03 сен 2025, 21:40
Не верифицирован
03 сен 2025, 21:40
65876e9
Код
Авторство
О чём код?
/* * CloudBeaver - Cloud Database Manager * Copyright (C) 2020-2025 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ import { AppScreenService } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { MenuService } from '@cloudbeaver/core-view'; import { MENU_APP_ACTIONS } from '@cloudbeaver/plugin-top-app-bar'; import { importLazyComponent } from '@cloudbeaver/core-blocks'; import { MENU_TOOLS } from './Menu/MENU_TOOLS.js'; import { ToolsPanelService } from './ToolsPanel/ToolsPanelService.js'; const ToolsPanel = importLazyComponent(() => import('./ToolsPanel/ToolsPanel.js').then(module => module.ToolsPanel)); @injectable(() => [AppScreenService, MenuService, ToolsPanelService]) export class PluginBootstrap extends Bootstrap { constructor( private readonly appScreenService: AppScreenService, private readonly menuService: MenuService, private readonly toolsPanelService: ToolsPanelService, ) { super(); } override register(): void { this.appScreenService.rightAreaBottom.add( ToolsPanel, undefined, () => this.toolsPanelService.disabled || this.toolsPanelService.tabsContainer.getDisplayed().length === 0, ); this.menuService.addCreator({ menus: [MENU_APP_ACTIONS], getItems: (context, items) => [...items, MENU_TOOLS], }); this.menuService.setHandler({ id: 'tools-menu-base', menus: [MENU_TOOLS], isLabelVisible: () => false, isHidden: () => this.toolsPanelService.disabled, }); } }