ydb-embedded-ui 22.4.0 → 22.5.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/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +3 -2
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +19 -4
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js.map +1 -1
- package/dist/components/CopyableValue/CopyableValue.d.ts +10 -0
- package/dist/components/CopyableValue/CopyableValue.js +10 -0
- package/dist/components/CopyableValue/CopyableValue.js.map +1 -0
- package/dist/components/CopyableValue/CopyableValue.scss +16 -0
- package/dist/components/CopyableValue/i18n/en.json +3 -0
- package/dist/components/CopyableValue/i18n/index.d.ts +2 -0
- package/dist/components/CopyableValue/i18n/index.js +6 -0
- package/dist/components/CopyableValue/i18n/index.js.map +1 -0
- package/dist/components/CriticalActionDialog/CriticalActionDialog.d.ts +2 -1
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +2 -1
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js.map +1 -1
- package/dist/components/DiskCapacityInfo/DiskCapacityInfo.d.ts +1 -21
- package/dist/components/DiskCapacityInfo/DiskCapacityInfo.js +40 -126
- package/dist/components/DiskCapacityInfo/DiskCapacityInfo.js.map +1 -1
- package/dist/components/DiskCapacityInfo/i18n/en.json +0 -1
- package/dist/components/DiskCapacityInfo/i18n/index.d.ts +1 -1
- package/dist/components/EntityStatus/EntityStatus.d.ts +18 -6
- package/dist/components/EntityStatus/EntityStatus.js +5 -1
- package/dist/components/EntityStatus/EntityStatus.js.map +1 -1
- package/dist/components/EntityStatus/EntityStatus.scss +5 -0
- package/dist/components/EvictVDiskButton/EvictVDiskButton.d.ts +5 -2
- package/dist/components/EvictVDiskButton/EvictVDiskButton.js +3 -2
- package/dist/components/EvictVDiskButton/EvictVDiskButton.js.map +1 -1
- package/dist/components/EvictVDiskButton/i18n/en.json +2 -2
- package/dist/components/FullNodeViewer/FullNodeViewer.js +4 -7
- package/dist/components/FullNodeViewer/FullNodeViewer.js.map +1 -1
- package/dist/components/FullNodeViewer/i18n/index.d.ts +1 -1
- package/dist/components/HoverPopup/HoverPopup.d.ts +1 -0
- package/dist/components/HoverPopup/HoverPopup.js +87 -16
- package/dist/components/HoverPopup/HoverPopup.js.map +1 -1
- package/dist/components/MemoryViewer/MemoryViewer.d.ts +3 -1
- package/dist/components/MemoryViewer/MemoryViewer.js +25 -16
- package/dist/components/MemoryViewer/MemoryViewer.js.map +1 -1
- package/dist/components/MemoryViewer/i18n/en.json +4 -3
- package/dist/components/MemoryViewer/i18n/index.d.ts +1 -1
- package/dist/components/MemoryViewer/utils.d.ts +4 -2
- package/dist/components/MemoryViewer/utils.js +11 -11
- package/dist/components/MemoryViewer/utils.js.map +1 -1
- package/dist/components/PDiskInfo/PDiskInfo.d.ts +4 -9
- package/dist/components/PDiskInfo/PDiskInfo.js +32 -144
- package/dist/components/PDiskInfo/PDiskInfo.js.map +1 -1
- package/dist/components/PDiskInfo/PDiskInfo.scss +15 -0
- package/dist/components/PDiskInfo/PDiskLogSize.js +1 -1
- package/dist/components/PDiskInfo/PDiskLogSize.js.map +1 -1
- package/dist/components/PDiskInfo/i18n/en.json +6 -3
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/PDiskInfo/statuses.js +12 -3
- package/dist/components/PDiskInfo/statuses.js.map +1 -1
- package/dist/components/Search/Search.js +3 -1
- package/dist/components/Search/Search.js.map +1 -1
- package/dist/components/StorageGroupInfo/StorageGroupInfo.js +4 -9
- package/dist/components/StorageGroupInfo/StorageGroupInfo.js.map +1 -1
- package/dist/components/StorageGroupInfo/i18n/index.d.ts +1 -1
- package/dist/components/TenantNameWrapper/i18n/index.d.ts +1 -1
- package/dist/components/VDisk/VDisk.js +2 -2
- package/dist/components/VDisk/VDisk.js.map +1 -1
- package/dist/components/VDiskInfo/VDiskInfo.d.ts +3 -7
- package/dist/components/VDiskInfo/VDiskInfo.js +57 -235
- package/dist/components/VDiskInfo/VDiskInfo.js.map +1 -1
- package/dist/components/VDiskInfo/VDiskInfo.scss +19 -3
- package/dist/components/VDiskInfo/getVDiskDetails.d.ts +7 -1
- package/dist/components/VDiskInfo/getVDiskDetails.js +14 -1
- package/dist/components/VDiskInfo/getVDiskDetails.js.map +1 -1
- package/dist/components/VDiskInfo/i18n/en.json +4 -13
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.d.ts +2 -1
- package/dist/components/VDiskPopup/VDiskPopup.js +10 -26
- package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
- package/dist/components/VDiskPopup/i18n/en.json +0 -2
- package/dist/components/VDiskPopup/i18n/index.d.ts +1 -1
- package/dist/components/VDiskStatus/VDiskReplicationStatus.js +1 -1
- package/dist/components/VDiskStatus/VDiskReplicationStatus.js.map +1 -1
- package/dist/components/VDiskStatus/VDiskStatus.js +2 -2
- package/dist/components/VDiskStatus/VDiskStatus.js.map +1 -1
- package/dist/components/VDiskStatus/VDiskStatus.scss +4 -0
- package/dist/components/VDiskStatus/statuses.js +2 -2
- package/dist/components/VDiskStatus/statuses.js.map +1 -1
- package/dist/components/nodesColumns/columns.d.ts +1 -0
- package/dist/components/nodesColumns/columns.js +13 -6
- package/dist/components/nodesColumns/columns.js.map +1 -1
- package/dist/containers/Clusters/Clusters.js +35 -6
- package/dist/containers/Clusters/Clusters.js.map +1 -1
- package/dist/containers/Clusters/Clusters.scss +24 -6
- package/dist/containers/Clusters/columns.js +9 -4
- package/dist/containers/Clusters/columns.js.map +1 -1
- package/dist/containers/Clusters/i18n/en.json +6 -0
- package/dist/containers/Clusters/i18n/index.d.ts +1 -1
- package/dist/containers/Header/Header.js +8 -0
- package/dist/containers/Header/Header.js.map +1 -1
- package/dist/containers/Header/HeaderLeftControls.js +3 -1
- package/dist/containers/Header/HeaderLeftControls.js.map +1 -1
- package/dist/containers/Header/PDiskLeftControls.d.ts +1 -0
- package/dist/containers/Header/PDiskLeftControls.js +24 -0
- package/dist/containers/Header/PDiskLeftControls.js.map +1 -0
- package/dist/containers/Header/VDiskLeftControls.d.ts +1 -0
- package/dist/containers/Header/VDiskLeftControls.js +23 -0
- package/dist/containers/Header/VDiskLeftControls.js.map +1 -0
- package/dist/containers/Header/breadcrumbs.js +5 -2
- package/dist/containers/Header/breadcrumbs.js.map +1 -1
- package/dist/containers/Header/i18n/en.json +4 -1
- package/dist/containers/Header/i18n/index.d.ts +1 -1
- package/dist/containers/Nodes/NodesControls/NodesControls.js +1 -1
- package/dist/containers/Nodes/NodesControls/NodesControls.js.map +1 -1
- package/dist/containers/Nodes/PaginatedNodes/GroupedNodesComponent.js +5 -3
- package/dist/containers/Nodes/PaginatedNodes/GroupedNodesComponent.js.map +1 -1
- package/dist/containers/Nodes/PaginatedNodes/NodesComponent.js +4 -2
- package/dist/containers/Nodes/PaginatedNodes/NodesComponent.js.map +1 -1
- package/dist/containers/Nodes/useDebouncedSearch.d.ts +2 -0
- package/dist/containers/Nodes/useDebouncedSearch.js +11 -0
- package/dist/containers/Nodes/useDebouncedSearch.js.map +1 -0
- package/dist/containers/PDiskPage/PDiskPage.js +30 -31
- package/dist/containers/PDiskPage/PDiskPage.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskPage.scss +22 -11
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js +3 -3
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskStorageDetails.d.ts +6 -0
- package/dist/containers/PDiskPage/PDiskStorageDetails.js +28 -0
- package/dist/containers/PDiskPage/PDiskStorageDetails.js.map +1 -0
- package/dist/containers/PDiskPage/PDiskStorageDetails.scss +51 -0
- package/dist/containers/PDiskPage/i18n/en.json +2 -0
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/constants.d.ts +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/useStorageQueryParams.d.ts +4 -4
- package/dist/containers/StorageGroupPage/StorageGroupPage.js +7 -5
- package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
- package/dist/containers/StorageGroupPage/StorageGroupPage.scss +10 -0
- package/dist/containers/StorageGroupPage/i18n/en.json +0 -1
- package/dist/containers/StorageGroupPage/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +5 -12
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Healthcheck/Healthcheck.scss +6 -1
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckIssue.js +2 -2
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckIssue.js.map +1 -1
- package/dist/containers/Tenant/TenantDrawerHealthcheck.js +10 -2
- package/dist/containers/Tenant/TenantDrawerHealthcheck.js.map +1 -1
- package/dist/containers/VDiskPage/VDiskPage.js +33 -33
- package/dist/containers/VDiskPage/VDiskPage.js.map +1 -1
- package/dist/containers/VDiskPage/VDiskPage.scss +21 -8
- package/dist/containers/VDiskPage/VDiskStorageDetails.js +27 -29
- package/dist/containers/VDiskPage/VDiskStorageDetails.js.map +1 -1
- package/dist/containers/VDiskPage/VDiskStorageDetails.scss +24 -93
- package/dist/containers/VDiskPage/i18n/en.json +3 -12
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
- package/dist/store/reducers/cluster/parseFields.js +1 -0
- package/dist/store/reducers/cluster/parseFields.js.map +1 -1
- package/dist/store/reducers/clusters/clusters.js +1 -0
- package/dist/store/reducers/clusters/clusters.js.map +1 -1
- package/dist/store/reducers/clusters/selectors.d.ts +1 -0
- package/dist/store/reducers/clusters/selectors.js +4 -1
- package/dist/store/reducers/clusters/selectors.js.map +1 -1
- package/dist/store/reducers/clusters/types.d.ts +2 -0
- package/dist/store/reducers/storage/prepareGroupsDisks.d.ts +1 -1
- package/dist/store/reducers/storage/prepareGroupsDisks.js +2 -1
- package/dist/store/reducers/storage/prepareGroupsDisks.js.map +1 -1
- package/dist/store/reducers/storage/utils.js +10 -3
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/store/reducers/vdisk/types.d.ts +1 -1
- package/dist/store/reducers/vdisk/utils.js +5 -5
- package/dist/store/reducers/vdisk/utils.js.map +1 -1
- package/dist/types/api/meta.d.ts +1 -0
- package/dist/types/api/nodesList.d.ts +2 -0
- package/dist/utils/hooks/useDatabaseHealthcheckAvailable.d.ts +2 -0
- package/dist/utils/hooks/useDatabaseHealthcheckAvailable.js +6 -0
- package/dist/utils/hooks/useDatabaseHealthcheckAvailable.js.map +1 -0
- package/dist/utils/memory.d.ts +5 -0
- package/dist/utils/memory.js +9 -0
- package/dist/utils/memory.js.map +1 -0
- package/dist/utils/nodes.js +3 -3
- package/dist/utils/nodes.js.map +1 -1
- package/dist/utils/storageMetrics.d.ts +1 -0
- package/dist/utils/storageMetrics.js +8 -0
- package/dist/utils/storageMetrics.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.tsx +22 -3
- package/src/components/CopyableValue/CopyableValue.scss +16 -0
- package/src/components/CopyableValue/CopyableValue.tsx +40 -0
- package/src/components/CopyableValue/i18n/en.json +3 -0
- package/src/components/CopyableValue/i18n/index.ts +8 -0
- package/src/components/CriticalActionDialog/CriticalActionDialog.tsx +3 -0
- package/src/components/DiskCapacityInfo/DiskCapacityInfo.tsx +40 -185
- package/src/components/DiskCapacityInfo/i18n/en.json +0 -1
- package/src/components/EntityStatus/EntityStatus.scss +5 -0
- package/src/components/EntityStatus/EntityStatus.tsx +38 -5
- package/src/components/EvictVDiskButton/EvictVDiskButton.tsx +10 -2
- package/src/components/EvictVDiskButton/i18n/en.json +2 -2
- package/src/components/FullNodeViewer/FullNodeViewer.tsx +4 -9
- package/src/components/HoverPopup/HoverPopup.tsx +95 -19
- package/src/components/MemoryViewer/MemoryViewer.tsx +30 -17
- package/src/components/MemoryViewer/i18n/en.json +4 -3
- package/src/components/MemoryViewer/utils.ts +19 -12
- package/src/components/PDiskInfo/PDiskInfo.scss +15 -0
- package/src/components/PDiskInfo/PDiskInfo.tsx +51 -243
- package/src/components/PDiskInfo/PDiskLogSize.tsx +12 -8
- package/src/components/PDiskInfo/i18n/en.json +6 -3
- package/src/components/PDiskInfo/statuses.ts +16 -3
- package/src/components/Search/Search.tsx +5 -2
- package/src/components/StorageGroupInfo/StorageGroupInfo.tsx +8 -13
- package/src/components/VDisk/VDisk.tsx +3 -2
- package/src/components/VDiskInfo/VDiskInfo.scss +19 -3
- package/src/components/VDiskInfo/VDiskInfo.tsx +119 -341
- package/src/components/VDiskInfo/getVDiskDetails.tsx +24 -2
- package/src/components/VDiskInfo/i18n/en.json +4 -13
- package/src/components/VDiskPopup/VDiskPopup.tsx +16 -24
- package/src/components/VDiskPopup/i18n/en.json +0 -2
- package/src/components/VDiskStatus/VDiskReplicationStatus.tsx +1 -1
- package/src/components/VDiskStatus/VDiskStatus.scss +4 -0
- package/src/components/VDiskStatus/VDiskStatus.tsx +13 -2
- package/src/components/VDiskStatus/statuses.ts +2 -2
- package/src/components/nodesColumns/columns.tsx +26 -12
- package/src/containers/Clusters/Clusters.scss +24 -6
- package/src/containers/Clusters/Clusters.tsx +74 -5
- package/src/containers/Clusters/columns.tsx +36 -6
- package/src/containers/Clusters/i18n/en.json +6 -0
- package/src/containers/Header/Header.tsx +8 -0
- package/src/containers/Header/HeaderLeftControls.tsx +3 -1
- package/src/containers/Header/PDiskLeftControls.tsx +41 -0
- package/src/containers/Header/VDiskLeftControls.tsx +40 -0
- package/src/containers/Header/breadcrumbs.tsx +4 -2
- package/src/containers/Header/i18n/en.json +4 -1
- package/src/containers/Nodes/NodesControls/NodesControls.tsx +1 -0
- package/src/containers/Nodes/PaginatedNodes/GroupedNodesComponent.tsx +5 -3
- package/src/containers/Nodes/PaginatedNodes/NodesComponent.tsx +4 -2
- package/src/containers/Nodes/useDebouncedSearch.ts +13 -0
- package/src/containers/PDiskPage/PDiskPage.scss +22 -11
- package/src/containers/PDiskPage/PDiskPage.tsx +88 -56
- package/src/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.tsx +3 -9
- package/src/containers/PDiskPage/PDiskStorageDetails.scss +51 -0
- package/src/containers/PDiskPage/PDiskStorageDetails.tsx +64 -0
- package/src/containers/PDiskPage/i18n/en.json +2 -0
- package/src/containers/StorageGroupPage/StorageGroupPage.scss +10 -0
- package/src/containers/StorageGroupPage/StorageGroupPage.tsx +37 -28
- package/src/containers/StorageGroupPage/i18n/en.json +0 -1
- package/src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +5 -32
- package/src/containers/Tenant/Healthcheck/Healthcheck.scss +6 -1
- package/src/containers/Tenant/Healthcheck/components/HealthcheckIssue.tsx +18 -8
- package/src/containers/Tenant/TenantDrawerHealthcheck.tsx +14 -1
- package/src/containers/VDiskPage/VDiskPage.scss +21 -8
- package/src/containers/VDiskPage/VDiskPage.tsx +103 -64
- package/src/containers/VDiskPage/VDiskStorageDetails.scss +24 -93
- package/src/containers/VDiskPage/VDiskStorageDetails.tsx +50 -158
- package/src/containers/VDiskPage/i18n/en.json +3 -14
- package/src/store/reducers/cluster/parseFields.ts +1 -0
- package/src/store/reducers/clusters/clusters.ts +1 -0
- package/src/store/reducers/clusters/selectors.ts +4 -0
- package/src/store/reducers/clusters/types.ts +3 -0
- package/src/store/reducers/storage/prepareGroupsDisks.ts +2 -0
- package/src/store/reducers/storage/utils.ts +13 -3
- package/src/store/reducers/vdisk/types.ts +2 -1
- package/src/store/reducers/vdisk/utils.ts +4 -5
- package/src/types/api/meta.ts +1 -0
- package/src/types/api/nodesList.ts +3 -0
- package/src/utils/hooks/useDatabaseHealthcheckAvailable.ts +9 -0
- package/src/utils/memory.ts +16 -0
- package/src/utils/nodes.ts +3 -2
- package/src/utils/storageMetrics.ts +11 -0
- package/dist/components/VDiskInfo/getVDiskCapacityColumns.d.ts +0 -11
- package/dist/components/VDiskInfo/getVDiskCapacityColumns.js +0 -52
- package/dist/components/VDiskInfo/getVDiskCapacityColumns.js.map +0 -1
- package/src/components/VDiskInfo/getVDiskCapacityColumns.tsx +0 -83
|
@@ -6,13 +6,14 @@ import {isNonEmptyValue} from '../../utils';
|
|
|
6
6
|
import {formatBytes} from '../../utils/bytesParsers';
|
|
7
7
|
import {cn} from '../../utils/cn';
|
|
8
8
|
import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
formatMetricPercent,
|
|
11
|
+
formatStorageMetricPair,
|
|
12
|
+
formatStorageThroughput,
|
|
13
|
+
} from '../../utils/storageMetrics';
|
|
10
14
|
import {formatToMs} from '../../utils/timeParsers';
|
|
11
15
|
import {parseOptionalNonNegativeNumber} from '../../utils/utils';
|
|
12
|
-
import {
|
|
13
|
-
getStorageGroupCapacityInfoItems,
|
|
14
|
-
toDefinitionListItems,
|
|
15
|
-
} from '../DiskCapacityInfo/DiskCapacityInfo';
|
|
16
|
+
import {getStorageGroupCapacityInfoItems} from '../DiskCapacityInfo/DiskCapacityInfo';
|
|
16
17
|
import diskCapacityInfoKeyset from '../DiskCapacityInfo/i18n';
|
|
17
18
|
import {StatusIcon} from '../StatusIcon/StatusIcon';
|
|
18
19
|
import type {YDBDefinitionListItem} from '../YDBDefinitionList/YDBDefinitionList';
|
|
@@ -94,13 +95,7 @@ export function StorageGroupInfo({data, className}: StorageGroupInfoProps) {
|
|
|
94
95
|
] as const
|
|
95
96
|
).map(([name, value]) => ({
|
|
96
97
|
name,
|
|
97
|
-
content:
|
|
98
|
-
formatBytes({
|
|
99
|
-
value: parseOptionalNonNegativeNumber(value),
|
|
100
|
-
size: 'mb',
|
|
101
|
-
fixedDecimalPlaces: 2,
|
|
102
|
-
withSpeedLabel: true,
|
|
103
|
-
}) || EMPTY_DATA_PLACEHOLDER,
|
|
98
|
+
content: formatStorageThroughput(value),
|
|
104
99
|
}));
|
|
105
100
|
const capacityItems: YDBDefinitionListItem[] = [];
|
|
106
101
|
|
|
@@ -127,7 +122,7 @@ export function StorageGroupInfo({data, className}: StorageGroupInfoProps) {
|
|
|
127
122
|
},
|
|
128
123
|
);
|
|
129
124
|
if (capacityMetricsEnabled) {
|
|
130
|
-
capacityItems.push(...
|
|
125
|
+
capacityItems.push(...getStorageGroupCapacityInfoItems(data));
|
|
131
126
|
} else {
|
|
132
127
|
capacityItems.push(
|
|
133
128
|
{
|
|
@@ -175,7 +175,7 @@ function getAccessibleName(
|
|
|
175
175
|
{mode, allMode, isNoData, driveType}: VDiskDisplayState,
|
|
176
176
|
) {
|
|
177
177
|
if (!mode) {
|
|
178
|
-
return
|
|
178
|
+
return getAccessibleDiskName(data, {mode, isNoData});
|
|
179
179
|
}
|
|
180
180
|
if (mode === 'all') {
|
|
181
181
|
return getAllModeAccessibleName(data, allMode?.hasIssues);
|
|
@@ -334,10 +334,11 @@ export const VDisk = ({
|
|
|
334
334
|
onShowPopup={onShowPopup}
|
|
335
335
|
onHidePopup={onHidePopup}
|
|
336
336
|
onClosePopup={onClosePopup}
|
|
337
|
-
renderPopupContent={({onClose}) => (
|
|
337
|
+
renderPopupContent={({onClose, holdOpen}) => (
|
|
338
338
|
<VDiskPopup
|
|
339
339
|
data={hidePDiskInPopup ? {...data, PDisk: undefined} : data}
|
|
340
340
|
onClose={onClose}
|
|
341
|
+
onDialogOpen={holdOpen}
|
|
341
342
|
/>
|
|
342
343
|
)}
|
|
343
344
|
offset={popupOffset}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
.ydb-vdisk-info {
|
|
2
|
-
|
|
3
|
-
flex: unset;
|
|
2
|
+
--g-definition-list-item-gap: var(--g-spacing-3);
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
&__metrics {
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&__column {
|
|
9
|
+
flex: 1 1 400px;
|
|
10
|
+
|
|
11
|
+
min-width: 0;
|
|
12
|
+
max-width: 500px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&__identity {
|
|
16
|
+
width: 100%;
|
|
17
|
+
max-width: 500px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&__disk {
|
|
21
|
+
width: 55px;
|
|
6
22
|
}
|
|
7
23
|
}
|
|
@@ -1,375 +1,153 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {ChevronDown, ChevronUp} from '@gravity-ui/icons';
|
|
4
|
+
import {Button, Flex, Icon} from '@gravity-ui/uikit';
|
|
4
5
|
import {isNil} from 'lodash';
|
|
5
6
|
|
|
6
|
-
import {getPDiskPagePath, useVDiskPagePath} from '../../routes';
|
|
7
7
|
import {useBlobStorageCapacityMetricsEnabled} from '../../store/reducers/capabilities/hooks';
|
|
8
|
-
import {EVDiskState} from '../../types/api/vdisk';
|
|
9
8
|
import {cn} from '../../utils/cn';
|
|
10
|
-
import {
|
|
11
|
-
formatDurationSeconds,
|
|
12
|
-
formatStorageValuesToGb,
|
|
13
|
-
} from '../../utils/dataFormatters/dataFormatters';
|
|
14
|
-
import {createVDiskDeveloperUILink, useHasDeveloperUi} from '../../utils/developerUI/developerUI';
|
|
15
|
-
import {getDataSeverityColor} from '../../utils/disks/helpers';
|
|
9
|
+
import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
|
|
16
10
|
import type {PreparedVDisk} from '../../utils/disks/types';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
11
|
+
import {formatMetricPercent} from '../../utils/storageMetrics';
|
|
12
|
+
import {CopyableValue} from '../CopyableValue/CopyableValue';
|
|
13
|
+
import {getVDiskCapacityItems} from '../DiskCapacityInfo/DiskCapacityInfo';
|
|
14
|
+
import {DiskFlagLabel} from '../DiskStatus/DiskStatus';
|
|
15
|
+
import {VDisk} from '../VDisk/VDisk';
|
|
16
|
+
import {VDiskCompactionRankLabel, VDiskFrontQueuesLabel} from '../VDiskStatus';
|
|
23
17
|
import type {YDBDefinitionListItem} from '../YDBDefinitionList/YDBDefinitionList';
|
|
24
18
|
import {YDBDefinitionList} from '../YDBDefinitionList/YDBDefinitionList';
|
|
25
19
|
|
|
26
|
-
import {
|
|
20
|
+
import {getVDiskIdentityItems, getVDiskThroughputItems} from './getVDiskDetails';
|
|
27
21
|
import {vDiskInfoKeyset} from './i18n';
|
|
28
22
|
|
|
29
23
|
import './VDiskInfo.scss';
|
|
30
24
|
|
|
31
25
|
const b = cn('ydb-vdisk-info');
|
|
32
26
|
|
|
33
|
-
interface VDiskInfoProps
|
|
34
|
-
data?:
|
|
35
|
-
/** @deprecated VDisk page link is now rendered externally */
|
|
36
|
-
withVDiskPageLink?: boolean;
|
|
37
|
-
withTitle?: boolean;
|
|
27
|
+
interface VDiskInfoProps {
|
|
28
|
+
data?: PreparedVDisk;
|
|
38
29
|
className?: string;
|
|
39
|
-
wrap?: true;
|
|
40
30
|
}
|
|
41
31
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
data,
|
|
45
|
-
withVDiskPageLink,
|
|
46
|
-
withTitle,
|
|
47
|
-
className,
|
|
48
|
-
wrap,
|
|
49
|
-
}: VDiskInfoProps<T>) {
|
|
50
|
-
const hasDeveloperUi = useHasDeveloperUi();
|
|
51
|
-
const isViewerUser = useIsViewerUser();
|
|
52
|
-
const capacityMetricsEnabled = useBlobStorageCapacityMetricsEnabled();
|
|
53
|
-
|
|
54
|
-
const getVDiskPagePath = useVDiskPagePath();
|
|
55
|
-
|
|
56
|
-
const {
|
|
57
|
-
FrontQueues,
|
|
58
|
-
Guid,
|
|
59
|
-
Replicated,
|
|
60
|
-
ReplicationProgress,
|
|
61
|
-
ReplicationSecondsRemaining,
|
|
62
|
-
Donors,
|
|
63
|
-
VDiskState,
|
|
64
|
-
VDiskSlotId,
|
|
65
|
-
Kind,
|
|
66
|
-
SatisfactionRank,
|
|
67
|
-
HasUnreadableBlobs,
|
|
68
|
-
IncarnationGuid,
|
|
69
|
-
InstanceGuid,
|
|
70
|
-
StoragePoolName,
|
|
71
|
-
ReadThroughput,
|
|
72
|
-
WriteThroughput,
|
|
73
|
-
PDiskId,
|
|
74
|
-
StringifiedId,
|
|
75
|
-
NodeId,
|
|
76
|
-
Recipient,
|
|
77
|
-
} = data || {};
|
|
78
|
-
|
|
79
|
-
const capacityColumns = capacityMetricsEnabled
|
|
80
|
-
? getVDiskCapacityColumns({data, isViewerUser})
|
|
81
|
-
: undefined;
|
|
82
|
-
const leftColumn: YDBDefinitionListItem[] = capacityColumns?.leftColumn ?? [];
|
|
83
|
-
const rightColumn: YDBDefinitionListItem[] = capacityColumns?.rightColumn ?? [];
|
|
84
|
-
const linksColumn = capacityMetricsEnabled ? leftColumn : rightColumn;
|
|
85
|
-
|
|
32
|
+
function getPageCapacityItems(data: PreparedVDisk, capacityMetricsEnabled: boolean) {
|
|
33
|
+
const capacityItems = getVDiskCapacityItems(data, {capacityMetricsEnabled});
|
|
86
34
|
if (!capacityMetricsEnabled) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
leftColumn.push({name: vDiskInfoKeyset('pool-name'), content: StoragePoolName});
|
|
91
|
-
}
|
|
92
|
-
if (!isNil(VDiskState)) {
|
|
93
|
-
leftColumn.push({
|
|
94
|
-
name: vDiskInfoKeyset('state-status'),
|
|
95
|
-
content: VDiskState,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (Number(AllocatedSize) >= 0 && Number(SizeLimit) >= 0) {
|
|
100
|
-
leftColumn.push({
|
|
101
|
-
name: vDiskInfoKeyset('size'),
|
|
102
|
-
content: formatStorageValuesToGb(Number(AllocatedSize), Number(SizeLimit)).join(
|
|
103
|
-
' / ',
|
|
104
|
-
),
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (!isNaN(Number(AllocatedPercent))) {
|
|
108
|
-
leftColumn.push({
|
|
35
|
+
capacityItems.push(
|
|
36
|
+
{
|
|
37
|
+
id: 'usage',
|
|
109
38
|
name: vDiskInfoKeyset('usage'),
|
|
110
|
-
content:
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (!isNil(DiskSpace)) {
|
|
115
|
-
leftColumn.push({
|
|
39
|
+
content: formatMetricPercent(data.AllocatedPercent, 2),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'disk-space',
|
|
116
43
|
name: vDiskInfoKeyset('space-status'),
|
|
117
|
-
content: <
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (!capacityMetricsEnabled) {
|
|
123
|
-
if (!isNil(FrontQueues)) {
|
|
124
|
-
leftColumn.push({
|
|
125
|
-
name: vDiskInfoKeyset('front-queues'),
|
|
126
|
-
content: <StatusIcon status={FrontQueues} />,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
if (!isNil(SatisfactionRank?.FreshRank?.Flag)) {
|
|
130
|
-
leftColumn.push({
|
|
131
|
-
name: vDiskInfoKeyset('fresh-rank-satisfaction'),
|
|
132
|
-
content: <StatusIcon status={SatisfactionRank?.FreshRank?.Flag} />,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
if (!isNil(SatisfactionRank?.LevelRank?.Flag)) {
|
|
136
|
-
leftColumn.push({
|
|
137
|
-
name: vDiskInfoKeyset('level-rank-satisfaction'),
|
|
138
|
-
content: <StatusIcon status={SatisfactionRank?.LevelRank?.Flag} />,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
if (!isNil(ReadThroughput)) {
|
|
142
|
-
leftColumn.push({
|
|
143
|
-
name: vDiskInfoKeyset('read-throughput'),
|
|
144
|
-
content: bytesToSpeed(ReadThroughput),
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (!isNil(WriteThroughput)) {
|
|
148
|
-
leftColumn.push({
|
|
149
|
-
name: vDiskInfoKeyset('write-throughput'),
|
|
150
|
-
content: bytesToSpeed(WriteThroughput),
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (!isNil(Replicated)) {
|
|
156
|
-
rightColumn.push({
|
|
157
|
-
name: vDiskInfoKeyset('replication-status'),
|
|
158
|
-
content: Replicated ? vDiskInfoKeyset('yes') : vDiskInfoKeyset('no'),
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
// Only show replication progress and time remaining when disk is not replicated and state is OK
|
|
162
|
-
if (Replicated === false && VDiskState === EVDiskState.OK) {
|
|
163
|
-
if (!isNil(ReplicationProgress)) {
|
|
164
|
-
rightColumn.push({
|
|
165
|
-
name: vDiskInfoKeyset('replication-progress'),
|
|
166
|
-
content: (
|
|
167
|
-
<ProgressViewer
|
|
168
|
-
value={Math.round(ReplicationProgress * 100)}
|
|
169
|
-
percents
|
|
170
|
-
defaultStatus="info"
|
|
171
|
-
capacity={100}
|
|
172
|
-
/>
|
|
173
|
-
),
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
if (!isNil(ReplicationSecondsRemaining)) {
|
|
177
|
-
const timeRemaining = formatDurationSeconds(ReplicationSecondsRemaining);
|
|
178
|
-
if (timeRemaining) {
|
|
179
|
-
rightColumn.push({
|
|
180
|
-
name: vDiskInfoKeyset('replication-time-remaining'),
|
|
181
|
-
content: timeRemaining,
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
if (!capacityMetricsEnabled && !isNil(VDiskSlotId)) {
|
|
187
|
-
rightColumn.push({name: vDiskInfoKeyset('slot-id'), content: VDiskSlotId});
|
|
188
|
-
}
|
|
189
|
-
if (!capacityMetricsEnabled && !isNil(PDiskId)) {
|
|
190
|
-
const pDiskPath =
|
|
191
|
-
isViewerUser && !isNil(NodeId) ? getPDiskPagePath(PDiskId, NodeId) : undefined;
|
|
192
|
-
|
|
193
|
-
const content = pDiskPath ? <InternalLink to={pDiskPath}>{PDiskId}</InternalLink> : PDiskId;
|
|
194
|
-
|
|
195
|
-
rightColumn.push({
|
|
196
|
-
name: vDiskInfoKeyset('label_pdisk-id'),
|
|
197
|
-
content,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (!capacityMetricsEnabled && !isNil(Kind)) {
|
|
202
|
-
rightColumn.push({name: vDiskInfoKeyset('kind'), content: Kind});
|
|
203
|
-
}
|
|
204
|
-
if (!capacityMetricsEnabled && !isNil(Guid)) {
|
|
205
|
-
rightColumn.push({name: vDiskInfoKeyset('guid'), content: Guid});
|
|
206
|
-
}
|
|
207
|
-
if (!capacityMetricsEnabled && !isNil(IncarnationGuid)) {
|
|
208
|
-
rightColumn.push({name: vDiskInfoKeyset('incarnation-guid'), content: IncarnationGuid});
|
|
209
|
-
}
|
|
210
|
-
if (!capacityMetricsEnabled && !isNil(InstanceGuid)) {
|
|
211
|
-
rightColumn.push({name: vDiskInfoKeyset('instance-guid'), content: InstanceGuid});
|
|
212
|
-
}
|
|
213
|
-
if (!capacityMetricsEnabled && !isNil(HasUnreadableBlobs)) {
|
|
214
|
-
rightColumn.push({
|
|
215
|
-
name: vDiskInfoKeyset('has-unreadable-blobs'),
|
|
216
|
-
content: HasUnreadableBlobs ? vDiskInfoKeyset('yes') : vDiskInfoKeyset('no'),
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
if (!isNil(Recipient) && !isNil(Recipient.StringifiedId)) {
|
|
220
|
-
const recipientPath = getVDiskPagePath({
|
|
221
|
-
nodeId: Recipient.NodeId,
|
|
222
|
-
vDiskId: Recipient.StringifiedId,
|
|
223
|
-
});
|
|
224
|
-
rightColumn.push({
|
|
225
|
-
name: vDiskInfoKeyset('label_recipient'),
|
|
226
|
-
content: recipientPath ? (
|
|
227
|
-
<InternalLink to={recipientPath}>{Recipient.StringifiedId}</InternalLink>
|
|
228
|
-
) : (
|
|
229
|
-
Recipient.StringifiedId
|
|
230
|
-
),
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Show donors list when replication is in progress
|
|
235
|
-
if (Replicated === false && Donors?.length) {
|
|
236
|
-
const donorLinks = Donors.map((donor, index) => {
|
|
237
|
-
const {StringifiedId: id, NodeId: dNodeId} = donor;
|
|
238
|
-
|
|
239
|
-
if (!id) {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const vDiskPath = getVDiskPagePath({
|
|
244
|
-
nodeId: dNodeId,
|
|
245
|
-
vDiskId: id,
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
return vDiskPath ? (
|
|
249
|
-
<InternalLink key={index} to={vDiskPath}>
|
|
250
|
-
{id}
|
|
251
|
-
</InternalLink>
|
|
252
|
-
) : null;
|
|
253
|
-
}).filter(Boolean);
|
|
254
|
-
|
|
255
|
-
if (donorLinks.length) {
|
|
256
|
-
rightColumn.push({
|
|
257
|
-
name: vDiskInfoKeyset('donors'),
|
|
258
|
-
content: (
|
|
259
|
-
<Flex direction="column" gap={1}>
|
|
260
|
-
{donorLinks}
|
|
261
|
-
</Flex>
|
|
262
|
-
),
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
if (capacityMetricsEnabled) {
|
|
267
|
-
if (!isNil(FrontQueues)) {
|
|
268
|
-
rightColumn.push({
|
|
269
|
-
name: vDiskInfoKeyset('front-queues'),
|
|
270
|
-
content: <StatusIcon status={FrontQueues} />,
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
if (!isNil(SatisfactionRank?.FreshRank?.Flag)) {
|
|
274
|
-
rightColumn.push({
|
|
275
|
-
name: vDiskInfoKeyset('fresh-rank-satisfaction'),
|
|
276
|
-
content: <StatusIcon status={SatisfactionRank?.FreshRank?.Flag} />,
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
if (!isNil(SatisfactionRank?.LevelRank?.Flag)) {
|
|
280
|
-
rightColumn.push({
|
|
281
|
-
name: vDiskInfoKeyset('level-rank-satisfaction'),
|
|
282
|
-
content: <StatusIcon status={SatisfactionRank?.LevelRank?.Flag} />,
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
if (!isNil(HasUnreadableBlobs)) {
|
|
286
|
-
rightColumn.push({
|
|
287
|
-
name: vDiskInfoKeyset('has-unreadable-blobs'),
|
|
288
|
-
content: HasUnreadableBlobs ? vDiskInfoKeyset('yes') : vDiskInfoKeyset('no'),
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
if (!isNil(ReadThroughput)) {
|
|
292
|
-
rightColumn.push({
|
|
293
|
-
name: vDiskInfoKeyset('read-throughput'),
|
|
294
|
-
content: bytesToSpeed(ReadThroughput),
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
if (!isNil(WriteThroughput)) {
|
|
298
|
-
rightColumn.push({
|
|
299
|
-
name: vDiskInfoKeyset('write-throughput'),
|
|
300
|
-
content: bytesToSpeed(WriteThroughput),
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
const links: React.ReactNode[] = [];
|
|
305
|
-
const vDiskPagePath = getVDiskPagePath({
|
|
306
|
-
nodeId: NodeId,
|
|
307
|
-
vDiskId: StringifiedId,
|
|
308
|
-
});
|
|
309
|
-
if (withVDiskPageLink && vDiskPagePath) {
|
|
310
|
-
links.push(
|
|
311
|
-
<LinkWithIcon
|
|
312
|
-
key={vDiskPagePath}
|
|
313
|
-
title={vDiskInfoKeyset('vdisk-page')}
|
|
314
|
-
url={vDiskPagePath}
|
|
315
|
-
external={false}
|
|
316
|
-
/>,
|
|
317
|
-
);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
if (hasDeveloperUi && !isNil(NodeId) && !isNil(VDiskSlotId) && !isNil(PDiskId)) {
|
|
321
|
-
const vDiskInternalViewerPath = createVDiskDeveloperUILink({
|
|
322
|
-
nodeId: NodeId,
|
|
323
|
-
pDiskId: PDiskId,
|
|
324
|
-
vDiskSlotId: VDiskSlotId,
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
links.push(
|
|
328
|
-
<LinkWithIcon
|
|
329
|
-
key={vDiskInternalViewerPath}
|
|
330
|
-
title={vDiskInfoKeyset('developer-ui')}
|
|
331
|
-
url={vDiskInternalViewerPath}
|
|
332
|
-
/>,
|
|
44
|
+
content: <DiskFlagLabel flag={data.DiskSpace} />,
|
|
45
|
+
},
|
|
333
46
|
);
|
|
334
47
|
}
|
|
48
|
+
return capacityItems;
|
|
49
|
+
}
|
|
335
50
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
51
|
+
export function VDiskInfo({data = {}, className}: VDiskInfoProps) {
|
|
52
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
53
|
+
const capacityMetricsEnabled = useBlobStorageCapacityMetricsEnabled();
|
|
54
|
+
const donors = data.Replicated === false ? data.Donors : undefined;
|
|
55
|
+
const disks = data.DonorMode ? [data.Recipient].filter((disk) => disk !== undefined) : donors;
|
|
56
|
+
const runtimeItems: YDBDefinitionListItem[] = [
|
|
57
|
+
{
|
|
58
|
+
name: vDiskInfoKeyset('front-queues'),
|
|
59
|
+
content: <VDiskFrontQueuesLabel flag={data.FrontQueues} />,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: vDiskInfoKeyset('field_compaction'),
|
|
339
63
|
content: (
|
|
340
|
-
<Flex wrap="wrap"
|
|
341
|
-
|
|
64
|
+
<Flex gap={1} wrap="wrap">
|
|
65
|
+
<VDiskCompactionRankLabel
|
|
66
|
+
flag={data.SatisfactionRank?.FreshRank?.Flag}
|
|
67
|
+
rank="fresh"
|
|
68
|
+
/>
|
|
69
|
+
<VDiskCompactionRankLabel
|
|
70
|
+
flag={data.SatisfactionRank?.LevelRank?.Flag}
|
|
71
|
+
rank="level"
|
|
72
|
+
/>
|
|
342
73
|
</Flex>
|
|
343
74
|
),
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: vDiskInfoKeyset('has-unreadable-blobs'),
|
|
78
|
+
content: isNil(data.HasUnreadableBlobs)
|
|
79
|
+
? EMPTY_DATA_PLACEHOLDER
|
|
80
|
+
: vDiskInfoKeyset(data.HasUnreadableBlobs ? 'yes' : 'no'),
|
|
81
|
+
},
|
|
82
|
+
...getVDiskThroughputItems(data),
|
|
83
|
+
{
|
|
84
|
+
name: vDiskInfoKeyset(data.DonorMode ? 'label_recipient' : 'donors'),
|
|
85
|
+
content: disks?.length ? (
|
|
86
|
+
<Flex gap={2} wrap="wrap">
|
|
87
|
+
{disks.map((disk) => (
|
|
88
|
+
<div className={b('disk')} key={disk.StringifiedId}>
|
|
89
|
+
<VDisk data={disk} withIcon />
|
|
90
|
+
</div>
|
|
91
|
+
))}
|
|
92
|
+
</Flex>
|
|
93
|
+
) : (
|
|
94
|
+
vDiskInfoKeyset('no')
|
|
95
|
+
),
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
const capacityItems = getPageCapacityItems(data, capacityMetricsEnabled);
|
|
99
|
+
const identityItems = getVDiskIdentityItems(data, {
|
|
100
|
+
copyFields: ['guid', 'incarnation-guid', 'instance-guid'],
|
|
101
|
+
}).map(({copyText, ...item}) => ({
|
|
102
|
+
...item,
|
|
103
|
+
content: (
|
|
104
|
+
<CopyableValue
|
|
105
|
+
copyText={copyText === undefined ? undefined : String(copyText)}
|
|
106
|
+
fieldName={item.name}
|
|
107
|
+
>
|
|
108
|
+
{item.content}
|
|
109
|
+
</CopyableValue>
|
|
110
|
+
),
|
|
111
|
+
}));
|
|
348
112
|
|
|
349
|
-
// Component is used both on vdisk page and in popups
|
|
350
|
-
// Display in two columns on page (row + wrap) and in one column in popups (column + nowrap)
|
|
351
113
|
return (
|
|
352
|
-
<Flex
|
|
353
|
-
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
{
|
|
357
|
-
|
|
114
|
+
<Flex
|
|
115
|
+
className={b(null, className)}
|
|
116
|
+
direction="column"
|
|
117
|
+
alignItems="flex-start"
|
|
118
|
+
gap={3}
|
|
119
|
+
qa="vdisk-page-info"
|
|
120
|
+
>
|
|
121
|
+
<Flex className={b('metrics')} gap={6} gapRow={3} wrap="wrap">
|
|
122
|
+
<YDBDefinitionList
|
|
123
|
+
items={runtimeItems}
|
|
124
|
+
nameMaxWidth={200}
|
|
125
|
+
wrapperClassName={b('column')}
|
|
126
|
+
/>
|
|
127
|
+
{capacityItems.length > 0 && (
|
|
128
|
+
<YDBDefinitionList
|
|
129
|
+
items={capacityItems}
|
|
130
|
+
nameMaxWidth={200}
|
|
131
|
+
wrapperClassName={b('column')}
|
|
132
|
+
/>
|
|
133
|
+
)}
|
|
134
|
+
</Flex>
|
|
135
|
+
{expanded && (
|
|
136
|
+
<YDBDefinitionList
|
|
137
|
+
items={identityItems}
|
|
138
|
+
nameMaxWidth={200}
|
|
139
|
+
wrapperClassName={b('identity')}
|
|
140
|
+
/>
|
|
358
141
|
)}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return (
|
|
369
|
-
<Flex gap={2} alignItems="center">
|
|
370
|
-
{vDiskInfoKeyset('vdiks-title')}
|
|
371
|
-
<StatusIcon status={getDataSeverityColor(data.Severity)} />
|
|
372
|
-
{data.StringifiedId}
|
|
142
|
+
<Button
|
|
143
|
+
size="m"
|
|
144
|
+
view="outlined"
|
|
145
|
+
onClick={() => setExpanded(!expanded)}
|
|
146
|
+
aria-expanded={expanded}
|
|
147
|
+
>
|
|
148
|
+
{vDiskInfoKeyset(expanded ? 'action_show-less' : 'action_show-more')}
|
|
149
|
+
<Icon data={expanded ? ChevronUp : ChevronDown} />
|
|
150
|
+
</Button>
|
|
373
151
|
</Flex>
|
|
374
152
|
);
|
|
375
153
|
}
|
|
@@ -6,6 +6,8 @@ import type {DiskDetailItem} from '../../utils/disks/diskInfo/getDiskLocationIte
|
|
|
6
6
|
import {getDiskLocationItems} from '../../utils/disks/diskInfo/getDiskLocationItems';
|
|
7
7
|
import {isFullVDiskData} from '../../utils/disks/helpers';
|
|
8
8
|
import type {PreparedVDisk} from '../../utils/disks/types';
|
|
9
|
+
import {formatStorageThroughput} from '../../utils/storageMetrics';
|
|
10
|
+
import type {YDBDefinitionListItem} from '../YDBDefinitionList/YDBDefinitionList';
|
|
9
11
|
|
|
10
12
|
import {vDiskInfoKeyset as i18n} from './i18n';
|
|
11
13
|
|
|
@@ -26,16 +28,36 @@ export function getVDiskLocationItems(
|
|
|
26
28
|
);
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
type VDiskIdentityField = 'kind' | 'guid' | 'incarnation-guid' | 'instance-guid';
|
|
32
|
+
|
|
33
|
+
export function getVDiskIdentityItems(
|
|
34
|
+
data: PreparedVDisk = {},
|
|
35
|
+
{copyFields = []}: {copyFields?: readonly VDiskIdentityField[]} = {},
|
|
36
|
+
): DiskDetailItem[] {
|
|
30
37
|
const entries = [
|
|
31
38
|
{id: 'kind', name: i18n('kind'), value: data.Kind},
|
|
32
39
|
{id: 'guid', name: i18n('guid'), value: data.Guid},
|
|
33
40
|
{id: 'incarnation-guid', name: i18n('incarnation-guid'), value: data.IncarnationGuid},
|
|
34
41
|
{id: 'instance-guid', name: i18n('instance-guid'), value: data.InstanceGuid},
|
|
35
|
-
];
|
|
42
|
+
] as const;
|
|
36
43
|
return entries.map(({id, name, value}) => ({
|
|
37
44
|
id,
|
|
38
45
|
name,
|
|
39
46
|
content: isNil(value) || value === '' ? EMPTY_DATA_PLACEHOLDER : value,
|
|
47
|
+
...(copyFields.includes(id) && !isNil(value) && value !== ''
|
|
48
|
+
? {copyText: String(value)}
|
|
49
|
+
: {}),
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function getVDiskThroughputItems(data: PreparedVDisk = {}): YDBDefinitionListItem[] {
|
|
54
|
+
return (
|
|
55
|
+
[
|
|
56
|
+
[i18n('read-throughput'), data.ReadThroughput],
|
|
57
|
+
[i18n('write-throughput'), data.WriteThroughput],
|
|
58
|
+
] as const
|
|
59
|
+
).map(([name, value]) => ({
|
|
60
|
+
name,
|
|
61
|
+
content: formatStorageThroughput(value),
|
|
40
62
|
}));
|
|
41
63
|
}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"slot-id": "VDisk Slot Id",
|
|
3
|
-
"label_pdisk-id": "PDisk Id",
|
|
4
2
|
"pool-name": "Storage Pool Name",
|
|
5
3
|
"kind": "Kind",
|
|
6
4
|
"guid": "GUID",
|
|
7
5
|
"incarnation-guid": "Incarnation GUID",
|
|
8
6
|
"instance-guid": "Instance GUID",
|
|
9
|
-
"replication-status": "Replicated",
|
|
10
|
-
"replication-progress": "Replication Progress",
|
|
11
|
-
"replication-time-remaining": "Time Remaining",
|
|
12
7
|
"donors": "Donors",
|
|
13
8
|
"label_recipient": "Recipient",
|
|
14
|
-
"state-status": "VDisk State",
|
|
15
9
|
"space-status": "Disk Space",
|
|
16
|
-
"fresh-rank-satisfaction": "Fresh Rank Satisfaction",
|
|
17
|
-
"level-rank-satisfaction": "Level Rank Satisfaction",
|
|
18
10
|
"front-queues": "Front Queues",
|
|
19
11
|
"has-unreadable-blobs": "Has Unreadable Blobs",
|
|
20
12
|
"size": "Size",
|
|
21
13
|
"usage": "Usage",
|
|
22
14
|
"read-throughput": "Read Throughput",
|
|
23
15
|
"write-throughput": "Write Throughput",
|
|
24
|
-
"links": "Links",
|
|
25
|
-
"vdisk-page": "VDisk page",
|
|
26
|
-
"developer-ui": "Developer UI",
|
|
27
16
|
"yes": "Yes",
|
|
28
17
|
"no": "No",
|
|
29
|
-
"vdiks-title": "VDisk",
|
|
30
18
|
"field_group-size-in-units": "Group Size in Units",
|
|
31
|
-
"field_capacity-alert": "Capacity alert"
|
|
19
|
+
"field_capacity-alert": "Capacity alert",
|
|
20
|
+
"field_compaction": "Compaction",
|
|
21
|
+
"action_show-more": "Show more",
|
|
22
|
+
"action_show-less": "Show less"
|
|
32
23
|
}
|