Files
cloudbeaver/webapp/packages/plugin-resource-manager-scripts/src/ResourceManagerScriptsSettingsService.ts
T
fdde4348a2 CB-3703 save product configuration from ui (#2334)
* CB-4560 api for saving product configuration

* CB-4560 save product config in te

* CB-4560 move update product config to mutations

* CB-3703 feat: extend base components

* CB-3703 feat: settings editor

* CB-3703 chore: review fixes

* CB-3703 chore: pr review

* CB-3703 feat: update server configuration icon

* CB-4560 add events

* CB-3703 fix: localization

* CB-3703 chore: localization

---------

Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2024-01-31 20:33:05 +03:00

40 lines
1.3 KiB
TypeScript

/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 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 { Dependency, injectable } from '@cloudbeaver/core-di';
import { PluginManagerService, PluginSettings, SettingsManagerService } from '@cloudbeaver/core-plugin';
import { schema } from '@cloudbeaver/core-utils';
const settingsSchema = schema.object({
disabled: schema.coerce.boolean().default(false),
});
type Settings = typeof settingsSchema;
@injectable()
export class ResourceManagerScriptsSettingsService extends Dependency {
readonly settings: PluginSettings<Settings>;
constructor(private readonly pluginManagerService: PluginManagerService, private readonly settingsManagerService: SettingsManagerService) {
super();
this.settings = this.pluginManagerService.createSettings('resource-manager-scripts', 'plugin', settingsSchema);
this.registerSettings();
}
private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
// {
// group: RESOURCE_MANAGER_SETTINGS_GROUP,
// key: 'disabled',
// type: ESettingsValueType.Checkbox,
// name: 'Disable resource manager scripts',
// },
]);
}
}