ydb-embedded-ui 6.11.0 → 6.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/DateRange/DateRange.d.ts +4 -4
- package/dist/components/DateRange/DateRange.js +23 -26
- package/dist/components/DateRange/DateRange.scss +14 -13
- package/dist/components/DateRange/__test__/fromDateRangeValues.test.d.ts +1 -0
- package/dist/components/DateRange/__test__/fromDateRangeValues.test.js +80 -0
- package/dist/components/DateRange/__test__/getdatePickerSize.test.d.ts +1 -0
- package/dist/components/DateRange/__test__/getdatePickerSize.test.js +56 -0
- package/dist/components/DateRange/__test__/toDateRangeValues.test.d.ts +1 -0
- package/dist/components/DateRange/__test__/toDateRangeValues.test.js +80 -0
- package/dist/components/DateRange/i18n/en.json +4 -0
- package/dist/components/DateRange/i18n/index.d.ts +2 -0
- package/dist/components/DateRange/i18n/index.js +5 -0
- package/dist/components/DateRange/i18n/ru.json +4 -0
- package/dist/components/DateRange/utils.d.ts +5 -0
- package/dist/components/DateRange/utils.js +41 -0
- package/dist/components/DeveloperUILinkButton/DeveloperUILinkButton.d.ts +8 -0
- package/dist/components/{DeveloperUiLink/DeveloperUiLink.js → DeveloperUILinkButton/DeveloperUILinkButton.js} +3 -3
- package/dist/components/{DeveloperUiLink/DeveloperUiLink.scss → DeveloperUILinkButton/DeveloperUILinkButton.scss} +3 -2
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.d.ts +6 -1
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.js +22 -12
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.scss +45 -45
- package/dist/components/EntityStatus/EntityStatus.js +1 -1
- package/dist/components/EntityStatus/EntityStatus.scss +6 -2
- package/dist/components/MetricChart/reducer.d.ts +2 -2
- package/dist/components/MonacoEditor/MonacoEditor.js +0 -2
- package/dist/components/NodeHostWrapper/NodeHostWrapper.d.ts +0 -1
- package/dist/components/NodeHostWrapper/NodeHostWrapper.js +3 -6
- package/dist/components/PDiskInfo/PDiskInfo.d.ts +7 -4
- package/dist/components/PDiskInfo/PDiskInfo.js +73 -26
- package/dist/components/PDiskInfo/PDiskInfo.scss +15 -1
- package/dist/components/PDiskInfo/i18n/en.json +11 -5
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/PDiskPopup/PDiskPopup.js +8 -2
- package/dist/components/VDiskInfo/VDiskInfo.d.ts +3 -2
- package/dist/components/VDiskInfo/VDiskInfo.js +9 -4
- package/dist/components/VDiskInfo/VDiskInfo.scss +7 -1
- package/dist/components/VDiskInfo/i18n/en.json +2 -1
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Cluster/Cluster.scss +1 -4
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +1 -1
- package/dist/containers/Heatmap/Heatmap.d.ts +2 -1
- package/dist/containers/Heatmap/Heatmap.js +2 -2
- package/dist/containers/Node/Node.scss +1 -4
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +0 -20
- package/dist/containers/Node/NodeStructure/Pdisk.js +2 -2
- package/dist/containers/PDiskPage/PDiskGroups/PDiskGroups.d.ts +6 -0
- package/dist/containers/PDiskPage/PDiskGroups/PDiskGroups.js +24 -0
- package/dist/containers/PDiskPage/PDiskPage.js +62 -24
- package/dist/containers/PDiskPage/PDiskPage.scss +8 -5
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.d.ts +7 -0
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js +93 -0
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.scss +52 -0
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/utils.d.ts +4 -0
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/utils.js +9 -0
- package/dist/containers/PDiskPage/i18n/en.json +8 -1
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +16 -6
- package/dist/containers/Tablets/Tablets.js +11 -8
- package/dist/containers/Tenant/Acl/Acl.d.ts +2 -1
- package/dist/containers/Tenant/Acl/Acl.js +10 -8
- package/dist/containers/Tenant/Acl/Acl.scss +8 -8
- package/dist/containers/Tenant/Acl/i18n/en.json +6 -0
- package/dist/containers/Tenant/Acl/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Acl/i18n/index.js +4 -0
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +4 -4
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js +3 -3
- package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +3 -1
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +3 -3
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +5 -5
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/en.json +14 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.js +1 -2
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.js +36 -17
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +8 -5
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/getSectionTitle.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/getSectionTitle.js +2 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +3 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +2 -2
- package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.d.ts +2 -2
- package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +14 -14
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +3 -3
- package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.js +4 -4
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +31 -18
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +2 -2
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +8 -3
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.d.ts +2 -1
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +9 -7
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.d.ts +2 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.js +38 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.scss +63 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.d.ts +15 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.js +14 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.scss +19 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.d.ts +99 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js +109 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/en.json +13 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/index.js +5 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/ru.json +13 -0
- package/dist/containers/Tenant/Query/i18n/en.json +14 -0
- package/dist/containers/Tenant/Query/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Schema/CreateDirectoryDialog/CreateDirectoryDialog.d.ts +3 -2
- package/dist/containers/Tenant/Schema/CreateDirectoryDialog/CreateDirectoryDialog.js +2 -2
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +2 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +1 -1
- package/dist/containers/Tenant/Tenant.js +1 -1
- package/dist/containers/Tenant/TenantPages.d.ts +12 -1
- package/dist/containers/Tenant/TenantPages.js +1 -1
- package/dist/containers/Tenant/i18n/en.json +2 -2
- package/dist/containers/Tenant/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/utils/schema.js +1 -1
- package/dist/containers/Tenants/Tenants.js +1 -1
- package/dist/containers/Tenants/Tenants.scss +0 -4
- package/dist/containers/UserSettings/i18n/en.json +2 -0
- package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
- package/dist/containers/UserSettings/settings.d.ts +1 -0
- package/dist/containers/UserSettings/settings.js +6 -1
- package/dist/routes.js +2 -2
- package/dist/services/api.d.ts +39 -21
- package/dist/services/api.js +45 -56
- package/dist/services/settings.d.ts +1 -0
- package/dist/services/settings.js +2 -1
- package/dist/store/configureStore.d.ts +4 -4
- package/dist/store/defaultStore.d.ts +2 -2
- package/dist/store/reducers/api.d.ts +1 -1
- package/dist/store/reducers/api.js +1 -1
- package/dist/store/reducers/cluster/cluster.d.ts +2 -2
- package/dist/store/reducers/clusterNodes/clusterNodes.d.ts +2 -2
- package/dist/store/reducers/clusters/clusters.d.ts +2 -2
- package/dist/store/reducers/describe.d.ts +5 -2
- package/dist/store/reducers/describe.js +2 -2
- package/dist/store/reducers/executeQuery.d.ts +2 -2
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +2 -2
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js +19 -14
- package/dist/store/reducers/executeTopQueries/types.d.ts +2 -2
- package/dist/store/reducers/executeTopQueries/utils.js +11 -7
- package/dist/store/reducers/explainQuery/explainQuery.d.ts +2 -2
- package/dist/store/reducers/explainQuery/explainQuery.js +6 -1
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +58 -58
- package/dist/store/reducers/heatmap.d.ts +2 -2
- package/dist/store/reducers/heatmap.js +3 -3
- package/dist/store/reducers/hotKeys/hotKeys.d.ts +3 -2
- package/dist/store/reducers/hotKeys/hotKeys.js +3 -3
- package/dist/store/reducers/index.d.ts +3 -3
- package/dist/store/reducers/network/network.d.ts +2 -2
- package/dist/store/reducers/network/network.js +1 -1
- package/dist/store/reducers/node/node.d.ts +3 -3
- package/dist/store/reducers/node/selectors.d.ts +1 -1
- package/dist/store/reducers/node/selectors.js +2 -2
- package/dist/store/reducers/nodes/nodes.d.ts +3 -3
- package/dist/store/reducers/nodesList.d.ts +3 -3
- package/dist/store/reducers/overview/overview.d.ts +5 -2
- package/dist/store/reducers/overview/overview.js +2 -2
- package/dist/store/reducers/partitions/partitions.d.ts +2 -2
- package/dist/store/reducers/pdisk/pdisk.d.ts +3 -3
- package/dist/store/reducers/pdisk/pdisk.js +15 -2
- package/dist/store/reducers/pdisk/types.d.ts +17 -1
- package/dist/store/reducers/pdisk/utils.d.ts +2 -2
- package/dist/store/reducers/pdisk/utils.js +68 -8
- package/dist/store/reducers/preview.d.ts +2 -2
- package/dist/store/reducers/preview.js +1 -1
- package/dist/store/reducers/queryActions/types.d.ts +1 -1
- package/dist/store/reducers/schema/schema.d.ts +28 -10
- package/dist/store/reducers/schema/schema.js +11 -12
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +4 -2
- package/dist/store/reducers/schemaAcl/schemaAcl.js +9 -3
- package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +2 -2
- package/dist/store/reducers/shardsWorkload/shardsWorkload.js +22 -6
- package/dist/store/reducers/shardsWorkload/types.d.ts +2 -2
- package/dist/store/reducers/storage/storage.d.ts +3 -3
- package/dist/store/reducers/tablet.d.ts +3 -3
- package/dist/store/reducers/tablets.d.ts +13 -13
- package/dist/store/reducers/tabletsFilters.d.ts +1 -1
- package/dist/store/reducers/tenant/tenant.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +1 -1
- package/dist/store/reducers/tenantOverview/topNodes/topNodes.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +1 -1
- package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.d.ts +2 -2
- package/dist/store/reducers/tenants/selectors.d.ts +27 -27
- package/dist/store/reducers/tenants/tenants.d.ts +2 -2
- package/dist/store/reducers/topic.d.ts +44 -44
- package/dist/store/reducers/vdisk/vdisk.d.ts +2 -2
- package/dist/store/reducers/vdisk/vdisk.js +1 -1
- package/dist/store/reducers/viewSchema/viewSchema.d.ts +2 -2
- package/dist/store/reducers/viewSchema/viewSchema.js +1 -1
- package/dist/store/state-url-mapping.d.ts +70 -0
- package/dist/store/state-url-mapping.js +1 -5
- package/dist/styles/mixins.scss +11 -0
- package/dist/types/api/acl.d.ts +1 -0
- package/dist/types/api/pdisk.d.ts +65 -2
- package/dist/types/api/vdisk.d.ts +33 -2
- package/dist/types/common.d.ts +3 -0
- package/dist/types/store/heatmap.d.ts +1 -0
- package/dist/types/store/query.d.ts +4 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +1 -0
- package/dist/utils/dataFormatters/dataFormatters.d.ts +0 -4
- package/dist/utils/dataFormatters/dataFormatters.js +2 -8
- package/dist/utils/developerUI/developerUI.d.ts +1 -0
- package/dist/utils/developerUI/developerUI.js +3 -0
- package/dist/utils/disks/getPDiskType.d.ts +3 -3
- package/dist/utils/disks/helpers.d.ts +1 -0
- package/dist/utils/disks/helpers.js +3 -0
- package/dist/utils/disks/prepareDisks.d.ts +2 -2
- package/dist/utils/disks/prepareDisks.js +17 -22
- package/dist/utils/disks/types.d.ts +7 -5
- package/dist/utils/monaco/constats.d.ts +2 -0
- package/dist/utils/monaco/constats.js +2 -0
- package/dist/utils/monaco/yql/constants.d.ts +0 -1
- package/dist/utils/monaco/yql/constants.js +0 -1
- package/dist/utils/monaco/yql/yql.completionItemProvider.js +2 -2
- package/dist/utils/query.d.ts +24 -1
- package/dist/utils/query.js +40 -0
- package/package.json +5 -1
- package/dist/components/DeveloperUiLink/DeveloperUiLink.d.ts +0 -8
- package/dist/components/NodeHostWrapper/NodeHostWrapper.scss +0 -15
- package/dist/containers/Node/NodeStructure/Vdisk.d.ts +0 -6
- package/dist/containers/Node/NodeStructure/Vdisk.js +0 -13
- package/dist/containers/PDiskPage/PDiskGroups.d.ts +0 -9
- package/dist/containers/PDiskPage/PDiskGroups.js +0 -20
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/ru.json +0 -5
- package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.d.ts +0 -5
- package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.js +0 -38
- package/dist/utils/monaco/index.d.ts +0 -1
- package/dist/utils/monaco/index.js +0 -6
- package/dist/utils/monaco/s-expression/constants.d.ts +0 -1
- package/dist/utils/monaco/s-expression/constants.js +0 -1
- package/dist/utils/monaco/s-expression/registerLanguage.d.ts +0 -1
- package/dist/utils/monaco/s-expression/registerLanguage.js +0 -59
- package/dist/utils/monaco/yql/registerLanguage.d.ts +0 -1
- package/dist/utils/monaco/yql/registerLanguage.js +0 -8
- package/dist/utils/monaco/yql/yql.d.ts +0 -7
- package/dist/utils/monaco/yql/yql.js +0 -180
- package/dist/utils/monaco/yql/yql.keywords.d.ts +0 -3
- package/dist/utils/monaco/yql/yql.keywords.js +0 -3
@@ -1,53 +1,72 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
3
|
import { ArrowRotateLeft } from '@gravity-ui/icons';
|
4
|
-
import { Icon } from '@gravity-ui/uikit';
|
4
|
+
import { Icon, Tabs } from '@gravity-ui/uikit';
|
5
5
|
import { skipToken } from '@reduxjs/toolkit/query';
|
6
6
|
import { Helmet } from 'react-helmet-async';
|
7
7
|
import { StringParam, useQueryParams } from 'use-query-params';
|
8
|
+
import { z } from 'zod';
|
8
9
|
import { AutoRefreshControl } from '../../components/AutoRefreshControl/AutoRefreshControl';
|
9
10
|
import { ButtonWithConfirmDialog } from '../../components/ButtonWithConfirmDialog/ButtonWithConfirmDialog';
|
10
11
|
import { DiskPageTitle } from '../../components/DiskPageTitle/DiskPageTitle';
|
11
12
|
import { InfoViewerSkeleton } from '../../components/InfoViewerSkeleton/InfoViewerSkeleton';
|
13
|
+
import { InternalLink } from '../../components/InternalLink/InternalLink';
|
12
14
|
import { PDiskInfo } from '../../components/PDiskInfo/PDiskInfo';
|
13
15
|
import { PageMeta } from '../../components/PageMeta/PageMeta';
|
16
|
+
import { getPDiskPagePath } from '../../routes';
|
17
|
+
import { api } from '../../store/reducers/api';
|
14
18
|
import { setHeaderBreadcrumbs } from '../../store/reducers/header/header';
|
15
|
-
import { selectNodesMap } from '../../store/reducers/nodesList';
|
16
19
|
import { pDiskApi } from '../../store/reducers/pdisk/pdisk';
|
17
20
|
import { valueIsDefined } from '../../utils';
|
18
|
-
import { getSeverityColor } from '../../utils/disks/helpers';
|
21
|
+
import { getPDiskId, getSeverityColor } from '../../utils/disks/helpers';
|
19
22
|
import { useAutoRefreshInterval, useTypedDispatch, useTypedSelector } from '../../utils/hooks';
|
20
|
-
import { PDiskGroups } from './PDiskGroups';
|
23
|
+
import { PDiskGroups } from './PDiskGroups/PDiskGroups';
|
24
|
+
import { PDiskSpaceDistribution } from './PDiskSpaceDistribution/PDiskSpaceDistribution';
|
21
25
|
import { pDiskPageKeyset } from './i18n';
|
22
26
|
import { pdiskPageCn } from './shared';
|
23
27
|
import './PDiskPage.scss';
|
28
|
+
const PDISK_TABS_IDS = {
|
29
|
+
diskDistribution: 'diskDistribution',
|
30
|
+
groups: 'groups',
|
31
|
+
};
|
32
|
+
const PDISK_PAGE_TABS = [
|
33
|
+
{
|
34
|
+
id: PDISK_TABS_IDS.diskDistribution,
|
35
|
+
get title() {
|
36
|
+
return pDiskPageKeyset('disk-distribution');
|
37
|
+
},
|
38
|
+
},
|
39
|
+
{
|
40
|
+
id: PDISK_TABS_IDS.groups,
|
41
|
+
get title() {
|
42
|
+
return pDiskPageKeyset('groups');
|
43
|
+
},
|
44
|
+
},
|
45
|
+
];
|
46
|
+
const pDiskTabSchema = z.nativeEnum(PDISK_TABS_IDS).catch(PDISK_TABS_IDS.diskDistribution);
|
24
47
|
export function PDiskPage() {
|
25
|
-
var _a;
|
26
48
|
const dispatch = useTypedDispatch();
|
27
|
-
const nodesMap = useTypedSelector(selectNodesMap);
|
28
49
|
const { isUserAllowedToMakeChanges } = useTypedSelector((state) => state.authentication);
|
29
|
-
const [{ nodeId, pDiskId }] = useQueryParams({
|
50
|
+
const [{ nodeId, pDiskId, activeTab }] = useQueryParams({
|
51
|
+
activeTab: StringParam,
|
30
52
|
nodeId: StringParam,
|
31
53
|
pDiskId: StringParam,
|
32
54
|
});
|
55
|
+
const pDiskParamsDefined = valueIsDefined(nodeId) && valueIsDefined(pDiskId);
|
56
|
+
const pDiskTab = pDiskTabSchema.parse(activeTab);
|
33
57
|
React.useEffect(() => {
|
34
58
|
dispatch(setHeaderBreadcrumbs('pDisk', { nodeId, pDiskId }));
|
35
59
|
}, [dispatch, nodeId, pDiskId]);
|
36
60
|
const [autoRefreshInterval] = useAutoRefreshInterval();
|
37
|
-
const params =
|
61
|
+
const params = pDiskParamsDefined ? { nodeId, pDiskId } : skipToken;
|
38
62
|
const pdiskDataQuery = pDiskApi.useGetPdiskInfoQuery(params, {
|
39
63
|
pollingInterval: autoRefreshInterval,
|
40
64
|
});
|
41
65
|
const pDiskLoading = pdiskDataQuery.isFetching && pdiskDataQuery.currentData === undefined;
|
42
|
-
const pDiskData = pdiskDataQuery.currentData
|
43
|
-
const { NodeHost, NodeId, NodeType, NodeDC, Severity } = pDiskData;
|
44
|
-
const pDiskStorageQuery = pDiskApi.useGetStorageInfoQuery(params, {
|
45
|
-
pollingInterval: autoRefreshInterval,
|
46
|
-
});
|
47
|
-
const groupsLoading = pDiskStorageQuery.isFetching && pDiskStorageQuery.currentData === undefined;
|
48
|
-
const groupsData = (_a = pDiskStorageQuery.currentData) !== null && _a !== void 0 ? _a : [];
|
66
|
+
const pDiskData = pdiskDataQuery.currentData;
|
67
|
+
const { NodeHost, NodeId, NodeType, NodeDC, Severity } = pDiskData || {};
|
49
68
|
const handleRestart = async () => {
|
50
|
-
if (
|
69
|
+
if (pDiskParamsDefined) {
|
51
70
|
return window.api.restartPDisk(nodeId, pDiskId).then((res) => {
|
52
71
|
if ((res === null || res === void 0 ? void 0 : res.result) === false) {
|
53
72
|
const err = { statusText: res.error };
|
@@ -57,8 +76,10 @@ export function PDiskPage() {
|
|
57
76
|
}
|
58
77
|
return undefined;
|
59
78
|
};
|
60
|
-
const handleAfterRestart =
|
61
|
-
|
79
|
+
const handleAfterRestart = () => {
|
80
|
+
if (pDiskParamsDefined) {
|
81
|
+
dispatch(api.util.invalidateTags([{ type: 'PDiskData', id: getPDiskId(nodeId, pDiskId) }]));
|
82
|
+
}
|
62
83
|
};
|
63
84
|
const renderHelmet = () => {
|
64
85
|
const pDiskPagePart = pDiskId
|
@@ -70,13 +91,13 @@ export function PDiskPage() {
|
|
70
91
|
const renderPageMeta = () => {
|
71
92
|
const hostItem = NodeHost ? `${pDiskPageKeyset('fqdn')}: ${NodeHost}` : undefined;
|
72
93
|
const nodeIdItem = NodeId ? `${pDiskPageKeyset('node')}: ${NodeId}` : undefined;
|
73
|
-
return (
|
94
|
+
return (_jsxs("div", { className: pdiskPageCn('meta'), children: [_jsx(PageMeta, { loading: pDiskLoading, items: [hostItem, nodeIdItem, NodeType, NodeDC] }), _jsx(AutoRefreshControl, {})] }));
|
74
95
|
};
|
75
96
|
const renderPageTitle = () => {
|
76
|
-
return (_jsx(DiskPageTitle, { entityName: pDiskPageKeyset('pdisk'), status: getSeverityColor(Severity), id: pDiskId, className: pdiskPageCn('title') }));
|
97
|
+
return (_jsx(DiskPageTitle, { entityName: pDiskPageKeyset('pdisk'), status: getSeverityColor(Severity), id: pDiskParamsDefined ? getPDiskId(nodeId, pDiskId) : null, className: pdiskPageCn('title') }));
|
77
98
|
};
|
78
99
|
const renderControls = () => {
|
79
|
-
return (
|
100
|
+
return (_jsx("div", { className: pdiskPageCn('controls'), children: _jsxs(ButtonWithConfirmDialog, { onConfirmAction: handleRestart, onConfirmActionSuccess: handleAfterRestart, buttonDisabled: !nodeId || !pDiskId || !isUserAllowedToMakeChanges, buttonView: "normal", dialogContent: pDiskPageKeyset('restart-pdisk-dialog'), withPopover: true, popoverContent: pDiskPageKeyset('restart-pdisk-not-allowed'), popoverDisabled: isUserAllowedToMakeChanges, children: [_jsx(Icon, { data: ArrowRotateLeft }), pDiskPageKeyset('restart-pdisk-button')] }) }));
|
80
101
|
};
|
81
102
|
const renderInfo = () => {
|
82
103
|
if (pDiskLoading) {
|
@@ -84,8 +105,25 @@ export function PDiskPage() {
|
|
84
105
|
}
|
85
106
|
return (_jsx(PDiskInfo, { pDisk: pDiskData, nodeId: nodeId, className: pdiskPageCn('info'), isPDiskPage: true }));
|
86
107
|
};
|
87
|
-
const
|
88
|
-
return _jsx(
|
108
|
+
const renderTabs = () => {
|
109
|
+
return (_jsx("div", { className: pdiskPageCn('tabs'), children: _jsx(Tabs, { size: "l", items: PDISK_PAGE_TABS, activeTab: pDiskTab, wrapTo: ({ id }, tabNode) => {
|
110
|
+
const path = pDiskParamsDefined
|
111
|
+
? getPDiskPagePath(pDiskId, nodeId, { activeTab: id })
|
112
|
+
: undefined;
|
113
|
+
return (_jsx(InternalLink, { to: path, children: tabNode }, id));
|
114
|
+
} }) }));
|
115
|
+
};
|
116
|
+
const renderTabsContent = () => {
|
117
|
+
switch (pDiskTab) {
|
118
|
+
case 'diskDistribution': {
|
119
|
+
return pDiskData ? _jsx(PDiskSpaceDistribution, { data: pDiskData }) : null;
|
120
|
+
}
|
121
|
+
case 'groups': {
|
122
|
+
return pDiskParamsDefined ? (_jsx(PDiskGroups, { nodeId: nodeId, pDiskId: pDiskId })) : null;
|
123
|
+
}
|
124
|
+
default:
|
125
|
+
return null;
|
126
|
+
}
|
89
127
|
};
|
90
|
-
return (_jsxs("div", { className: pdiskPageCn(null), children: [renderHelmet(), renderPageMeta(), renderPageTitle(), renderControls(), renderInfo(),
|
128
|
+
return (_jsxs("div", { className: pdiskPageCn(null), children: [renderHelmet(), renderPageMeta(), renderPageTitle(), renderControls(), renderInfo(), renderTabs(), renderTabsContent()] }));
|
91
129
|
}
|
@@ -15,13 +15,16 @@
|
|
15
15
|
&__title,
|
16
16
|
&__info,
|
17
17
|
&__controls,
|
18
|
-
&
|
18
|
+
&__tabs {
|
19
19
|
position: sticky;
|
20
20
|
left: 0;
|
21
21
|
}
|
22
22
|
|
23
|
-
&
|
24
|
-
|
23
|
+
&__meta {
|
24
|
+
display: flex;
|
25
|
+
justify-content: space-between;
|
26
|
+
align-items: center;
|
27
|
+
gap: var(--g-spacing-4);
|
25
28
|
}
|
26
29
|
|
27
30
|
&__controls {
|
@@ -30,7 +33,7 @@
|
|
30
33
|
gap: var(--g-spacing-2);
|
31
34
|
}
|
32
35
|
|
33
|
-
&
|
34
|
-
|
36
|
+
&__tabs {
|
37
|
+
@include tabs-wrapper-styles();
|
35
38
|
}
|
36
39
|
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { PDiskData } from '../../../store/reducers/pdisk/types';
|
2
|
+
import './PDiskSpaceDistribution.scss';
|
3
|
+
interface PDiskSpaceDistributionProps {
|
4
|
+
data: PDiskData;
|
5
|
+
}
|
6
|
+
export declare function PDiskSpaceDistribution({ data }: PDiskSpaceDistributionProps): string | import("react/jsx-runtime").JSX.Element;
|
7
|
+
export {};
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { ContentWithPopup } from '../../../components/ContentWithPopup/ContentWithPopup';
|
3
|
+
import { DiskStateProgressBar } from '../../../components/DiskStateProgressBar/DiskStateProgressBar';
|
4
|
+
import { InfoViewer } from '../../../components/InfoViewer';
|
5
|
+
import { InternalLink } from '../../../components/InternalLink';
|
6
|
+
import { ProgressViewer } from '../../../components/ProgressViewer/ProgressViewer';
|
7
|
+
import { VDiskInfo } from '../../../components/VDiskInfo/VDiskInfo';
|
8
|
+
import { getVDiskPagePath } from '../../../routes';
|
9
|
+
import { valueIsDefined } from '../../../utils';
|
10
|
+
import { formatBytes } from '../../../utils/bytesParsers';
|
11
|
+
import { cn } from '../../../utils/cn';
|
12
|
+
import { formatStorageValuesToGb } from '../../../utils/dataFormatters/dataFormatters';
|
13
|
+
import { pDiskPageKeyset } from '../i18n';
|
14
|
+
import { isEmptySlot, isLogSlot, isVDiskSlot } from './utils';
|
15
|
+
import './PDiskSpaceDistribution.scss';
|
16
|
+
const b = cn('ydb-pdisk-space-distribution');
|
17
|
+
const SLOT_HEIGHT = 40;
|
18
|
+
export function PDiskSpaceDistribution({ data }) {
|
19
|
+
const { SlotItems } = data;
|
20
|
+
const { PDiskId, NodeId } = data;
|
21
|
+
const containerHeight = SLOT_HEIGHT * ((SlotItems === null || SlotItems === void 0 ? void 0 : SlotItems.length) || 1);
|
22
|
+
const renderSlots = () => {
|
23
|
+
return SlotItems === null || SlotItems === void 0 ? void 0 : SlotItems.map((item, index) => {
|
24
|
+
return _jsx(Slot, { item: item, pDiskId: PDiskId, nodeId: NodeId }, index);
|
25
|
+
});
|
26
|
+
};
|
27
|
+
if (!(SlotItems === null || SlotItems === void 0 ? void 0 : SlotItems.length)) {
|
28
|
+
return pDiskPageKeyset('no-slots-data');
|
29
|
+
}
|
30
|
+
return (_jsx("div", { className: b(null), style: {
|
31
|
+
height: containerHeight,
|
32
|
+
minHeight: containerHeight,
|
33
|
+
}, children: _jsx(DiskStateProgressBar, { className: b('pdisk-bar'), severity: data.Severity, diskAllocatedPercent: data.AllocatedPercent, content: renderSlots(), faded: true }) }));
|
34
|
+
}
|
35
|
+
function Slot({ item, pDiskId, nodeId }) {
|
36
|
+
const renderContent = () => {
|
37
|
+
var _a;
|
38
|
+
if (isVDiskSlot(item)) {
|
39
|
+
const vDiskPagePath = valueIsDefined((_a = item.SlotData) === null || _a === void 0 ? void 0 : _a.VDiskSlotId) &&
|
40
|
+
valueIsDefined(pDiskId) &&
|
41
|
+
valueIsDefined(nodeId)
|
42
|
+
? getVDiskPagePath(item.SlotData.VDiskSlotId, pDiskId, nodeId)
|
43
|
+
: undefined;
|
44
|
+
return (_jsx(ContentWithPopup, { content: _jsx(VDiskInfo, { data: item.SlotData, withTitle: true }), contentClassName: b('vdisk-popup'), placement: ['right', 'top'], children: _jsx(InternalLink, { to: vDiskPagePath, children: _jsx(DiskStateProgressBar, { className: b('slot'), severity: item.Severity, diskAllocatedPercent: item.UsagePercent, content: _jsx(SlotContent, { id: item.Id, title: item.Title, used: item.Used, total: item.Total }) }) }) }));
|
45
|
+
}
|
46
|
+
if (isLogSlot(item)) {
|
47
|
+
return (_jsx(ContentWithPopup, { content: _jsx(LogInfo, { data: item.SlotData }), contentClassName: b('vdisk-popup'), placement: ['right', 'top'], children: _jsx(DiskStateProgressBar, { className: b('slot'), severity: item.Severity, diskAllocatedPercent: item.UsagePercent, content: _jsx(SlotContent, { title: pDiskPageKeyset('log'), used: item.Used, total: item.Total }) }) }));
|
48
|
+
}
|
49
|
+
if (isEmptySlot(item)) {
|
50
|
+
return (_jsx(ContentWithPopup, { content: _jsx(EmptySlotInfo, { data: item.SlotData }), contentClassName: b('vdisk-popup'), placement: ['right', 'top'], children: _jsx(DiskStateProgressBar, { className: b('slot'), severity: item.Severity, empty: true, content: _jsx(SlotContent, { title: pDiskPageKeyset('empty-slot'),
|
51
|
+
// Empty slots have only total size
|
52
|
+
used: item.Total }) }) }));
|
53
|
+
}
|
54
|
+
return null;
|
55
|
+
};
|
56
|
+
return (_jsx("div", { className: b('slot-wrapper'), style: { flexGrow: Number(item.Total) || 1 }, children: renderContent() }));
|
57
|
+
}
|
58
|
+
function SlotContent({ id, title, used, total }) {
|
59
|
+
const renderSize = () => {
|
60
|
+
const [formattedUsed, formattedTotal] = formatStorageValuesToGb(used, total);
|
61
|
+
if (!total) {
|
62
|
+
return formattedUsed;
|
63
|
+
}
|
64
|
+
return `${formattedUsed} / ${formattedTotal}`;
|
65
|
+
};
|
66
|
+
return (_jsxs("div", { className: b('slot-content'), children: [_jsxs("span", { children: [valueIsDefined(id) ? _jsx("span", { className: b('slot-id'), children: id }) : null, title] }), _jsx("span", { className: b('slot-size'), children: renderSize() })] }));
|
67
|
+
}
|
68
|
+
function LogInfo({ data }) {
|
69
|
+
const { LogTotalSize, LogUsedSize, SystemSize } = data;
|
70
|
+
const info = [
|
71
|
+
{
|
72
|
+
label: pDiskPageKeyset('label.log-size'),
|
73
|
+
value: (_jsx(ProgressViewer, { value: LogUsedSize, capacity: LogTotalSize, formatValues: formatStorageValuesToGb })),
|
74
|
+
},
|
75
|
+
];
|
76
|
+
if (valueIsDefined(SystemSize)) {
|
77
|
+
info.push({
|
78
|
+
label: pDiskPageKeyset('label.system-size'),
|
79
|
+
value: formatBytes({ value: SystemSize }),
|
80
|
+
});
|
81
|
+
}
|
82
|
+
return _jsx(InfoViewer, { title: pDiskPageKeyset('log'), info: info });
|
83
|
+
}
|
84
|
+
function EmptySlotInfo({ data }) {
|
85
|
+
const { Size } = data;
|
86
|
+
const info = [
|
87
|
+
{
|
88
|
+
label: pDiskPageKeyset('label.slot-size'),
|
89
|
+
value: formatBytes({ value: Size }),
|
90
|
+
},
|
91
|
+
];
|
92
|
+
return _jsx(InfoViewer, { title: pDiskPageKeyset('empty-slot'), info: info });
|
93
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
.ydb-pdisk-space-distribution {
|
2
|
+
.storage-disk-progress-bar {
|
3
|
+
height: 100%;
|
4
|
+
}
|
5
|
+
|
6
|
+
&__pdisk-bar {
|
7
|
+
display: flex;
|
8
|
+
flex-grow: 1;
|
9
|
+
flex-direction: column;
|
10
|
+
gap: var(--g-spacing-2);
|
11
|
+
|
12
|
+
min-width: 500px;
|
13
|
+
max-width: 800px;
|
14
|
+
padding: var(--g-spacing-2);
|
15
|
+
}
|
16
|
+
|
17
|
+
&__slot-wrapper {
|
18
|
+
z-index: 1;
|
19
|
+
|
20
|
+
background-color: var(--g-color-base-background);
|
21
|
+
}
|
22
|
+
|
23
|
+
&__slot {
|
24
|
+
display: flex;
|
25
|
+
|
26
|
+
width: 100%;
|
27
|
+
}
|
28
|
+
|
29
|
+
&__slot-content {
|
30
|
+
z-index: 1;
|
31
|
+
|
32
|
+
display: flex;
|
33
|
+
flex-grow: 1;
|
34
|
+
flex-direction: row;
|
35
|
+
justify-content: space-between;
|
36
|
+
align-items: center;
|
37
|
+
|
38
|
+
padding: 0 var(--g-spacing-2);
|
39
|
+
|
40
|
+
line-height: 15px;
|
41
|
+
}
|
42
|
+
|
43
|
+
&__slot-id {
|
44
|
+
margin-right: var(--g-spacing-3);
|
45
|
+
|
46
|
+
font-weight: 600;
|
47
|
+
}
|
48
|
+
|
49
|
+
&__vdisk-popup {
|
50
|
+
padding: var(--g-spacing-half) var(--g-spacing-2) var(--g-spacing-2);
|
51
|
+
}
|
52
|
+
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type { SlotItem, SlotItemType } from '../../../store/reducers/pdisk/types';
|
2
|
+
export declare function isVDiskSlot(slot: SlotItem<SlotItemType>): slot is SlotItem<'vDisk'>;
|
3
|
+
export declare function isLogSlot(slot: SlotItem<SlotItemType>): slot is SlotItem<'log'>;
|
4
|
+
export declare function isEmptySlot(slot: SlotItem<SlotItemType>): slot is SlotItem<'empty'>;
|
@@ -1,8 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"fqdn": "FQDN",
|
3
3
|
"pdisk": "PDisk",
|
4
|
-
"groups": "Groups",
|
5
4
|
"node": "Node",
|
5
|
+
"groups": "Groups",
|
6
|
+
"disk-distribution": "Disk distribution",
|
7
|
+
"empty-slot": "Empty slot",
|
8
|
+
"log": "Log",
|
9
|
+
"label.log-size": "Log Size",
|
10
|
+
"label.system-size": "System Size",
|
11
|
+
"label.slot-size": "Slot Size",
|
12
|
+
"no-slots-data": "No slots data",
|
6
13
|
"restart-pdisk-button": "Restart PDisk",
|
7
14
|
"restart-pdisk-dialog": "PDisk will be restarted. Do you want to proceed?",
|
8
15
|
"restart-pdisk-not-allowed": "You don't have enough rights to restart PDisk"
|
@@ -1 +1 @@
|
|
1
|
-
export declare const pDiskPageKeyset: (key: "node" | "groups" | "fqdn" | "pdisk" | "restart-pdisk-button" | "restart-pdisk-dialog" | "restart-pdisk-not-allowed", params?: import("@gravity-ui/i18n").Params) => string;
|
1
|
+
export declare const pDiskPageKeyset: (key: "node" | "groups" | "fqdn" | "log" | "pdisk" | "disk-distribution" | "empty-slot" | "label.log-size" | "label.system-size" | "label.slot-size" | "no-slots-data" | "restart-pdisk-button" | "restart-pdisk-dialog" | "restart-pdisk-not-allowed", params?: import("@gravity-ui/i18n").Params) => string;
|
@@ -56,9 +56,9 @@ const erasureColumn = {
|
|
56
56
|
name: GROUPS_COLUMNS_IDS.Erasure,
|
57
57
|
header: 'Erasure',
|
58
58
|
width: 100,
|
59
|
+
sortAccessor: (row) => row.ErasureSpecies,
|
59
60
|
render: ({ row }) => (row.ErasureSpecies ? row.ErasureSpecies : '-'),
|
60
61
|
align: DataTable.LEFT,
|
61
|
-
sortable: false,
|
62
62
|
};
|
63
63
|
const degradedColumn = {
|
64
64
|
name: GROUPS_COLUMNS_IDS.Degraded,
|
@@ -82,7 +82,6 @@ const usageColumn = {
|
|
82
82
|
// without a limit exclude usage from sort to display at the bottom
|
83
83
|
sortAccessor: (row) => (row.Limit ? row.Usage : null),
|
84
84
|
align: DataTable.LEFT,
|
85
|
-
sortable: false,
|
86
85
|
};
|
87
86
|
const groupIdColumn = {
|
88
87
|
name: GROUPS_COLUMNS_IDS.GroupId,
|
@@ -93,7 +92,6 @@ const groupIdColumn = {
|
|
93
92
|
},
|
94
93
|
sortAccessor: (row) => Number(row.GroupID),
|
95
94
|
align: DataTable.RIGHT,
|
96
|
-
sortable: false,
|
97
95
|
};
|
98
96
|
const usedColumn = {
|
99
97
|
name: GROUPS_COLUMNS_IDS.Used,
|
@@ -103,7 +101,6 @@ const usedColumn = {
|
|
103
101
|
return bytesToGB(row.Used, true);
|
104
102
|
},
|
105
103
|
align: DataTable.RIGHT,
|
106
|
-
sortable: false,
|
107
104
|
};
|
108
105
|
const limitColumn = {
|
109
106
|
name: GROUPS_COLUMNS_IDS.Limit,
|
@@ -113,7 +110,6 @@ const limitColumn = {
|
|
113
110
|
return bytesToGB(row.Limit);
|
114
111
|
},
|
115
112
|
align: DataTable.RIGHT,
|
116
|
-
sortable: false,
|
117
113
|
};
|
118
114
|
const usedSpaceFlagColumn = {
|
119
115
|
name: GROUPS_COLUMNS_IDS.UsedSpaceFlag,
|
@@ -166,9 +162,23 @@ const getVDisksColumn = (nodes) => ({
|
|
166
162
|
align: DataTable.CENTER,
|
167
163
|
width: 900,
|
168
164
|
resizeable: false,
|
165
|
+
sortable: false,
|
169
166
|
});
|
170
167
|
export const getStorageTopGroupsColumns = () => {
|
171
|
-
|
168
|
+
const columns = [
|
169
|
+
groupIdColumn,
|
170
|
+
typeColumn,
|
171
|
+
erasureColumn,
|
172
|
+
usageColumn,
|
173
|
+
usedColumn,
|
174
|
+
limitColumn,
|
175
|
+
];
|
176
|
+
return columns.map((column) => {
|
177
|
+
return {
|
178
|
+
...column,
|
179
|
+
sortable: false,
|
180
|
+
};
|
181
|
+
});
|
172
182
|
};
|
173
183
|
export const getPDiskStorageColumns = (nodes) => {
|
174
184
|
return [
|
@@ -3,19 +3,19 @@ import { ArrowsRotateRight } from '@gravity-ui/icons';
|
|
3
3
|
import { Icon, Label, Text } from '@gravity-ui/uikit';
|
4
4
|
import { skipToken } from '@reduxjs/toolkit/query';
|
5
5
|
import { ButtonWithConfirmDialog } from '../../components/ButtonWithConfirmDialog/ButtonWithConfirmDialog';
|
6
|
-
import {
|
6
|
+
import { DeveloperUILinkButton } from '../../components/DeveloperUILinkButton/DeveloperUILinkButton';
|
7
7
|
import { EntityStatus } from '../../components/EntityStatus/EntityStatus';
|
8
8
|
import { ResponseError } from '../../components/Errors/ResponseError';
|
9
9
|
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 { backend } from '../../store';
|
14
13
|
import { selectTabletsWithFqdn, tabletsApi } from '../../store/reducers/tablets';
|
15
14
|
import { ETabletState } from '../../types/api/tablet';
|
16
15
|
import { cn } from '../../utils/cn';
|
17
|
-
import { DEFAULT_TABLE_SETTINGS } from '../../utils/constants';
|
16
|
+
import { DEFAULT_TABLE_SETTINGS, EMPTY_DATA_PLACEHOLDER } from '../../utils/constants';
|
18
17
|
import { calcUptime } from '../../utils/dataFormatters/dataFormatters';
|
18
|
+
import { createTabletDeveloperUIHref } from '../../utils/developerUI/developerUI';
|
19
19
|
import { useAutoRefreshInterval, useTypedDispatch, useTypedSelector } from '../../utils/hooks';
|
20
20
|
import { mapTabletStateToLabelTheme } from '../../utils/tablet';
|
21
21
|
import { getDefaultNodePath } from '../Node/NodePages';
|
@@ -28,20 +28,23 @@ const columns = [
|
|
28
28
|
return i18n('Type');
|
29
29
|
},
|
30
30
|
render: ({ row }) => {
|
31
|
-
|
31
|
+
const isFollower = row.Leader === false;
|
32
|
+
return (_jsxs("span", { children: [row.Type, " ", isFollower ? _jsx(Text, { color: "secondary", children: "follower" }) : ''] }));
|
32
33
|
},
|
33
34
|
},
|
34
35
|
{
|
35
36
|
name: 'TabletId',
|
36
|
-
width:
|
37
|
+
width: 220,
|
37
38
|
get header() {
|
38
39
|
return i18n('Tablet');
|
39
40
|
},
|
40
41
|
render: ({ row }) => {
|
41
42
|
var _a;
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
if (!row.TabletId) {
|
44
|
+
return EMPTY_DATA_PLACEHOLDER;
|
45
|
+
}
|
46
|
+
const tabletPath = createHref(routes.tablet, { id: row.TabletId }, { nodeId: row.NodeId, type: row.Type });
|
47
|
+
return (_jsx(EntityStatus, { name: (_a = row.TabletId) === null || _a === void 0 ? void 0 : _a.toString(), path: tabletPath, hasClipboardButton: true, showStatus: false, additionalControls: _jsx(DeveloperUILinkButton, { href: createTabletDeveloperUIHref(row.TabletId) }) }));
|
45
48
|
},
|
46
49
|
},
|
47
50
|
{
|
@@ -6,7 +6,7 @@ import { Loader } from '../../../components/Loader';
|
|
6
6
|
import { schemaAclApi } from '../../../store/reducers/schemaAcl/schemaAcl';
|
7
7
|
import { valueIsDefined } from '../../../utils';
|
8
8
|
import { cn } from '../../../utils/cn';
|
9
|
-
import i18n from '
|
9
|
+
import i18n from './i18n';
|
10
10
|
import './Acl.scss';
|
11
11
|
const b = cn('ydb-acl');
|
12
12
|
const prepareLogin = (value) => {
|
@@ -87,15 +87,16 @@ function getOwnerItem(owner) {
|
|
87
87
|
return [
|
88
88
|
{
|
89
89
|
name: _jsx("span", { className: b('owner'), children: preparedOwner }),
|
90
|
-
content: _jsx("span", { className: b('owner'), children: i18n('
|
90
|
+
content: _jsx("span", { className: b('owner'), children: i18n('title_owner') }),
|
91
91
|
},
|
92
92
|
];
|
93
93
|
}
|
94
|
-
export const Acl = ({ path }) => {
|
95
|
-
const { currentData, isFetching, error } = schemaAclApi.useGetSchemaAclQuery({ path });
|
94
|
+
export const Acl = ({ path, database }) => {
|
95
|
+
const { currentData, isFetching, error } = schemaAclApi.useGetSchemaAclQuery({ path, database });
|
96
96
|
const loading = isFetching && !currentData;
|
97
|
-
const { acl, owner } = currentData || {};
|
97
|
+
const { acl, effectiveAcl, owner } = currentData || {};
|
98
98
|
const aclListItems = getAclListItems(acl);
|
99
|
+
const effectiveAclListItems = getAclListItems(effectiveAcl);
|
99
100
|
const ownerItem = getOwnerItem(owner);
|
100
101
|
if (loading) {
|
101
102
|
return _jsx(Loader, {});
|
@@ -103,8 +104,9 @@ export const Acl = ({ path }) => {
|
|
103
104
|
if (error) {
|
104
105
|
return _jsx(ResponseError, { error: error });
|
105
106
|
}
|
106
|
-
if (!acl && !owner) {
|
107
|
-
return _jsx(React.Fragment, { children: i18n('
|
107
|
+
if (!acl && !owner && !effectiveAcl) {
|
108
|
+
return _jsx(React.Fragment, { children: i18n('description_empty') });
|
108
109
|
}
|
109
|
-
|
110
|
+
const accessRightsItems = ownerItem.concat(aclListItems);
|
111
|
+
return (_jsxs("div", { className: b(), children: [accessRightsItems.length ? (_jsxs(React.Fragment, { children: [_jsx("div", { className: b('list-title'), children: i18n('title_rights') }), _jsx(DefinitionList, { items: accessRightsItems, nameMaxWidth: 200, className: b('result') })] })) : null, effectiveAclListItems.length ? (_jsxs(React.Fragment, { children: [_jsx("div", { className: b('list-title'), children: i18n('title_effective-rights') }), _jsx(DefinitionList, { items: effectiveAclListItems, nameMaxWidth: 200, className: b('result') })] })) : null] }));
|
110
112
|
};
|
@@ -2,20 +2,20 @@
|
|
2
2
|
|
3
3
|
.ydb-acl {
|
4
4
|
width: 100%;
|
5
|
-
&__owner-container {
|
6
|
-
padding-bottom: 25px;
|
7
|
-
}
|
8
5
|
&__result {
|
9
|
-
padding-bottom:
|
10
|
-
|
11
|
-
|
12
|
-
&__owner {
|
13
|
-
font-weight: 600;
|
6
|
+
padding-bottom: var(--g-spacing-4);
|
7
|
+
padding-left: var(--g-spacing-2);
|
14
8
|
}
|
15
9
|
&__definition-content {
|
16
10
|
display: flex;
|
17
11
|
flex-direction: column;
|
18
12
|
}
|
13
|
+
&__list-title {
|
14
|
+
margin: var(--g-spacing-3) 0 var(--g-spacing-5);
|
15
|
+
|
16
|
+
font-weight: 600;
|
17
|
+
@include subheader-2-typography();
|
18
|
+
}
|
19
19
|
&__group-label {
|
20
20
|
@include subheader-2-typography();
|
21
21
|
}
|
@@ -3,7 +3,8 @@ import './Describe.scss';
|
|
3
3
|
import 'react-json-inspector/json-inspector.css';
|
4
4
|
interface IDescribeProps {
|
5
5
|
path: string;
|
6
|
+
database: string;
|
6
7
|
type?: EPathType;
|
7
8
|
}
|
8
|
-
declare const Describe: ({ path, type }: IDescribeProps) => import("react/jsx-runtime").JSX.Element;
|
9
|
+
declare const Describe: ({ path, database, type }: IDescribeProps) => import("react/jsx-runtime").JSX.Element;
|
9
10
|
export default Describe;
|
@@ -13,18 +13,18 @@ import './Describe.scss';
|
|
13
13
|
import 'react-json-inspector/json-inspector.css';
|
14
14
|
const b = cn('kv-describe');
|
15
15
|
const expandMap = new Map();
|
16
|
-
const Describe = ({ path, type }) => {
|
16
|
+
const Describe = ({ path, database, type }) => {
|
17
17
|
const [autoRefreshInterval] = useAutoRefreshInterval();
|
18
18
|
const isEntityWithMergedImpl = isEntityWithMergedImplementation(type);
|
19
|
-
const mergedChildrenPaths = useTypedSelector((state) => selectSchemaMergedChildrenPaths(state, path, type), shallowEqual);
|
20
|
-
let paths =
|
19
|
+
const mergedChildrenPaths = useTypedSelector((state) => selectSchemaMergedChildrenPaths(state, path, type, database), shallowEqual);
|
20
|
+
let paths = [];
|
21
21
|
if (!isEntityWithMergedImpl) {
|
22
22
|
paths = [path];
|
23
23
|
}
|
24
24
|
else if (mergedChildrenPaths) {
|
25
25
|
paths = [path, ...mergedChildrenPaths];
|
26
26
|
}
|
27
|
-
const { currentData, isFetching, error } = describeApi.useGetDescribeQuery(paths, {
|
27
|
+
const { currentData, isFetching, error } = describeApi.useGetDescribeQuery(paths.length ? { paths, database } : skipToken, {
|
28
28
|
pollingInterval: autoRefreshInterval,
|
29
29
|
});
|
30
30
|
const loading = isFetching && currentData === undefined;
|
@@ -10,6 +10,6 @@ function DetailedOverview(props) {
|
|
10
10
|
return (_jsx("div", { className: b('section'), children: _jsx(TenantOverview, { tenantName: tenantName, additionalTenantProps: additionalTenantProps, additionalNodesProps: additionalNodesProps }) }));
|
11
11
|
};
|
12
12
|
const isTenant = tenantName === path;
|
13
|
-
return (_jsx("div", { className: b(), children: isTenant ? renderTenantOverview() : _jsx(Overview, { type: type, path: path }) }));
|
13
|
+
return (_jsx("div", { className: b(), children: isTenant ? (renderTenantOverview()) : (_jsx(Overview, { type: type, path: path, database: tenantName })) }));
|
14
14
|
}
|
15
15
|
export default DetailedOverview;
|