mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
Merge pull request #162 from dbeaver/fix/disconnect-button
fix(core-app): moved new connection options from sub layout to main
This commit is contained in:
@@ -18,7 +18,6 @@ import { NodeManagerUtils } from './NodeManagerUtils';
|
||||
|
||||
@injectable()
|
||||
export class ConnectionDialogsService {
|
||||
newConnectionMenuToken = 'connectionMenu';
|
||||
|
||||
constructor(
|
||||
private mainMenuService: MainMenuService,
|
||||
@@ -28,22 +27,12 @@ export class ConnectionDialogsService {
|
||||
) {}
|
||||
|
||||
registerMenuItems() {
|
||||
this.mainMenuService.registerMenuItem(
|
||||
EMainMenu.mainMenuConnectionsPanel,
|
||||
{
|
||||
id: this.newConnectionMenuToken,
|
||||
order: 1,
|
||||
title: 'app_shared_connectionMenu_newConnection',
|
||||
isPanel: true,
|
||||
isHidden: () => this.mainMenuService.isEmptyMenuPanel(this.newConnectionMenuToken),
|
||||
}
|
||||
);
|
||||
|
||||
this.mainMenuService.registerMenuItem(
|
||||
EMainMenu.mainMenuConnectionsPanel,
|
||||
{
|
||||
id: 'mainMenuDisconnect',
|
||||
order: 2,
|
||||
order: 3,
|
||||
title: 'app_shared_connectionMenu_disconnect',
|
||||
onClick: () => this.connectionsManagerService.closeAllConnections(),
|
||||
isDisabled: () => !this.connectionsManagerService.hasAnyConnection(true),
|
||||
|
||||
@@ -20,7 +20,6 @@ export const defaultRULocale = [
|
||||
['app_root_session_expired_title', 'Сесстия истекла'],
|
||||
['app_root_session_expired_message', 'Сессия истекла. Хотите перезагрузить страницу?'],
|
||||
['app_root_session_expired_reload', 'Перезагрузить'],
|
||||
['app_shared_connectionMenu_newConnection', 'Новое подключение'],
|
||||
['app_shared_connectionMenu_connection', 'Подключение'],
|
||||
['app_shared_connectionMenu_custom', 'Настроить'],
|
||||
['app_shared_connectionMenu_disconnect', 'Отключить'],
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
MainMenuService, ConnectionDialogsService,
|
||||
} from '@cloudbeaver/core-app';
|
||||
import { MainMenuService, EMainMenu } from '@cloudbeaver/core-app';
|
||||
import { injectable } from '@cloudbeaver/core-di';
|
||||
import { CommonDialogService } from '@cloudbeaver/core-dialogs';
|
||||
|
||||
@@ -16,26 +14,18 @@ import { CustomConnectionDialog } from './CustomConnection/CustomConnectionDialo
|
||||
|
||||
@injectable()
|
||||
export class CustomConnectionPluginBootstrap {
|
||||
|
||||
constructor(private connectionDialogsService: ConnectionDialogsService,
|
||||
private mainMenuService: MainMenuService,
|
||||
private commonDialogService: CommonDialogService) {
|
||||
}
|
||||
constructor(private mainMenuService: MainMenuService, private commonDialogService: CommonDialogService) {}
|
||||
|
||||
bootstrap() {
|
||||
this.mainMenuService.registerMenuItem(
|
||||
this.connectionDialogsService.newConnectionMenuToken,
|
||||
{
|
||||
id: 'сustomConnection',
|
||||
order: 1,
|
||||
title: 'app_shared_connectionMenu_custom',
|
||||
onClick: () => this.openConnectionsDialog(),
|
||||
}
|
||||
);
|
||||
this.mainMenuService.registerMenuItem(EMainMenu.mainMenuConnectionsPanel, {
|
||||
id: 'сustomConnection',
|
||||
order: 1,
|
||||
title: 'app_shared_connectionMenu_custom',
|
||||
onClick: () => this.openConnectionsDialog(),
|
||||
});
|
||||
}
|
||||
|
||||
private async openConnectionsDialog() {
|
||||
await this.commonDialogService.open(CustomConnectionDialog, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+9
-12
@@ -6,7 +6,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { MainMenuService, ConnectionDialogsService } from '@cloudbeaver/core-app';
|
||||
import { MainMenuService, ConnectionDialogsService, EMainMenu } from '@cloudbeaver/core-app';
|
||||
import { injectable } from '@cloudbeaver/core-di';
|
||||
import { CommonDialogService } from '@cloudbeaver/core-dialogs';
|
||||
import { NotificationService } from '@cloudbeaver/core-events';
|
||||
@@ -30,17 +30,14 @@ export class TemplateConnectionPluginBootstrap {
|
||||
|
||||
bootstrap() {
|
||||
this.loadTemplateConnections();
|
||||
this.mainMenuService.registerMenuItem(
|
||||
this.connectionDialogsService.newConnectionMenuToken,
|
||||
{
|
||||
id: 'mainMenuConnect',
|
||||
order: 2,
|
||||
title: 'basicConnection_main_menu_item',
|
||||
onClick: () => this.openConnectionsDialog(),
|
||||
isHidden: () => !this.permissionsService.has(EPermission.public),
|
||||
isDisabled: () => this.isDisabled(),
|
||||
}
|
||||
);
|
||||
this.mainMenuService.registerMenuItem(EMainMenu.mainMenuConnectionsPanel, {
|
||||
id: 'mainMenuConnect',
|
||||
order: 2,
|
||||
title: 'basicConnection_main_menu_item',
|
||||
onClick: () => this.openConnectionsDialog(),
|
||||
isHidden: () => !this.permissionsService.has(EPermission.public),
|
||||
isDisabled: () => this.isDisabled(),
|
||||
});
|
||||
}
|
||||
|
||||
private async openConnectionsDialog() {
|
||||
|
||||
Reference in New Issue
Block a user