ydb-embedded-ui 6.4.0 → 6.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/components/AsyncReplicationState/AsyncReplicationState.d.ts +6 -0
- package/dist/components/AsyncReplicationState/AsyncReplicationState.js +20 -0
- package/dist/components/AsyncReplicationState/index.d.ts +1 -0
- package/dist/components/AsyncReplicationState/index.js +1 -0
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +6 -2
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +12 -3
- package/dist/components/Errors/ResponseError/ResponseError.js +3 -0
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.d.ts +1 -2
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.js +2 -1
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Clusters/Clusters.js +7 -2
- package/dist/containers/Clusters/constants.d.ts +1 -3
- package/dist/containers/Clusters/constants.js +0 -18
- package/dist/containers/PDiskPage/PDiskPage.js +2 -1
- package/dist/containers/PDiskPage/i18n/en.json +2 -1
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Tablet/TabletControls/TabletControls.js +3 -1
- package/dist/containers/Tablet/i18n/en.json +3 -0
- package/dist/containers/Tablet/i18n/index.d.ts +1 -1
- package/dist/containers/Tablet/i18n/index.js +1 -2
- package/dist/containers/Tablets/Tablets.js +2 -1
- package/dist/containers/Tablets/i18n/en.json +2 -1
- package/dist/containers/Tablets/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +7 -0
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +2 -0
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +29 -18
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +14 -4
- package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/en.json +2 -1
- package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.d.ts +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js +39 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.d.ts +6 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.js +14 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/en.json +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/index.js +4 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/index.d.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/index.js +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.d.ts +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.js +34 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.scss +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/en.json +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/index.js +4 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/index.d.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/index.js +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +2 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +3 -3
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +3 -3
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +20 -6
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.d.ts +2 -2
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +5 -6
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +5 -13
- package/dist/containers/Tenant/Query/Preview/Preview.js +2 -2
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +1 -7
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +18 -19
- package/dist/containers/Tenant/Tenant.js +3 -2
- package/dist/containers/Tenant/utils/schema.js +8 -0
- package/dist/containers/Tenant/utils/schemaActions.js +1 -0
- package/dist/containers/Tenant/utils/schemaControls.js +1 -0
- package/dist/containers/VDiskPage/VDiskPage.js +2 -1
- package/dist/containers/VDiskPage/i18n/en.json +2 -1
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
- package/dist/services/api.d.ts +3 -3
- package/dist/services/settings.d.ts +1 -0
- package/dist/services/settings.js +2 -1
- package/dist/store/configureStore.d.ts +0 -4
- package/dist/store/defaultStore.d.ts +0 -2
- package/dist/store/reducers/authentication/authentication.d.ts +187 -7
- package/dist/store/reducers/authentication/authentication.js +12 -3
- package/dist/store/reducers/authentication/types.d.ts +5 -1
- package/dist/store/reducers/cluster/cluster.js +4 -0
- package/dist/store/reducers/executeQuery.d.ts +4 -63
- package/dist/store/reducers/executeQuery.js +38 -34
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js +4 -1
- package/dist/store/reducers/explainQuery/explainQuery.d.ts +9 -0
- package/dist/store/reducers/explainQuery/explainQuery.js +32 -0
- package/dist/store/reducers/explainQuery/types.d.ts +12 -0
- package/dist/store/reducers/explainQuery/utils.d.ts +6 -0
- package/dist/store/reducers/explainQuery/utils.js +40 -0
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +0 -20
- package/dist/store/reducers/host.d.ts +61 -2
- package/dist/store/reducers/index.d.ts +0 -3
- package/dist/store/reducers/index.js +0 -2
- package/dist/store/reducers/node/selectors.d.ts +0 -1
- package/dist/store/reducers/nodesList.d.ts +0 -1
- package/dist/store/reducers/olapStats.js +4 -1
- package/dist/store/reducers/preview.js +4 -1
- package/dist/store/reducers/schema/schema.d.ts +61 -2
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +61 -2
- package/dist/store/reducers/shardsWorkload/shardsWorkload.js +4 -1
- package/dist/store/reducers/tablets.d.ts +0 -1
- package/dist/store/reducers/tabletsFilters.d.ts +61 -2
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +6 -3
- package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.js +6 -3
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +6 -3
- package/dist/store/reducers/tenants/selectors.d.ts +0 -9
- package/dist/store/reducers/topic.d.ts +0 -15
- package/dist/store/utils.d.ts +2 -3
- package/dist/store/utils.js +1 -1
- package/dist/types/api/schema/replication.d.ts +74 -0
- package/dist/types/api/schema/replication.js +7 -0
- package/dist/types/api/schema/schema.d.ts +4 -1
- package/dist/types/api/schema/schema.js +1 -0
- package/dist/types/api/whoami.d.ts +6 -0
- package/dist/types/store/executeQuery.d.ts +2 -9
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +1 -0
- package/dist/utils/monaco/yql/constants.d.ts +2 -0
- package/dist/utils/monaco/yql/constants.js +33 -0
- package/dist/utils/monaco/yql/generateSuggestions.d.ts +1 -0
- package/dist/utils/monaco/yql/generateSuggestions.js +28 -11
- package/dist/utils/monaco/yql/yqlSuggestions.js +6 -1
- package/dist/utils/query.d.ts +5 -3
- package/dist/utils/query.js +27 -4
- package/dist/utils/response.d.ts +4 -0
- package/dist/utils/response.js +9 -0
- package/package.json +3 -3
- package/dist/containers/Tablet/i18n/ru.json +0 -10
- package/dist/store/reducers/explainQuery.d.ts +0 -145
- package/dist/store/reducers/explainQuery.js +0 -94
- package/dist/types/store/explainQuery.d.ts +0 -27
- package/dist/utils/error.d.ts +0 -2
- package/dist/utils/error.js +0 -13
- /package/dist/{types/store/explainQuery.js → store/reducers/explainQuery/types.js} +0 -0
package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.js
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Text } from '@gravity-ui/uikit';
|
3
|
+
import { ResizeableDataTable } from '../../../../../components/ResizeableDataTable/ResizeableDataTable';
|
4
|
+
import { cn } from '../../../../../utils/cn';
|
5
|
+
import { TENANT_OVERVIEW_TABLES_SETTINGS } from '../../../../../utils/constants';
|
6
|
+
import i18n from './i18n';
|
7
|
+
import './AsyncReplicationPaths.scss';
|
8
|
+
const b = cn('ydb-async-replication-paths');
|
9
|
+
const columns = [
|
10
|
+
{
|
11
|
+
name: i18n('column.srcPath.name'),
|
12
|
+
render: ({ row }) => row.SrcPath,
|
13
|
+
sortAccessor: (row) => row.SrcPath,
|
14
|
+
},
|
15
|
+
{
|
16
|
+
name: i18n('column.dstPath.name'),
|
17
|
+
render: ({ row }) => row.DstPath,
|
18
|
+
sortAccessor: (row) => row.DstPath,
|
19
|
+
},
|
20
|
+
];
|
21
|
+
export function AsyncReplicationPaths({ config }) {
|
22
|
+
var _a, _b;
|
23
|
+
if (!config) {
|
24
|
+
return null;
|
25
|
+
}
|
26
|
+
let content = i18n('noData');
|
27
|
+
if (config.Everything) {
|
28
|
+
content = (_jsxs("span", { children: [i18n('everythingWithPrefix'), ' ', _jsx(Text, { variant: "code-inline-2", children: (_b = (_a = config.Everything) === null || _a === void 0 ? void 0 : _a.DstPrefix) !== null && _b !== void 0 ? _b : 'undefined' }), "."] }));
|
29
|
+
}
|
30
|
+
if (config.Specific) {
|
31
|
+
content = (_jsx(ResizeableDataTable, { data: config.Specific.Targets, settings: TENANT_OVERVIEW_TABLES_SETTINGS, columns: columns }));
|
32
|
+
}
|
33
|
+
return (_jsxs("div", { className: b(), children: [_jsx("div", { className: b('title'), children: i18n('title') }), content] }));
|
34
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './AsyncReplicationPaths';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './AsyncReplicationPaths';
|
@@ -12,6 +12,7 @@ import { useTypedSelector } from '../../../../utils/hooks';
|
|
12
12
|
import { ExternalDataSourceInfo } from '../../Info/ExternalDataSource/ExternalDataSource';
|
13
13
|
import { ExternalTableInfo } from '../../Info/ExternalTable/ExternalTable';
|
14
14
|
import { isColumnEntityType, isEntityWithMergedImplementation, isTableType, } from '../../utils/schema';
|
15
|
+
import { AsyncReplicationInfo } from './AsyncReplicationInfo';
|
15
16
|
import { ChangefeedInfo } from './ChangefeedInfo';
|
16
17
|
import { TableInfo } from './TableInfo';
|
17
18
|
import { TopicInfo } from './TopicInfo';
|
@@ -63,6 +64,7 @@ function Overview({ type, tenantName }) {
|
|
63
64
|
[EPathType.EPathTypeExternalTable]: () => _jsx(ExternalTableInfo, { data: data }),
|
64
65
|
[EPathType.EPathTypeExternalDataSource]: () => _jsx(ExternalDataSourceInfo, { data: data }),
|
65
66
|
[EPathType.EPathTypeView]: undefined,
|
67
|
+
[EPathType.EPathTypeReplication]: () => _jsx(AsyncReplicationInfo, { data: data }),
|
66
68
|
};
|
67
69
|
return ((type && ((_a = pathTypeToComponent[type]) === null || _a === void 0 ? void 0 : _a.call(pathTypeToComponent))) || (_jsx(TableInfo, { data: data, type: type, olapStats: olapStats })));
|
68
70
|
};
|
@@ -6,6 +6,7 @@ import { changeUserInput } from '../../../../../store/reducers/executeQuery';
|
|
6
6
|
import { TENANT_DIAGNOSTICS_TABS_IDS, TENANT_PAGE, TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID, } from '../../../../../store/reducers/tenant/constants';
|
7
7
|
import { topQueriesApi } from '../../../../../store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries';
|
8
8
|
import { useTypedDispatch, useTypedSelector } from '../../../../../utils/hooks';
|
9
|
+
import { parseQueryErrorToString } from '../../../../../utils/query';
|
9
10
|
import { TenantTabsGroups, getTenantPath } from '../../../TenantPages';
|
10
11
|
import { TOP_QUERIES_COLUMNS_WIDTH_LS_KEY, getTenantOverviewTopQueriesColumns, } from '../../TopQueries/getTopQueriesColumns';
|
11
12
|
import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
|
@@ -34,5 +35,5 @@ export function TopQueries({ path }) {
|
|
34
35
|
postfix: i18n('by-cpu-time'),
|
35
36
|
link: getTenantPath(Object.assign(Object.assign({}, query), { [TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.topQueries })),
|
36
37
|
});
|
37
|
-
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_QUERIES_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, onRowClick: handleRowClick, title: title, loading: loading, error: error, rowClassName: () => b('top-queries-row') }));
|
38
|
+
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_QUERIES_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, onRowClick: handleRowClick, title: title, loading: loading, error: parseQueryErrorToString(error), rowClassName: () => b('top-queries-row') }));
|
38
39
|
}
|
@@ -4,6 +4,7 @@ import { parseQuery } from '../../../../../routes';
|
|
4
4
|
import { TENANT_DIAGNOSTICS_TABS_IDS } from '../../../../../store/reducers/tenant/constants';
|
5
5
|
import { topShardsApi } from '../../../../../store/reducers/tenantOverview/topShards/tenantOverviewTopShards';
|
6
6
|
import { useTypedSelector } from '../../../../../utils/hooks';
|
7
|
+
import { parseQueryErrorToString } from '../../../../../utils/query';
|
7
8
|
import { TenantTabsGroups, getTenantPath } from '../../../TenantPages';
|
8
9
|
import { TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, getTopShardsColumns, } from '../../TopShards/getTopShardsColumns';
|
9
10
|
import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
|
@@ -22,5 +23,5 @@ export const TopShards = ({ path }) => {
|
|
22
23
|
postfix: i18n('by-cpu-usage'),
|
23
24
|
link: getTenantPath(Object.assign(Object.assign({}, query), { [TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.topShards })),
|
24
25
|
});
|
25
|
-
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, title: title, loading: loading, error: error }));
|
26
|
+
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, title: title, loading: loading, error: parseQueryErrorToString(error) }));
|
26
27
|
};
|
@@ -6,6 +6,7 @@ import { LinkToSchemaObject } from '../../../../../components/LinkToSchemaObject
|
|
6
6
|
import { topTablesApi } from '../../../../../store/reducers/tenantOverview/executeTopTables/executeTopTables';
|
7
7
|
import { formatBytes, getSizeWithSignificantDigits } from '../../../../../utils/bytesParsers';
|
8
8
|
import { useTypedSelector } from '../../../../../utils/hooks';
|
9
|
+
import { parseQueryErrorToString } from '../../../../../utils/query';
|
9
10
|
import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
|
10
11
|
import { getSectionTitle } from '../getSectionTitle';
|
11
12
|
import i18n from '../i18n';
|
@@ -40,5 +41,5 @@ export function TopTables({ path }) {
|
|
40
41
|
entity: i18n('tables'),
|
41
42
|
postfix: i18n('by-size'),
|
42
43
|
});
|
43
|
-
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_TABLES_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, title: title, loading: loading, error: error }));
|
44
|
+
return (_jsx(TenantOverviewTableLayout, { columnsWidthLSKey: TOP_TABLES_COLUMNS_WIDTH_LS_KEY, data: data || [], columns: columns, title: title, loading: loading, error: parseQueryErrorToString(error) }));
|
44
45
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key: "nodes" | "queries" | "groups" | "
|
1
|
+
declare const _default: (key: "nodes" | "queries" | "groups" | "top" | "shards" | "tables" | "no-data" | "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", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
2
2
|
export default _default;
|
@@ -12,7 +12,7 @@ import { TENANT_PAGE, TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID, } from '../../../.
|
|
12
12
|
import { cn } from '../../../../utils/cn';
|
13
13
|
import { isSortableTopQueriesProperty } from '../../../../utils/diagnostics';
|
14
14
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
15
|
-
import {
|
15
|
+
import { parseQueryErrorToString } from '../../../../utils/query';
|
16
16
|
import { TenantTabsGroups, getTenantPath } from '../../TenantPages';
|
17
17
|
import { QUERY_TABLE_SETTINGS } from '../../utils/constants';
|
18
18
|
import { isColumnEntityType } from '../../utils/schema';
|
@@ -48,8 +48,8 @@ export const TopQueries = ({ path, type }) => {
|
|
48
48
|
dispatch(setTopQueriesFilters(value));
|
49
49
|
};
|
50
50
|
const renderContent = () => {
|
51
|
-
if (error
|
52
|
-
return _jsx("div", { className: "error", children:
|
51
|
+
if (error) {
|
52
|
+
return _jsx("div", { className: "error", children: parseQueryErrorToString(error) });
|
53
53
|
}
|
54
54
|
if (!data || isColumnEntityType(type)) {
|
55
55
|
return i18n('no-data');
|
@@ -11,7 +11,7 @@ import { DEFAULT_TABLE_SETTINGS, HOUR_IN_SECONDS } from '../../../../utils/const
|
|
11
11
|
import { formatDateTime } from '../../../../utils/dataFormatters/dataFormatters';
|
12
12
|
import { isSortableTopShardsProperty } from '../../../../utils/diagnostics';
|
13
13
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
14
|
-
import {
|
14
|
+
import { parseQueryErrorToString } from '../../../../utils/query';
|
15
15
|
import { isColumnEntityType } from '../../utils/schema';
|
16
16
|
import { Filters } from './Filters';
|
17
17
|
import { TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, getShardsWorkloadColumns } from './getTopShardsColumns';
|
@@ -134,8 +134,8 @@ export const TopShards = ({ tenantPath, type }) => {
|
|
134
134
|
return _jsx(Filters, { value: filters, onChange: handleFiltersChange });
|
135
135
|
};
|
136
136
|
const renderContent = () => {
|
137
|
-
if (error
|
138
|
-
return _jsx("div", { className: "error", children:
|
137
|
+
if (error) {
|
138
|
+
return _jsx("div", { className: "error", children: parseQueryErrorToString(error) });
|
139
139
|
}
|
140
140
|
if (!data || isColumnEntityType(type)) {
|
141
141
|
return i18n('no-data');
|
@@ -6,6 +6,7 @@ import { Button, Icon, Tabs } from '@gravity-ui/uikit';
|
|
6
6
|
import qs from 'qs';
|
7
7
|
import { useLocation } from 'react-router';
|
8
8
|
import { Link } from 'react-router-dom';
|
9
|
+
import { AsyncReplicationState } from '../../../components/AsyncReplicationState';
|
9
10
|
import { ClipboardButton } from '../../../components/ClipboardButton';
|
10
11
|
import InfoViewer from '../../../components/InfoViewer/InfoViewer';
|
11
12
|
import { CDCStreamOverview, PersQueueGroupOverview, } from '../../../components/InfoViewer/schemaOverview';
|
@@ -71,6 +72,11 @@ export function ObjectSummary({ type, subType, onCollapseSummary, onExpandSummar
|
|
71
72
|
};
|
72
73
|
const renderObjectOverview = () => {
|
73
74
|
var _a;
|
75
|
+
const startTimeInMilliseconds = Number(currentSchemaData === null || currentSchemaData === void 0 ? void 0 : currentSchemaData.CreateStep);
|
76
|
+
const createdAt = startTimeInMilliseconds
|
77
|
+
? formatDateTime(startTimeInMilliseconds)
|
78
|
+
: 'unknown';
|
79
|
+
const createdAtLabel = 'Created At';
|
74
80
|
// verbose mapping to guarantee a correct render for new path types
|
75
81
|
// TS will error when a new type is added but not mapped here
|
76
82
|
const pathTypeToComponent = {
|
@@ -87,15 +93,23 @@ export function ObjectSummary({ type, subType, onCollapseSummary, onExpandSummar
|
|
87
93
|
[EPathType.EPathTypeExternalTable]: () => (_jsx(ExternalTableSummary, { data: currentObjectData })),
|
88
94
|
[EPathType.EPathTypeExternalDataSource]: () => (_jsx(ExternalDataSourceSummary, { data: currentObjectData })),
|
89
95
|
[EPathType.EPathTypeView]: undefined,
|
96
|
+
[EPathType.EPathTypeReplication]: () => {
|
97
|
+
var _a, _b;
|
98
|
+
return (_jsx(InfoViewer, { info: [
|
99
|
+
{
|
100
|
+
label: createdAtLabel,
|
101
|
+
value: createdAt,
|
102
|
+
},
|
103
|
+
{
|
104
|
+
label: 'State',
|
105
|
+
value: (_jsx(AsyncReplicationState, { state: (_b = (_a = currentObjectData === null || currentObjectData === void 0 ? void 0 : currentObjectData.PathDescription) === null || _a === void 0 ? void 0 : _a.ReplicationDescription) === null || _b === void 0 ? void 0 : _b.State })),
|
106
|
+
},
|
107
|
+
] }));
|
108
|
+
},
|
90
109
|
};
|
91
110
|
let component = (currentSchemaData === null || currentSchemaData === void 0 ? void 0 : currentSchemaData.PathType) && ((_a = pathTypeToComponent[currentSchemaData.PathType]) === null || _a === void 0 ? void 0 : _a.call(pathTypeToComponent));
|
92
111
|
if (!component) {
|
93
|
-
|
94
|
-
let createTime = '';
|
95
|
-
if (startTimeInMilliseconds) {
|
96
|
-
createTime = formatDateTime(startTimeInMilliseconds);
|
97
|
-
}
|
98
|
-
component = _jsx(InfoViewer, { info: [{ label: 'Create time', value: createTime }] });
|
112
|
+
component = _jsx(InfoViewer, { info: [{ label: createdAtLabel, value: createdAt }] });
|
99
113
|
}
|
100
114
|
return component;
|
101
115
|
};
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { IQueryResult
|
1
|
+
import type { IQueryResult } from '../../../../types/store/query';
|
2
2
|
import './ExecuteResult.scss';
|
3
3
|
interface ExecuteResultProps {
|
4
4
|
data: IQueryResult | undefined;
|
5
5
|
stats: IQueryResult['stats'] | undefined;
|
6
|
-
error:
|
6
|
+
error: unknown;
|
7
7
|
isResultsCollapsed?: boolean;
|
8
8
|
onCollapseResults: VoidFunction;
|
9
9
|
onExpandResults: VoidFunction;
|
@@ -12,7 +12,7 @@ import { disableFullscreen } from '../../../../store/reducers/fullscreen';
|
|
12
12
|
import { getArray } from '../../../../utils';
|
13
13
|
import { cn } from '../../../../utils/cn';
|
14
14
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
15
|
-
import {
|
15
|
+
import { parseQueryError } from '../../../../utils/query';
|
16
16
|
import { PaneVisibilityToggleButtons } from '../../utils/paneVisibilityToggleHelpers';
|
17
17
|
import { ResultIssues } from '../Issues/Issues';
|
18
18
|
import { QueryDuration } from '../QueryDuration/QueryDuration';
|
@@ -39,6 +39,7 @@ export function ExecuteResult({ data, stats, error, isResultsCollapsed, onCollap
|
|
39
39
|
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
40
|
const textResults = getPreparedResult(currentResult);
|
41
41
|
const copyDisabled = !textResults.length;
|
42
|
+
const parsedError = parseQueryError(error);
|
42
43
|
React.useEffect(() => {
|
43
44
|
return () => {
|
44
45
|
dispatch(disableFullscreen());
|
@@ -70,15 +71,13 @@ export function ExecuteResult({ data, stats, error, isResultsCollapsed, onCollap
|
|
70
71
|
return (_jsxs(React.Fragment, { children: [content, isFullscreen && (_jsx(Fullscreen, { children: _jsx("div", { className: b('result-fullscreen-wrapper'), children: content }) }))] }));
|
71
72
|
};
|
72
73
|
const renderIssues = () => {
|
73
|
-
|
74
|
-
if (!error) {
|
74
|
+
if (!parsedError) {
|
75
75
|
return null;
|
76
76
|
}
|
77
|
-
if (typeof
|
78
|
-
const content = _jsx(ResultIssues, { data:
|
77
|
+
if (typeof parsedError === 'object') {
|
78
|
+
const content = _jsx(ResultIssues, { data: parsedError });
|
79
79
|
return (_jsxs(React.Fragment, { children: [content, isFullscreen && (_jsx(Fullscreen, { children: _jsx("div", { className: b('result-fullscreen-wrapper', b('result')), children: content }) }))] }));
|
80
80
|
}
|
81
|
-
const parsedError = typeof error === 'string' ? error : prepareQueryError(error);
|
82
81
|
return _jsx("div", { className: b('error'), children: parsedError });
|
83
82
|
};
|
84
83
|
const renderResultSection = () => {
|
@@ -8,11 +8,12 @@ import EnableFullscreenButton from '../../../../components/EnableFullscreenButto
|
|
8
8
|
import Fullscreen from '../../../../components/Fullscreen/Fullscreen';
|
9
9
|
import { MonacoEditor } from '../../../../components/MonacoEditor/MonacoEditor';
|
10
10
|
import { QueryExecutionStatus } from '../../../../components/QueryExecutionStatus';
|
11
|
-
import { explainVersions } from '../../../../store/reducers/explainQuery';
|
11
|
+
import { explainVersions } from '../../../../store/reducers/explainQuery/utils';
|
12
12
|
import { disableFullscreen } from '../../../../store/reducers/fullscreen';
|
13
13
|
import { cn } from '../../../../utils/cn';
|
14
14
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
15
15
|
import { LANGUAGE_S_EXPRESSION_ID } from '../../../../utils/monaco/s-expression/constants';
|
16
|
+
import { parseQueryErrorToString } from '../../../../utils/query';
|
16
17
|
import { PaneVisibilityToggleButtons } from '../../utils/paneVisibilityToggleHelpers';
|
17
18
|
import { renderExplainNode } from './utils';
|
18
19
|
import './ExplainResult.scss';
|
@@ -117,20 +118,11 @@ export function ExplainResult(props) {
|
|
117
118
|
return (_jsxs(React.Fragment, { children: [!isFullscreen && content, isFullscreen && _jsx(Fullscreen, { children: content })] }));
|
118
119
|
};
|
119
120
|
const renderError = () => {
|
120
|
-
|
121
|
-
const { error } = props;
|
122
|
-
let message;
|
123
|
-
if (error.data) {
|
124
|
-
message = typeof error.data === 'string' ? error.data : (_a = error.data.error) === null || _a === void 0 ? void 0 : _a.message;
|
125
|
-
}
|
126
|
-
else {
|
127
|
-
message = error;
|
128
|
-
}
|
129
|
-
return _jsx("div", { className: b('text-message'), children: message });
|
121
|
+
return _jsx("div", { className: b('text-message'), children: parseQueryErrorToString(props.error) });
|
130
122
|
};
|
131
123
|
const renderContent = () => {
|
132
|
-
const { error, loading
|
133
|
-
if (loading
|
124
|
+
const { error, loading } = props;
|
125
|
+
if (loading) {
|
134
126
|
return renderLoader();
|
135
127
|
}
|
136
128
|
if (error) {
|
@@ -8,7 +8,7 @@ import { previewApi } from '../../../../store/reducers/preview';
|
|
8
8
|
import { setShowPreview } from '../../../../store/reducers/schema/schema';
|
9
9
|
import { cn } from '../../../../utils/cn';
|
10
10
|
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
11
|
-
import {
|
11
|
+
import { parseQueryErrorToString } from '../../../../utils/query';
|
12
12
|
import { isExternalTableType, isTableType } from '../../utils/schema';
|
13
13
|
import i18n from '../i18n';
|
14
14
|
import './Preview.scss';
|
@@ -36,7 +36,7 @@ export const Preview = ({ database, type }) => {
|
|
36
36
|
message = _jsx("div", { className: b('message-container'), children: i18n('preview.not-available') });
|
37
37
|
}
|
38
38
|
else if (error) {
|
39
|
-
message = _jsx("div", { className: b('message-container', 'error'), children:
|
39
|
+
message = (_jsx("div", { className: b('message-container', 'error'), children: parseQueryErrorToString(error) }));
|
40
40
|
}
|
41
41
|
const content = message !== null && message !== void 0 ? message : (_jsx("div", { className: b('result'), children: _jsx(QueryResultTable, { data: data.result, columns: data.columns }) }));
|
42
42
|
return (_jsxs("div", { className: b(), children: [renderHeader(), isFullscreen ? _jsx(Fullscreen, { children: content }) : content] }));
|
@@ -1,16 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { goToNextQuery, goToPreviousQuery, saveQueryToHistory,
|
3
|
-
import { getExplainQuery, getExplainQueryAst } from '../../../../store/reducers/explainQuery';
|
2
|
+
import { goToNextQuery, goToPreviousQuery, saveQueryToHistory, setTenantPath } from '../../../../store/reducers/executeQuery';
|
4
3
|
import { setShowPreview } from '../../../../store/reducers/schema/schema';
|
5
4
|
import type { EPathType } from '../../../../types/api/schema';
|
6
5
|
import type { ExecuteQueryState } from '../../../../types/store/executeQuery';
|
7
|
-
import type { ExplainQueryState } from '../../../../types/store/explainQuery';
|
8
6
|
import './QueryEditor.scss';
|
9
7
|
interface QueryEditorProps {
|
10
8
|
path: string;
|
11
|
-
sendExecuteQuery: (...args: Parameters<typeof sendExecuteQuery>) => void;
|
12
|
-
getExplainQuery: (...args: Parameters<typeof getExplainQuery>) => void;
|
13
|
-
getExplainQueryAst: (...args: Parameters<typeof getExplainQueryAst>) => void;
|
14
9
|
changeUserInput: (arg: {
|
15
10
|
input: string;
|
16
11
|
}) => void;
|
@@ -18,7 +13,6 @@ interface QueryEditorProps {
|
|
18
13
|
goToPreviousQuery: (...args: Parameters<typeof goToPreviousQuery>) => void;
|
19
14
|
setTenantPath: (...args: Parameters<typeof setTenantPath>) => void;
|
20
15
|
executeQuery: ExecuteQueryState;
|
21
|
-
explainQuery: ExplainQueryState;
|
22
16
|
theme: string;
|
23
17
|
type?: EPathType;
|
24
18
|
showPreview: boolean;
|
@@ -1,11 +1,12 @@
|
|
1
|
+
import { __rest } from "tslib";
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
3
|
import React from 'react';
|
3
4
|
import throttle from 'lodash/throttle';
|
4
5
|
import { connect } from 'react-redux';
|
5
6
|
import { MonacoEditor } from '../../../../components/MonacoEditor/MonacoEditor';
|
6
7
|
import SplitPane from '../../../../components/SplitPane';
|
7
|
-
import { goToNextQuery, goToPreviousQuery, saveQueryToHistory,
|
8
|
-
import {
|
8
|
+
import { executeQueryApi, goToNextQuery, goToPreviousQuery, saveQueryToHistory, setTenantPath, } from '../../../../store/reducers/executeQuery';
|
9
|
+
import { explainQueryApi } from '../../../../store/reducers/explainQuery/explainQuery';
|
9
10
|
import { setShowPreview } from '../../../../store/reducers/schema/schema';
|
10
11
|
import { cn } from '../../../../utils/cn';
|
11
12
|
import { DEFAULT_IS_QUERY_RESULT_COLLAPSED, DEFAULT_SIZE_RESULT_PANE_KEY, LAST_USED_QUERY_ACTION_KEY, QUERY_USE_MULTI_SCHEMA_KEY, SAVED_QUERIES_KEY, } from '../../../../utils/constants';
|
@@ -38,7 +39,7 @@ const initialTenantCommonInfoState = {
|
|
38
39
|
};
|
39
40
|
function QueryEditor(props) {
|
40
41
|
const editorOptions = useEditorOptions();
|
41
|
-
const { path, setTenantPath: setPath, executeQuery,
|
42
|
+
const { path, setTenantPath: setPath, executeQuery, type, theme, changeUserInput, showPreview, } = props;
|
42
43
|
const { tenantPath: savedPath } = executeQuery;
|
43
44
|
const [resultType, setResultType] = React.useState(RESULT_TYPES.EXECUTE);
|
44
45
|
const [isResultLoaded, setIsResultLoaded] = React.useState(false);
|
@@ -47,6 +48,8 @@ function QueryEditor(props) {
|
|
47
48
|
const [lastUsedQueryAction, setLastUsedQueryAction] = useSetting(LAST_USED_QUERY_ACTION_KEY);
|
48
49
|
const [savedQueries, setSavedQueries] = useSetting(SAVED_QUERIES_KEY);
|
49
50
|
const [monacoHotKey, setMonacoHotKey] = React.useState(null);
|
51
|
+
const [sendExecuteQuery, executeQueryResult] = executeQueryApi.useExecuteQueryMutation();
|
52
|
+
const [sendExplainQuery, explainQueryResult] = explainQueryApi.useExplainQueryMutation();
|
50
53
|
React.useEffect(() => {
|
51
54
|
if (savedPath !== path) {
|
52
55
|
if (savedPath) {
|
@@ -125,7 +128,7 @@ function QueryEditor(props) {
|
|
125
128
|
const query = text !== null && text !== void 0 ? text : input;
|
126
129
|
setLastUsedQueryAction(QUERY_ACTIONS.execute);
|
127
130
|
setResultType(RESULT_TYPES.EXECUTE);
|
128
|
-
|
131
|
+
sendExecuteQuery({
|
129
132
|
query,
|
130
133
|
database: path,
|
131
134
|
mode,
|
@@ -146,7 +149,7 @@ function QueryEditor(props) {
|
|
146
149
|
const { input } = executeQuery;
|
147
150
|
setLastUsedQueryAction(QUERY_ACTIONS.explain);
|
148
151
|
setResultType(RESULT_TYPES.EXPLAIN);
|
149
|
-
|
152
|
+
sendExplainQuery({
|
150
153
|
query: input,
|
151
154
|
database: path,
|
152
155
|
mode: mode,
|
@@ -257,9 +260,6 @@ function QueryEditor(props) {
|
|
257
260
|
const onChange = (newValue) => {
|
258
261
|
props.changeUserInput({ input: newValue });
|
259
262
|
};
|
260
|
-
const handleAstQuery = () => {
|
261
|
-
props.getExplainQueryAst({ query: executeQuery.input, database: path });
|
262
|
-
};
|
263
263
|
const onCollapseResultHandler = () => {
|
264
264
|
dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerCollapse);
|
265
265
|
};
|
@@ -283,41 +283,40 @@ function QueryEditor(props) {
|
|
283
283
|
setSavedQueries(newSavedQueries);
|
284
284
|
};
|
285
285
|
const renderControls = () => {
|
286
|
-
return (_jsx(QueryEditorControls, { onRunButtonClick: handleSendExecuteClick, runIsLoading:
|
286
|
+
return (_jsx(QueryEditorControls, { onRunButtonClick: handleSendExecuteClick, runIsLoading: executeQueryResult.isLoading, onExplainButtonClick: handleGetExplainQueryClick, explainIsLoading: explainQueryResult.isLoading, onSaveQueryClick: onSaveQueryHandler, savedQueries: savedQueries, disabled: !executeQuery.input, onUpdateQueryMode: setQueryMode, queryMode: queryMode, highlightedAction: lastUsedQueryAction }));
|
287
287
|
};
|
288
288
|
return (_jsx("div", { className: b(), children: _jsxs(SplitPane, { direction: "vertical", defaultSizePaneKey: DEFAULT_SIZE_RESULT_PANE_KEY, triggerCollapse: resultVisibilityState.triggerCollapse, triggerExpand: resultVisibilityState.triggerExpand, minSize: [0, 52], collapsedSizes: [100, 0], onSplitStartDragAdditional: onSplitStartDragAdditional, children: [_jsxs("div", { className: b('pane-wrapper', {
|
289
289
|
top: true,
|
290
|
-
}), children: [_jsx("div", { className: b('monaco-wrapper'), children: _jsx("div", { className: b('monaco'), children: _jsx(MonacoEditor, { language: LANGUAGE_YQL_ID, value: executeQuery.input, options: editorOptions, onChange: onChange, editorDidMount: editorDidMount, theme: `vs-${theme}` }) }) }), renderControls()] }), _jsx("div", { className: b('pane-wrapper'), children: _jsx(Result, {
|
290
|
+
}), children: [_jsx("div", { className: b('monaco-wrapper'), children: _jsx("div", { className: b('monaco'), children: _jsx(MonacoEditor, { language: LANGUAGE_YQL_ID, value: executeQuery.input, options: editorOptions, onChange: onChange, editorDidMount: editorDidMount, theme: `vs-${theme}` }) }) }), renderControls()] }), _jsx("div", { className: b('pane-wrapper'), children: _jsx(Result, { executeQueryData: executeQueryResult.data, executeQueryError: executeQueryResult.error, explainQueryData: explainQueryResult.data, explainQueryError: explainQueryResult.error, explainQueryLoading: explainQueryResult.isLoading, resultVisibilityState: resultVisibilityState, onExpandResultHandler: onExpandResultHandler, onCollapseResultHandler: onCollapseResultHandler, type: type, theme: theme, resultType: resultType, path: path, showPreview: showPreview }) })] }) }));
|
291
291
|
}
|
292
292
|
const mapStateToProps = (state) => {
|
293
293
|
return {
|
294
294
|
executeQuery: state.executeQuery,
|
295
|
-
explainQuery: state.explainQuery,
|
296
295
|
showPreview: state.schema.showPreview,
|
297
296
|
};
|
298
297
|
};
|
299
298
|
const mapDispatchToProps = {
|
300
|
-
sendExecuteQuery,
|
301
299
|
saveQueryToHistory,
|
302
300
|
goToPreviousQuery,
|
303
301
|
goToNextQuery,
|
304
|
-
getExplainQuery,
|
305
|
-
getExplainQueryAst,
|
306
302
|
setShowPreview,
|
307
303
|
setTenantPath,
|
308
304
|
};
|
309
305
|
export default connect(mapStateToProps, mapDispatchToProps)(QueryEditor);
|
310
|
-
function Result({
|
306
|
+
function Result({ executeQueryData, executeQueryError, explainQueryData, explainQueryError, explainQueryLoading, resultVisibilityState, onExpandResultHandler, onCollapseResultHandler, type, theme, resultType, path, showPreview, }) {
|
311
307
|
if (showPreview) {
|
312
308
|
return _jsx(Preview, { database: path, type: type });
|
313
309
|
}
|
314
310
|
if (resultType === RESULT_TYPES.EXECUTE) {
|
315
|
-
|
316
|
-
|
311
|
+
if (executeQueryData || executeQueryError) {
|
312
|
+
const _a = executeQueryData || {}, { stats } = _a, data = __rest(_a, ["stats"]);
|
313
|
+
return (_jsx(ExecuteResult, { data: data, stats: stats, error: executeQueryError, isResultsCollapsed: resultVisibilityState.collapsed, onExpandResults: onExpandResultHandler, onCollapseResults: onCollapseResultHandler }));
|
314
|
+
}
|
315
|
+
return null;
|
317
316
|
}
|
318
317
|
if (resultType === RESULT_TYPES.EXPLAIN) {
|
319
|
-
const {
|
320
|
-
return (_jsx(ExplainResult, { error:
|
318
|
+
const { plan, ast } = explainQueryData || {};
|
319
|
+
return (_jsx(ExplainResult, { error: explainQueryError, explain: plan, ast: ast, loading: explainQueryLoading, theme: theme, isResultsCollapsed: resultVisibilityState.collapsed, onExpandResults: onExpandResultHandler, onCollapseResults: onCollapseResultHandler }));
|
321
320
|
}
|
322
321
|
return null;
|
323
322
|
}
|
@@ -58,10 +58,11 @@ function Tenant(props) {
|
|
58
58
|
dispatch(getSchema({ path: tenantName }));
|
59
59
|
}, [tenantName, dispatch]);
|
60
60
|
React.useEffect(() => {
|
61
|
-
|
61
|
+
//TODO: should be refactored when move to @reduxjs/toolkit/query
|
62
|
+
if (currentSchemaPath && currentSchemaPath !== tenantName) {
|
62
63
|
dispatch(getSchema({ path: currentSchemaPath }));
|
63
64
|
}
|
64
|
-
}, [currentSchemaPath, dispatch]);
|
65
|
+
}, [currentSchemaPath, dispatch, tenantName]);
|
65
66
|
React.useEffect(() => {
|
66
67
|
if (tenantName) {
|
67
68
|
dispatch(setHeaderBreadcrumbs('tenant', { tenantName }));
|
@@ -23,6 +23,7 @@ const pathTypeToNodeType = {
|
|
23
23
|
[EPathType.EPathTypeExternalDataSource]: 'external_data_source',
|
24
24
|
[EPathType.EPathTypeExternalTable]: 'external_table',
|
25
25
|
[EPathType.EPathTypeView]: 'view',
|
26
|
+
[EPathType.EPathTypeReplication]: 'async_replication',
|
26
27
|
};
|
27
28
|
export const mapPathTypeToNavigationTreeType = (type = EPathType.EPathTypeDir, subType, defaultType = 'directory') => (subType && pathSubTypeToNodeType[subType]) || pathTypeToNodeType[type] || defaultType;
|
28
29
|
// ====================
|
@@ -46,6 +47,7 @@ const pathTypeToEntityName = {
|
|
46
47
|
[EPathType.EPathTypeExternalDataSource]: 'External Data Source',
|
47
48
|
[EPathType.EPathTypeExternalTable]: 'External Table',
|
48
49
|
[EPathType.EPathTypeView]: 'View',
|
50
|
+
[EPathType.EPathTypeReplication]: 'Async Replication',
|
49
51
|
};
|
50
52
|
export const mapPathTypeToEntityName = (type, subType) => (subType && pathSubTypeToEntityName[subType]) || (type && pathTypeToEntityName[type]);
|
51
53
|
// ====================
|
@@ -72,6 +74,7 @@ const pathTypeToIsTable = {
|
|
72
74
|
[EPathType.EPathTypeCdcStream]: false,
|
73
75
|
[EPathType.EPathTypePersQueueGroup]: false,
|
74
76
|
[EPathType.EPathTypeExternalDataSource]: false,
|
77
|
+
[EPathType.EPathTypeReplication]: false,
|
75
78
|
};
|
76
79
|
export const isTableType = (pathType) => { var _a; return (_a = (pathType && pathTypeToIsTable[pathType])) !== null && _a !== void 0 ? _a : false; };
|
77
80
|
// ====================
|
@@ -97,6 +100,7 @@ const pathTypeToIsColumn = {
|
|
97
100
|
[EPathType.EPathTypeExternalDataSource]: false,
|
98
101
|
[EPathType.EPathTypeExternalTable]: false,
|
99
102
|
[EPathType.EPathTypeView]: false,
|
103
|
+
[EPathType.EPathTypeReplication]: false,
|
100
104
|
};
|
101
105
|
export const isColumnEntityType = (type) => { var _a; return (_a = (type && pathTypeToIsColumn[type])) !== null && _a !== void 0 ? _a : false; };
|
102
106
|
// ====================
|
@@ -114,6 +118,7 @@ const pathTypeToIsDatabase = {
|
|
114
118
|
[EPathType.EPathTypeExternalDataSource]: false,
|
115
119
|
[EPathType.EPathTypeExternalTable]: false,
|
116
120
|
[EPathType.EPathTypeView]: false,
|
121
|
+
[EPathType.EPathTypeReplication]: false,
|
117
122
|
};
|
118
123
|
export const isDatabaseEntityType = (type) => { var _a; return (_a = (type && pathTypeToIsDatabase[type])) !== null && _a !== void 0 ? _a : false; };
|
119
124
|
// ====================
|
@@ -133,6 +138,7 @@ const pathTypeToEntityWithMergedImplementation = {
|
|
133
138
|
[EPathType.EPathTypeExternalDataSource]: false,
|
134
139
|
[EPathType.EPathTypeExternalTable]: false,
|
135
140
|
[EPathType.EPathTypeView]: false,
|
141
|
+
[EPathType.EPathTypeReplication]: false,
|
136
142
|
};
|
137
143
|
export const isEntityWithMergedImplementation = (type) => { var _a; return (_a = (type && pathTypeToEntityWithMergedImplementation[type])) !== null && _a !== void 0 ? _a : false; };
|
138
144
|
// ====================
|
@@ -148,6 +154,7 @@ const pathTypeToChildless = {
|
|
148
154
|
[EPathType.EPathTypeExternalDataSource]: true,
|
149
155
|
[EPathType.EPathTypeExternalTable]: true,
|
150
156
|
[EPathType.EPathTypeView]: true,
|
157
|
+
[EPathType.EPathTypeReplication]: true,
|
151
158
|
[EPathType.EPathTypeInvalid]: false,
|
152
159
|
[EPathType.EPathTypeColumnStore]: false,
|
153
160
|
[EPathType.EPathTypeColumnTable]: false,
|
@@ -173,6 +180,7 @@ const mapPathTypeToIsWithTopic = {
|
|
173
180
|
[EPathType.EPathTypeExternalDataSource]: false,
|
174
181
|
[EPathType.EPathTypeExternalTable]: false,
|
175
182
|
[EPathType.EPathTypeView]: false,
|
183
|
+
[EPathType.EPathTypeReplication]: false,
|
176
184
|
};
|
177
185
|
export const isPathTypeWithTopic = (type) => { var _a; return (_a = (type && mapPathTypeToIsWithTopic[type])) !== null && _a !== void 0 ? _a : false; };
|
178
186
|
// ====================
|
@@ -97,6 +97,7 @@ export const getActions = (dispatch, additionalEffects) => (path, type) => {
|
|
97
97
|
// verbose mapping to guarantee a correct actions set for new node types
|
98
98
|
// TS will error when a new type is added in the lib but is not mapped here
|
99
99
|
const nodeTypeToActions = {
|
100
|
+
async_replication: JUST_COPY,
|
100
101
|
database: DIR_SET,
|
101
102
|
directory: DIR_SET,
|
102
103
|
table: TABLE_SET,
|
@@ -20,6 +20,7 @@ export const getControls = (dispatch, additionalEffects) => (path, type) => {
|
|
20
20
|
const options = bindActions(path, dispatch, additionalEffects);
|
21
21
|
const openPreview = (_jsx(Button, { view: "flat-secondary", onClick: options.openPreview, title: i18n('actions.openPreview'), size: "s", children: _jsx(Icon, { data: LayoutHeaderCellsLargeFill }) }));
|
22
22
|
const nodeTypeToControls = {
|
23
|
+
async_replication: undefined,
|
23
24
|
database: undefined,
|
24
25
|
directory: undefined,
|
25
26
|
table: openPreview,
|
@@ -27,6 +27,7 @@ const vDiskPageCn = cn('ydb-vdisk-page');
|
|
27
27
|
export function VDiskPage() {
|
28
28
|
const dispatch = useTypedDispatch();
|
29
29
|
const nodesMap = useTypedSelector(selectNodesMap);
|
30
|
+
const { isUserAllowedToMakeChanges } = useTypedSelector((state) => state.authentication);
|
30
31
|
const [{ nodeId, pDiskId, vDiskSlotId }] = useQueryParams({
|
31
32
|
nodeId: StringParam,
|
32
33
|
pDiskId: StringParam,
|
@@ -84,7 +85,7 @@ export function VDiskPage() {
|
|
84
85
|
return (_jsx(DiskPageTitle, { entityName: vDiskPageKeyset('vdisk'), status: getSeverityColor(Severity), id: stringifyVdiskId(vDiskData === null || vDiskData === void 0 ? void 0 : vDiskData.VDiskId) }));
|
85
86
|
};
|
86
87
|
const renderControls = () => {
|
87
|
-
return (_jsx("div", { children: _jsxs(ButtonWithConfirmDialog, { onConfirmAction: handleEvictVDisk, onConfirmActionSuccess: handleAfterEvictVDisk, buttonDisabled: !VDiskId, buttonView: "normal", dialogContent: vDiskPageKeyset('evict-vdisk-dialog'), children: [_jsx(Icon, { data: ArrowsOppositeToDots }), vDiskPageKeyset('evict-vdisk-button')] }) }));
|
88
|
+
return (_jsx("div", { children: _jsxs(ButtonWithConfirmDialog, { onConfirmAction: handleEvictVDisk, onConfirmActionSuccess: handleAfterEvictVDisk, buttonDisabled: !VDiskId || !isUserAllowedToMakeChanges, buttonView: "normal", dialogContent: vDiskPageKeyset('evict-vdisk-dialog'), withPopover: true, popoverContent: vDiskPageKeyset('evict-vdisk-not-allowed'), popoverDisabled: isUserAllowedToMakeChanges, children: [_jsx(Icon, { data: ArrowsOppositeToDots }), vDiskPageKeyset('evict-vdisk-button')] }) }));
|
88
89
|
};
|
89
90
|
const renderInfo = () => {
|
90
91
|
return _jsx(VDiskInfo, { data: vDiskData, isVDiskPage: true });
|
@@ -5,5 +5,6 @@
|
|
5
5
|
"vdisk": "VDisk",
|
6
6
|
"group": "Group",
|
7
7
|
"evict-vdisk-button": "Evict VDisk",
|
8
|
-
"evict-vdisk-dialog": "VDisk will be evicted. Do you want to proceed?"
|
8
|
+
"evict-vdisk-dialog": "VDisk will be evicted. Do you want to proceed?",
|
9
|
+
"evict-vdisk-not-allowed": "You don't have enough rights to evict VDisk"
|
9
10
|
}
|
@@ -1 +1 @@
|
|
1
|
-
export declare const vDiskPageKeyset: (key: "node" | "fqdn" | "group" | "pdisk" | "vdisk" | "evict-vdisk-button" | "evict-vdisk-dialog", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
1
|
+
export declare const vDiskPageKeyset: (key: "node" | "fqdn" | "group" | "pdisk" | "vdisk" | "evict-vdisk-button" | "evict-vdisk-dialog" | "evict-vdisk-not-allowed", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|