ydb-embedded-ui 6.11.0 → 6.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/DateRange/DateRange.d.ts +4 -4
- package/dist/components/DateRange/DateRange.js +23 -26
- package/dist/components/DateRange/DateRange.scss +14 -13
- package/dist/components/DateRange/__test__/fromDateRangeValues.test.d.ts +1 -0
- package/dist/components/DateRange/__test__/fromDateRangeValues.test.js +80 -0
- package/dist/components/DateRange/__test__/getdatePickerSize.test.d.ts +1 -0
- package/dist/components/DateRange/__test__/getdatePickerSize.test.js +56 -0
- package/dist/components/DateRange/__test__/toDateRangeValues.test.d.ts +1 -0
- package/dist/components/DateRange/__test__/toDateRangeValues.test.js +80 -0
- package/dist/components/DateRange/i18n/en.json +4 -0
- package/dist/components/DateRange/i18n/index.d.ts +2 -0
- package/dist/components/DateRange/i18n/index.js +5 -0
- package/dist/components/DateRange/i18n/ru.json +4 -0
- package/dist/components/DateRange/utils.d.ts +5 -0
- package/dist/components/DateRange/utils.js +41 -0
- package/dist/components/DeveloperUILinkButton/DeveloperUILinkButton.d.ts +8 -0
- package/dist/components/{DeveloperUiLink/DeveloperUiLink.js → DeveloperUILinkButton/DeveloperUILinkButton.js} +3 -3
- package/dist/components/{DeveloperUiLink/DeveloperUiLink.scss → DeveloperUILinkButton/DeveloperUILinkButton.scss} +3 -2
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.d.ts +6 -1
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.js +22 -12
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.scss +45 -45
- package/dist/components/EntityStatus/EntityStatus.js +1 -1
- package/dist/components/EntityStatus/EntityStatus.scss +6 -2
- package/dist/components/MetricChart/reducer.d.ts +2 -2
- package/dist/components/MonacoEditor/MonacoEditor.js +0 -2
- package/dist/components/NodeHostWrapper/NodeHostWrapper.d.ts +0 -1
- package/dist/components/NodeHostWrapper/NodeHostWrapper.js +3 -6
- package/dist/components/PDiskInfo/PDiskInfo.d.ts +7 -4
- package/dist/components/PDiskInfo/PDiskInfo.js +73 -26
- package/dist/components/PDiskInfo/PDiskInfo.scss +15 -1
- package/dist/components/PDiskInfo/i18n/en.json +11 -5
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/PDiskPopup/PDiskPopup.js +8 -2
- package/dist/components/VDiskInfo/VDiskInfo.d.ts +3 -2
- package/dist/components/VDiskInfo/VDiskInfo.js +9 -4
- package/dist/components/VDiskInfo/VDiskInfo.scss +7 -1
- package/dist/components/VDiskInfo/i18n/en.json +2 -1
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Cluster/Cluster.scss +1 -4
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +1 -1
- package/dist/containers/Heatmap/Heatmap.d.ts +2 -1
- package/dist/containers/Heatmap/Heatmap.js +2 -2
- package/dist/containers/Node/Node.scss +1 -4
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +0 -20
- package/dist/containers/Node/NodeStructure/Pdisk.js +2 -2
- package/dist/containers/PDiskPage/PDiskGroups/PDiskGroups.d.ts +6 -0
- package/dist/containers/PDiskPage/PDiskGroups/PDiskGroups.js +24 -0
- package/dist/containers/PDiskPage/PDiskPage.js +62 -24
- package/dist/containers/PDiskPage/PDiskPage.scss +8 -5
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.d.ts +7 -0
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js +93 -0
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.scss +52 -0
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/utils.d.ts +4 -0
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/utils.js +9 -0
- package/dist/containers/PDiskPage/i18n/en.json +8 -1
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +16 -6
- package/dist/containers/Tablets/Tablets.js +11 -8
- package/dist/containers/Tenant/Acl/Acl.d.ts +2 -1
- package/dist/containers/Tenant/Acl/Acl.js +10 -8
- package/dist/containers/Tenant/Acl/Acl.scss +8 -8
- package/dist/containers/Tenant/Acl/i18n/en.json +6 -0
- package/dist/containers/Tenant/Acl/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Acl/i18n/index.js +4 -0
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +4 -4
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js +3 -3
- package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +3 -1
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +3 -3
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +5 -5
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/en.json +14 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.js +1 -2
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.js +36 -17
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +8 -5
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/getSectionTitle.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/getSectionTitle.js +2 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +3 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +2 -2
- package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.d.ts +2 -2
- package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +14 -14
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +3 -3
- package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.js +4 -4
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +31 -18
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +2 -2
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +8 -3
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.d.ts +2 -1
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +9 -7
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.d.ts +2 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.js +38 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.scss +63 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.d.ts +15 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.js +14 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.scss +19 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.d.ts +99 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js +109 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/en.json +13 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/index.js +5 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/ru.json +13 -0
- package/dist/containers/Tenant/Query/i18n/en.json +14 -0
- package/dist/containers/Tenant/Query/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Schema/CreateDirectoryDialog/CreateDirectoryDialog.d.ts +3 -2
- package/dist/containers/Tenant/Schema/CreateDirectoryDialog/CreateDirectoryDialog.js +2 -2
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +2 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +1 -1
- package/dist/containers/Tenant/Tenant.js +1 -1
- package/dist/containers/Tenant/TenantPages.d.ts +12 -1
- package/dist/containers/Tenant/TenantPages.js +1 -1
- package/dist/containers/Tenant/i18n/en.json +2 -2
- package/dist/containers/Tenant/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/utils/schema.js +1 -1
- package/dist/containers/Tenants/Tenants.js +1 -1
- package/dist/containers/Tenants/Tenants.scss +0 -4
- package/dist/containers/UserSettings/i18n/en.json +2 -0
- package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
- package/dist/containers/UserSettings/settings.d.ts +1 -0
- package/dist/containers/UserSettings/settings.js +6 -1
- package/dist/routes.js +2 -2
- package/dist/services/api.d.ts +39 -21
- package/dist/services/api.js +45 -56
- package/dist/services/settings.d.ts +1 -0
- package/dist/services/settings.js +2 -1
- package/dist/store/configureStore.d.ts +4 -4
- package/dist/store/defaultStore.d.ts +2 -2
- package/dist/store/reducers/api.d.ts +1 -1
- package/dist/store/reducers/api.js +1 -1
- package/dist/store/reducers/cluster/cluster.d.ts +2 -2
- package/dist/store/reducers/clusterNodes/clusterNodes.d.ts +2 -2
- package/dist/store/reducers/clusters/clusters.d.ts +2 -2
- package/dist/store/reducers/describe.d.ts +5 -2
- package/dist/store/reducers/describe.js +2 -2
- package/dist/store/reducers/executeQuery.d.ts +2 -2
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +2 -2
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js +19 -14
- package/dist/store/reducers/executeTopQueries/types.d.ts +2 -2
- package/dist/store/reducers/executeTopQueries/utils.js +11 -7
- package/dist/store/reducers/explainQuery/explainQuery.d.ts +2 -2
- package/dist/store/reducers/explainQuery/explainQuery.js +6 -1
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +58 -58
- package/dist/store/reducers/heatmap.d.ts +2 -2
- package/dist/store/reducers/heatmap.js +3 -3
- package/dist/store/reducers/hotKeys/hotKeys.d.ts +3 -2
- package/dist/store/reducers/hotKeys/hotKeys.js +3 -3
- package/dist/store/reducers/index.d.ts +3 -3
- package/dist/store/reducers/network/network.d.ts +2 -2
- package/dist/store/reducers/network/network.js +1 -1
- package/dist/store/reducers/node/node.d.ts +3 -3
- package/dist/store/reducers/node/selectors.d.ts +1 -1
- package/dist/store/reducers/node/selectors.js +2 -2
- package/dist/store/reducers/nodes/nodes.d.ts +3 -3
- package/dist/store/reducers/nodesList.d.ts +3 -3
- package/dist/store/reducers/overview/overview.d.ts +5 -2
- package/dist/store/reducers/overview/overview.js +2 -2
- package/dist/store/reducers/partitions/partitions.d.ts +2 -2
- package/dist/store/reducers/pdisk/pdisk.d.ts +3 -3
- package/dist/store/reducers/pdisk/pdisk.js +15 -2
- package/dist/store/reducers/pdisk/types.d.ts +17 -1
- package/dist/store/reducers/pdisk/utils.d.ts +2 -2
- package/dist/store/reducers/pdisk/utils.js +68 -8
- package/dist/store/reducers/preview.d.ts +2 -2
- package/dist/store/reducers/preview.js +1 -1
- package/dist/store/reducers/queryActions/types.d.ts +1 -1
- package/dist/store/reducers/schema/schema.d.ts +28 -10
- package/dist/store/reducers/schema/schema.js +11 -12
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +4 -2
- package/dist/store/reducers/schemaAcl/schemaAcl.js +9 -3
- package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +2 -2
- package/dist/store/reducers/shardsWorkload/shardsWorkload.js +22 -6
- package/dist/store/reducers/shardsWorkload/types.d.ts +2 -2
- package/dist/store/reducers/storage/storage.d.ts +3 -3
- package/dist/store/reducers/tablet.d.ts +3 -3
- package/dist/store/reducers/tablets.d.ts +13 -13
- package/dist/store/reducers/tabletsFilters.d.ts +1 -1
- package/dist/store/reducers/tenant/tenant.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +1 -1
- package/dist/store/reducers/tenantOverview/topNodes/topNodes.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +1 -1
- package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.d.ts +2 -2
- package/dist/store/reducers/tenants/selectors.d.ts +27 -27
- package/dist/store/reducers/tenants/tenants.d.ts +2 -2
- package/dist/store/reducers/topic.d.ts +44 -44
- package/dist/store/reducers/vdisk/vdisk.d.ts +2 -2
- package/dist/store/reducers/vdisk/vdisk.js +1 -1
- package/dist/store/reducers/viewSchema/viewSchema.d.ts +2 -2
- package/dist/store/reducers/viewSchema/viewSchema.js +1 -1
- package/dist/store/state-url-mapping.d.ts +70 -0
- package/dist/store/state-url-mapping.js +1 -5
- package/dist/styles/mixins.scss +11 -0
- package/dist/types/api/acl.d.ts +1 -0
- package/dist/types/api/pdisk.d.ts +65 -2
- package/dist/types/api/vdisk.d.ts +33 -2
- package/dist/types/common.d.ts +3 -0
- package/dist/types/store/heatmap.d.ts +1 -0
- package/dist/types/store/query.d.ts +4 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +1 -0
- package/dist/utils/dataFormatters/dataFormatters.d.ts +0 -4
- package/dist/utils/dataFormatters/dataFormatters.js +2 -8
- package/dist/utils/developerUI/developerUI.d.ts +1 -0
- package/dist/utils/developerUI/developerUI.js +3 -0
- package/dist/utils/disks/getPDiskType.d.ts +3 -3
- package/dist/utils/disks/helpers.d.ts +1 -0
- package/dist/utils/disks/helpers.js +3 -0
- package/dist/utils/disks/prepareDisks.d.ts +2 -2
- package/dist/utils/disks/prepareDisks.js +17 -22
- package/dist/utils/disks/types.d.ts +7 -5
- package/dist/utils/monaco/constats.d.ts +2 -0
- package/dist/utils/monaco/constats.js +2 -0
- package/dist/utils/monaco/yql/constants.d.ts +0 -1
- package/dist/utils/monaco/yql/constants.js +0 -1
- package/dist/utils/monaco/yql/yql.completionItemProvider.js +2 -2
- package/dist/utils/query.d.ts +24 -1
- package/dist/utils/query.js +40 -0
- package/package.json +5 -1
- package/dist/components/DeveloperUiLink/DeveloperUiLink.d.ts +0 -8
- package/dist/components/NodeHostWrapper/NodeHostWrapper.scss +0 -15
- package/dist/containers/Node/NodeStructure/Vdisk.d.ts +0 -6
- package/dist/containers/Node/NodeStructure/Vdisk.js +0 -13
- package/dist/containers/PDiskPage/PDiskGroups.d.ts +0 -9
- package/dist/containers/PDiskPage/PDiskGroups.js +0 -20
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/ru.json +0 -5
- package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.d.ts +0 -5
- package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.js +0 -38
- package/dist/utils/monaco/index.d.ts +0 -1
- package/dist/utils/monaco/index.js +0 -6
- package/dist/utils/monaco/s-expression/constants.d.ts +0 -1
- package/dist/utils/monaco/s-expression/constants.js +0 -1
- package/dist/utils/monaco/s-expression/registerLanguage.d.ts +0 -1
- package/dist/utils/monaco/s-expression/registerLanguage.js +0 -59
- package/dist/utils/monaco/yql/registerLanguage.d.ts +0 -1
- package/dist/utils/monaco/yql/registerLanguage.js +0 -8
- package/dist/utils/monaco/yql/yql.d.ts +0 -7
- package/dist/utils/monaco/yql/yql.js +0 -180
- package/dist/utils/monaco/yql/yql.keywords.d.ts +0 -3
- package/dist/utils/monaco/yql/yql.keywords.js +0 -3
@@ -2,6 +2,7 @@ import type { QueryAction, QueryMode } from '../../../../types/store/query';
|
|
2
2
|
import './QueryEditorControls.scss';
|
3
3
|
interface QueryEditorControlsProps {
|
4
4
|
onRunButtonClick: (mode?: QueryMode) => void;
|
5
|
+
onSettingsButtonClick: () => void;
|
5
6
|
runIsLoading: boolean;
|
6
7
|
onExplainButtonClick: (mode?: QueryMode) => void;
|
7
8
|
explainIsLoading: boolean;
|
@@ -10,5 +11,5 @@ interface QueryEditorControlsProps {
|
|
10
11
|
queryMode: QueryMode;
|
11
12
|
highlightedAction: QueryAction;
|
12
13
|
}
|
13
|
-
export declare const QueryEditorControls: ({ onRunButtonClick, runIsLoading, onExplainButtonClick, explainIsLoading, disabled,
|
14
|
+
export declare const QueryEditorControls: ({ onRunButtonClick, onSettingsButtonClick, onUpdateQueryMode, runIsLoading, onExplainButtonClick, explainIsLoading, disabled, queryMode, highlightedAction, }: QueryEditorControlsProps) => import("react/jsx-runtime").JSX.Element;
|
14
15
|
export {};
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
|
-
import { ChevronDown, PlayFill } from '@gravity-ui/icons';
|
3
|
+
import { ChevronDown, Gear, PlayFill } from '@gravity-ui/icons';
|
4
4
|
import { Button, DropdownMenu, Icon } from '@gravity-ui/uikit';
|
5
5
|
import { LabelWithPopover } from '../../../../components/LabelWithPopover';
|
6
|
+
import { QUERY_SETTINGS, useSetting } from '../../../../lib';
|
6
7
|
import { cn } from '../../../../utils/cn';
|
7
8
|
import { QUERY_MODES, QUERY_MODES_TITLES } from '../../../../utils/query';
|
8
9
|
import { SaveQuery } from '../SaveQuery/SaveQuery';
|
@@ -33,7 +34,10 @@ const QueryModeSelectorOptions = {
|
|
33
34
|
description: i18n('method-description.pg'),
|
34
35
|
},
|
35
36
|
};
|
36
|
-
export const QueryEditorControls = ({ onRunButtonClick, runIsLoading, onExplainButtonClick, explainIsLoading, disabled,
|
37
|
+
export const QueryEditorControls = ({ onRunButtonClick, onSettingsButtonClick, onUpdateQueryMode, runIsLoading, onExplainButtonClick, explainIsLoading, disabled, queryMode, highlightedAction, }) => {
|
38
|
+
const [useQuerySettings] = useSetting(QUERY_SETTINGS);
|
39
|
+
const runView = highlightedAction === 'execute' ? 'action' : undefined;
|
40
|
+
const explainView = highlightedAction === 'explain' ? 'action' : undefined;
|
37
41
|
const querySelectorMenuItems = React.useMemo(() => {
|
38
42
|
return Object.entries(QueryModeSelectorOptions).map(([mode, { title, description }]) => {
|
39
43
|
return {
|
@@ -44,14 +48,12 @@ export const QueryEditorControls = ({ onRunButtonClick, runIsLoading, onExplainB
|
|
44
48
|
};
|
45
49
|
});
|
46
50
|
}, [onUpdateQueryMode]);
|
47
|
-
const runView = highlightedAction === 'execute' ? 'action' : undefined;
|
48
|
-
const explainView = highlightedAction === 'explain' ? 'action' : undefined;
|
49
51
|
return (_jsxs("div", { className: b(), children: [_jsxs("div", { className: b('left'), children: [_jsxs(Button, { onClick: () => {
|
50
52
|
onRunButtonClick(queryMode);
|
51
|
-
}, disabled: disabled, loading: runIsLoading, view: runView, children: [_jsx(Icon, { data: PlayFill, size: 14 }), 'Run'] }), _jsx(Button, { onClick: () => {
|
53
|
+
}, disabled: disabled, loading: runIsLoading, view: runView, className: b('run-button'), children: [_jsx(Icon, { data: PlayFill, size: 14 }), 'Run'] }), _jsx(Button, { onClick: () => {
|
52
54
|
onExplainButtonClick(queryMode);
|
53
|
-
}, disabled: disabled, loading: explainIsLoading, view: explainView, children: "Explain" }), _jsx("div", { className: b('mode-selector'), children: _jsx(DropdownMenu, { items: querySelectorMenuItems, popupProps: {
|
55
|
+
}, disabled: disabled, loading: explainIsLoading, view: explainView, children: "Explain" }), useQuerySettings ? (_jsx(Button, { onClick: onSettingsButtonClick, loading: runIsLoading, className: b('gear-button'), children: _jsx(Icon, { data: Gear, size: 16 }) })) : (_jsx("div", { className: b('mode-selector'), children: _jsx(DropdownMenu, { items: querySelectorMenuItems, popupProps: {
|
54
56
|
className: b('mode-selector__popup'),
|
55
57
|
qa: queryModeSelectorPopupQa,
|
56
|
-
}, switcher: _jsx(Button, { className: b('mode-selector__button'), qa: queryModeSelectorQa, children: _jsxs("span", { className: b('mode-selector__button-content'), children: [`${i18n('controls.query-mode-selector_type')} ${QueryModeSelectorOptions[queryMode].title}`, _jsx(Icon, { data: ChevronDown })] }) }) }) })] }), _jsx(SaveQuery, { isSaveButtonDisabled: disabled })] }));
|
58
|
+
}, switcher: _jsx(Button, { className: b('mode-selector__button'), qa: queryModeSelectorQa, children: _jsxs("span", { className: b('mode-selector__button-content'), children: [`${i18n('controls.query-mode-selector_type')} ${QueryModeSelectorOptions[queryMode].title}`, _jsx(Icon, { data: ChevronDown })] }) }) }) }))] }), _jsx(SaveQuery, { isSaveButtonDisabled: disabled })] }));
|
57
59
|
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
3
|
+
import { Dialog, Link as ExternalLink, Flex, TextInput } from '@gravity-ui/uikit';
|
4
|
+
import { Controller, useForm } from 'react-hook-form';
|
5
|
+
import { selectQueryAction, setQueryAction, } from '../../../../store/reducers/queryActions/queryActions';
|
6
|
+
import { cn } from '../../../../utils/cn';
|
7
|
+
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
8
|
+
import { ISOLATION_LEVELS, QUERY_MODES, STATISTICS_MODES, TRACING_LEVELS, } from '../../../../utils/query';
|
9
|
+
import { QuerySettingsSelect } from './QuerySettingsSelect';
|
10
|
+
import { ISOLATION_LEVEL_SELECT_OPTIONS, QUERY_MODE_SELECT_OPTIONS, STATISTICS_MODE_SELECT_OPTIONS, TRACING_LEVEL_SELECT_OPTIONS, } from './constants';
|
11
|
+
import i18n from './i18n';
|
12
|
+
import './QuerySettingsDialog.scss';
|
13
|
+
const b = cn('ydb-query-settings-dialog');
|
14
|
+
export function QuerySettingsDialog() {
|
15
|
+
const dispatch = useTypedDispatch();
|
16
|
+
const queryAction = useTypedSelector(selectQueryAction);
|
17
|
+
const { control, handleSubmit, reset } = useForm({
|
18
|
+
defaultValues: {
|
19
|
+
queryMode: QUERY_MODES.script,
|
20
|
+
timeout: '60',
|
21
|
+
isolationLevel: ISOLATION_LEVELS.serializable,
|
22
|
+
statisticsMode: STATISTICS_MODES.none,
|
23
|
+
tracingLevel: TRACING_LEVELS.detailed,
|
24
|
+
},
|
25
|
+
});
|
26
|
+
const onCloseDialog = () => {
|
27
|
+
dispatch(setQueryAction('idle'));
|
28
|
+
reset();
|
29
|
+
};
|
30
|
+
const onSaveClick = (data) => {
|
31
|
+
console.log('Form Data:', data);
|
32
|
+
// dispatch(saveQuerySettings(data));
|
33
|
+
onCloseDialog();
|
34
|
+
};
|
35
|
+
return (_jsxs(Dialog, { open: queryAction === 'settings', size: "s", onClose: onCloseDialog, className: b(), hasCloseButton: false, children: [_jsx(Dialog.Header, { caption: i18n('action.settings') }), _jsxs("form", { onSubmit: handleSubmit(onSaveClick), children: [_jsxs(Dialog.Body, { className: b('dialog-body'), children: [_jsxs(Flex, { direction: "row", alignItems: "flex-start", className: b('dialog-row'), children: [_jsx("label", { htmlFor: "queryMode", className: b('field-title'), children: i18n('form.query-mode') }), _jsx("div", { className: b('control-wrapper'), children: _jsx(Controller, { name: "queryMode", control: control, render: ({ field }) => (_jsx(QuerySettingsSelect, { setting: field.value, onUpdateSetting: field.onChange, settingOptions: QUERY_MODE_SELECT_OPTIONS })) }) })] }), _jsxs(Flex, { direction: "row", alignItems: "flex-start", className: b('dialog-row'), children: [_jsx("label", { htmlFor: "timeout", className: b('field-title'), children: i18n('form.timeout') }), _jsx("div", { className: b('control-wrapper'), children: _jsx(Controller, { name: "timeout", control: control, render: ({ field }) => (_jsxs(React.Fragment, { children: [_jsx(TextInput, { type: "number", ...field, className: b('timeout'), placeholder: "60" }), _jsx("span", { className: b('timeout-suffix'), children: i18n('form.timeout.seconds') })] })) }) })] }), _jsxs(Flex, { direction: "row", alignItems: "flex-start", className: b('dialog-row'), children: [_jsx("label", { htmlFor: "tracingLevel", className: b('field-title'), children: i18n('form.tracing-level') }), _jsx("div", { className: b('control-wrapper'), children: _jsx(Controller, { name: "tracingLevel", control: control, render: ({ field }) => (_jsx(QuerySettingsSelect, { setting: field.value, onUpdateSetting: field.onChange, settingOptions: TRACING_LEVEL_SELECT_OPTIONS })) }) })] }), _jsxs(Flex, { direction: "row", alignItems: "flex-start", className: b('dialog-row'), children: [_jsx("label", { htmlFor: "isolationLevel", className: b('field-title'), children: i18n('form.isolation-level') }), _jsx("div", { className: b('control-wrapper'), children: _jsx(Controller, { name: "isolationLevel", control: control, render: ({ field }) => (_jsx(QuerySettingsSelect, { setting: field.value, onUpdateSetting: field.onChange, settingOptions: ISOLATION_LEVEL_SELECT_OPTIONS })) }) })] }), _jsxs(Flex, { direction: "row", alignItems: "flex-start", className: b('dialog-row'), children: [_jsx("label", { htmlFor: "statisticsMode", className: b('field-title'), children: i18n('form.statistics-mode') }), _jsx("div", { className: b('control-wrapper'), children: _jsx(Controller, { name: "statisticsMode", control: control, render: ({ field }) => (_jsx(QuerySettingsSelect, { setting: field.value, onUpdateSetting: field.onChange, settingOptions: STATISTICS_MODE_SELECT_OPTIONS })) }) })] })] }), _jsx(Dialog.Footer, { textButtonApply: i18n('button-done'), textButtonCancel: i18n('button-cancel'), onClickButtonCancel: onCloseDialog, propsButtonApply: {
|
36
|
+
type: 'submit',
|
37
|
+
}, renderButtons: (buttonApply, buttonCancel) => (_jsxs("div", { className: b('buttons-container'), children: [_jsx(ExternalLink, { href: "https://ydb.tech/docs/ru/concepts/transactions", target: "_blank", className: b('documentation-link'), children: i18n('docs') }), _jsxs("div", { className: b('main-buttons'), children: [buttonCancel, buttonApply] })] })) })] })] }));
|
38
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
.ydb-query-settings-dialog {
|
2
|
+
&__dialog-row {
|
3
|
+
& + & {
|
4
|
+
margin-top: var(--g-text-body-1-line-height);
|
5
|
+
}
|
6
|
+
}
|
7
|
+
|
8
|
+
&__field-title {
|
9
|
+
flex: 4;
|
10
|
+
|
11
|
+
margin-right: var(--g-spacing-3);
|
12
|
+
|
13
|
+
font-weight: 500;
|
14
|
+
line-height: var(--g-text-header-2-line-height);
|
15
|
+
white-space: nowrap;
|
16
|
+
}
|
17
|
+
|
18
|
+
.g-dialog-footer__bts-wrapper {
|
19
|
+
width: 100%;
|
20
|
+
}
|
21
|
+
|
22
|
+
&__dialog-body {
|
23
|
+
padding-top: var(--g-spacing-6);
|
24
|
+
}
|
25
|
+
|
26
|
+
&__control-wrapper {
|
27
|
+
display: flex;
|
28
|
+
flex: 6;
|
29
|
+
}
|
30
|
+
|
31
|
+
&__timeout {
|
32
|
+
width: 33.3%;
|
33
|
+
margin-right: var(--g-spacing-2);
|
34
|
+
}
|
35
|
+
|
36
|
+
&__timeout-suffix {
|
37
|
+
display: flex;
|
38
|
+
align-items: center;
|
39
|
+
|
40
|
+
color: var(--g-color-text-secondary);
|
41
|
+
}
|
42
|
+
|
43
|
+
&__documentation-link {
|
44
|
+
display: flex;
|
45
|
+
align-items: center;
|
46
|
+
|
47
|
+
margin-left: var(--g-spacing-4);
|
48
|
+
|
49
|
+
color: var(--g-color-text-secondary);
|
50
|
+
}
|
51
|
+
|
52
|
+
&__buttons-container {
|
53
|
+
display: flex;
|
54
|
+
justify-content: space-between;
|
55
|
+
|
56
|
+
width: 100%;
|
57
|
+
}
|
58
|
+
|
59
|
+
&__main-buttons {
|
60
|
+
display: flex;
|
61
|
+
gap: 10px;
|
62
|
+
}
|
63
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { SelectOption } from '@gravity-ui/uikit';
|
2
|
+
import type { IsolationLevel, QueryMode, StatisticsMode, TracingLevel } from '../../../../types/store/query';
|
3
|
+
import './QuerySettingsSelect.scss';
|
4
|
+
export declare const getOptionHeight: () => number;
|
5
|
+
type SelectType = QueryMode | IsolationLevel | StatisticsMode | TracingLevel;
|
6
|
+
type QuerySettingSelectOption<T> = SelectOption<T> & {
|
7
|
+
isDefault?: boolean;
|
8
|
+
};
|
9
|
+
interface QuerySettingsSelectProps<T extends SelectType> {
|
10
|
+
setting: T;
|
11
|
+
settingOptions: QuerySettingSelectOption<T>[];
|
12
|
+
onUpdateSetting: (mode: T) => void;
|
13
|
+
}
|
14
|
+
export declare function QuerySettingsSelect<T extends SelectType>(props: QuerySettingsSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
15
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { Select } from '@gravity-ui/uikit';
|
3
|
+
import { cn } from '../../../../utils/cn';
|
4
|
+
import i18n from './i18n';
|
5
|
+
import './QuerySettingsSelect.scss';
|
6
|
+
// Make option height dynamic.
|
7
|
+
// By default it has static height.
|
8
|
+
export const getOptionHeight = () => -1;
|
9
|
+
const b = cn('ydb-query-settings-select');
|
10
|
+
export function QuerySettingsSelect(props) {
|
11
|
+
return (_jsx("div", { className: b('selector'), children: _jsx(Select, { options: props.settingOptions, value: [props.setting], onUpdate: (value) => {
|
12
|
+
props.onUpdateSetting(value[0]);
|
13
|
+
}, getOptionHeight: getOptionHeight, popupClassName: b('popup'), renderOption: (option) => (_jsxs("div", { className: b('item'), children: [_jsxs("div", { className: b('item-title'), children: [option.content, option.isDefault ? i18n('description.default') : ''] }), option.text && (_jsx("span", { className: b('item-description'), children: option.text }))] })), width: "max" }) }));
|
14
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.ydb-query-settings-select {
|
2
|
+
&__selector {
|
3
|
+
width: 100%;
|
4
|
+
}
|
5
|
+
|
6
|
+
&__popup {
|
7
|
+
max-width: 320px;
|
8
|
+
}
|
9
|
+
|
10
|
+
&__item-description {
|
11
|
+
white-space: pre-wrap;
|
12
|
+
|
13
|
+
color: var(--g-color-text-secondary);
|
14
|
+
}
|
15
|
+
|
16
|
+
&__item {
|
17
|
+
padding: var(--g-spacing-1) 0;
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
export declare const ISOLATION_LEVEL_SELECT_OPTIONS: ({
|
2
|
+
value: "serializable-read-write";
|
3
|
+
content: string;
|
4
|
+
text: string;
|
5
|
+
isDefault: boolean;
|
6
|
+
} | {
|
7
|
+
value: "online-read-only";
|
8
|
+
content: string;
|
9
|
+
text: string;
|
10
|
+
isDefault?: undefined;
|
11
|
+
} | {
|
12
|
+
value: "stale-read-only";
|
13
|
+
content: string;
|
14
|
+
text: string;
|
15
|
+
isDefault?: undefined;
|
16
|
+
} | {
|
17
|
+
value: "snapshot-read-only";
|
18
|
+
content: string;
|
19
|
+
text: string;
|
20
|
+
isDefault?: undefined;
|
21
|
+
})[];
|
22
|
+
export declare const QUERY_MODE_SELECT_OPTIONS: ({
|
23
|
+
value: "script";
|
24
|
+
content: string;
|
25
|
+
text: string;
|
26
|
+
isDefault: boolean;
|
27
|
+
} | {
|
28
|
+
value: "scan";
|
29
|
+
content: string;
|
30
|
+
text: string;
|
31
|
+
isDefault?: undefined;
|
32
|
+
} | {
|
33
|
+
value: "data";
|
34
|
+
content: string;
|
35
|
+
text: string;
|
36
|
+
isDefault?: undefined;
|
37
|
+
} | {
|
38
|
+
value: "query";
|
39
|
+
content: string;
|
40
|
+
text: string;
|
41
|
+
isDefault?: undefined;
|
42
|
+
} | {
|
43
|
+
value: "pg";
|
44
|
+
content: string;
|
45
|
+
text: string;
|
46
|
+
isDefault?: undefined;
|
47
|
+
})[];
|
48
|
+
export declare const STATISTICS_MODE_SELECT_OPTIONS: ({
|
49
|
+
value: "none";
|
50
|
+
content: string;
|
51
|
+
text: string;
|
52
|
+
isDefault: boolean;
|
53
|
+
} | {
|
54
|
+
value: "basic";
|
55
|
+
content: string;
|
56
|
+
text: string;
|
57
|
+
isDefault?: undefined;
|
58
|
+
} | {
|
59
|
+
value: "full";
|
60
|
+
content: string;
|
61
|
+
text: string;
|
62
|
+
isDefault?: undefined;
|
63
|
+
} | {
|
64
|
+
value: "profile";
|
65
|
+
content: string;
|
66
|
+
text: string;
|
67
|
+
isDefault?: undefined;
|
68
|
+
})[];
|
69
|
+
export declare const TRACING_LEVEL_SELECT_OPTIONS: ({
|
70
|
+
value: "basic";
|
71
|
+
content: string;
|
72
|
+
text: string;
|
73
|
+
isDefault?: undefined;
|
74
|
+
} | {
|
75
|
+
value: "detailed";
|
76
|
+
content: string;
|
77
|
+
text: string;
|
78
|
+
isDefault: boolean;
|
79
|
+
} | {
|
80
|
+
value: "diagnostic";
|
81
|
+
content: string;
|
82
|
+
text: string;
|
83
|
+
isDefault?: undefined;
|
84
|
+
} | {
|
85
|
+
value: "off";
|
86
|
+
content: string;
|
87
|
+
text: string;
|
88
|
+
isDefault?: undefined;
|
89
|
+
} | {
|
90
|
+
value: "toplevel";
|
91
|
+
content: string;
|
92
|
+
text: string;
|
93
|
+
isDefault?: undefined;
|
94
|
+
} | {
|
95
|
+
value: "trace";
|
96
|
+
content: string;
|
97
|
+
text: string;
|
98
|
+
isDefault?: undefined;
|
99
|
+
})[];
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import { ISOLATION_LEVELS, ISOLATION_LEVELS_TITLES, QUERY_MODES, QUERY_MODES_TITLES, STATISTICS_MODES, STATISTICS_MODES_TITLES, TRACING_LEVELS, TRACING_LEVELS_TITLES, } from '../../../../utils/query';
|
2
|
+
import i18n from '../i18n';
|
3
|
+
export const ISOLATION_LEVEL_SELECT_OPTIONS = [
|
4
|
+
{
|
5
|
+
value: ISOLATION_LEVELS.serializable,
|
6
|
+
content: ISOLATION_LEVELS_TITLES[ISOLATION_LEVELS.serializable],
|
7
|
+
text: i18n('isolation-level-description.serializable'),
|
8
|
+
isDefault: true,
|
9
|
+
},
|
10
|
+
{
|
11
|
+
value: ISOLATION_LEVELS.onlinero,
|
12
|
+
content: ISOLATION_LEVELS_TITLES[ISOLATION_LEVELS.onlinero],
|
13
|
+
text: i18n('isolation-level-description.onlinero'),
|
14
|
+
},
|
15
|
+
{
|
16
|
+
value: ISOLATION_LEVELS.stalero,
|
17
|
+
content: ISOLATION_LEVELS_TITLES[ISOLATION_LEVELS.stalero],
|
18
|
+
text: i18n('isolation-level-description.stalero'),
|
19
|
+
},
|
20
|
+
{
|
21
|
+
value: ISOLATION_LEVELS.snapshot,
|
22
|
+
content: ISOLATION_LEVELS_TITLES[ISOLATION_LEVELS.snapshot],
|
23
|
+
text: i18n('isolation-level-description.snapshot'),
|
24
|
+
},
|
25
|
+
];
|
26
|
+
export const QUERY_MODE_SELECT_OPTIONS = [
|
27
|
+
{
|
28
|
+
value: QUERY_MODES.script,
|
29
|
+
content: QUERY_MODES_TITLES[QUERY_MODES.script],
|
30
|
+
text: i18n('method-description.script'),
|
31
|
+
isDefault: true,
|
32
|
+
},
|
33
|
+
{
|
34
|
+
value: QUERY_MODES.scan,
|
35
|
+
content: QUERY_MODES_TITLES[QUERY_MODES.scan],
|
36
|
+
text: i18n('method-description.scan'),
|
37
|
+
},
|
38
|
+
{
|
39
|
+
value: QUERY_MODES.data,
|
40
|
+
content: QUERY_MODES_TITLES[QUERY_MODES.data],
|
41
|
+
text: i18n('method-description.data'),
|
42
|
+
},
|
43
|
+
{
|
44
|
+
value: QUERY_MODES.query,
|
45
|
+
content: QUERY_MODES_TITLES[QUERY_MODES.query],
|
46
|
+
text: i18n('method-description.query'),
|
47
|
+
},
|
48
|
+
{
|
49
|
+
value: QUERY_MODES.pg,
|
50
|
+
content: QUERY_MODES_TITLES[QUERY_MODES.pg],
|
51
|
+
text: i18n('method-description.pg'),
|
52
|
+
},
|
53
|
+
];
|
54
|
+
export const STATISTICS_MODE_SELECT_OPTIONS = [
|
55
|
+
{
|
56
|
+
value: STATISTICS_MODES.none,
|
57
|
+
content: STATISTICS_MODES_TITLES[STATISTICS_MODES.none],
|
58
|
+
text: i18n('statistics-mode-description.none'),
|
59
|
+
isDefault: true,
|
60
|
+
},
|
61
|
+
{
|
62
|
+
value: STATISTICS_MODES.basic,
|
63
|
+
content: STATISTICS_MODES_TITLES[STATISTICS_MODES.basic],
|
64
|
+
text: i18n('statistics-mode-description.basic'),
|
65
|
+
},
|
66
|
+
{
|
67
|
+
value: STATISTICS_MODES.full,
|
68
|
+
content: STATISTICS_MODES_TITLES[STATISTICS_MODES.full],
|
69
|
+
text: i18n('statistics-mode-description.full'),
|
70
|
+
},
|
71
|
+
{
|
72
|
+
value: STATISTICS_MODES.profile,
|
73
|
+
content: STATISTICS_MODES_TITLES[STATISTICS_MODES.profile],
|
74
|
+
text: i18n('statistics-mode-description.profile'),
|
75
|
+
},
|
76
|
+
];
|
77
|
+
export const TRACING_LEVEL_SELECT_OPTIONS = [
|
78
|
+
{
|
79
|
+
value: TRACING_LEVELS.basic,
|
80
|
+
content: TRACING_LEVELS_TITLES[TRACING_LEVELS.basic],
|
81
|
+
text: i18n('tracing-level-description.basic'),
|
82
|
+
},
|
83
|
+
{
|
84
|
+
value: TRACING_LEVELS.detailed,
|
85
|
+
content: TRACING_LEVELS_TITLES[TRACING_LEVELS.detailed],
|
86
|
+
text: i18n('tracing-level-description.detailed'),
|
87
|
+
isDefault: true,
|
88
|
+
},
|
89
|
+
{
|
90
|
+
value: TRACING_LEVELS.diagnostic,
|
91
|
+
content: TRACING_LEVELS_TITLES[TRACING_LEVELS.diagnostic],
|
92
|
+
text: i18n('tracing-level-description.diagnostic'),
|
93
|
+
},
|
94
|
+
{
|
95
|
+
value: TRACING_LEVELS.off,
|
96
|
+
content: TRACING_LEVELS_TITLES[TRACING_LEVELS.off],
|
97
|
+
text: i18n('tracing-level-description.off'),
|
98
|
+
},
|
99
|
+
{
|
100
|
+
value: TRACING_LEVELS.toplevel,
|
101
|
+
content: TRACING_LEVELS_TITLES[TRACING_LEVELS.toplevel],
|
102
|
+
text: i18n('tracing-level-description.toplevel'),
|
103
|
+
},
|
104
|
+
{
|
105
|
+
value: TRACING_LEVELS.trace,
|
106
|
+
content: TRACING_LEVELS_TITLES[TRACING_LEVELS.trace],
|
107
|
+
text: i18n('tracing-level-description.trace'),
|
108
|
+
},
|
109
|
+
];
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"action.settings": "Query settings",
|
3
|
+
"form.query-mode": "Query type",
|
4
|
+
"form.timeout": "Timeout",
|
5
|
+
"form.isolation-level": "Isolation level",
|
6
|
+
"form.statistics-mode": "Statistics collection mode",
|
7
|
+
"form.tracing-level": "Tracing level",
|
8
|
+
"button-done": "Save",
|
9
|
+
"button-cancel": "Cancel",
|
10
|
+
"form.timeout.seconds": "sec",
|
11
|
+
"description.default": " (default)",
|
12
|
+
"docs": "Documentation"
|
13
|
+
}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
declare const _default: (key: "button-cancel" | "action.settings" | "form.query-mode" | "form.timeout" | "form.isolation-level" | "form.statistics-mode" | "form.tracing-level" | "button-done" | "form.timeout.seconds" | "description.default" | "docs", params?: import("@gravity-ui/i18n").Params) => string;
|
2
|
+
export default _default;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"action.settings": "Настройки запроса",
|
3
|
+
"form.query-mode": "Тип запроса",
|
4
|
+
"form.timeout": "Таймаут",
|
5
|
+
"form.isolation-level": "Уровень изоляции",
|
6
|
+
"form.statistics-mode": "Режим сбора статистики",
|
7
|
+
"form.tracing-level": "Tracing level",
|
8
|
+
"button-done": "Готово",
|
9
|
+
"button-cancel": "Отменить",
|
10
|
+
"form.timeout.seconds": "сек",
|
11
|
+
"description.default": " (default)",
|
12
|
+
"docs": "Документация"
|
13
|
+
}
|
@@ -17,6 +17,20 @@
|
|
17
17
|
"method-description.data": "DML queries for changing and fetching data in serialization mode.\nAPI call: table.executeDataQuery",
|
18
18
|
"method-description.query": "Any query. An experimental API call supposed to replace all existing methods.\nAPI Call: query.ExecuteScript",
|
19
19
|
"method-description.pg": "Queries in postgresql syntax.\nAPI call: query.ExecuteScript",
|
20
|
+
"isolation-level-description.serializable": "Provides the strictest isolation level for custom transactions",
|
21
|
+
"isolation-level-description.onlinero": "Each read operation in the transaction is reading the data that is most recent at execution time",
|
22
|
+
"isolation-level-description.stalero": "Read operations within a transaction may return results that are slightly out-of-date (lagging by fractions of a second)",
|
23
|
+
"isolation-level-description.snapshot": "All the read operations within a transaction access the database snapshot. All the data reads are consistent",
|
24
|
+
"tracing-level-description.basic": "Spans of main component operations",
|
25
|
+
"tracing-level-description.detailed": "Highest detail applicable for diagnosing problems in production",
|
26
|
+
"tracing-level-description.diagnostic": "Detailed debugging information for developers",
|
27
|
+
"tracing-level-description.off": "No tracing",
|
28
|
+
"tracing-level-description.toplevel": "Lowest detail, no more than two spans per request to the component",
|
29
|
+
"tracing-level-description.trace": "Very detailed debugging information",
|
30
|
+
"statistics-mode-description.none": "Don't collect statistics",
|
31
|
+
"statistics-mode-description.basic": "Collect statistics",
|
32
|
+
"statistics-mode-description.full": "Collect statistics and query plan",
|
33
|
+
"statistics-mode-description.profile": "Collect statistics for individual tasks",
|
20
34
|
"query-duration.description": "Duration of server-side query execution",
|
21
35
|
"action.send-query": "Send query",
|
22
36
|
"action.send-selected-query": "Send selected query",
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key: "controls.query-mode-selector_type" | "tabs.newQuery" | "tabs.history" | "tabs.saved" | "history.empty" | "saved.empty" | "delete-dialog.header" | "delete-dialog.question" | "delete-dialog.delete" | "delete-dialog.cancel" | "preview.title" | "preview.not-available" | "preview.close" | "method-description.script" | "method-description.scan" | "method-description.data" | "method-description.query" | "method-description.pg" | "query-duration.description" | "action.send-query" | "action.send-selected-query" | "action.previous-query" | "action.next-query" | "action.save-query", params?: import("@gravity-ui/i18n").Params) => string;
|
1
|
+
declare const _default: (key: "controls.query-mode-selector_type" | "tabs.newQuery" | "tabs.history" | "tabs.saved" | "history.empty" | "saved.empty" | "delete-dialog.header" | "delete-dialog.question" | "delete-dialog.delete" | "delete-dialog.cancel" | "preview.title" | "preview.not-available" | "preview.close" | "method-description.script" | "method-description.scan" | "method-description.data" | "method-description.query" | "method-description.pg" | "isolation-level-description.serializable" | "isolation-level-description.onlinero" | "isolation-level-description.stalero" | "isolation-level-description.snapshot" | "tracing-level-description.basic" | "tracing-level-description.detailed" | "tracing-level-description.diagnostic" | "tracing-level-description.off" | "tracing-level-description.toplevel" | "tracing-level-description.trace" | "statistics-mode-description.none" | "statistics-mode-description.basic" | "statistics-mode-description.full" | "statistics-mode-description.profile" | "query-duration.description" | "action.send-query" | "action.send-selected-query" | "action.previous-query" | "action.next-query" | "action.save-query", params?: import("@gravity-ui/i18n").Params) => string;
|
2
2
|
export default _default;
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import './CreateDirectoryDialog.scss';
|
2
|
-
interface
|
2
|
+
interface CreateDirectoryDialogProps {
|
3
3
|
open: boolean;
|
4
4
|
onClose: VoidFunction;
|
5
|
+
database: string;
|
5
6
|
parentPath: string;
|
6
7
|
onSuccess: (value: string) => void;
|
7
8
|
}
|
8
|
-
export declare function CreateDirectoryDialog({ open, onClose, parentPath, onSuccess }:
|
9
|
+
export declare function CreateDirectoryDialog({ open, onClose, database, parentPath, onSuccess, }: CreateDirectoryDialogProps): import("react/jsx-runtime").JSX.Element;
|
9
10
|
export {};
|
@@ -17,7 +17,7 @@ function validateRelativePath(value) {
|
|
17
17
|
}
|
18
18
|
return '';
|
19
19
|
}
|
20
|
-
export function CreateDirectoryDialog({ open, onClose, parentPath, onSuccess }) {
|
20
|
+
export function CreateDirectoryDialog({ open, onClose, database, parentPath, onSuccess, }) {
|
21
21
|
const [validationError, setValidationError] = React.useState('');
|
22
22
|
const [relativePath, setRelativePath] = React.useState('');
|
23
23
|
const [create, response] = schemaApi.useCreateDirectoryMutation();
|
@@ -37,7 +37,7 @@ export function CreateDirectoryDialog({ open, onClose, parentPath, onSuccess })
|
|
37
37
|
const handleSubmit = () => {
|
38
38
|
const path = `${parentPath}/${relativePath}`;
|
39
39
|
create({
|
40
|
-
database
|
40
|
+
database,
|
41
41
|
path,
|
42
42
|
})
|
43
43
|
.unwrap()
|
@@ -22,7 +22,7 @@ export function SchemaTree(props) {
|
|
22
22
|
const fetchPath = async (path) => {
|
23
23
|
let schemaData;
|
24
24
|
do {
|
25
|
-
const promise = dispatch(schemaApi.endpoints.getSchema.initiate({ path }, { forceRefetch: true }));
|
25
|
+
const promise = dispatch(schemaApi.endpoints.getSchema.initiate({ path, database: rootPath }, { forceRefetch: true }));
|
26
26
|
const { data, originalArgs } = await promise;
|
27
27
|
promise.unsubscribe();
|
28
28
|
// Check if the result from the current request is received. rtk-query may skip the current request and
|
@@ -67,7 +67,7 @@ export function SchemaTree(props) {
|
|
67
67
|
setParentPath(value);
|
68
68
|
setCreateDirectoryOpen(true);
|
69
69
|
};
|
70
|
-
return (_jsxs(React.Fragment, { children: [_jsx(CreateDirectoryDialog, { onClose: handleCloseDialog, open: createDirectoryOpen, parentPath: parentPath, onSuccess: handleSuccessSubmit }), _jsx(NavigationTree, { rootState: {
|
70
|
+
return (_jsxs(React.Fragment, { children: [_jsx(CreateDirectoryDialog, { onClose: handleCloseDialog, open: createDirectoryOpen, database: rootPath, parentPath: parentPath, onSuccess: handleSuccessSubmit }), _jsx(NavigationTree, { rootState: {
|
71
71
|
path: rootPath,
|
72
72
|
name: rootName,
|
73
73
|
type: mapPathTypeToNavigationTreeType(rootType),
|
@@ -13,7 +13,7 @@ import { prepareSchemaData, prepareViewSchema } from './prepareData';
|
|
13
13
|
import { b } from './shared';
|
14
14
|
import './SchemaViewer.scss';
|
15
15
|
export const SchemaViewer = ({ type, path, tenantName, extended = false }) => {
|
16
|
-
const { data: schemaData, isLoading: loading } = useGetSchemaQuery({ path });
|
16
|
+
const { data: schemaData, isLoading: loading } = useGetSchemaQuery({ path, database: tenantName });
|
17
17
|
const viewSchemaRequestParams = isViewType(type) ? { path, database: tenantName } : skipToken;
|
18
18
|
const { data: viewColumnsData, isLoading: isViewSchemaLoading } = viewSchemaApi.useGetViewSchemaQuery(viewSchemaRequestParams);
|
19
19
|
const tableData = React.useMemo(() => {
|
@@ -47,7 +47,7 @@ export function Tenant(props) {
|
|
47
47
|
dispatch(setHeaderBreadcrumbs('tenant', { tenantName }));
|
48
48
|
}, [tenantName, dispatch]);
|
49
49
|
const path = schema !== null && schema !== void 0 ? schema : tenantName;
|
50
|
-
const { data: currentItem, error, isLoading } = useGetSchemaQuery({ path });
|
50
|
+
const { data: currentItem, error, isLoading } = useGetSchemaQuery({ path, database: tenantName });
|
51
51
|
const { PathType: currentPathType, PathSubType: currentPathSubType } = ((_a = currentItem === null || currentItem === void 0 ? void 0 : currentItem.PathDescription) === null || _a === void 0 ? void 0 : _a.Self) || {};
|
52
52
|
let showBlockingError = false;
|
53
53
|
if (error && typeof error === 'object' && 'status' in error) {
|
@@ -1,3 +1,13 @@
|
|
1
|
+
import type { paramSetup } from '../../store/state-url-mapping';
|
2
|
+
import type { ExtractType } from '../../types/common';
|
3
|
+
type TenantQueryParams = {
|
4
|
+
[K in keyof (typeof paramSetup)['/tenant']]?: ExtractType<(typeof paramSetup)['/tenant'][K]>;
|
5
|
+
};
|
6
|
+
type AdditionalQueryParams = {
|
7
|
+
name?: string;
|
8
|
+
backend?: string;
|
9
|
+
};
|
10
|
+
type TenantQuery = TenantQueryParams | AdditionalQueryParams;
|
1
11
|
export declare const TenantTabsGroups: {
|
2
12
|
readonly summaryTab: "summaryTab";
|
3
13
|
readonly queryTab: "queryTab";
|
@@ -15,4 +25,5 @@ export declare const TENANT_SCHEMA_TAB: {
|
|
15
25
|
id: "schema";
|
16
26
|
title: string;
|
17
27
|
}[];
|
18
|
-
export declare const getTenantPath: (query
|
28
|
+
export declare const getTenantPath: (query: TenantQuery) => string;
|
29
|
+
export {};
|
@@ -2,8 +2,6 @@
|
|
2
2
|
"page.title": "Database",
|
3
3
|
"pages.query": "Query",
|
4
4
|
"pages.diagnostics": "Diagnostics",
|
5
|
-
"acl.owner": "Owner",
|
6
|
-
"acl.empty": "No Acl data",
|
7
5
|
"summary.navigation": "Navigation",
|
8
6
|
"summary.showPreview": "Show preview",
|
9
7
|
"summary.source-type": "Source Type",
|
@@ -14,6 +12,8 @@
|
|
14
12
|
"summary.id": "Id",
|
15
13
|
"summary.version": "Version",
|
16
14
|
"summary.created": "Created",
|
15
|
+
"summary.data-size": "Data size",
|
16
|
+
"summary.row-count": "Row count",
|
17
17
|
"summary.partitions": "Partitions count",
|
18
18
|
"summary.paths": "Paths",
|
19
19
|
"summary.shards": "Shards",
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key: "page.title" | "pages.query" | "pages.diagnostics" | "
|
1
|
+
declare const _default: (key: "page.title" | "pages.query" | "pages.diagnostics" | "summary.navigation" | "summary.showPreview" | "summary.source-type" | "summary.data-source" | "summary.copySchemaPath" | "summary.type" | "summary.subtype" | "summary.id" | "summary.version" | "summary.created" | "summary.data-size" | "summary.row-count" | "summary.partitions" | "summary.paths" | "summary.shards" | "summary.state" | "summary.mode" | "summary.format" | "summary.retention" | "label.read-only" | "actions.copied" | "actions.notCopied" | "actions.copyPath" | "actions.openPreview" | "actions.createTable" | "actions.createExternalTable" | "actions.createTopic" | "actions.createColumnTable" | "actions.createAsyncReplication" | "actions.createView" | "actions.dropTable" | "actions.dropTopic" | "actions.dropView" | "actions.alterTable" | "actions.alterTopic" | "actions.selectQuery" | "actions.upsertQuery" | "actions.alterReplication" | "actions.dropReplication" | "actions.createDirectory" | "schema.tree.dialog.placeholder" | "schema.tree.dialog.invalid" | "schema.tree.dialog.whitespace" | "schema.tree.dialog.empty" | "schema.tree.dialog.header" | "schema.tree.dialog.description" | "schema.tree.dialog.buttonCancel" | "schema.tree.dialog.buttonApply", params?: import("@gravity-ui/i18n").Params) => string;
|
2
2
|
export default _default;
|
@@ -40,7 +40,7 @@ const pathTypeToEntityName = {
|
|
40
40
|
[EPathType.EPathTypeTable]: 'Table',
|
41
41
|
[EPathType.EPathTypeTableIndex]: 'Secondary Index',
|
42
42
|
[EPathType.EPathTypeColumnStore]: 'Tablestore',
|
43
|
-
[EPathType.EPathTypeColumnTable]: '
|
43
|
+
[EPathType.EPathTypeColumnTable]: 'Column-oriented table',
|
44
44
|
[EPathType.EPathTypeCdcStream]: 'Changefeed',
|
45
45
|
[EPathType.EPathTypePersQueueGroup]: 'Topic',
|
46
46
|
[EPathType.EPathTypeExternalDataSource]: 'External Data Source',
|