/
vshmidt
/
cloudbeaver
Обзор
Документация
Войти
/
vshmidt
/
cloudbeaver
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
devel
webapp/packages/plugin-administration/src/ConfigurationWizard/ServerConfiguration/ServerConfigurationService.ts
49 строк
2 KB
Alexey Potsetsuev
dbeaver/pro#6744 refactor: migration to `@wroud/di` (#3704)
29 авг 2025, 13:22
Не верифицирован
29 авг 2025, 13:22
80f258b
Код
Авторство
О чём код?
/* * 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 { makeObservable, observable } from 'mobx'; import { PlaceholderContainer } from '@cloudbeaver/core-blocks'; import { injectable } from '@cloudbeaver/core-di'; import { formValidationContext } from '@cloudbeaver/core-ui'; import type { IServerConfigurationFormPartState } from './IServerConfigurationFormPartState.js'; import { ServerConfigurationFormService } from './ServerConfigurationFormService.js'; export interface IConfigurationPlaceholderProps { configurationWizard: boolean; state: IServerConfigurationFormPartState; } @injectable(() => [ServerConfigurationFormService]) export class ServerConfigurationService { isDone: boolean; readonly configurationContainer: PlaceholderContainer<IConfigurationPlaceholderProps>; readonly pluginsContainer: PlaceholderContainer<IConfigurationPlaceholderProps>; readonly securitySettingsContainer: PlaceholderContainer<IConfigurationPlaceholderProps>; constructor(private readonly serverConfigurationFormService: ServerConfigurationFormService) { this.isDone = false; this.configurationContainer = new PlaceholderContainer(); this.pluginsContainer = new PlaceholderContainer(); this.securitySettingsContainer = new PlaceholderContainer(); this.serverConfigurationFormService.onValidate.addHandler((data, contexts) => { const validation = contexts.getContext(formValidationContext); this.setDone(validation.valid); }); makeObservable(this, { isDone: observable.ref, }); } setDone(value: boolean) { this.isDone = value; } }