ydb-embedded-ui 21.0.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ComponentsProvider/ComponentsProvider.d.ts +0 -4
- package/dist/components/ComponentsProvider/componentsRegistry.d.ts +0 -2
- package/dist/components/ComponentsProvider/componentsRegistry.js +1 -3
- package/dist/components/ComponentsProvider/componentsRegistry.js.map +1 -1
- package/dist/components/ContentWithPopup/ContentWithPopup.d.ts +1 -1
- package/dist/components/ContentWithPopup/ContentWithPopup.js +4 -2
- package/dist/components/ContentWithPopup/ContentWithPopup.js.map +1 -1
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +10 -6
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js.map +1 -1
- package/dist/components/CriticalActionDialog/i18n/en.json +1 -2
- package/dist/components/CriticalActionDialog/i18n/index.d.ts +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/FullNodeViewer/i18n/index.d.ts +1 -1
- package/dist/components/HoverPopup/HoverPopup.js +27 -4
- package/dist/components/HoverPopup/HoverPopup.js.map +1 -1
- package/dist/components/HoverPopup/getPopupScrollContainer.d.ts +1 -0
- package/dist/components/HoverPopup/getPopupScrollContainer.js +20 -0
- package/dist/components/HoverPopup/getPopupScrollContainer.js.map +1 -0
- package/dist/components/MetricChart/reducer.d.ts +2 -2
- package/dist/components/SegmentedProgress/SegmentedProgress.d.ts +22 -1
- package/dist/components/SegmentedProgress/SegmentedProgress.js +44 -3
- package/dist/components/SegmentedProgress/SegmentedProgress.js.map +1 -1
- package/dist/components/SegmentedProgress/SegmentedProgress.scss +5 -0
- package/dist/components/StorageGroupInfo/StorageGroupInfo.js +1 -13
- package/dist/components/StorageGroupInfo/StorageGroupInfo.js.map +1 -1
- package/dist/components/StorageGroupInfo/i18n/en.json +0 -1
- package/dist/components/StorageGroupInfo/i18n/index.d.ts +1 -1
- package/dist/components/nodesColumns/i18n/index.d.ts +1 -1
- package/dist/containers/App/App.js +3 -3
- package/dist/containers/App/App.js.map +1 -1
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js +8 -5
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js.map +1 -1
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +8 -0
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStats.d.ts +4 -3
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStats.js +62 -25
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStats.js.map +1 -1
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStats.scss +18 -0
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/utils.d.ts +22 -0
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/utils.js +49 -0
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/utils.js.map +1 -0
- package/dist/containers/Cluster/i18n/en.json +13 -4
- package/dist/containers/Cluster/i18n/index.d.ts +1 -1
- package/dist/containers/Header/HeaderActionsMenu.js +19 -3
- package/dist/containers/Header/HeaderActionsMenu.js.map +1 -1
- package/dist/containers/Header/hooks/useSharedDatabasePath.d.ts +4 -1
- package/dist/containers/Header/hooks/useSharedDatabasePath.js +14 -10
- package/dist/containers/Header/hooks/useSharedDatabasePath.js.map +1 -1
- package/dist/containers/Header/i18n/en.json +1 -0
- package/dist/containers/Header/i18n/index.d.ts +1 -1
- package/dist/containers/Node/Node.js +20 -17
- package/dist/containers/Node/Node.js.map +1 -1
- package/dist/containers/Node/NodePages.d.ts +3 -9
- package/dist/containers/Node/NodePages.js +2 -10
- package/dist/containers/Node/NodePages.js.map +1 -1
- package/dist/containers/Node/i18n/en.json +0 -3
- package/dist/containers/Node/i18n/index.d.ts +1 -1
- package/dist/containers/Nodes/NodesTable.js +2 -2
- package/dist/containers/Nodes/NodesTable.js.map +1 -1
- package/dist/containers/Operations/columns.js +2 -2
- package/dist/containers/Operations/columns.js.map +1 -1
- package/dist/containers/Operations/i18n/en.json +2 -2
- package/dist/containers/PDiskPage/DecommissionButton/DecommissionButton.js +1 -1
- package/dist/containers/PDiskPage/DecommissionButton/DecommissionButton.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskPage.js +1 -1
- package/dist/containers/PDiskPage/PDiskPage.js.map +1 -1
- package/dist/containers/PDiskPage/i18n/en.json +3 -3
- package/dist/containers/Storage/PDisks/PDisks.js +1 -1
- package/dist/containers/Storage/PDisks/PDisks.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageGroups/GroupedStorageGroupsComponent.js +0 -1
- package/dist/containers/Storage/PaginatedStorageGroups/GroupedStorageGroupsComponent.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageGroupsTable/PaginatedStorageGroupsTable.js +2 -3
- package/dist/containers/Storage/PaginatedStorageGroupsTable/PaginatedStorageGroupsTable.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/constants.d.ts +2 -2
- package/dist/containers/Storage/PaginatedStorageGroupsTable/getGroups.d.ts +1 -1
- package/dist/containers/Storage/PaginatedStorageGroupsTable/getGroups.js +2 -3
- package/dist/containers/Storage/PaginatedStorageGroupsTable/getGroups.js.map +1 -1
- package/dist/containers/StorageGroupPage/StorageGroupPage.js +2 -3
- package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
- package/dist/containers/Tablet/components/TabletControls/TabletControls.js +1 -1
- package/dist/containers/Tablet/components/TabletControls/TabletControls.js.map +1 -1
- package/dist/containers/Tablet/i18n/en.json +3 -3
- package/dist/containers/Tablets/TabletsTable.js +1 -1
- package/dist/containers/Tablets/TabletsTable.js.map +1 -1
- package/dist/containers/Tablets/i18n/en.json +1 -1
- package/dist/containers/Tenant/Diagnostics/Partitions/utils/constants.d.ts +2 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +3 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +2 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +1 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/useTenantStorageNewData.d.ts +5 -5
- package/dist/containers/Tenant/Diagnostics/useDiagnosticsPages.js +2 -4
- package/dist/containers/Tenant/Diagnostics/useDiagnosticsPages.js.map +1 -1
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.js +10 -2
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.js.map +1 -1
- package/dist/routes.d.ts +1 -0
- package/dist/routes.js.map +1 -1
- package/dist/services/api/viewer.d.ts +1 -2
- package/dist/services/api/viewer.js +0 -11
- package/dist/services/api/viewer.js.map +1 -1
- package/dist/store/configureStore.d.ts +12 -12
- package/dist/store/defaultStore.d.ts +6 -6
- package/dist/store/reducers/api.d.ts +1 -1
- package/dist/store/reducers/api.js +3 -0
- package/dist/store/reducers/api.js.map +1 -1
- package/dist/store/reducers/authentication/authentication.d.ts +4 -4
- package/dist/store/reducers/cancelQuery.d.ts +2 -2
- package/dist/store/reducers/capabilities/capabilities.d.ts +43 -43
- package/dist/store/reducers/capabilities/hooks.d.ts +5 -6
- package/dist/store/reducers/capabilities/hooks.js +0 -3
- package/dist/store/reducers/capabilities/hooks.js.map +1 -1
- package/dist/store/reducers/cluster/cluster.d.ts +5 -5
- package/dist/store/reducers/cluster/cluster.js +3 -2
- package/dist/store/reducers/cluster/cluster.js.map +1 -1
- package/dist/store/reducers/clusters/clusters.d.ts +2 -2
- package/dist/store/reducers/clusters/clusters.js +2 -1
- package/dist/store/reducers/clusters/clusters.js.map +1 -1
- package/dist/store/reducers/codeAssist/codeAssist.d.ts +6 -6
- package/dist/store/reducers/configs.d.ts +3 -3
- package/dist/store/reducers/entityDataTags.d.ts +21 -0
- package/dist/store/reducers/entityDataTags.js +24 -0
- package/dist/store/reducers/entityDataTags.js.map +1 -0
- package/dist/store/reducers/environments/environments.d.ts +2 -2
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +4 -4
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +111 -111
- 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 +8 -8
- package/dist/store/reducers/network/network.d.ts +2 -2
- package/dist/store/reducers/node/node.d.ts +2 -5
- package/dist/store/reducers/node/node.js +0 -12
- package/dist/store/reducers/node/node.js.map +1 -1
- package/dist/store/reducers/node/types.d.ts +0 -14
- package/dist/store/reducers/nodes/nodes.d.ts +2 -2
- package/dist/store/reducers/nodesList.d.ts +12 -12
- package/dist/store/reducers/operations.d.ts +5 -5
- package/dist/store/reducers/overview/overview.d.ts +2 -2
- package/dist/store/reducers/partitions/partitions.d.ts +3 -3
- package/dist/store/reducers/pdisk/pdisk.d.ts +2 -2
- package/dist/store/reducers/planToSvg.d.ts +2 -2
- package/dist/store/reducers/preview.d.ts +2 -2
- package/dist/store/reducers/query/api.d.ts +4 -4
- package/dist/store/reducers/replication.d.ts +2 -2
- package/dist/store/reducers/schema/schema.d.ts +16 -16
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +40 -40
- package/dist/store/reducers/settings/api.d.ts +4 -4
- package/dist/store/reducers/settings/settings.d.ts +1 -1
- package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +2 -2
- package/dist/store/reducers/showCreateTable/showCreateTable.d.ts +2 -2
- package/dist/store/reducers/storage/requestStorageData.d.ts +2 -4
- package/dist/store/reducers/storage/requestStorageData.js +4 -10
- package/dist/store/reducers/storage/requestStorageData.js.map +1 -1
- package/dist/store/reducers/storage/storage.d.ts +4 -6
- package/dist/store/reducers/storage/storage.js.map +1 -1
- package/dist/store/reducers/storage/types.d.ts +0 -9
- package/dist/store/reducers/storage/utils.d.ts +1 -2
- package/dist/store/reducers/storage/utils.js +3 -114
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/store/reducers/storageUsage/StorageUsage.d.ts +2 -2
- package/dist/store/reducers/streamingQuery/streamingQuery.d.ts +2 -2
- package/dist/store/reducers/table/table.d.ts +4 -4
- package/dist/store/reducers/tableData.d.ts +1 -1
- package/dist/store/reducers/tablePartitioning/tablePartitioning.d.ts +2 -2
- package/dist/store/reducers/tableSchemaData.d.ts +2 -2
- package/dist/store/reducers/tablet.d.ts +8 -8
- package/dist/store/reducers/tablets.d.ts +3 -3
- package/dist/store/reducers/tenant/tenant.d.ts +2 -2
- package/dist/store/reducers/tenant/tenant.js +14 -1
- package/dist/store/reducers/tenant/tenant.js.map +1 -1
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/storage/tenantOverviewStorage.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +2 -2
- package/dist/store/reducers/tenants/tenants.d.ts +3 -3
- package/dist/store/reducers/tenants/tenants.js +2 -1
- package/dist/store/reducers/tenants/tenants.js.map +1 -1
- package/dist/store/reducers/topic/topic.d.ts +84 -84
- package/dist/store/reducers/vdisk/vdisk.d.ts +3 -3
- package/dist/store/reducers/viewSchema/viewSchema.d.ts +2 -2
- package/dist/store/state-url-mapping.js +5 -1
- package/dist/store/state-url-mapping.js.map +1 -1
- package/dist/types/api/storage.d.ts +2 -111
- package/dist/types/api/storage.js.map +1 -1
- package/dist/uiFactory/types.d.ts +8 -0
- package/dist/uiFactory/uiFactory.js +5 -2
- package/dist/uiFactory/uiFactory.js.map +1 -1
- package/dist/utils/hooks/useWhoami.d.ts +5 -5
- package/package.json +2 -2
- package/src/components/ComponentsProvider/componentsRegistry.ts +1 -4
- package/src/components/ContentWithPopup/ContentWithPopup.tsx +7 -0
- package/src/components/CriticalActionDialog/CriticalActionDialog.tsx +12 -25
- package/src/components/CriticalActionDialog/i18n/en.json +1 -2
- package/src/components/DropdownMenu/DropdownMenu.tsx +3 -2
- package/src/components/HoverPopup/HoverPopup.tsx +32 -3
- package/src/components/HoverPopup/getPopupScrollContainer.ts +20 -0
- package/src/components/SegmentedProgress/SegmentedProgress.scss +5 -0
- package/src/components/SegmentedProgress/SegmentedProgress.tsx +99 -10
- package/src/components/StorageGroupInfo/StorageGroupInfo.tsx +0 -13
- package/src/components/StorageGroupInfo/i18n/en.json +0 -1
- package/src/containers/App/App.tsx +3 -3
- package/src/containers/Cluster/ClusterInfo/ClusterInfo.scss +8 -0
- package/src/containers/Cluster/ClusterInfo/ClusterInfo.tsx +12 -11
- package/src/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStats.scss +18 -0
- package/src/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStats.tsx +143 -58
- package/src/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/utils.ts +89 -0
- package/src/containers/Cluster/i18n/en.json +13 -4
- package/src/containers/Header/HeaderActionsMenu.tsx +22 -2
- package/src/containers/Header/hooks/useSharedDatabasePath.ts +33 -26
- package/src/containers/Header/i18n/en.json +1 -0
- package/src/containers/Node/Node.tsx +32 -18
- package/src/containers/Node/NodePages.ts +5 -10
- package/src/containers/Node/i18n/en.json +0 -4
- package/src/containers/Nodes/NodesTable.tsx +7 -1
- package/src/containers/Operations/columns.tsx +4 -0
- package/src/containers/Operations/i18n/en.json +2 -2
- package/src/containers/PDiskPage/DecommissionButton/DecommissionButton.tsx +2 -0
- package/src/containers/PDiskPage/PDiskPage.tsx +3 -1
- package/src/containers/PDiskPage/i18n/en.json +3 -3
- package/src/containers/Storage/PDisks/PDisks.tsx +1 -1
- package/src/containers/Storage/PaginatedStorageGroups/GroupedStorageGroupsComponent.tsx +0 -1
- package/src/containers/Storage/PaginatedStorageGroupsTable/PaginatedStorageGroupsTable.tsx +2 -6
- package/src/containers/Storage/PaginatedStorageGroupsTable/columns/constants.ts +2 -2
- package/src/containers/Storage/PaginatedStorageGroupsTable/getGroups.ts +40 -47
- package/src/containers/StorageGroupPage/StorageGroupPage.tsx +2 -6
- package/src/containers/Tablet/components/TabletControls/TabletControls.tsx +7 -1
- package/src/containers/Tablet/i18n/en.json +3 -3
- package/src/containers/Tablets/TabletsTable.tsx +3 -1
- package/src/containers/Tablets/i18n/en.json +1 -1
- package/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.tsx +3 -1
- package/src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +2 -2
- package/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.tsx +1 -6
- package/src/containers/Tenant/Diagnostics/useDiagnosticsPages.ts +1 -4
- package/src/containers/Tenant/Healthcheck/components/HealthcheckDrawer.tsx +16 -1
- package/src/routes.ts +1 -1
- package/src/services/api/viewer.ts +1 -25
- package/src/store/reducers/api.ts +4 -0
- package/src/store/reducers/capabilities/hooks.ts +0 -4
- package/src/store/reducers/cluster/cluster.ts +3 -2
- package/src/store/reducers/clusters/clusters.ts +2 -1
- package/src/store/reducers/entityDataTags.ts +34 -0
- package/src/store/reducers/node/node.ts +0 -11
- package/src/store/reducers/node/types.ts +0 -18
- package/src/store/reducers/storage/requestStorageData.ts +5 -17
- package/src/store/reducers/storage/storage.ts +2 -6
- package/src/store/reducers/storage/types.ts +0 -9
- package/src/store/reducers/storage/utils.ts +5 -178
- package/src/store/reducers/tenant/tenant.ts +17 -1
- package/src/store/reducers/tenants/tenants.ts +2 -1
- package/src/store/state-url-mapping.ts +5 -1
- package/src/types/api/storage.ts +7 -131
- package/src/uiFactory/types.ts +9 -0
- package/src/uiFactory/uiFactory.ts +12 -2
- package/dist/containers/Node/NodeStructure/NodeStructure.d.ts +0 -7
- package/dist/containers/Node/NodeStructure/NodeStructure.js +0 -76
- package/dist/containers/Node/NodeStructure/NodeStructure.js.map +0 -1
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +0 -155
- package/dist/containers/Node/NodeStructure/PDiskTitleBadge.d.ts +0 -7
- package/dist/containers/Node/NodeStructure/PDiskTitleBadge.js +0 -7
- package/dist/containers/Node/NodeStructure/PDiskTitleBadge.js.map +0 -1
- package/dist/containers/Node/NodeStructure/Pdisk.d.ts +0 -10
- package/dist/containers/Node/NodeStructure/Pdisk.js +0 -125
- package/dist/containers/Node/NodeStructure/Pdisk.js.map +0 -1
- package/dist/store/reducers/node/selectors.d.ts +0 -47
- package/dist/store/reducers/node/selectors.js +0 -43
- package/dist/store/reducers/node/selectors.js.map +0 -1
- package/src/containers/Node/NodeStructure/NodeStructure.scss +0 -155
- package/src/containers/Node/NodeStructure/NodeStructure.tsx +0 -121
- package/src/containers/Node/NodeStructure/PDiskTitleBadge.tsx +0 -18
- package/src/containers/Node/NodeStructure/Pdisk.tsx +0 -274
- package/src/store/reducers/node/selectors.ts +0 -68
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {Flex, Text} from '@gravity-ui/uikit';
|
|
3
|
+
import {Flex, Text, Tooltip} from '@gravity-ui/uikit';
|
|
4
4
|
|
|
5
5
|
import {cn} from '../../utils/cn';
|
|
6
6
|
|
|
@@ -28,6 +28,7 @@ interface SegmentedProgressByValueProps extends SegmentedProgressBaseProps {
|
|
|
28
28
|
total: number;
|
|
29
29
|
fillPercent?: never;
|
|
30
30
|
displayNoLimit?: DisplayNoLimit;
|
|
31
|
+
segments?: never;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
interface SegmentedProgressByFillPercentProps extends SegmentedProgressBaseProps {
|
|
@@ -35,11 +36,33 @@ interface SegmentedProgressByFillPercentProps extends SegmentedProgressBaseProps
|
|
|
35
36
|
value?: never;
|
|
36
37
|
total?: never;
|
|
37
38
|
displayNoLimit?: never;
|
|
39
|
+
segments?: never;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SegmentedProgressSegment {
|
|
43
|
+
id: string;
|
|
44
|
+
value: number;
|
|
45
|
+
/** Minimum width in pixels. A positive value keeps zero-value segments visible. */
|
|
46
|
+
minWidth?: number;
|
|
47
|
+
color?: string;
|
|
48
|
+
className?: string;
|
|
49
|
+
dataQa?: string;
|
|
50
|
+
tooltip?: string;
|
|
51
|
+
ariaLabelledBy?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface SegmentedProgressBySegmentsProps extends SegmentedProgressBaseProps {
|
|
55
|
+
segments: SegmentedProgressSegment[];
|
|
56
|
+
total: number;
|
|
57
|
+
value?: never;
|
|
58
|
+
fillPercent?: never;
|
|
59
|
+
displayNoLimit?: never;
|
|
38
60
|
}
|
|
39
61
|
|
|
40
62
|
export type SegmentedProgressProps =
|
|
41
63
|
| SegmentedProgressByValueProps
|
|
42
|
-
| SegmentedProgressByFillPercentProps
|
|
64
|
+
| SegmentedProgressByFillPercentProps
|
|
65
|
+
| SegmentedProgressBySegmentsProps;
|
|
43
66
|
|
|
44
67
|
function clampPercent(percent: number) {
|
|
45
68
|
if (!Number.isFinite(percent) || percent <= 0) {
|
|
@@ -51,7 +74,7 @@ function clampPercent(percent: number) {
|
|
|
51
74
|
return percent;
|
|
52
75
|
}
|
|
53
76
|
|
|
54
|
-
function defaultNormalizePercent(percent: number) {
|
|
77
|
+
export function defaultNormalizePercent(percent: number) {
|
|
55
78
|
if (percent < 1) {
|
|
56
79
|
return Math.round(percent * 10) / 10;
|
|
57
80
|
}
|
|
@@ -64,11 +87,25 @@ function isFillPercentMode(
|
|
|
64
87
|
return typeof props.fillPercent === 'number';
|
|
65
88
|
}
|
|
66
89
|
|
|
90
|
+
function isSegmentsMode(props: SegmentedProgressProps): props is SegmentedProgressBySegmentsProps {
|
|
91
|
+
return Array.isArray(props.segments);
|
|
92
|
+
}
|
|
93
|
+
|
|
67
94
|
function getPercentUsed(props: SegmentedProgressProps) {
|
|
68
95
|
if (isFillPercentMode(props)) {
|
|
69
96
|
return props.fillPercent;
|
|
70
97
|
}
|
|
71
98
|
|
|
99
|
+
if (isSegmentsMode(props)) {
|
|
100
|
+
if (props.total > 0) {
|
|
101
|
+
const value = props.segments.reduce((sum, segment) => sum + segment.value, 0);
|
|
102
|
+
|
|
103
|
+
return (value / props.total) * 100;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
72
109
|
if (props.total > 0) {
|
|
73
110
|
return (props.value / props.total) * 100;
|
|
74
111
|
}
|
|
@@ -110,9 +147,57 @@ export function SegmentedProgress(props: SegmentedProgressProps) {
|
|
|
110
147
|
[normalizePercent, percentUsed],
|
|
111
148
|
);
|
|
112
149
|
const fillWidth = getFillWidth(props, normalizedUsed);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
150
|
+
const segmentSections = isSegmentsMode(props)
|
|
151
|
+
? props.segments.map((segment) => ({
|
|
152
|
+
...segment,
|
|
153
|
+
width: props.total > 0 ? clampPercent((segment.value / props.total) * 100) : 0,
|
|
154
|
+
}))
|
|
155
|
+
: undefined;
|
|
156
|
+
const hasEmptySection = (segmentSections ? percentUsed : fillWidth) < 100;
|
|
157
|
+
|
|
158
|
+
const renderSections = () => {
|
|
159
|
+
if (segmentSections) {
|
|
160
|
+
return segmentSections
|
|
161
|
+
.filter((segment) => segment.width > 0 || (segment.minWidth ?? 0) > 0)
|
|
162
|
+
.map((segment) => {
|
|
163
|
+
const section = (
|
|
164
|
+
<div
|
|
165
|
+
key={segment.id}
|
|
166
|
+
aria-label={segment.tooltip}
|
|
167
|
+
aria-labelledby={segment.ariaLabelledBy}
|
|
168
|
+
className={b('section', {used: true}, segment.className)}
|
|
169
|
+
data-qa={segment.dataQa}
|
|
170
|
+
role={segment.tooltip ? 'img' : undefined}
|
|
171
|
+
style={{
|
|
172
|
+
width: `${segment.width}%`,
|
|
173
|
+
minWidth: segment.minWidth,
|
|
174
|
+
backgroundColor: segment.color,
|
|
175
|
+
}}
|
|
176
|
+
tabIndex={segment.tooltip ? 0 : undefined}
|
|
177
|
+
/>
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
if (!segment.tooltip) {
|
|
181
|
+
return section;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<Tooltip key={segment.id} content={segment.tooltip}>
|
|
186
|
+
{section}
|
|
187
|
+
</Tooltip>
|
|
188
|
+
);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (fillWidth > 0) {
|
|
193
|
+
return <div className={b('section', {used: true})} style={{width: `${fillWidth}%`}} />;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return null;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const renderProgress = () => {
|
|
200
|
+
return (
|
|
116
201
|
<div
|
|
117
202
|
className={b({theme}, className)}
|
|
118
203
|
data-qa={dataQa}
|
|
@@ -122,11 +207,15 @@ export function SegmentedProgress(props: SegmentedProgressProps) {
|
|
|
122
207
|
aria-valuemax={100}
|
|
123
208
|
aria-valuenow={normalizedUsed}
|
|
124
209
|
>
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
)}
|
|
128
|
-
{100 - fillWidth > 0 && <div className={b('section')} style={{flexGrow: 1}} />}
|
|
210
|
+
{renderSections()}
|
|
211
|
+
{hasEmptySection && <div className={b('section')} style={{flexGrow: 1}} />}
|
|
129
212
|
</div>
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<Flex direction="column" gap={1}>
|
|
218
|
+
{renderProgress()}
|
|
130
219
|
{!hideLabels && (
|
|
131
220
|
<Flex width="100%">
|
|
132
221
|
{labelStart && <Text color="secondary">{labelStart}</Text>}
|
|
@@ -43,7 +43,6 @@ export function StorageGroupInfo({data, className, ...infoViewerProps}: StorageG
|
|
|
43
43
|
Read,
|
|
44
44
|
Write,
|
|
45
45
|
GroupGeneration,
|
|
46
|
-
Latency,
|
|
47
46
|
AllocationUnits,
|
|
48
47
|
State,
|
|
49
48
|
MissingDisks,
|
|
@@ -140,12 +139,6 @@ export function StorageGroupInfo({data, className, ...infoViewerProps}: StorageG
|
|
|
140
139
|
});
|
|
141
140
|
}
|
|
142
141
|
runtimeInfo.push(...toInfoViewerItems(getStorageGroupCapacityInfoItems(data)));
|
|
143
|
-
if (valueIsDefined(Latency)) {
|
|
144
|
-
runtimeInfo.push({
|
|
145
|
-
label: storageGroupInfoKeyset('latency'),
|
|
146
|
-
value: <StatusIcon status={Latency} />,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
142
|
if (valueIsDefined(LatencyPutTabletLogMs)) {
|
|
150
143
|
runtimeInfo.push({
|
|
151
144
|
label: storageGroupInfoKeyset('latency-put-tablet-log'),
|
|
@@ -258,12 +251,6 @@ export function StorageGroupInfo({data, className, ...infoViewerProps}: StorageG
|
|
|
258
251
|
value: <StatusIcon status={DiskSpace} />,
|
|
259
252
|
});
|
|
260
253
|
}
|
|
261
|
-
if (valueIsDefined(Latency)) {
|
|
262
|
-
storageGroupInfoSecondColumn.push({
|
|
263
|
-
label: storageGroupInfoKeyset('latency'),
|
|
264
|
-
value: <StatusIcon status={Latency} />,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
254
|
if (valueIsDefined(LatencyPutTabletLogMs)) {
|
|
268
255
|
storageGroupInfoSecondColumn.push({
|
|
269
256
|
label: storageGroupInfoKeyset('latency-put-tablet-log'),
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"yes": "Yes",
|
|
13
13
|
"no": "No",
|
|
14
14
|
"group-generation": "Group Generation",
|
|
15
|
-
"latency": "Latency",
|
|
16
15
|
"allocation-units": "Allocation Units",
|
|
17
16
|
"context_allocation-units": "The number of channels used by tablets to write data to the storage group.",
|
|
18
17
|
"state": "State",
|
|
@@ -4,9 +4,9 @@ import type {Store} from '@reduxjs/toolkit';
|
|
|
4
4
|
import type {History} from 'history';
|
|
5
5
|
import {Helmet} from 'react-helmet-async';
|
|
6
6
|
|
|
7
|
-
import {componentsRegistry} from '../../components/ComponentsProvider/componentsRegistry';
|
|
8
7
|
import {FullscreenProvider} from '../../components/Fullscreen/FullscreenContext';
|
|
9
|
-
import {
|
|
8
|
+
import {uiFactory} from '../../uiFactory/uiFactory';
|
|
9
|
+
import {useTypedSelector} from '../../utils/hooks/useTypedSelector';
|
|
10
10
|
import type {YDBEmbeddedUISettings} from '../UserSettings/settings';
|
|
11
11
|
|
|
12
12
|
import {useAppTitle} from './AppTitleContext';
|
|
@@ -27,7 +27,7 @@ export interface AppProps {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
function App({store, history, children, userSettings, appTitle = defaultAppTitle}: AppProps) {
|
|
30
|
-
const ChatPanel =
|
|
30
|
+
const ChatPanel = uiFactory.renderChatPanel;
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<Providers store={store} history={history} appTitle={appTitle}>
|
|
@@ -53,6 +53,14 @@
|
|
|
53
53
|
|
|
54
54
|
&__storage-section {
|
|
55
55
|
--g-card-border-radius: var(--g-border-radius-s);
|
|
56
|
+
|
|
57
|
+
width: 100%;
|
|
58
|
+
|
|
59
|
+
@container overview-wrapper (min-width: 804px) {
|
|
60
|
+
width: var(--cluster-overview-section);
|
|
61
|
+
min-width: var(--cluster-overview-section);
|
|
62
|
+
}
|
|
63
|
+
|
|
56
64
|
@container overview-wrapper (min-width: 1104px) {
|
|
57
65
|
grid-area: storage;
|
|
58
66
|
}
|
|
@@ -15,6 +15,7 @@ import {BridgeInfoTable} from '../ClusterOverview/components/BridgeInfoTable';
|
|
|
15
15
|
import i18n from '../i18n';
|
|
16
16
|
|
|
17
17
|
import {StorageGroupStats} from './components/DiskGroupsStatsBars/DiskGroupsStats';
|
|
18
|
+
import {prepareClusterGroupsStats} from './components/DiskGroupsStatsBars/utils';
|
|
18
19
|
import {b} from './shared';
|
|
19
20
|
|
|
20
21
|
import './ClusterInfo.scss';
|
|
@@ -35,12 +36,16 @@ export const ClusterInfo = ({
|
|
|
35
36
|
loading,
|
|
36
37
|
error,
|
|
37
38
|
additionalClusterProps = {},
|
|
38
|
-
groupStats
|
|
39
|
+
groupStats,
|
|
39
40
|
bridgePiles,
|
|
40
41
|
}: ClusterInfoProps) => {
|
|
41
42
|
const {info = [], links = []} = additionalClusterProps;
|
|
42
43
|
|
|
43
44
|
const clusterLinks = useClusterLinks(links);
|
|
45
|
+
const preparedGroupStats = React.useMemo(
|
|
46
|
+
() => prepareClusterGroupsStats(groupStats ?? {}),
|
|
47
|
+
[groupStats],
|
|
48
|
+
);
|
|
44
49
|
|
|
45
50
|
const noDetails = (error && !cluster) || (!info.length && !clusterLinks.length);
|
|
46
51
|
|
|
@@ -106,17 +111,12 @@ export const ClusterInfo = ({
|
|
|
106
111
|
};
|
|
107
112
|
|
|
108
113
|
const renderStorageGroupsSection = () => {
|
|
109
|
-
if (loading ||
|
|
114
|
+
if (loading || preparedGroupStats.disks.length === 0) {
|
|
110
115
|
return null;
|
|
111
116
|
}
|
|
112
117
|
return (
|
|
113
|
-
<InfoSection className={b('storage-section')}>
|
|
114
|
-
<
|
|
115
|
-
{i18n('title_storage-groups')}
|
|
116
|
-
</Text>
|
|
117
|
-
<Card view="filled" className={b('section', {compact: true})}>
|
|
118
|
-
<StorageGroupStats groupStats={groupStats} />
|
|
119
|
-
</Card>
|
|
118
|
+
<InfoSection className={b('storage-section')} dataQa="cluster-storage-groups">
|
|
119
|
+
<StorageGroupStats stats={preparedGroupStats} />
|
|
120
120
|
</InfoSection>
|
|
121
121
|
);
|
|
122
122
|
};
|
|
@@ -157,11 +157,12 @@ export const ClusterInfo = ({
|
|
|
157
157
|
interface InfoSectionProps {
|
|
158
158
|
children: React.ReactNode;
|
|
159
159
|
className?: string;
|
|
160
|
+
dataQa?: string;
|
|
160
161
|
}
|
|
161
162
|
|
|
162
|
-
function InfoSection({children, className}: InfoSectionProps) {
|
|
163
|
+
function InfoSection({children, className, dataQa}: InfoSectionProps) {
|
|
163
164
|
return (
|
|
164
|
-
<Flex direction="column" gap={2} className={className}>
|
|
165
|
+
<Flex direction="column" gap={2} className={className} qa={dataQa}>
|
|
165
166
|
{children}
|
|
166
167
|
</Flex>
|
|
167
168
|
);
|
package/src/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStats.scss
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.ydb-disk-groups-stats {
|
|
2
|
+
&__card {
|
|
3
|
+
padding: var(--g-spacing-3) var(--g-spacing-4);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&__available-help {
|
|
7
|
+
color: inherit;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__legend-dot {
|
|
11
|
+
flex: 0 0 8px;
|
|
12
|
+
|
|
13
|
+
width: 8px;
|
|
14
|
+
height: 8px;
|
|
15
|
+
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStats.tsx
CHANGED
|
@@ -1,81 +1,166 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {Flex, Label, Text} from '@gravity-ui/uikit';
|
|
3
|
+
import {Card, Flex, HelpMark, Label, Text} from '@gravity-ui/uikit';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from '../../../../../
|
|
5
|
+
import {
|
|
6
|
+
SegmentedProgress,
|
|
7
|
+
defaultNormalizePercent,
|
|
8
|
+
} from '../../../../../components/SegmentedProgress/SegmentedProgress';
|
|
9
|
+
import {cn} from '../../../../../utils/cn';
|
|
10
10
|
import {formatNumber} from '../../../../../utils/dataFormatters/dataFormatters';
|
|
11
11
|
import i18n from '../../../i18n';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import type {
|
|
14
|
+
PreparedClusterGroupsStats,
|
|
15
|
+
PreparedDiskGroupsStats,
|
|
16
|
+
PreparedErasureGroupsStats,
|
|
17
|
+
} from './utils';
|
|
18
|
+
|
|
19
|
+
import './DiskGroupsStats.scss';
|
|
20
|
+
|
|
21
|
+
const b = cn('ydb-disk-groups-stats');
|
|
22
|
+
|
|
23
|
+
const ERASURE_COLORS: Record<string, string> = {
|
|
24
|
+
'block-4-2': 'var(--g-color-base-info-heavy)',
|
|
25
|
+
'mirror-3-dc': 'var(--g-color-base-utility-heavy)',
|
|
26
|
+
'mirror-3of4': 'var(--g-color-base-utility-heavy)',
|
|
27
|
+
none: 'var(--g-color-base-neutral-heavy)',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function getErasureColor(erasure: string) {
|
|
31
|
+
return ERASURE_COLORS[erasure] ?? 'var(--g-color-base-neutral-heavy)';
|
|
16
32
|
}
|
|
17
33
|
|
|
18
|
-
function
|
|
19
|
-
|
|
34
|
+
function formatGroups(count: number) {
|
|
35
|
+
return i18n('value_groups', {
|
|
36
|
+
count,
|
|
37
|
+
formattedCount: formatNumber(count),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
20
40
|
|
|
21
|
-
|
|
41
|
+
function formatAvailableGroups({min, max}: PreparedDiskGroupsStats['availableGroups']) {
|
|
42
|
+
if (min === max) {
|
|
43
|
+
return formatGroups(min);
|
|
44
|
+
}
|
|
22
45
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
return i18n('value_available-groups-range', {
|
|
47
|
+
min: formatNumber(min),
|
|
48
|
+
max: formatNumber(max),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getErasureTooltip(stats: PreparedErasureGroupsStats) {
|
|
53
|
+
return i18n('context_available-groups-by-erasure', {
|
|
54
|
+
count: stats.availableGroups,
|
|
55
|
+
formattedCount: formatNumber(stats.availableGroups),
|
|
56
|
+
erasure: stats.erasure,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function DiskGroupStats({stats}: {stats: PreparedDiskGroupsStats}) {
|
|
61
|
+
const legendId = React.useId();
|
|
62
|
+
const {allocatedGroups, availableGroups, diskType, erasures, progressTotalGroups} = stats;
|
|
63
|
+
const progressValue = progressTotalGroups > 0 ? allocatedGroups / progressTotalGroups : 0;
|
|
64
|
+
const progressPercent = progressValue * 100;
|
|
65
|
+
const progressLabel = i18n('context_storage-group-allocation-progress', {
|
|
66
|
+
diskType,
|
|
67
|
+
percent: defaultNormalizePercent(progressPercent),
|
|
68
|
+
});
|
|
69
|
+
const availableGroupsContext = i18n('context_available-groups');
|
|
70
|
+
|
|
71
|
+
const segments = erasures.map((erasureStats, index) => ({
|
|
72
|
+
id: erasureStats.erasure,
|
|
73
|
+
value: erasureStats.createdGroups,
|
|
74
|
+
minWidth: 10,
|
|
75
|
+
color: getErasureColor(erasureStats.erasure),
|
|
76
|
+
className: b('progress-segment'),
|
|
77
|
+
dataQa: 'cluster-storage-group-segment',
|
|
78
|
+
tooltip: getErasureTooltip(erasureStats),
|
|
79
|
+
ariaLabelledBy: `${legendId}-${index}`,
|
|
80
|
+
}));
|
|
29
81
|
|
|
30
82
|
return (
|
|
31
|
-
<
|
|
32
|
-
<Flex
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
83
|
+
<Card view="filled" className={b('card')} qa="cluster-storage-group-card">
|
|
84
|
+
<Flex direction="column" gap={1}>
|
|
85
|
+
<Flex direction="column" gap={2}>
|
|
86
|
+
<Flex justifyContent="space-between" alignItems="center" gap={2}>
|
|
87
|
+
<Text variant="subheader-1">{diskType}</Text>
|
|
88
|
+
<Label
|
|
89
|
+
theme="info"
|
|
90
|
+
value={
|
|
91
|
+
<Flex alignItems="center" gap={1}>
|
|
92
|
+
{formatAvailableGroups(availableGroups)}
|
|
93
|
+
<HelpMark
|
|
94
|
+
iconSize="s"
|
|
95
|
+
aria-label={i18n('action_show-available-groups-info', {
|
|
96
|
+
diskType,
|
|
97
|
+
})}
|
|
98
|
+
className={b('available-help')}
|
|
99
|
+
popoverProps={{placement: ['top', 'bottom']}}
|
|
100
|
+
>
|
|
101
|
+
{availableGroupsContext}
|
|
102
|
+
</HelpMark>
|
|
103
|
+
</Flex>
|
|
104
|
+
}
|
|
105
|
+
>
|
|
106
|
+
{i18n('title_available')}
|
|
107
|
+
</Label>
|
|
108
|
+
</Flex>
|
|
109
|
+
<div role="group" aria-label={progressLabel}>
|
|
110
|
+
<SegmentedProgress
|
|
111
|
+
segments={segments}
|
|
112
|
+
total={progressTotalGroups}
|
|
113
|
+
ariaLabel={progressLabel}
|
|
114
|
+
hideLabels
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
</Flex>
|
|
118
|
+
<Flex justifyContent="space-between" alignItems="center" gap={2} wrap="wrap">
|
|
119
|
+
<Flex alignItems="center" gap={4} wrap="wrap">
|
|
120
|
+
{erasures.map((erasureStats, index) => (
|
|
121
|
+
<Flex
|
|
122
|
+
key={erasureStats.erasure}
|
|
123
|
+
id={`${legendId}-${index}`}
|
|
124
|
+
alignItems="center"
|
|
125
|
+
gap={2}
|
|
126
|
+
>
|
|
127
|
+
<span
|
|
128
|
+
aria-hidden="true"
|
|
129
|
+
className={b('legend-dot')}
|
|
130
|
+
style={{backgroundColor: getErasureColor(erasureStats.erasure)}}
|
|
131
|
+
/>
|
|
132
|
+
<Text>{erasureStats.erasure}</Text>
|
|
133
|
+
<Text color="secondary">
|
|
134
|
+
{formatGroups(erasureStats.createdGroups)}
|
|
135
|
+
</Text>
|
|
136
|
+
</Flex>
|
|
137
|
+
))}
|
|
138
|
+
</Flex>
|
|
139
|
+
<Text color="secondary">{formatGroups(allocatedGroups)}</Text>
|
|
42
140
|
</Flex>
|
|
43
141
|
</Flex>
|
|
44
|
-
|
|
45
|
-
value={stats.createdGroups}
|
|
46
|
-
total={stats.totalGroups}
|
|
47
|
-
labelStart={erasure}
|
|
48
|
-
ariaLabel={i18n('context_storage-group-allocation-progress')}
|
|
49
|
-
/>
|
|
50
|
-
</Flex>
|
|
142
|
+
</Card>
|
|
51
143
|
);
|
|
52
144
|
}
|
|
53
145
|
|
|
54
146
|
interface StorageGroupStatsProps {
|
|
55
|
-
|
|
147
|
+
stats: PreparedClusterGroupsStats;
|
|
56
148
|
}
|
|
57
149
|
|
|
58
|
-
export function StorageGroupStats({
|
|
59
|
-
const stats = React.useMemo(() => {
|
|
60
|
-
const result: React.ReactNode[] = [];
|
|
61
|
-
|
|
62
|
-
Object.entries(groupStats).forEach(([storageType, stats]) => {
|
|
63
|
-
Object.values(stats).forEach((erasureStats) => {
|
|
64
|
-
result.push(
|
|
65
|
-
<DiskGroupStats
|
|
66
|
-
key={`${storageType}|${erasureStats.erasure}`}
|
|
67
|
-
stats={erasureStats}
|
|
68
|
-
storageType={storageType}
|
|
69
|
-
/>,
|
|
70
|
-
);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
return result;
|
|
74
|
-
}, [groupStats]);
|
|
75
|
-
|
|
150
|
+
export function StorageGroupStats({stats}: StorageGroupStatsProps) {
|
|
76
151
|
return (
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
152
|
+
<React.Fragment>
|
|
153
|
+
<Text as="div" variant="subheader-2">
|
|
154
|
+
{i18n('title_storage-groups')}{' '}
|
|
155
|
+
<Text color="secondary" variant="subheader-2">
|
|
156
|
+
{formatNumber(stats.allocatedGroups)}
|
|
157
|
+
</Text>
|
|
158
|
+
</Text>
|
|
159
|
+
<Flex direction="column" gap={1}>
|
|
160
|
+
{stats.disks.map((diskStats) => (
|
|
161
|
+
<DiskGroupStats key={diskStats.diskType} stats={diskStats} />
|
|
162
|
+
))}
|
|
163
|
+
</Flex>
|
|
164
|
+
</React.Fragment>
|
|
80
165
|
);
|
|
81
166
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type {ClusterGroupsStats} from '../../../../../store/reducers/cluster/types';
|
|
2
|
+
|
|
3
|
+
const DISK_TYPE_ORDER = ['HDD', 'SSD'];
|
|
4
|
+
const ERASURE_ORDER = ['block-4-2', 'mirror-3-dc', 'mirror-3of4', 'none'];
|
|
5
|
+
|
|
6
|
+
export interface PreparedErasureGroupsStats {
|
|
7
|
+
erasure: string;
|
|
8
|
+
createdGroups: number;
|
|
9
|
+
availableGroups: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface PreparedDiskGroupsStats {
|
|
13
|
+
diskType: string;
|
|
14
|
+
erasures: PreparedErasureGroupsStats[];
|
|
15
|
+
allocatedGroups: number;
|
|
16
|
+
availableGroups: {
|
|
17
|
+
min: number;
|
|
18
|
+
max: number;
|
|
19
|
+
average: number;
|
|
20
|
+
};
|
|
21
|
+
progressTotalGroups: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface PreparedClusterGroupsStats {
|
|
25
|
+
disks: PreparedDiskGroupsStats[];
|
|
26
|
+
allocatedGroups: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function getErasureOrder(erasure: string) {
|
|
30
|
+
const index = ERASURE_ORDER.indexOf(erasure);
|
|
31
|
+
|
|
32
|
+
return index === -1 ? ERASURE_ORDER.length : index;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getDiskTypeOrder(diskType: string) {
|
|
36
|
+
const index = DISK_TYPE_ORDER.indexOf(diskType);
|
|
37
|
+
|
|
38
|
+
return index === -1 ? DISK_TYPE_ORDER.length : index;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function prepareClusterGroupsStats(
|
|
42
|
+
groupStats: ClusterGroupsStats,
|
|
43
|
+
): PreparedClusterGroupsStats {
|
|
44
|
+
let allocatedGroups = 0;
|
|
45
|
+
|
|
46
|
+
const disks = Object.entries(groupStats)
|
|
47
|
+
.flatMap(([diskType, diskStats]) => {
|
|
48
|
+
const erasures = Object.values(diskStats)
|
|
49
|
+
.filter(({createdGroups}) => createdGroups > 0)
|
|
50
|
+
.map((stats) => ({
|
|
51
|
+
erasure: stats.erasure,
|
|
52
|
+
createdGroups: stats.createdGroups,
|
|
53
|
+
availableGroups: stats.totalGroups - stats.createdGroups,
|
|
54
|
+
}))
|
|
55
|
+
.sort((a, b) => getErasureOrder(a.erasure) - getErasureOrder(b.erasure));
|
|
56
|
+
|
|
57
|
+
if (erasures.length === 0) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const diskAllocatedGroups = erasures.reduce(
|
|
62
|
+
(sum, stats) => sum + stats.createdGroups,
|
|
63
|
+
0,
|
|
64
|
+
);
|
|
65
|
+
const availableValues = erasures.map((stats) => stats.availableGroups);
|
|
66
|
+
const minAvailableGroups = Math.min(...availableValues);
|
|
67
|
+
const maxAvailableGroups = Math.max(...availableValues);
|
|
68
|
+
const averageAvailableGroups = (minAvailableGroups + maxAvailableGroups) / 2;
|
|
69
|
+
|
|
70
|
+
allocatedGroups += diskAllocatedGroups;
|
|
71
|
+
|
|
72
|
+
return [
|
|
73
|
+
{
|
|
74
|
+
diskType,
|
|
75
|
+
erasures,
|
|
76
|
+
allocatedGroups: diskAllocatedGroups,
|
|
77
|
+
availableGroups: {
|
|
78
|
+
min: minAvailableGroups,
|
|
79
|
+
max: maxAvailableGroups,
|
|
80
|
+
average: averageAvailableGroups,
|
|
81
|
+
},
|
|
82
|
+
progressTotalGroups: diskAllocatedGroups + averageAvailableGroups,
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
})
|
|
86
|
+
.sort((a, b) => getDiskTypeOrder(a.diskType) - getDiskTypeOrder(b.diskType));
|
|
87
|
+
|
|
88
|
+
return {disks, allocatedGroups};
|
|
89
|
+
}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"title_available": "Available",
|
|
3
|
+
"value_groups": {
|
|
4
|
+
"one": "{{formattedCount}} group",
|
|
5
|
+
"other": "{{formattedCount}} groups"
|
|
6
|
+
},
|
|
7
|
+
"value_available-groups-range": "{{min}}–{{max}} groups",
|
|
8
|
+
"context_available-groups": "Estimated number of free groups available for allocation.",
|
|
9
|
+
"action_show-available-groups-info": "About available {{diskType}} storage groups",
|
|
10
|
+
"context_available-groups-by-erasure": {
|
|
11
|
+
"one": "{{formattedCount}} group available if only {{erasure}} is used",
|
|
12
|
+
"other": "{{formattedCount}} groups available if only {{erasure}} is used"
|
|
13
|
+
},
|
|
14
|
+
"context_storage-group-allocation-progress": "{{diskType}} storage group allocation: {{percent}}%",
|
|
6
15
|
"title_cpu": "CPU",
|
|
7
16
|
"title_storage-groups": "Allocated Storage Groups",
|
|
8
17
|
"title_memory": "Memory",
|