mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#6363 adds settings for dangerous queries dialogs
This commit is contained in:
committed by
Dmitrii Barnukov
parent
c5e8d510a2
commit
a88ca77049
@@ -30,7 +30,10 @@
|
||||
"@cloudbeaver/core-localization": "workspace:*",
|
||||
"@cloudbeaver/core-root": "workspace:*",
|
||||
"@cloudbeaver/core-sdk": "workspace:*",
|
||||
"@cloudbeaver/core-settings": "workspace:*",
|
||||
"@cloudbeaver/core-utils": "workspace:*",
|
||||
"@cloudbeaver/plugin-codemirror6": "workspace:*",
|
||||
"@cloudbeaver/plugin-sql-editor": "workspace:*",
|
||||
"@cloudbeaver/plugin-sql-editor-new": "workspace:*",
|
||||
"mobx": "^6",
|
||||
"mobx-react-lite": "^4",
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2019-2025 DBeaver Corp
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* NOTICE: All information contained herein is, and remains
|
||||
* the property of DBeaver Corp and its suppliers, if any.
|
||||
* The intellectual and technical concepts contained
|
||||
* herein are proprietary to DBeaver Corp and its suppliers
|
||||
* and may be covered by U.S. and Foreign Patents,
|
||||
* patents in process, and are protected by trade secret or copyright law.
|
||||
* Dissemination of this information or reproduction of this material
|
||||
* is strictly forbidden unless prior written permission is obtained
|
||||
* from DBeaver Corp.
|
||||
*/
|
||||
import { Bootstrap, injectable } from '@cloudbeaver/core-di';
|
||||
import { ESettingsValueType, SettingsManagerService, SettingsProvider, SettingsProviderService } from '@cloudbeaver/core-settings';
|
||||
import { schema } from '@cloudbeaver/core-utils';
|
||||
import { SQL_EDITOR_SETTINGS_GROUP } from '@cloudbeaver/plugin-sql-editor';
|
||||
|
||||
const defaultSettings = schema.object({
|
||||
'plugin.sql-editor.executeDropTableQueriesDialog': schema.boolean().default(true),
|
||||
'plugin.sql-editor.executeDangerousQueriesDialog': schema.boolean().default(true),
|
||||
});
|
||||
|
||||
export type SqlQueryConfirmationSettingsSchema = typeof defaultSettings;
|
||||
export type SqlQueryConfirmationSettings = schema.infer<SqlQueryConfirmationSettingsSchema>;
|
||||
|
||||
@injectable(() => [SettingsProviderService, SettingsManagerService])
|
||||
export class SqlQueryConfirmationSettingsBootstrap extends Bootstrap {
|
||||
readonly settings: SettingsProvider<SqlQueryConfirmationSettingsSchema>;
|
||||
|
||||
constructor(
|
||||
private readonly settingsProviderService: SettingsProviderService,
|
||||
private readonly settingsManagerService: SettingsManagerService,
|
||||
) {
|
||||
super();
|
||||
this.settings = this.settingsProviderService.createSettings(defaultSettings);
|
||||
}
|
||||
|
||||
override register(): void {
|
||||
this.settingsManagerService.registerSettings<typeof defaultSettings>(() => [
|
||||
{
|
||||
group: SQL_EDITOR_SETTINGS_GROUP,
|
||||
key: 'plugin.sql-editor.executeDropTableQueriesDialog',
|
||||
access: {
|
||||
scope: ['client'],
|
||||
},
|
||||
type: ESettingsValueType.Checkbox,
|
||||
name: 'plugin_sql_editor_execute_drop_table_queries',
|
||||
description: 'plugin_sql_editor_execute_drop_table_queries_description',
|
||||
},
|
||||
{
|
||||
group: SQL_EDITOR_SETTINGS_GROUP,
|
||||
key: 'plugin.sql-editor.executeDangerousQueriesDialog',
|
||||
access: {
|
||||
scope: ['client'],
|
||||
},
|
||||
type: ESettingsValueType.Checkbox,
|
||||
name: 'plugin_sql_editor_execute_dangerous_queries',
|
||||
description: 'plugin_sql_editor_execute_dangerous_queries_description',
|
||||
},
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1 +1,6 @@
|
||||
export default [];
|
||||
export default [
|
||||
['plugin_sql_editor_execute_drop_table_queries', 'Confirmation dialog for DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_drop_table_queries_description', 'Show confirmation dialog before executing DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries', 'Confirmation dialog for dangerous queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries_description', 'Show confirmation dialog before executing dangerous queries'],
|
||||
];
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
export default [];
|
||||
export default [
|
||||
['plugin_sql_editor_execute_drop_table_queries', 'Confirmation dialog for DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_drop_table_queries_description', 'Show confirmation dialog before executing DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries', 'Confirmation dialog for dangerous queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries_description', 'Show confirmation dialog before executing dangerous queries'],
|
||||
];
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
export default [];
|
||||
export default [
|
||||
['plugin_sql_editor_execute_drop_table_queries', 'Confirmation dialog for DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_drop_table_queries_description', 'Show confirmation dialog before executing DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries', 'Confirmation dialog for dangerous queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries_description', 'Show confirmation dialog before executing dangerous queries'],
|
||||
];
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
export default [];
|
||||
export default [
|
||||
['plugin_sql_editor_execute_drop_table_queries', ' Подтверждение диалога для DROP TABLE запросов'],
|
||||
['plugin_sql_editor_execute_drop_table_queries_description', ' Показать диалог подтверждения перед выполнением DROP TABLE запросов'],
|
||||
['plugin_sql_editor_execute_dangerous_queries', ' Подтверждение диалога для опасных запросов'],
|
||||
['plugin_sql_editor_execute_dangerous_queries_description', ' Показать диалог подтверждения перед выполнением опасных запросов'],
|
||||
];
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
export default [];
|
||||
export default [
|
||||
['plugin_sql_editor_execute_drop_table_queries', 'Confirmation dialog for DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_drop_table_queries_description', 'Show confirmation dialog before executing DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries', 'Confirmation dialog for dangerous queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries_description', 'Show confirmation dialog before executing dangerous queries'],
|
||||
];
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
export default [];
|
||||
export default [
|
||||
['plugin_sql_editor_execute_drop_table_queries', 'Confirmation dialog for DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_drop_table_queries_description', 'Show confirmation dialog before executing DROP TABLE queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries', 'Confirmation dialog for dangerous queries'],
|
||||
['plugin_sql_editor_execute_dangerous_queries_description', 'Show confirmation dialog before executing dangerous queries'],
|
||||
];
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
import { Bootstrap, ModuleRegistry } from '@cloudbeaver/core-di';
|
||||
import { LocaleService } from './LocaleService.js';
|
||||
import { SqlQueryAsyncTaskConfirmationBootstrap } from './SqlQueryAsyncTaskConfirmationBootstrap.js';
|
||||
import { SqlQueryConfirmationSettingsBootstrap } from './SqlQueryConfirmationSettingsBootstrap.js';
|
||||
|
||||
export default ModuleRegistry.add({
|
||||
name: '@cloudbeaver/plugin-sql-async-task-confirmation',
|
||||
|
||||
configure: serviceCollection => {
|
||||
serviceCollection.addSingleton(Bootstrap, SqlQueryAsyncTaskConfirmationBootstrap).addSingleton(Bootstrap, LocaleService);
|
||||
serviceCollection.addSingleton(Bootstrap, SqlQueryConfirmationSettingsBootstrap);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -34,9 +34,18 @@
|
||||
{
|
||||
"path": "../core-sdk"
|
||||
},
|
||||
{
|
||||
"path": "../core-settings"
|
||||
},
|
||||
{
|
||||
"path": "../core-utils"
|
||||
},
|
||||
{
|
||||
"path": "../plugin-codemirror6"
|
||||
},
|
||||
{
|
||||
"path": "../plugin-sql-editor"
|
||||
},
|
||||
{
|
||||
"path": "../plugin-sql-editor-new"
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import './module.js';
|
||||
|
||||
export * from './SQL_EDITOR_SETTINGS_GROUP.js';
|
||||
export * from './actions/bindings/KEY_BINDING_SQL_EDITOR_EXECUTE_NEW.js';
|
||||
export * from './actions/bindings/KEY_BINDING_SQL_EDITOR_EXECUTE_SCRIPT.js';
|
||||
export * from './actions/bindings/KEY_BINDING_SQL_EDITOR_EXECUTE.js';
|
||||
|
||||
@@ -3904,7 +3904,10 @@ __metadata:
|
||||
"@cloudbeaver/core-localization": "workspace:*"
|
||||
"@cloudbeaver/core-root": "workspace:*"
|
||||
"@cloudbeaver/core-sdk": "workspace:*"
|
||||
"@cloudbeaver/core-settings": "workspace:*"
|
||||
"@cloudbeaver/core-utils": "workspace:*"
|
||||
"@cloudbeaver/plugin-codemirror6": "workspace:*"
|
||||
"@cloudbeaver/plugin-sql-editor": "workspace:*"
|
||||
"@cloudbeaver/plugin-sql-editor-new": "workspace:*"
|
||||
"@cloudbeaver/tsconfig": "workspace:*"
|
||||
"@types/react": "npm:^19"
|
||||
|
||||
Reference in New Issue
Block a user