/
vshmidt
/
cloudbeaver
Обзор
Документация
Войти
/
vshmidt
/
cloudbeaver
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
devel
webapp/packages/plugin-root/src/ServerNodeChangedDialog/ServerNodeChangedDialogBootstrap.ts
51 строка
2 KB
Dmitrii Barnukov
dbeaver/pro#6509 Query confirmations (#3793)
28 окт 2025, 16:35
Не верифицирован
28 окт 2025, 16:35
2a107f3
Код
Авторство
О чём код?
/* * 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 { ActionSnackbar, importLazyComponent } from '@cloudbeaver/core-blocks'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, DialogueStateResult } from '@cloudbeaver/core-dialogs'; import { ENotificationType, NotificationService } from '@cloudbeaver/core-events'; import { ServerNodeService } from '@cloudbeaver/core-root'; import { RouterService } from '@cloudbeaver/core-routing'; const ServerNodeChangedDialog = importLazyComponent(() => import('./ServerNodeChangedDialog.js').then(m => m.ServerNodeChangedDialog)); @injectable(() => [RouterService, NotificationService, CommonDialogService, ServerNodeService]) export class ServerNodeChangedDialogBootstrap extends Bootstrap { constructor( private readonly routerService: RouterService, private readonly notificationService: NotificationService, private readonly commonDialogService: CommonDialogService, private readonly serverNodeService: ServerNodeService, ) { super(); } override register(): void { this.serverNodeService.onApplicationRunIdChange.addPostHandler(this.handleServerNodeChanged.bind(this)); } private async handleServerNodeChanged(): Promise<void> { const { status } = await this.commonDialogService.open(ServerNodeChangedDialog, undefined); if (status === DialogueStateResult.Rejected) { this.notificationService.customNotification( () => ActionSnackbar, { actionText: 'ui_processing_reload', onAction: () => this.routerService.reload(), }, { title: 'app_root_server_node_changed_title', message: 'app_root_server_node_changed_message', persistent: true, type: ENotificationType.Error, }, ); } } }