diff --git a/webapp/packages/core-resource/src/Resource/CachedMapResource.ts b/webapp/packages/core-resource/src/Resource/CachedMapResource.ts index e54c41777e..f2232a3c07 100644 --- a/webapp/packages/core-resource/src/Resource/CachedMapResource.ts +++ b/webapp/packages/core-resource/src/Resource/CachedMapResource.ts @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2024 DBeaver Corp and others + * 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. @@ -19,6 +19,7 @@ import type { ResourceKeyAlias } from './ResourceKeyAlias.js'; import { isResourceKeyList, resourceKeyList, ResourceKeyList } from './ResourceKeyList.js'; import { ResourceKeyListAlias, resourceKeyListAlias } from './ResourceKeyListAlias.js'; import { ResourceKeyUtils } from './ResourceKeyUtils.js'; +import { CachedResourceOffsetPageTargetKey } from './CachedResourceOffsetPageKeys.js'; export type CachedMapResourceKey = CachedResourceKey; export type CachedMapResourceValue = TResource extends CachedResource, any, any, any, any> ? T : never; @@ -64,6 +65,12 @@ export abstract class CachedMapResource< this.aliases.add(CachedMapAllKey, () => resourceKeyList(this.keys)); + this.onItemDelete.addHandler(key => { + ResourceKeyUtils.forEach(key, key => { + this.metadata.delete(CachedResourceOffsetPageTargetKey(key)); + }); + }); + makeObservable(this, { set: action, delete: action, diff --git a/webapp/packages/plugin-administration/src/ConfigurationWizard/ServerConfiguration/Form/ServerConfigurationInfoForm.tsx b/webapp/packages/plugin-administration/src/ConfigurationWizard/ServerConfiguration/Form/ServerConfigurationInfoForm.tsx index d81ed69032..18d4b82b45 100644 --- a/webapp/packages/plugin-administration/src/ConfigurationWizard/ServerConfiguration/Form/ServerConfigurationInfoForm.tsx +++ b/webapp/packages/plugin-administration/src/ConfigurationWizard/ServerConfiguration/Form/ServerConfigurationInfoForm.tsx @@ -46,7 +46,7 @@ export const ServerConfigurationInfoForm = observer(function ServerConfig function constructSupportedHostsExample() { const exampleWithPort = serverConfigLoader.data?.distributed ? 'localhost' : 'localhost:5000'; - return `example.com\n${exampleWithPort}\n127.0.0.1`; + return `example.com\n${exampleWithPort}`; } return ( diff --git a/webapp/packages/plugin-administration/src/locales/en.ts b/webapp/packages/plugin-administration/src/locales/en.ts index 768b05d733..c6c46b6b02 100644 --- a/webapp/packages/plugin-administration/src/locales/en.ts +++ b/webapp/packages/plugin-administration/src/locales/en.ts @@ -39,7 +39,7 @@ export default [ ['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'], [ 'administration_configuration_wizard_configuration_supported_hosts_description', - 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed', + 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.', ], [ 'administration_configuration_wizard_configuration_supported_hosts_warning', diff --git a/webapp/packages/plugin-administration/src/locales/fr.ts b/webapp/packages/plugin-administration/src/locales/fr.ts index 047c29880a..f3bd380e6a 100644 --- a/webapp/packages/plugin-administration/src/locales/fr.ts +++ b/webapp/packages/plugin-administration/src/locales/fr.ts @@ -39,7 +39,7 @@ export default [ ['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'], [ 'administration_configuration_wizard_configuration_supported_hosts_description', - 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed', + 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.', ], [ 'administration_configuration_wizard_configuration_supported_hosts_warning', diff --git a/webapp/packages/plugin-administration/src/locales/it.ts b/webapp/packages/plugin-administration/src/locales/it.ts index 0292c6b159..e88a12e53d 100644 --- a/webapp/packages/plugin-administration/src/locales/it.ts +++ b/webapp/packages/plugin-administration/src/locales/it.ts @@ -39,7 +39,7 @@ export default [ ['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'], [ 'administration_configuration_wizard_configuration_supported_hosts_description', - 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed', + 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.', ], [ 'administration_configuration_wizard_configuration_supported_hosts_warning', diff --git a/webapp/packages/plugin-administration/src/locales/ru.ts b/webapp/packages/plugin-administration/src/locales/ru.ts index ffc1f1c09c..a909fff6e7 100644 --- a/webapp/packages/plugin-administration/src/locales/ru.ts +++ b/webapp/packages/plugin-administration/src/locales/ru.ts @@ -18,7 +18,7 @@ export default [ ['administration_configuration_wizard_configuration_supported_hosts', 'Разрешённые URL сервера'], [ 'administration_configuration_wizard_configuration_supported_hosts_description', - 'Вы можете указать несколько URL серверов, разделенных новой строкой. Пустое значение означает, что все URL разрешены', + 'Вы можете указать несколько URL серверов, разделенных новой строкой. Пустое значение означает, что все URL разрешены. Доступ с IP-адресов всегда разрешен.', ], [ 'administration_configuration_wizard_configuration_supported_hosts_warning', diff --git a/webapp/packages/plugin-administration/src/locales/vi.ts b/webapp/packages/plugin-administration/src/locales/vi.ts index 546c96da5f..f285888977 100644 --- a/webapp/packages/plugin-administration/src/locales/vi.ts +++ b/webapp/packages/plugin-administration/src/locales/vi.ts @@ -30,7 +30,7 @@ export default [ ['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'], [ 'administration_configuration_wizard_configuration_supported_hosts_description', - 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed', + 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.', ], [ 'administration_configuration_wizard_configuration_supported_hosts_warning', diff --git a/webapp/packages/plugin-administration/src/locales/zh.ts b/webapp/packages/plugin-administration/src/locales/zh.ts index f7c3100bbb..2a1e8536fe 100644 --- a/webapp/packages/plugin-administration/src/locales/zh.ts +++ b/webapp/packages/plugin-administration/src/locales/zh.ts @@ -36,7 +36,7 @@ export default [ ['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'], [ 'administration_configuration_wizard_configuration_supported_hosts_description', - 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed', + 'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.', ], [ 'administration_configuration_wizard_configuration_supported_hosts_warning', diff --git a/webapp/packages/plugin-sql-editor/src/SQLParser.ts b/webapp/packages/plugin-sql-editor/src/SQLParser.ts index ec8c98946d..3ca229cf5f 100644 --- a/webapp/packages/plugin-sql-editor/src/SQLParser.ts +++ b/webapp/packages/plugin-sql-editor/src/SQLParser.ts @@ -47,7 +47,7 @@ export class SQLParser { this.script = ''; this.lastParsingArgs = []; - makeObservable(this, { + makeObservable(this, { actualScript: computed, _scripts: observable.ref, script: observable.ref, @@ -109,22 +109,6 @@ export class SQLParser { }; } - getQueryAtPos(position: number): ISQLScriptSegment | undefined { - const script = this._scripts.find(script => script.begin <= position && script.end > position); - - if (script) { - return script; - } - - const closestScripts = this._scripts.filter(script => script.begin <= position); - - if (closestScripts.length > 0) { - return closestScripts[closestScripts.length - 1]; - } - - return undefined; - } - setScript(script: string): void { this.script = script; } @@ -138,4 +122,18 @@ export class SQLParser { return this; } + + private getQueryAtPos(position: number): ISQLScriptSegment | undefined { + const script = this._scripts.find(script => script.begin <= position && script.end > position); + + if (script) { + return script; + } + + return { + query: this.actualScript.substring(position, position), + begin: position, + end: position, + }; + } }