diff --git a/config/GlobalConfiguration/.dbeaver/data-sources.json b/config/GlobalConfiguration/.dbeaver/data-sources.json index c954ec82d9..a5f18e204f 100644 --- a/config/GlobalConfiguration/.dbeaver/data-sources.json +++ b/config/GlobalConfiguration/.dbeaver/data-sources.json @@ -1,24 +1,4 @@ { - "folders": {}, - "connections": { - "postgresql-template-1": { - "provider": "postgresql", - "driver": "postgres-jdbc", - "name": "PostgreSQL (Template)", - "save-password": false, - "show-system-objects": false, - "read-only": true, - "template": true, - "configuration": { - "host": "localhost", - "port": "5432", - "database": "postgres", - "url": "jdbc:postgresql://localhost:5432/postgres", - "type": "dev", - "provider-properties": { - "@dbeaver-show-non-default-db@": "false" - } - } - } - } + "folders": {}, + "connections": {} } diff --git a/webapp/packages/core-blocks/src/InfoItem.module.css b/webapp/packages/core-blocks/src/InfoItem.module.css index 5a8c0a4106..71f2362414 100644 --- a/webapp/packages/core-blocks/src/InfoItem.module.css +++ b/webapp/packages/core-blocks/src/InfoItem.module.css @@ -10,8 +10,15 @@ align-items: center; flex: 0 0 auto; } + .iconOrImage { width: 24px; height: 24px; margin-right: 16px; + + &.compact { + width: 18px; + height: 18px; + margin-right: 8px; + } } diff --git a/webapp/packages/core-blocks/src/InfoItem.tsx b/webapp/packages/core-blocks/src/InfoItem.tsx index f0039e961a..ea73c59c76 100644 --- a/webapp/packages/core-blocks/src/InfoItem.tsx +++ b/webapp/packages/core-blocks/src/InfoItem.tsx @@ -18,19 +18,20 @@ import { useS } from './useS.js'; export interface IInfoItem { info: TLocalizationToken; icon?: string; + compact?: boolean; } interface Props extends IInfoItem { className?: string; } -export const InfoItem = observer(function InfoItem({ info, icon = '/icons/info_icon.svg', className }) { +export const InfoItem = observer(function InfoItem({ info, compact, icon = '/icons/info_icon.svg', className }) { const styles = useS(style); const translate = useTranslate(); return (
- + {translate(info)}
); diff --git a/webapp/packages/core-connections/src/locales/de.ts b/webapp/packages/core-connections/src/locales/de.ts index c92b054ac0..e5ee57cb7f 100644 --- a/webapp/packages/core-connections/src/locales/de.ts +++ b/webapp/packages/core-connections/src/locales/de.ts @@ -58,4 +58,5 @@ export default [ ['core_connections_settings_disable', 'Disable'], ['core_connections_settings_disable_description', 'Disable the ability to create new connections'], + ['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'], ]; diff --git a/webapp/packages/core-connections/src/locales/en.ts b/webapp/packages/core-connections/src/locales/en.ts index ca44fcca48..93133fd7db 100644 --- a/webapp/packages/core-connections/src/locales/en.ts +++ b/webapp/packages/core-connections/src/locales/en.ts @@ -102,4 +102,5 @@ export default [ ['core_connections_settings_disable', 'Disable'], ['core_connections_settings_disable_description', 'Disable the ability to create new connections'], + ['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'], ]; diff --git a/webapp/packages/core-connections/src/locales/fr.ts b/webapp/packages/core-connections/src/locales/fr.ts index c38d142279..808e902f12 100644 --- a/webapp/packages/core-connections/src/locales/fr.ts +++ b/webapp/packages/core-connections/src/locales/fr.ts @@ -111,4 +111,5 @@ export default [ ['core_connections_settings_disable', 'Disable'], ['core_connections_settings_disable_description', 'Disable the ability to create new connections'], + ['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'], ]; diff --git a/webapp/packages/core-connections/src/locales/it.ts b/webapp/packages/core-connections/src/locales/it.ts index 3d3002693b..f5f61ab238 100644 --- a/webapp/packages/core-connections/src/locales/it.ts +++ b/webapp/packages/core-connections/src/locales/it.ts @@ -100,4 +100,5 @@ export default [ ['core_connections_settings_disable', 'Disable'], ['core_connections_settings_disable_description', 'Disable the ability to create new connections'], + ['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'], ]; diff --git a/webapp/packages/core-connections/src/locales/ru.ts b/webapp/packages/core-connections/src/locales/ru.ts index ae8dfeae11..804cb0b13f 100644 --- a/webapp/packages/core-connections/src/locales/ru.ts +++ b/webapp/packages/core-connections/src/locales/ru.ts @@ -103,4 +103,5 @@ export default [ ['core_connections_settings_disable', 'Отключить'], ['core_connections_settings_disable_description', 'Отключить возможность создания новых подключений'], + ['connections_templates_deprecated_message', 'Шаблоны подключений больше не поддерживаются и будут удалены в будущих релизах'], ]; diff --git a/webapp/packages/core-connections/src/locales/zh.ts b/webapp/packages/core-connections/src/locales/zh.ts index 57f7bfbb5b..027ec3a69a 100644 --- a/webapp/packages/core-connections/src/locales/zh.ts +++ b/webapp/packages/core-connections/src/locales/zh.ts @@ -37,10 +37,7 @@ export default [ ['connections_connection_authentication_save_credentials_for_session', '当前会话不再询问'], ['connections_connection_authentication_save_credentials_for_session_tooltip', '注销后将移除凭证'], ['connections_connection_edit_save_credentials_shared', '为所有访问用户保存凭证'], - [ - 'connections_connection_edit_save_credentials_shared_tooltip', - '凭证将用于为所有访问用户自动连接数据库', - ], + ['connections_connection_edit_save_credentials_shared_tooltip', '凭证将用于为所有访问用户自动连接数据库'], ['connections_connection_share_credentials', '分享凭证至团队'], ['connections_connection_share_credentials_tooltip', '凭证将用于为所有团队用户自动连接数据库'], ['connections_connection_credentials_provisioning', '认证凭据'], @@ -52,7 +49,7 @@ export default [ ['connections_connection_edit_search_hosts', '主机名称'], ['connections_connection_address', '地址'], ['connections_connection_folder', '文件夹'], - ['connections_connection_folder_validation', "文件夹名称不得包含以下符号 / : \" \\ ' <> | ? * 且不能以点开头"], + ['connections_connection_folder_validation', '文件夹名称不得包含以下符号 / : " \\ \' <> | ? * 且不能以点开头'], ['connections_connection_name', '连接名称'], ['connections_connection_access_admin_info', '管理员可以查看除其他用户的私有连接之外的所有连接。'], ['connections_connection_description', '描述'], @@ -95,4 +92,5 @@ export default [ ['core_connections_settings_disable', 'Disable'], ['core_connections_settings_disable_description', 'Disable the ability to create new connections'], + ['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'], ]; diff --git a/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionDialog.tsx b/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionDialog.tsx index 91cb00ceb3..d4c1b95155 100644 --- a/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionDialog.tsx +++ b/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionDialog.tsx @@ -14,6 +14,7 @@ import { CommonDialogWrapper, ErrorMessage, Form, + InfoItem, s, useAdministrationSettings, useErrorDetails, @@ -38,7 +39,12 @@ export const ConnectionDialog: DialogComponent = observer(function C const dialog = useConnectionDialog(rejectDialog); const errorDetails = useErrorDetails(dialog.connectException); - const subTitle = dialog.step === ConnectionStep.Connection ? dialog.template?.name : undefined; + const subTitle = + dialog.step === ConnectionStep.Connection ? ( + dialog.template?.name + ) : ( + + ); return ( diff --git a/webapp/packages/plugin-connections-administration/src/Administration/Connections/ConnectionsAdministration.tsx b/webapp/packages/plugin-connections-administration/src/Administration/Connections/ConnectionsAdministration.tsx index e98371c1aa..5472d94c7b 100644 --- a/webapp/packages/plugin-connections-administration/src/Administration/Connections/ConnectionsAdministration.tsx +++ b/webapp/packages/plugin-connections-administration/src/Administration/Connections/ConnectionsAdministration.tsx @@ -14,8 +14,8 @@ import { ExceptionMessageStyles, Group, GroupItem, - GroupSubTitle, GroupTitle, + InfoItem, Loader, s, SContext, @@ -25,13 +25,11 @@ import { useS, useTranslate, } from '@cloudbeaver/core-blocks'; -import { useService } from '@cloudbeaver/core-di'; import ConnectionsAdministrationStyle from './ConnectionsAdministration.module.css'; import { ConnectionsTable } from './ConnectionsTable/ConnectionsTable.js'; import { useConnectionsTable } from './ConnectionsTable/useConnectionsTable.js'; import { CreateConnection } from './CreateConnection/CreateConnection.js'; -import { CreateConnectionService } from './CreateConnectionService.js'; const registry: StyleRegistry = [ [ @@ -50,26 +48,16 @@ export const ConnectionsAdministration = observer - {translate('templates_administration_info_message')} + - - {translate('ui_add')} - this.serverConfigResource.distributed, + isHidden: () => this.serverConfigResource.distributed || !this.connectionInfoResource.values.some(connection => connection.template), getContentComponent: () => ConnectionsAdministration, getDrawerComponent: () => ConnectionsDrawerItem, onDeActivate: this.refreshUserConnections.bind(this), @@ -78,6 +78,10 @@ export class ConnectionsAdministrationService extends Bootstrap { this.connectionDetailsPlaceholder.add(SSH, 2); } + override async load(): Promise { + await this.connectionInfoResource.load(); + } + private async refreshUserConnections(configuration: boolean, outside: boolean, outsideAdminPage: boolean): Promise { // TODO: we have to track users' leaving the page if (outside) { diff --git a/webapp/packages/plugin-connections-administration/src/locales/en.ts b/webapp/packages/plugin-connections-administration/src/locales/en.ts index 3718ace448..ba1aed8728 100644 --- a/webapp/packages/plugin-connections-administration/src/locales/en.ts +++ b/webapp/packages/plugin-connections-administration/src/locales/en.ts @@ -13,9 +13,5 @@ export default [ ['plugin_connections_connection_edit_reconnect_failed', 'Failed to reconnect'], ['connections_administration_deactivate_message', "Your connection's settings will be lost. Do you want to continue?"], - [ - 'templates_administration_info_message', - 'The templates enable administrators to define various reusable connection parameters, subsequently allowing users to create multiple connections based on these templates.', - ], ['connections_administration_connection_create_error', 'Failed to create connection'], ]; diff --git a/webapp/packages/plugin-connections-administration/src/locales/fr.ts b/webapp/packages/plugin-connections-administration/src/locales/fr.ts index a70584acef..6efa32be67 100644 --- a/webapp/packages/plugin-connections-administration/src/locales/fr.ts +++ b/webapp/packages/plugin-connections-administration/src/locales/fr.ts @@ -13,9 +13,5 @@ export default [ ['plugin_connections_connection_edit_reconnect_failed', 'Échec de la reconnexion'], ['connections_administration_deactivate_message', 'Les paramètres de votre connexion seront perdus. Voulez-vous continuer ?'], - [ - 'templates_administration_info_message', - 'Les modèles permettent aux administrateurs de définir divers paramètres de connexion réutilisables, permettant ensuite aux utilisateurs de créer plusieurs connexions basées sur ces modèles.', - ], ['connections_administration_connection_create_error', 'Failed to create connection'], ]; diff --git a/webapp/packages/plugin-connections-administration/src/locales/it.ts b/webapp/packages/plugin-connections-administration/src/locales/it.ts index c1eea9c399..676b42db43 100644 --- a/webapp/packages/plugin-connections-administration/src/locales/it.ts +++ b/webapp/packages/plugin-connections-administration/src/locales/it.ts @@ -8,9 +8,5 @@ export default [ ['plugin_connections_connection_edit_menu_item_title', 'Modifica Connessione'], ['plugin_connections_connection_edit_cancel_title', "Conferma l'annullamento"], - [ - 'templates_administration_info_message', - 'The templates enable administrators to define various reusable connection parameters, subsequently allowing users to create multiple connections based on these templates.', - ], ['connections_administration_connection_create_error', 'Failed to create connection'], ]; diff --git a/webapp/packages/plugin-connections-administration/src/locales/ru.ts b/webapp/packages/plugin-connections-administration/src/locales/ru.ts index 3ffea2835b..d3691ed3af 100644 --- a/webapp/packages/plugin-connections-administration/src/locales/ru.ts +++ b/webapp/packages/plugin-connections-administration/src/locales/ru.ts @@ -13,9 +13,5 @@ export default [ ['plugin_connections_connection_edit_reconnect_failed', 'Не удалось переподключиться'], ['connections_administration_deactivate_message', 'Настройки вашего подключения будут потеряны. Вы хотите продолжить?'], - [ - 'templates_administration_info_message', - 'Шаблоны позволяют администраторам определять различные параметры подключения, а затем позволяют пользователям создавать несколько подключений на основе этих шаблонов.', - ], ['connections_administration_connection_create_error', 'Не удалось создать подключение'], ]; diff --git a/webapp/packages/plugin-connections-administration/src/locales/zh.ts b/webapp/packages/plugin-connections-administration/src/locales/zh.ts index 149fe0a2b0..eabd8240f1 100644 --- a/webapp/packages/plugin-connections-administration/src/locales/zh.ts +++ b/webapp/packages/plugin-connections-administration/src/locales/zh.ts @@ -13,6 +13,5 @@ export default [ ['plugin_connections_connection_edit_reconnect_failed', '重新连接失败'], ['connections_administration_deactivate_message', '您的连接设置将丢失。您要继续吗?'], - ['templates_administration_info_message', '管理员可在数据库连接模板中定义各种可重用的连接参数,之后用户可基于这些模板创建多个数据库连接。'], ['connections_administration_connection_create_error', 'Failed to create connection'], ];