ydb-embedded-ui 6.12.0 → 6.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/AutoRefreshControl/i18n/index.d.ts +1 -1
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +3 -2
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +9 -5
- package/dist/components/CriticalActionDialog/CriticalActionDialog.d.ts +5 -3
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +8 -7
- package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +1 -1
- package/dist/components/CriticalActionDialog/i18n/en.json +1 -0
- package/dist/components/CriticalActionDialog/i18n/index.d.ts +1 -1
- package/dist/components/Errors/PageError/PageError.d.ts +11 -0
- package/dist/components/Errors/PageError/PageError.js +19 -0
- package/dist/components/Errors/i18n/en.json +2 -1
- package/dist/components/Errors/i18n/index.d.ts +1 -1
- package/dist/components/Errors/i18n/ru.json +2 -1
- package/dist/components/Fullscreen/Fullscreen.d.ts +1 -1
- package/dist/components/Fullscreen/Fullscreen.js +34 -27
- package/dist/components/Fullscreen/Fullscreen.scss +16 -8
- package/dist/components/Graph/Graph.d.ts +13 -0
- package/dist/components/Graph/Graph.js +41 -0
- package/dist/components/LabelWithPopover/LabelWithPopover.d.ts +4 -1
- package/dist/components/LabelWithPopover/LabelWithPopover.js +1 -1
- package/dist/components/Loader/Loader.d.ts +2 -1
- package/dist/components/Loader/Loader.js +6 -1
- package/dist/components/LoaderWrapper/LoaderWrapper.d.ts +10 -0
- package/dist/components/LoaderWrapper/LoaderWrapper.js +8 -0
- package/dist/components/MetricChart/reducer.d.ts +2 -2
- package/dist/components/PDiskInfo/PDiskInfo.d.ts +2 -2
- package/dist/components/PDiskInfo/PDiskInfo.js +9 -6
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/ProgressViewer/ProgressViewer.js +3 -0
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.js +13 -3
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.scss +4 -0
- package/dist/components/QuerySettingsDescription/QuerySettingsDescription.d.ts +7 -0
- package/dist/components/QuerySettingsDescription/QuerySettingsDescription.js +8 -0
- package/dist/components/QuerySettingsDescription/QuerySettingsDescription.scss +8 -0
- package/dist/components/QuerySettingsDescription/index.d.ts +1 -0
- package/dist/components/QuerySettingsDescription/index.js +1 -0
- package/dist/components/VDisk/VDisk.js +3 -4
- package/dist/components/VDiskInfo/VDiskInfo.d.ts +2 -2
- package/dist/components/VDiskInfo/VDiskInfo.js +4 -2
- package/dist/containers/App/Content.js +15 -19
- package/dist/containers/AsideNavigation/AsideNavigation.js +2 -1
- package/dist/containers/AsideNavigation/YdbInternalUser/YdbInternalUser.js +4 -4
- package/dist/containers/Authentication/Authentication.js +8 -10
- package/dist/containers/Authentication/utils.d.ts +8 -0
- package/dist/containers/Authentication/utils.js +15 -0
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js +6 -6
- package/dist/containers/Clusters/constants.d.ts +1 -1
- package/dist/containers/Heatmap/Heatmap.js +5 -4
- package/dist/containers/Node/Node.js +5 -7
- package/dist/containers/Node/Node.scss +4 -0
- package/dist/containers/Node/NodeStructure/NodeStructure.js +4 -4
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +4 -0
- package/dist/containers/Node/NodeStructure/Pdisk.js +2 -2
- package/dist/containers/Nodes/Nodes.js +6 -8
- package/dist/containers/Nodes/getNodesColumns.js +6 -21
- package/dist/containers/PDiskPage/PDiskPage.js +19 -8
- package/dist/containers/PDiskPage/i18n/en.json +1 -0
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/PDisk/PDisk.js +3 -4
- package/dist/containers/Storage/Storage.js +4 -6
- package/dist/containers/Tablet/Tablet.js +2 -2
- package/dist/containers/Tablet/TabletControls/TabletControls.js +2 -1
- package/dist/containers/Tablets/Tablets.js +3 -5
- package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +2 -5
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +10 -13
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +1 -0
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +8 -11
- package/dist/containers/Tenant/Diagnostics/Network/Network.scss +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.d.ts +1 -2
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +3 -5
- package/dist/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.js +3 -4
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +1 -4
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.js +3 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +4 -3
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +4 -3
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.d.ts +2 -2
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +56 -20
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.scss +10 -6
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/en.json +7 -0
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.js +4 -0
- package/dist/containers/Tenant/Query/ExecuteResult/utils.d.ts +18 -0
- package/dist/containers/Tenant/Query/ExecuteResult/utils.js +36 -0
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.d.ts +23 -1
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +56 -111
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.scss +1 -30
- package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.d.ts +7 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.js +18 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.scss +8 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.d.ts +8 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.js +14 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.scss +14 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/MetricsCell.d.ts +6 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/MetricsCell.js +11 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationCell.d.ts +13 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationCell.js +48 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationParams.d.ts +6 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationParams.js +66 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.d.ts +7 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.js +100 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.scss +128 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/types.d.ts +5 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/utils.d.ts +5 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/utils.js +59 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.d.ts +8 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.js +11 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.scss +14 -0
- package/dist/containers/Tenant/Query/ExplainResult/i18n/en.json +8 -0
- package/dist/containers/Tenant/Query/ExplainResult/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Query/ExplainResult/i18n/index.js +4 -0
- package/dist/containers/Tenant/Query/Preview/Preview.js +2 -3
- package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.js +1 -19
- package/dist/containers/Tenant/Query/QueryDuration/QueryDuration.js +1 -1
- package/dist/containers/Tenant/Query/QueryDuration/QueryDuration.scss +11 -0
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +1 -1
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +91 -95
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.d.ts +4 -6
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +18 -49
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.d.ts +2 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.js +5 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.test.d.ts +1 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.test.js +42 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.d.ts +5 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.js +19 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.test.d.ts +1 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.test.js +56 -0
- package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.d.ts +2 -0
- package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.js +12 -0
- package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.scss +3 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.js +20 -23
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.d.ts +123 -7
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js +32 -10
- package/dist/containers/Tenant/Query/i18n/en.json +3 -1
- package/dist/containers/Tenant/Query/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +6 -6
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +5 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/columns.d.ts +2 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/columns.js +13 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/i18n/en.json +1 -0
- package/dist/containers/Tenant/Schema/SchemaViewer/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/prepareData.js +3 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/types.d.ts +1 -0
- package/dist/containers/Tenant/Tenant.js +4 -8
- package/dist/containers/Tenant/utils/schemaActions.d.ts +2 -2
- package/dist/containers/Tenant/utils/schemaActions.js +2 -2
- package/dist/containers/Tenants/Tenants.js +4 -7
- package/dist/containers/UserSettings/i18n/en.json +3 -5
- package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
- package/dist/containers/UserSettings/settings.d.ts +2 -3
- package/dist/containers/UserSettings/settings.js +17 -23
- package/dist/containers/VDiskPage/VDiskPage.js +27 -13
- package/dist/containers/VDiskPage/i18n/en.json +1 -0
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
- package/dist/services/api.d.ts +21 -8
- package/dist/services/api.js +29 -42
- package/dist/services/settings.d.ts +11 -4
- package/dist/services/settings.js +7 -6
- package/dist/store/configureStore.d.ts +7 -7
- package/dist/store/defaultStore.d.ts +3 -3
- package/dist/store/reducers/api.d.ts +1 -1
- package/dist/store/reducers/api.js +1 -1
- package/dist/store/reducers/authentication/authentication.d.ts +37 -24
- package/dist/store/reducers/authentication/authentication.js +77 -57
- package/dist/store/reducers/authentication/types.d.ts +0 -8
- package/dist/store/reducers/capabilities/capabilities.d.ts +106 -0
- package/dist/store/reducers/capabilities/capabilities.js +22 -0
- package/dist/store/reducers/capabilities/hooks.d.ts +2 -0
- package/dist/store/reducers/capabilities/hooks.js +13 -0
- 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 +2 -2
- package/dist/store/reducers/executeQuery.d.ts +7 -14
- package/dist/store/reducers/executeQuery.js +19 -14
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +2 -2
- package/dist/store/reducers/explainQuery/explainQuery.d.ts +5 -4
- package/dist/store/reducers/explainQuery/explainQuery.js +14 -4
- package/dist/store/reducers/explainQuery/types.d.ts +13 -1
- package/dist/store/reducers/explainQuery/utils.js +7 -2
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +58 -58
- package/dist/store/reducers/heatmap.d.ts +2 -2
- package/dist/store/reducers/hotKeys/hotKeys.d.ts +2 -2
- package/dist/store/reducers/index.d.ts +6 -6
- package/dist/store/reducers/network/network.d.ts +2 -2
- package/dist/store/reducers/node/node.d.ts +3 -3
- package/dist/store/reducers/node/selectors.d.ts +1 -1
- 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 +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/preview.d.ts +2 -2
- package/dist/store/reducers/schema/schema.d.ts +3 -3
- package/dist/store/reducers/schema/schema.js +10 -3
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +2 -2
- package/dist/store/reducers/shardsWorkload/shardsWorkload.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/topNodes/topNodes.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.d.ts +2 -2
- package/dist/store/reducers/tenants/selectors.d.ts +31 -30
- package/dist/store/reducers/tenants/selectors.js +8 -2
- 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/viewSchema/viewSchema.d.ts +2 -2
- package/dist/styles/mixins.scss +2 -0
- package/dist/types/api/capabilities.d.ts +7 -0
- package/dist/types/api/capabilities.js +1 -0
- package/dist/types/api/modifyDisk.d.ts +8 -0
- package/dist/types/api/modifyDisk.js +1 -0
- package/dist/types/api/query.d.ts +39 -3
- package/dist/types/api/query.js +9 -1
- package/dist/types/api/schema/shared.d.ts +8 -0
- package/dist/types/store/query.d.ts +7 -0
- package/dist/utils/__test__/prepareQueryExplain.test.d.ts +1 -0
- package/dist/utils/__test__/prepareQueryExplain.test.js +115 -0
- package/dist/utils/constants.d.ts +13 -4
- package/dist/utils/constants.js +15 -4
- package/dist/utils/dataFormatters/dataFormatters.d.ts +0 -1
- package/dist/utils/dataFormatters/dataFormatters.js +1 -4
- package/dist/utils/hooks/index.d.ts +2 -1
- package/dist/utils/hooks/index.js +2 -1
- package/dist/utils/hooks/useChangedQuerySettings.d.ts +10 -0
- package/dist/utils/hooks/useChangedQuerySettings.js +46 -0
- package/dist/utils/hooks/useDelayed.d.ts +1 -0
- package/dist/utils/hooks/useDelayed.js +13 -0
- package/dist/utils/hooks/useEventHandler.d.ts +6 -0
- package/dist/utils/hooks/useEventHandler.js +17 -0
- package/dist/utils/hooks/useLastQueryExecutionSettings.d.ts +2 -0
- package/dist/utils/hooks/useLastQueryExecutionSettings.js +5 -0
- package/dist/utils/hooks/useQueryExecutionSettings.d.ts +8 -0
- package/dist/utils/hooks/useQueryExecutionSettings.js +15 -0
- package/dist/utils/prepareQueryExplain.d.ts +3 -1
- package/dist/utils/prepareQueryExplain.js +54 -2
- package/dist/utils/query.js +1 -0
- package/dist/utils/query.test.js +3 -0
- package/dist/utils/utils.d.ts +8 -7
- package/dist/utils/utils.js +23 -11
- package/package.json +4 -2
- package/dist/containers/Tenant/Query/ExplainResult/utils.d.ts +0 -2
- package/dist/containers/Tenant/Query/ExplainResult/utils.js +0 -4
- package/dist/store/utils.d.ts +0 -23
- package/dist/store/utils.js +0 -49
- package/dist/types/api/restartPDisk.d.ts +0 -4
- package/dist/utils/hooks/useQueryModes.d.ts +0 -2
- package/dist/utils/hooks/useQueryModes.js +0 -5
- /package/dist/{types/api/restartPDisk.js → containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/types.js} +0 -0
@@ -5,17 +5,16 @@ import { InternalLink } from '../../../components/InternalLink';
|
|
5
5
|
import { PDiskPopup } from '../../../components/PDiskPopup/PDiskPopup';
|
6
6
|
import { VDiskWithDonorsStack } from '../../../components/VDisk/VDiskWithDonorsStack';
|
7
7
|
import routes, { createHref, getPDiskPagePath } from '../../../routes';
|
8
|
+
import { useDiskPagesAvailable } from '../../../store/reducers/capabilities/hooks';
|
8
9
|
import { valueIsDefined } from '../../../utils';
|
9
10
|
import { cn } from '../../../utils/cn';
|
10
|
-
import { USE_SEPARATE_DISKS_PAGES_KEY } from '../../../utils/constants';
|
11
11
|
import { stringifyVdiskId } from '../../../utils/dataFormatters/dataFormatters';
|
12
|
-
import { useSetting } from '../../../utils/hooks';
|
13
12
|
import { STRUCTURE } from '../../Node/NodePages';
|
14
13
|
import './PDisk.scss';
|
15
14
|
const b = cn('pdisk-storage');
|
16
15
|
export const PDisk = ({ nodeId, data = {}, vDisks }) => {
|
17
16
|
const [isPopupVisible, setIsPopupVisible] = React.useState(false);
|
18
|
-
const
|
17
|
+
const diskPagesAvailable = useDiskPagesAvailable();
|
19
18
|
const anchor = React.useRef(null);
|
20
19
|
const showPopup = () => {
|
21
20
|
setIsPopupVisible(true);
|
@@ -36,7 +35,7 @@ export const PDisk = ({ nodeId, data = {}, vDisks }) => {
|
|
36
35
|
}) }));
|
37
36
|
};
|
38
37
|
let pDiskPath = createHref(routes.node, { id: nodeId, activeTab: STRUCTURE }, { pdiskId: data.PDiskId || '' });
|
39
|
-
if (
|
38
|
+
if (diskPagesAvailable && valueIsDefined(data.PDiskId)) {
|
40
39
|
pDiskPath = getPDiskPagePath(data.PDiskId, nodeId);
|
41
40
|
}
|
42
41
|
return (_jsxs(React.Fragment, { children: [_jsx(PDiskPopup, { data: data, anchorRef: anchor, open: isPopupVisible }), _jsxs("div", { className: b(), ref: anchor, children: [renderVDisks(), _jsxs(InternalLink, { to: pDiskPath, className: b('content'), onMouseEnter: showPopup, onMouseLeave: hidePopup, children: [_jsx(DiskStateProgressBar, { diskAllocatedPercent: data.AllocatedPercent, severity: data.Severity }), _jsx("div", { className: b('media-type'), children: data.Type })] })] })] }));
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
3
3
|
import { ArrayParam, StringParam, useQueryParams, withDefault } from 'use-query-params';
|
4
4
|
import { AccessDenied } from '../../components/Errors/403';
|
5
|
+
import { isAccessError } from '../../components/Errors/PageError/PageError';
|
5
6
|
import { ResponseError } from '../../components/Errors/ResponseError';
|
6
7
|
import { TableWithControlsLayout } from '../../components/TableWithControlsLayout/TableWithControlsLayout';
|
7
8
|
import { selectNodesMap } from '../../store/reducers/nodesList';
|
@@ -104,11 +105,8 @@ export const Storage = ({ additionalNodesProps, tenant, nodeId }) => {
|
|
104
105
|
? storageGroups.length
|
105
106
|
: storageNodes.length, entitiesCountTotal: entitiesCount.total, entitiesLoading: isLoading }));
|
106
107
|
};
|
107
|
-
if (error) {
|
108
|
-
|
109
|
-
return _jsx(AccessDenied, { position: "left" });
|
110
|
-
}
|
111
|
-
return _jsx(ResponseError, { error: error });
|
108
|
+
if (isAccessError(error)) {
|
109
|
+
return _jsx(AccessDenied, { position: "left" });
|
112
110
|
}
|
113
|
-
return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), _jsx(TableWithControlsLayout.Table, { loading: isLoading, className: b('table'), children: renderDataTable() })] }));
|
111
|
+
return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), error ? _jsx(ResponseError, { error: error }) : null, _jsx(TableWithControlsLayout.Table, { loading: isLoading, className: b('table'), children: currentData ? renderDataTable() : null })] }));
|
114
112
|
};
|
@@ -54,7 +54,7 @@ export const Tablet = () => {
|
|
54
54
|
if (loading && id !== tabletId && isFirstDataFetchRef.current) {
|
55
55
|
return _jsx(Loader, { size: "l" });
|
56
56
|
}
|
57
|
-
if (error) {
|
57
|
+
if (error && !currentData) {
|
58
58
|
return _jsx(ResponseError, { error: error });
|
59
59
|
}
|
60
60
|
if (!tablet || !Object.keys(tablet).length) {
|
@@ -67,7 +67,7 @@ export const Tablet = () => {
|
|
67
67
|
path: `/tablets?TabletID=${TabletId}`,
|
68
68
|
},
|
69
69
|
];
|
70
|
-
return (
|
70
|
+
return (_jsxs("div", { className: b(), children: [error ? _jsx(ResponseError, { error: error }) : null, _jsxs("div", { className: b('pane-wrapper'), children: [_jsxs("div", { className: b('left-pane'), children: [_jsx("ul", { className: b('links'), children: externalLinks.map(renderExternalLinks) }), _jsxs("div", { className: b('row', { header: true }), children: [_jsx("span", { className: b('title'), children: i18n('tablet.header') }), _jsx(EntityStatus, { status: Overall, name: TabletId }), _jsx("a", { rel: "noopener noreferrer", className: b('link', { external: true }), href: `${backend}/tablets?TabletID=${TabletId}`, target: "_blank", children: _jsx(Icon, { data: ArrowUpRightFromSquare }) }), Leader && _jsx(Tag, { text: "Leader", type: "blue" }), _jsx("span", { className: b('loader'), children: loading && _jsx(Loader, { size: "s" }) })] }), _jsx(TabletInfo, { tablet: tablet, tenantPath: tenantName }), _jsx(TabletControls, { tablet: tablet, fetchData: refetch })] }), _jsx("div", { className: b('rigth-pane'), children: _jsx(TabletTable, { history: history }) })] })] }));
|
71
71
|
};
|
72
72
|
return (_jsxs(React.Fragment, { children: [_jsx(Helmet, { children: _jsx("title", { children: `${id} — ${i18n('tablet.header')} — ${tenantName || queryClusterName || CLUSTER_DEFAULT_TITLE}` }) }), renderView()] }));
|
73
73
|
};
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
3
|
import { ButtonWithConfirmDialog } from '../../../components/ButtonWithConfirmDialog/ButtonWithConfirmDialog';
|
4
|
+
import { selectIsUserAllowedToMakeChanges } from '../../../store/reducers/authentication/authentication';
|
4
5
|
import { ETabletState } from '../../../types/api/tablet';
|
5
6
|
import { useTypedSelector } from '../../../utils/hooks';
|
6
7
|
import { b } from '../Tablet';
|
7
8
|
import i18n from '../i18n';
|
8
9
|
export const TabletControls = ({ tablet, fetchData }) => {
|
9
10
|
const { TabletId, HiveId } = tablet;
|
10
|
-
const
|
11
|
+
const isUserAllowedToMakeChanges = useTypedSelector(selectIsUserAllowedToMakeChanges);
|
11
12
|
const _onKillClick = () => {
|
12
13
|
return window.api.killTablet(TabletId);
|
13
14
|
};
|
@@ -10,6 +10,7 @@ import { InternalLink } from '../../components/InternalLink';
|
|
10
10
|
import { ResizeableDataTable } from '../../components/ResizeableDataTable/ResizeableDataTable';
|
11
11
|
import { TableSkeleton } from '../../components/TableSkeleton/TableSkeleton';
|
12
12
|
import routes, { createHref } from '../../routes';
|
13
|
+
import { selectIsUserAllowedToMakeChanges } from '../../store/reducers/authentication/authentication';
|
13
14
|
import { selectTabletsWithFqdn, tabletsApi } from '../../store/reducers/tablets';
|
14
15
|
import { ETabletState } from '../../types/api/tablet';
|
15
16
|
import { cn } from '../../utils/cn';
|
@@ -110,7 +111,7 @@ const columns = [
|
|
110
111
|
function TabletActions(tablet) {
|
111
112
|
const isDisabledRestart = tablet.State === ETabletState.Stopped;
|
112
113
|
const dispatch = useTypedDispatch();
|
113
|
-
const
|
114
|
+
const isUserAllowedToMakeChanges = useTypedSelector(selectIsUserAllowedToMakeChanges);
|
114
115
|
return (_jsx(ButtonWithConfirmDialog, { buttonView: "outlined", dialogContent: i18n('dialog.kill'), onConfirmAction: () => {
|
115
116
|
return window.api.killTablet(tablet.TabletId);
|
116
117
|
}, onConfirmActionSuccess: () => {
|
@@ -135,8 +136,5 @@ export function Tablets({ nodeId, path, className }) {
|
|
135
136
|
if (loading) {
|
136
137
|
return _jsx(TableSkeleton, {});
|
137
138
|
}
|
138
|
-
|
139
|
-
return _jsx(ResponseError, { error: error });
|
140
|
-
}
|
141
|
-
return (_jsx("div", { className: b(null, className), children: _jsx(ResizeableDataTable, { columns: columns, data: tablets, settings: DEFAULT_TABLE_SETTINGS, emptyDataMessage: i18n('noTabletsData') }) }));
|
139
|
+
return (_jsxs("div", { className: b(null, className), children: [error ? _jsx(ResponseError, { error: error }) : null, currentData ? (_jsx(ResizeableDataTable, { columns: columns, data: tablets, settings: DEFAULT_TABLE_SETTINGS, emptyDataMessage: i18n('noTabletsData') })) : null] }));
|
142
140
|
}
|
@@ -38,11 +38,8 @@ export const Consumers = ({ path, type }) => {
|
|
38
38
|
if (loading) {
|
39
39
|
return _jsx(Loader, { size: "m" });
|
40
40
|
}
|
41
|
-
if (error) {
|
42
|
-
return _jsx(ResponseError, { error: error });
|
43
|
-
}
|
44
|
-
if (!consumers || !consumers.length) {
|
41
|
+
if (!error && (!consumers || !consumers.length)) {
|
45
42
|
return _jsx("div", { children: i18n(`noConsumersMessage.${isCdcStream ? 'stream' : 'topic'}`) });
|
46
43
|
}
|
47
|
-
return (_jsxs("div", { className: b(), children: [_jsxs("div", { className: b('controls'), children: [_jsx(Search, { onChange: handleSearchChange, placeholder: i18n('controls.search'), className: b('search'), value: searchValue }), topic && _jsx(ConsumersTopicStats, { data: topic })] }), _jsx("div", { className: b('table-wrapper'), children: _jsx("div", { className: b('table-content'), children: _jsx(ResizeableDataTable, { columnsWidthLSKey: CONSUMERS_COLUMNS_WIDTH_LS_KEY, wrapperClassName: b('table'), data: dataToRender, columns: columns, settings: DEFAULT_TABLE_SETTINGS, emptyDataMessage: i18n('table.emptyDataMessage') }) }) })] }));
|
44
|
+
return (_jsxs("div", { className: b(), children: [_jsxs("div", { className: b('controls'), children: [_jsx(Search, { onChange: handleSearchChange, placeholder: i18n('controls.search'), className: b('search'), value: searchValue }), topic && _jsx(ConsumersTopicStats, { data: topic })] }), error ? _jsx(ResponseError, { error: error }) : null, consumers ? (_jsx("div", { className: b('table-wrapper'), children: _jsx("div", { className: b('table-content'), children: _jsx(ResizeableDataTable, { columnsWidthLSKey: CONSUMERS_COLUMNS_WIDTH_LS_KEY, wrapperClassName: b('table'), data: dataToRender, columns: columns, settings: DEFAULT_TABLE_SETTINGS, emptyDataMessage: i18n('table.emptyDataMessage') }) }) })) : null] }));
|
48
45
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { skipToken } from '@reduxjs/toolkit/query';
|
3
3
|
import JSONTree from 'react-json-inspector';
|
4
4
|
import { shallowEqual } from 'react-redux';
|
@@ -42,19 +42,16 @@ const Describe = ({ path, database, type }) => {
|
|
42
42
|
if (loading || (isEntityWithMergedImpl && !mergedChildrenPaths)) {
|
43
43
|
return _jsx(Loader, { size: "m" });
|
44
44
|
}
|
45
|
-
if (error) {
|
46
|
-
return _jsx(ResponseError, { error: error, className: b('message-container') });
|
47
|
-
}
|
48
|
-
if (!loading && !preparedDescribeData) {
|
45
|
+
if (!preparedDescribeData && !error) {
|
49
46
|
return _jsx("div", { className: b('message-container'), children: "Empty" });
|
50
47
|
}
|
51
|
-
return (
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
return (_jsxs("div", { className: b(), children: [error ? _jsx(ResponseError, { error: error }) : null, preparedDescribeData ? (_jsx("div", { className: b('result'), children: _jsx(JSONTree, { data: preparedDescribeData, className: b('tree'), onClick: ({ path }) => {
|
49
|
+
const newValue = !(expandMap.get(path) || false);
|
50
|
+
expandMap.set(path, newValue);
|
51
|
+
}, searchOptions: {
|
52
|
+
debounceTime: 300,
|
53
|
+
}, isExpanded: (keypath) => {
|
54
|
+
return expandMap.get(keypath) || false;
|
55
|
+
} }) })) : null] }));
|
59
56
|
};
|
60
57
|
export default Describe;
|
@@ -31,23 +31,20 @@ export function Network({ tenantName }) {
|
|
31
31
|
if (loading) {
|
32
32
|
return (_jsx("div", { className: "loader", children: _jsx(Loader, { size: "l" }) }));
|
33
33
|
}
|
34
|
-
if (error) {
|
35
|
-
return _jsx(ResponseError, { error: error });
|
36
|
-
}
|
37
34
|
const netWorkInfo = currentData;
|
38
35
|
const nodes = (_a = ((netWorkInfo === null || netWorkInfo === void 0 ? void 0 : netWorkInfo.Tenants) && netWorkInfo.Tenants[0].Nodes)) !== null && _a !== void 0 ? _a : [];
|
39
|
-
if (nodes.length === 0) {
|
36
|
+
if (!error && nodes.length === 0) {
|
40
37
|
return _jsx("div", { className: "error", children: "no nodes data" });
|
41
38
|
}
|
42
39
|
const nodesGroupedByType = groupNodesByField(nodes, 'NodeType');
|
43
40
|
const rightNodes = clickedNode ? groupNodesByField((_b = clickedNode.Peers) !== null && _b !== void 0 ? _b : [], 'NodeType') : {};
|
44
|
-
return (
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
41
|
+
return (_jsxs("div", { className: b(), children: [error ? _jsx(ResponseError, { error: error }) : null, nodes.length > 0 ? (_jsx("div", { className: b('inner'), children: _jsxs("div", { className: b('nodes-row'), children: [_jsxs("div", { className: b('left'), children: [_jsx("div", { className: b('controls-wrapper'), children: _jsxs("div", { className: b('controls'), children: [_jsx(ProblemFilter, { value: filter, onChange: (v) => {
|
42
|
+
dispatch(changeFilter(v));
|
43
|
+
}, className: b('problem-filter') }), _jsx("div", { className: b('checkbox-wrapper'), children: _jsx(Checkbox, { onUpdate: () => {
|
44
|
+
setShowId(!showId);
|
45
|
+
}, checked: showId, children: "ID" }) }), _jsx("div", { className: b('checkbox-wrapper'), children: _jsx(Checkbox, { onUpdate: () => {
|
46
|
+
setShowRacks(!showRacks);
|
47
|
+
}, checked: showRacks, children: "Racks" }) })] }) }), _jsx(Nodes, { nodes: nodesGroupedByType, showId: showId, showRacks: showRacks, clickedNode: clickedNode, onClickNode: setClickedNode })] }), _jsx("div", { className: b('right'), children: clickedNode ? (_jsxs("div", { children: [_jsxs("div", { className: b('label'), children: ["Connectivity of node", ' ', _jsx(Link, { className: b('link'), to: getDefaultNodePath(clickedNode.NodeId), children: clickedNode.NodeId }), ' ', "to other nodes"] }), _jsx("div", { className: b('nodes-row'), children: _jsx(Nodes, { nodes: rightNodes, isRight: true, showId: showId, showRacks: showRacks, clickedNode: clickedNode, onClickNode: setClickedNode }) })] })) : (_jsxs("div", { className: b('placeholder'), children: [_jsx("div", { className: b('placeholder-img'), children: _jsx(Icon, { data: networkIcon, width: 221, height: 204 }) }), _jsx("div", { className: b('placeholder-text'), children: "Select node to see its connectivity to other nodes" })] })) })] }) })) : null] }));
|
51
48
|
}
|
52
49
|
function Nodes({ nodes, isRight, showId, showRacks, clickedNode, onClickNode }) {
|
53
50
|
const filter = useTypedSelector(selectProblemFilter);
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import { EPathType } from '../../../../types/api/schema';
|
3
2
|
interface OverviewProps {
|
4
3
|
type?: EPathType;
|
5
4
|
path: string;
|
6
5
|
database: string;
|
7
6
|
}
|
8
|
-
declare function Overview({ type, path, database }: OverviewProps):
|
7
|
+
declare function Overview({ type, path, database }: OverviewProps): import("react/jsx-runtime").JSX.Element;
|
9
8
|
export default Overview;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
2
3
|
import { skipToken } from '@reduxjs/toolkit/query';
|
3
4
|
import { shallowEqual } from 'react-redux';
|
4
5
|
import { ResponseError } from '../../../../components/Errors/ResponseError';
|
@@ -65,9 +66,6 @@ function Overview({ type, path, database }) {
|
|
65
66
|
if (entityLoading || entityNotReady) {
|
66
67
|
return _jsx(Loader, { size: "m" });
|
67
68
|
}
|
68
|
-
|
69
|
-
return _jsx(ResponseError, { error: schemaError || overviewError });
|
70
|
-
}
|
71
|
-
return renderContent();
|
69
|
+
return (_jsxs(React.Fragment, { children: [schemaError ? _jsx(ResponseError, { error: schemaError }) : null, overviewError ? _jsx(ResponseError, { error: overviewError }) : null, overviewError && !rawData ? null : renderContent()] }));
|
72
70
|
}
|
73
71
|
export default Overview;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
2
3
|
import { ResponseError } from '../../../../../components/Errors/ResponseError';
|
3
4
|
import { InfoViewer } from '../../../../../components/InfoViewer';
|
4
5
|
import { LabelWithPopover } from '../../../../../components/LabelWithPopover';
|
@@ -58,8 +59,6 @@ export const TopicStats = ({ path }) => {
|
|
58
59
|
// If there is at least some empty data object
|
59
60
|
// we initialize its fields with zero values
|
60
61
|
// so no data at all is considered to be error as well
|
61
|
-
|
62
|
-
|
63
|
-
}
|
64
|
-
return (_jsxs("div", { className: b(), children: [_jsx("div", { className: b('title'), children: "Stats" }), _jsx("div", { className: b('info'), children: _jsx(InfoViewer, { info: prepareTopicInfo(data), multilineLabels: true }) }), _jsx("div", { className: b('bytes-written'), children: _jsx(InfoViewer, { info: prepareBytesWrittenInfo(data) }) })] }));
|
62
|
+
const errorContent = error || !data ? _jsx(ResponseError, { error: error }) : null;
|
63
|
+
return (_jsxs("div", { className: b(), children: [_jsx("div", { className: b('title'), children: "Stats" }), errorContent, data ? (_jsxs(React.Fragment, { children: [_jsx("div", { className: b('info'), children: _jsx(InfoViewer, { info: prepareTopicInfo(data), multilineLabels: true }) }), _jsx("div", { className: b('bytes-written'), children: _jsx(InfoViewer, { info: prepareBytesWrittenInfo(data) }) })] })) : null] }));
|
65
64
|
};
|
@@ -64,10 +64,7 @@ export const Partitions = ({ path }) => {
|
|
64
64
|
if (loading) {
|
65
65
|
return _jsx(TableSkeleton, { className: b('loader') });
|
66
66
|
}
|
67
|
-
if (error) {
|
68
|
-
return _jsx(ResponseError, { error: error });
|
69
|
-
}
|
70
67
|
return (_jsx(ResizeableDataTable, { columnsWidthLSKey: PARTITIONS_COLUMNS_WIDTH_LS_KEY, wrapperClassName: b('table'), data: partitionsToRender, columns: columnsToShow, settings: DEFAULT_TABLE_SETTINGS, emptyDataMessage: i18n('table.emptyDataMessage') }));
|
71
68
|
};
|
72
|
-
return (_jsxs("div", { className: b(), children: [_jsx("div", { className: b('controls'), children: renderControls() }), _jsx("div", { className: b('table-wrapper'), children: _jsx("div", { className: b('table-content'), children: renderContent() }) })] }));
|
69
|
+
return (_jsxs("div", { className: b(), children: [_jsx("div", { className: b('controls'), children: renderControls() }), error ? _jsx(ResponseError, { error: error }) : null, _jsx("div", { className: b('table-wrapper'), children: _jsx("div", { className: b('table-content'), children: partitionsData ? renderContent() : null }) })] }));
|
73
70
|
};
|
@@ -7,13 +7,13 @@ import { TENANT_OVERVIEW_TABLES_LIMIT, TENANT_OVERVIEW_TABLES_SETTINGS, } from '
|
|
7
7
|
import { b } from './utils';
|
8
8
|
export function TenantOverviewTableLayout({ title, error, loading, tableClassNameModifiers = {}, ...props }) {
|
9
9
|
const renderContent = () => {
|
10
|
-
if (error) {
|
11
|
-
return
|
10
|
+
if (error && props.data.length === 0) {
|
11
|
+
return null;
|
12
12
|
}
|
13
13
|
if (loading) {
|
14
14
|
return _jsx(TableSkeleton, { rows: TENANT_OVERVIEW_TABLES_LIMIT });
|
15
15
|
}
|
16
16
|
return _jsx(ResizeableDataTable, { settings: TENANT_OVERVIEW_TABLES_SETTINGS, ...props });
|
17
17
|
};
|
18
|
-
return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b('title'), children: title }), _jsx("div", { className: b('table', tableClassNameModifiers), children: renderContent() })] }));
|
18
|
+
return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b('title'), children: title }), error ? _jsx(ResponseError, { error: error }) : null, _jsx("div", { className: b('table', tableClassNameModifiers), children: renderContent() })] }));
|
19
19
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key: "
|
1
|
+
declare const _default: (key: "queries" | "nodes" | "groups" | "no-data" | "top" | "shards" | "tables" | "no-pools-data" | "top-nodes.empty-data" | "top-groups.empty-data" | "by-pools-usage" | "by-cpu-time" | "by-cpu-usage" | "by-load" | "by-memory" | "by-usage" | "by-size" | "cards.cpu-label" | "cards.storage-label" | "cards.memory-label" | "charts.queries-per-second" | "charts.transaction-latency" | "charts.cpu-usage" | "charts.storage-usage" | "charts.memory-usage" | "storage.tablet-storage-title" | "storage.tablet-storage-description" | "storage.db-storage-title" | "storage.db-storage-description" | "executed-last-hour", params?: import("@gravity-ui/i18n").Params) => string;
|
2
2
|
export default _default;
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
3
3
|
import { useHistory, useLocation } from 'react-router-dom';
|
4
4
|
import { DateRange } from '../../../../components/DateRange';
|
5
|
+
import { ResponseError } from '../../../../components/Errors/ResponseError';
|
5
6
|
import { ResizeableDataTable } from '../../../../components/ResizeableDataTable/ResizeableDataTable';
|
6
7
|
import { Search } from '../../../../components/Search';
|
7
8
|
import { TableWithControlsLayout } from '../../../../components/TableWithControlsLayout/TableWithControlsLayout';
|
@@ -55,8 +56,8 @@ export const TopQueries = ({ tenantName, type }) => {
|
|
55
56
|
dispatch(setTopQueriesFilters(value));
|
56
57
|
};
|
57
58
|
const renderContent = () => {
|
58
|
-
if (error) {
|
59
|
-
return
|
59
|
+
if (error && !data) {
|
60
|
+
return null;
|
60
61
|
}
|
61
62
|
if (!data || isColumnEntityType(type)) {
|
62
63
|
return i18n('no-data');
|
@@ -66,5 +67,5 @@ export const TopQueries = ({ tenantName, type }) => {
|
|
66
67
|
const renderControls = () => {
|
67
68
|
return (_jsxs(React.Fragment, { children: [_jsx(Search, { value: filters.text, onChange: handleTextSearchUpdate, placeholder: i18n('filter.text.placeholder'), className: b('search') }), _jsx(DateRange, { from: filters.from, to: filters.to, onChange: handleDateRangeChange })] }));
|
68
69
|
};
|
69
|
-
return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), _jsx(TableWithControlsLayout.Table, { loading: loading, children: renderContent() })] }));
|
70
|
+
return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), error ? _jsx(ResponseError, { error: parseQueryErrorToString(error) }) : null, _jsx(TableWithControlsLayout.Table, { loading: loading, children: renderContent() })] }));
|
70
71
|
};
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
3
3
|
import DataTable from '@gravity-ui/react-data-table';
|
4
4
|
import { useLocation } from 'react-router-dom';
|
5
|
+
import { ResponseError } from '../../../../components/Errors/ResponseError';
|
5
6
|
import { ResizeableDataTable } from '../../../../components/ResizeableDataTable/ResizeableDataTable';
|
6
7
|
import { TableWithControlsLayout } from '../../../../components/TableWithControlsLayout/TableWithControlsLayout';
|
7
8
|
import { setShardsQueryFilters, shardApi, } from '../../../../store/reducers/shardsWorkload/shardsWorkload';
|
@@ -133,13 +134,13 @@ export const TopShards = ({ tenantName, path, type }) => {
|
|
133
134
|
return _jsx(Filters, { value: filters, onChange: handleFiltersChange });
|
134
135
|
};
|
135
136
|
const renderContent = () => {
|
136
|
-
if (error) {
|
137
|
-
return
|
137
|
+
if (error && !data) {
|
138
|
+
return null;
|
138
139
|
}
|
139
140
|
if (!data || isColumnEntityType(type)) {
|
140
141
|
return i18n('no-data');
|
141
142
|
}
|
142
143
|
return (_jsx(ResizeableDataTable, { columnsWidthLSKey: TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, columns: tableColumns, data: data, settings: TABLE_SETTINGS, onSort: onSort, sortOrder: stringToDataTableSortOrder(sortOrder) }));
|
143
144
|
};
|
144
|
-
return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), filters.mode === EShardsWorkloadMode.History && (_jsx("div", { className: b('hint'), children: i18n('description') })), _jsx(TableWithControlsLayout.Table, { loading: loading, children: renderContent() })] }));
|
145
|
+
return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), filters.mode === EShardsWorkloadMode.History && (_jsx("div", { className: b('hint'), children: i18n('description') })), error ? _jsx(ResponseError, { error: parseQueryErrorToString(error) }) : null, _jsx(TableWithControlsLayout.Table, { loading: loading, children: renderContent() })] }));
|
145
146
|
};
|
@@ -2,11 +2,11 @@ import type { IQueryResult } from '../../../../types/store/query';
|
|
2
2
|
import './ExecuteResult.scss';
|
3
3
|
interface ExecuteResultProps {
|
4
4
|
data: IQueryResult | undefined;
|
5
|
-
stats: IQueryResult['stats'] | undefined;
|
6
5
|
error: unknown;
|
7
6
|
isResultsCollapsed?: boolean;
|
8
7
|
onCollapseResults: VoidFunction;
|
9
8
|
onExpandResults: VoidFunction;
|
9
|
+
theme?: string;
|
10
10
|
}
|
11
|
-
export declare function ExecuteResult({ data,
|
11
|
+
export declare function ExecuteResult({ data, error, isResultsCollapsed, onCollapseResults, onExpandResults, theme, }: ExecuteResultProps): import("react/jsx-runtime").JSX.Element;
|
12
12
|
export {};
|
@@ -6,39 +6,56 @@ import { ClipboardButton } from '../../../../components/ClipboardButton';
|
|
6
6
|
import Divider from '../../../../components/Divider/Divider';
|
7
7
|
import EnableFullscreenButton from '../../../../components/EnableFullscreenButton/EnableFullscreenButton';
|
8
8
|
import Fullscreen from '../../../../components/Fullscreen/Fullscreen';
|
9
|
+
import { YDBGraph } from '../../../../components/Graph/Graph';
|
9
10
|
import { QueryExecutionStatus } from '../../../../components/QueryExecutionStatus';
|
10
11
|
import { QueryResultTable } from '../../../../components/QueryResultTable/QueryResultTable';
|
11
12
|
import { disableFullscreen } from '../../../../store/reducers/fullscreen';
|
12
13
|
import { getArray } from '../../../../utils';
|
13
14
|
import { cn } from '../../../../utils/cn';
|
14
|
-
import { useTypedDispatch
|
15
|
+
import { useTypedDispatch } from '../../../../utils/hooks';
|
15
16
|
import { parseQueryError } from '../../../../utils/query';
|
16
17
|
import { PaneVisibilityToggleButtons } from '../../utils/paneVisibilityToggleHelpers';
|
18
|
+
import { SimplifiedPlan } from '../ExplainResult/components/SimplifiedPlan/SimplifiedPlan';
|
17
19
|
import { ResultIssues } from '../Issues/Issues';
|
18
20
|
import { QueryDuration } from '../QueryDuration/QueryDuration';
|
21
|
+
import { QuerySettingsBanner } from '../QuerySettingsBanner/QuerySettingsBanner';
|
19
22
|
import { getPreparedResult } from '../utils/getPreparedResult';
|
23
|
+
import i18n from './i18n';
|
24
|
+
import { getPlan } from './utils';
|
20
25
|
import './ExecuteResult.scss';
|
21
26
|
const b = cn('ydb-query-execute-result');
|
22
27
|
const resultOptionsIds = {
|
23
28
|
result: 'result',
|
24
29
|
stats: 'stats',
|
30
|
+
schema: 'schema',
|
31
|
+
simplified: 'simplified',
|
25
32
|
};
|
26
|
-
|
27
|
-
{ value: resultOptionsIds.result, content: 'Result' },
|
28
|
-
{ value: resultOptionsIds.stats, content: 'Stats' },
|
29
|
-
];
|
30
|
-
export function ExecuteResult({ data, stats, error, isResultsCollapsed, onCollapseResults, onExpandResults, }) {
|
33
|
+
export function ExecuteResult({ data, error, isResultsCollapsed, onCollapseResults, onExpandResults, theme, }) {
|
31
34
|
var _a, _b, _c;
|
32
35
|
const [selectedResultSet, setSelectedResultSet] = React.useState(0);
|
33
36
|
const [activeSection, setActiveSection] = React.useState(resultOptionsIds.result);
|
34
|
-
const isFullscreen = useTypedSelector((state) => state.fullscreen);
|
35
37
|
const dispatch = useTypedDispatch();
|
38
|
+
const stats = data === null || data === void 0 ? void 0 : data.stats;
|
36
39
|
const resultsSetsCount = (_a = data === null || data === void 0 ? void 0 : data.resultSets) === null || _a === void 0 ? void 0 : _a.length;
|
37
40
|
const isMulti = resultsSetsCount && resultsSetsCount > 0;
|
38
41
|
const currentResult = isMulti ? (_b = data === null || data === void 0 ? void 0 : data.resultSets) === null || _b === void 0 ? void 0 : _b[selectedResultSet].result : data === null || data === void 0 ? void 0 : data.result;
|
39
42
|
const currentColumns = isMulti ? (_c = data === null || data === void 0 ? void 0 : data.resultSets) === null || _c === void 0 ? void 0 : _c[selectedResultSet].columns : data === null || data === void 0 ? void 0 : data.columns;
|
40
43
|
const textResults = getPreparedResult(currentResult);
|
41
44
|
const copyDisabled = !textResults.length;
|
45
|
+
const { plan, simplifiedPlan } = React.useMemo(() => getPlan(data), [data]);
|
46
|
+
const resultOptions = [
|
47
|
+
{ value: resultOptionsIds.result, content: i18n('action.result') },
|
48
|
+
{ value: resultOptionsIds.stats, content: i18n('action.stats') },
|
49
|
+
];
|
50
|
+
if (plan) {
|
51
|
+
resultOptions.push({ value: resultOptionsIds.schema, content: i18n('action.schema') });
|
52
|
+
}
|
53
|
+
if (simplifiedPlan) {
|
54
|
+
resultOptions.push({
|
55
|
+
value: resultOptionsIds.simplified,
|
56
|
+
content: i18n('action.explain-plan'),
|
57
|
+
});
|
58
|
+
}
|
42
59
|
const parsedError = parseQueryError(error);
|
43
60
|
React.useEffect(() => {
|
44
61
|
return () => {
|
@@ -51,7 +68,7 @@ export function ExecuteResult({ data, stats, error, isResultsCollapsed, onCollap
|
|
51
68
|
const renderResultTable = (result, columns) => {
|
52
69
|
return _jsx(QueryResultTable, { data: result, columns: columns, settings: { sortable: false } });
|
53
70
|
};
|
54
|
-
const
|
71
|
+
const renderResult = () => {
|
55
72
|
return (_jsxs(React.Fragment, { children: [isMulti && resultsSetsCount > 1 && (_jsx("div", { children: _jsx(Tabs, { className: b('result-tabs'), size: "l", items: getArray(resultsSetsCount).map((item) => ({
|
56
73
|
id: String(item),
|
57
74
|
title: `Result #${item + 1}`,
|
@@ -61,30 +78,49 @@ export function ExecuteResult({ data, stats, error, isResultsCollapsed, onCollap
|
|
61
78
|
return (_jsx(ClipboardButton, { text: textResults, view: "flat-secondary", title: "Copy results", disabled: copyDisabled }));
|
62
79
|
};
|
63
80
|
const renderStats = () => {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
return (_jsxs(React.Fragment, { children: [content, isFullscreen && (_jsx(Fullscreen, { children: _jsx("div", { className: b('inspector', { fullscreen: true }), children: content }) }))] }));
|
81
|
+
return (_jsx("div", { className: b('inspector'), children: _jsx(JSONTree, { data: stats, isExpanded: () => true, searchOptions: {
|
82
|
+
debounceTime: 300,
|
83
|
+
} }) }));
|
68
84
|
};
|
69
|
-
const
|
70
|
-
const
|
71
|
-
|
85
|
+
const renderSchema = () => {
|
86
|
+
const isEnoughDataForGraph = (plan === null || plan === void 0 ? void 0 : plan.links) && (plan === null || plan === void 0 ? void 0 : plan.nodes) && (plan === null || plan === void 0 ? void 0 : plan.nodes.length);
|
87
|
+
if (!isEnoughDataForGraph) {
|
88
|
+
return i18n('description.graph-is-not-supported');
|
89
|
+
}
|
90
|
+
return (_jsx("div", { className: b('explain-canvas-container'), children: _jsx(YDBGraph, { data: plan }, theme) }));
|
91
|
+
};
|
92
|
+
const renderSimplified = () => {
|
93
|
+
if (!simplifiedPlan) {
|
94
|
+
return null;
|
95
|
+
}
|
96
|
+
return _jsx(SimplifiedPlan, { plan: simplifiedPlan });
|
72
97
|
};
|
73
98
|
const renderIssues = () => {
|
74
99
|
if (!parsedError) {
|
75
100
|
return null;
|
76
101
|
}
|
77
102
|
if (typeof parsedError === 'object') {
|
78
|
-
|
79
|
-
return (_jsxs(React.Fragment, { children: [content, isFullscreen && (_jsx(Fullscreen, { children: _jsx("div", { className: b('result-fullscreen-wrapper', b('result')), children: content }) }))] }));
|
103
|
+
return _jsx(ResultIssues, { data: parsedError });
|
80
104
|
}
|
81
105
|
return _jsx("div", { className: b('error'), children: parsedError });
|
82
106
|
};
|
83
107
|
const renderResultSection = () => {
|
84
|
-
if (
|
108
|
+
if (error) {
|
109
|
+
return renderIssues();
|
110
|
+
}
|
111
|
+
if (activeSection === resultOptionsIds.result) {
|
85
112
|
return renderResult();
|
86
113
|
}
|
87
|
-
|
114
|
+
if (activeSection === resultOptionsIds.stats) {
|
115
|
+
return renderStats();
|
116
|
+
}
|
117
|
+
if (activeSection === resultOptionsIds.schema) {
|
118
|
+
return renderSchema();
|
119
|
+
}
|
120
|
+
if (activeSection === resultOptionsIds.simplified) {
|
121
|
+
return renderSimplified();
|
122
|
+
}
|
123
|
+
return null;
|
88
124
|
};
|
89
|
-
return (_jsxs(React.Fragment, { children: [_jsxs("div", { className: b('controls'), children: [_jsxs("div", { className: b('controls-right'), children: [_jsx(QueryExecutionStatus, { error: error }), stats && !error && (_jsxs(React.Fragment, { children: [_jsx(QueryDuration, { duration: stats === null || stats === void 0 ? void 0 : stats.DurationUs }), _jsx(Divider, {}), _jsx(RadioButton, { options: resultOptions, value: activeSection, onUpdate: onSelectSection })] }))] }), _jsxs("div", { className: b('controls-left'), children: [renderClipboardButton(), _jsx(EnableFullscreenButton, {}), _jsx(PaneVisibilityToggleButtons, { onCollapse: onCollapseResults, onExpand: onExpandResults, isCollapsed: isResultsCollapsed, initialDirection: "bottom" })] })] }), renderResultSection()] }));
|
125
|
+
return (_jsxs(React.Fragment, { children: [_jsxs("div", { className: b('controls'), children: [_jsxs("div", { className: b('controls-right'), children: [_jsx(QueryExecutionStatus, { error: error }), stats && !error && (_jsxs(React.Fragment, { children: [_jsx(QueryDuration, { duration: stats === null || stats === void 0 ? void 0 : stats.DurationUs }), _jsx(Divider, {}), _jsx(RadioButton, { options: resultOptions, value: activeSection, onUpdate: onSelectSection })] }))] }), _jsxs("div", { className: b('controls-left'), children: [renderClipboardButton(), _jsx(EnableFullscreenButton, {}), _jsx(PaneVisibilityToggleButtons, { onCollapse: onCollapseResults, onExpand: onExpandResults, isCollapsed: isResultsCollapsed, initialDirection: "bottom" })] })] }), _jsx(QuerySettingsBanner, {}), _jsx(Fullscreen, { children: renderResultSection() })] }));
|
90
126
|
}
|
@@ -57,14 +57,18 @@
|
|
57
57
|
gap: 4px;
|
58
58
|
}
|
59
59
|
&__inspector {
|
60
|
+
overflow: auto;
|
61
|
+
|
62
|
+
width: 100%;
|
63
|
+
height: 100%;
|
60
64
|
padding: 15px 10px;
|
61
65
|
@include json-tree-styles();
|
62
|
-
|
63
|
-
overflow: auto;
|
66
|
+
}
|
64
67
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
68
|
+
&__explain-canvas-container {
|
69
|
+
overflow-y: auto;
|
70
|
+
|
71
|
+
width: 100%;
|
72
|
+
height: 100%;
|
69
73
|
}
|
70
74
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import type { IQueryResult } from '../../../../types/store/query';
|
2
|
+
export declare function getPlan(data: IQueryResult | undefined): {
|
3
|
+
plan?: undefined;
|
4
|
+
simplifiedPlan?: undefined;
|
5
|
+
} | {
|
6
|
+
plan: {
|
7
|
+
tables: import("../../../../types/api/query").PlanTable[] | undefined;
|
8
|
+
nodes: import("@gravity-ui/paranoid").GraphNode<import("@gravity-ui/paranoid").ExplainPlanNodeData>[];
|
9
|
+
links: import("@gravity-ui/paranoid").Link[];
|
10
|
+
} | undefined;
|
11
|
+
simplifiedPlan: import("../../../../store/reducers/explainQuery/types").SimplifiedPlanItem[] | undefined;
|
12
|
+
} | {
|
13
|
+
plan: {
|
14
|
+
nodes: import("@gravity-ui/paranoid").GraphNode<import("@gravity-ui/paranoid").ExplainPlanNodeData>[];
|
15
|
+
links: import("@gravity-ui/paranoid").Link[];
|
16
|
+
};
|
17
|
+
simplifiedPlan?: undefined;
|
18
|
+
};
|