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
|
@@ -3,14 +3,15 @@ import {DefinitionList, Flex, useTheme} from '@gravity-ui/uikit';
|
|
|
3
3
|
import type {TMemoryStats} from '../../types/api/nodes';
|
|
4
4
|
import {formatBytes} from '../../utils/bytesParsers';
|
|
5
5
|
import {cn} from '../../utils/cn';
|
|
6
|
-
import {GIGABYTE} from '../../utils/constants';
|
|
6
|
+
import {EMPTY_DATA_PLACEHOLDER, GIGABYTE} from '../../utils/constants';
|
|
7
|
+
import {getNodeMemory} from '../../utils/memory';
|
|
7
8
|
import type {FormatProgressViewerValues} from '../../utils/progress';
|
|
8
9
|
import {calculateProgressStatus} from '../../utils/progress';
|
|
9
|
-
import {isNumeric} from '../../utils/utils';
|
|
10
|
+
import {isNumeric, parseOptionalNonNegativeNumber} from '../../utils/utils';
|
|
10
11
|
import {HoverPopup} from '../HoverPopup/HoverPopup';
|
|
11
12
|
import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
|
|
12
13
|
|
|
13
|
-
import {
|
|
14
|
+
import {getMemorySegments} from './utils';
|
|
14
15
|
|
|
15
16
|
import './MemoryViewer.scss';
|
|
16
17
|
|
|
@@ -38,6 +39,8 @@ const formatDetailedValues: FormatProgressViewerValues = (value, total) => {
|
|
|
38
39
|
|
|
39
40
|
export interface MemoryProgressViewerProps {
|
|
40
41
|
stats: TMemoryStats;
|
|
42
|
+
memoryUsed?: string;
|
|
43
|
+
memoryLimit?: string;
|
|
41
44
|
className?: string;
|
|
42
45
|
warningThreshold?: number;
|
|
43
46
|
dangerThreshold?: number;
|
|
@@ -47,29 +50,35 @@ export interface MemoryProgressViewerProps {
|
|
|
47
50
|
|
|
48
51
|
export function MemoryViewer({
|
|
49
52
|
stats,
|
|
53
|
+
memoryUsed,
|
|
54
|
+
memoryLimit,
|
|
50
55
|
percents,
|
|
51
56
|
formatValues,
|
|
52
57
|
className,
|
|
53
58
|
warningThreshold,
|
|
54
59
|
dangerThreshold,
|
|
55
60
|
}: MemoryProgressViewerProps) {
|
|
56
|
-
const memoryUsage
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
const {memoryUsed: memoryUsage, memoryLimit: capacity} = getNodeMemory({
|
|
62
|
+
MemoryStats: stats,
|
|
63
|
+
MemoryUsed: memoryUsed,
|
|
64
|
+
MemoryLimit: memoryLimit,
|
|
65
|
+
});
|
|
60
66
|
const theme = useTheme();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
|
|
68
|
+
if (memoryUsage === undefined) {
|
|
69
|
+
return EMPTY_DATA_PLACEHOLDER;
|
|
70
|
+
}
|
|
71
|
+
const fillWidth =
|
|
72
|
+
capacity === undefined ? 0 : Math.min(100, Math.floor((memoryUsage / capacity) * 100));
|
|
64
73
|
let valueText: number | string | undefined = memoryUsage,
|
|
65
74
|
capacityText: number | string | undefined = capacity,
|
|
66
75
|
divider = '/';
|
|
67
|
-
if (percents) {
|
|
76
|
+
if (percents && capacity !== undefined) {
|
|
68
77
|
valueText = fillWidth + '%';
|
|
69
78
|
capacityText = '';
|
|
70
79
|
divider = '';
|
|
71
80
|
} else if (formatValues) {
|
|
72
|
-
[valueText, capacityText] = formatValues(
|
|
81
|
+
[valueText, capacityText] = formatValues(memoryUsage, capacity);
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
const renderContent = () => {
|
|
@@ -81,13 +90,17 @@ export function MemoryViewer({
|
|
|
81
90
|
};
|
|
82
91
|
|
|
83
92
|
const calculateMemoryShare = (segmentSize: number) => {
|
|
84
|
-
if (!memoryUsage) {
|
|
93
|
+
if (!memoryUsage || capacity === undefined) {
|
|
85
94
|
return 0;
|
|
86
95
|
}
|
|
87
|
-
return (segmentSize /
|
|
96
|
+
return (segmentSize / capacity) * 100;
|
|
88
97
|
};
|
|
89
98
|
|
|
90
|
-
|
|
99
|
+
// Without anonymous RSS, the backend's MemoryUsed excludes allocator caches.
|
|
100
|
+
const memorySegments = getMemorySegments(stats, memoryUsage, {
|
|
101
|
+
allocatorCachesIncludedInUsage: parseOptionalNonNegativeNumber(stats.AnonRss) !== undefined,
|
|
102
|
+
memoryLimit: capacity,
|
|
103
|
+
});
|
|
91
104
|
|
|
92
105
|
const status = calculateProgressStatus({
|
|
93
106
|
fillWidth,
|
|
@@ -135,9 +148,9 @@ export function MemoryViewer({
|
|
|
135
148
|
)}
|
|
136
149
|
>
|
|
137
150
|
<div className={b({theme, status}, className)}>
|
|
138
|
-
<div className={b('progress-container')}>
|
|
151
|
+
<div className={capacity === undefined ? undefined : b('progress-container')}>
|
|
139
152
|
{memorySegments
|
|
140
|
-
.filter(({isInfo}) => !isInfo)
|
|
153
|
+
.filter(({isInfo}) => !isInfo && capacity !== undefined)
|
|
141
154
|
.map((segment) => {
|
|
142
155
|
if (segment.value < MIN_VISIBLE_MEMORY_VALUE) {
|
|
143
156
|
return null;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
"text_memtable": "MemTable",
|
|
6
6
|
"text_query-execution": "Query Execution",
|
|
7
7
|
"text_usage": "Usage",
|
|
8
|
-
"text_soft-limit": "Soft Limit",
|
|
9
|
-
"text_hard-limit": "Hard Limit",
|
|
8
|
+
"text_soft-limit": "Memory Controller Soft Limit",
|
|
9
|
+
"text_hard-limit": "Memory Controller Hard Limit",
|
|
10
10
|
"text_other": "Other",
|
|
11
|
-
"text_memory-details": "Memory Details"
|
|
11
|
+
"text_memory-details": "Memory Details",
|
|
12
|
+
"text_memory-limit": "Memory Limit"
|
|
12
13
|
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import type {TMemoryStats} from '../../types/api/nodes';
|
|
2
|
-
import {isNumeric} from '../../utils/utils';
|
|
2
|
+
import {isNumeric, parseOptionalNonNegativeNumber} from '../../utils/utils';
|
|
3
3
|
|
|
4
4
|
import i18n from './i18n';
|
|
5
5
|
|
|
6
|
-
export function calculateAllocatedMemory(stats: TMemoryStats) {
|
|
7
|
-
const allocatedMemory = getMaybeNumber(stats.AllocatedMemory) || 0;
|
|
8
|
-
const allocatorCaches = getMaybeNumber(stats.AllocatorCachesMemory) || 0;
|
|
9
|
-
return String(allocatedMemory + allocatorCaches);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
6
|
function getMaybeNumber(value: string | number | undefined): number | undefined {
|
|
13
7
|
return isNumeric(value) ? parseFloat(String(value)) : undefined;
|
|
14
8
|
}
|
|
@@ -34,7 +28,14 @@ export function getMemorySegmentColor(key: string): string {
|
|
|
34
28
|
return MEMORY_SEGMENT_COLORS[key] || MEMORY_SEGMENT_COLORS['Other'];
|
|
35
29
|
}
|
|
36
30
|
|
|
37
|
-
export function getMemorySegments(
|
|
31
|
+
export function getMemorySegments(
|
|
32
|
+
stats: TMemoryStats,
|
|
33
|
+
memoryUsage: number,
|
|
34
|
+
{
|
|
35
|
+
allocatorCachesIncludedInUsage = true,
|
|
36
|
+
memoryLimit,
|
|
37
|
+
}: {allocatorCachesIncludedInUsage?: boolean; memoryLimit?: number} = {},
|
|
38
|
+
): MemorySegment[] {
|
|
38
39
|
const segments = [
|
|
39
40
|
{
|
|
40
41
|
label: i18n('text_shared-cache'),
|
|
@@ -61,12 +62,12 @@ export function getMemorySegments(stats: TMemoryStats, memoryUsage: number): Mem
|
|
|
61
62
|
label: i18n('text_allocator-caches'),
|
|
62
63
|
key: 'AllocatorCachesMemory',
|
|
63
64
|
value: getMaybeNumber(stats.AllocatorCachesMemory),
|
|
64
|
-
isInfo:
|
|
65
|
+
isInfo: !allocatorCachesIncludedInUsage,
|
|
65
66
|
},
|
|
66
67
|
];
|
|
67
68
|
|
|
68
69
|
const nonInfoSegments = segments.filter(
|
|
69
|
-
(segment) => segment.value !== undefined,
|
|
70
|
+
(segment) => !segment.isInfo && segment.value !== undefined,
|
|
70
71
|
) as MemorySegment[];
|
|
71
72
|
const sumNonInfoSegments = nonInfoSegments.reduce((acc, segment) => acc + segment.value, 0);
|
|
72
73
|
|
|
@@ -92,16 +93,22 @@ export function getMemorySegments(stats: TMemoryStats, memoryUsage: number): Mem
|
|
|
92
93
|
value: memoryUsage,
|
|
93
94
|
isInfo: true,
|
|
94
95
|
},
|
|
96
|
+
{
|
|
97
|
+
label: i18n('text_memory-limit'),
|
|
98
|
+
key: 'MemoryLimit',
|
|
99
|
+
value: memoryLimit,
|
|
100
|
+
isInfo: true,
|
|
101
|
+
},
|
|
95
102
|
{
|
|
96
103
|
label: i18n('text_soft-limit'),
|
|
97
104
|
key: 'SoftLimit',
|
|
98
|
-
value:
|
|
105
|
+
value: parseOptionalNonNegativeNumber(stats.SoftLimit) || undefined,
|
|
99
106
|
isInfo: true,
|
|
100
107
|
},
|
|
101
108
|
{
|
|
102
109
|
label: i18n('text_hard-limit'),
|
|
103
110
|
key: 'HardLimit',
|
|
104
|
-
value:
|
|
111
|
+
value: parseOptionalNonNegativeNumber(stats.HardLimit) || undefined,
|
|
105
112
|
isInfo: true,
|
|
106
113
|
},
|
|
107
114
|
);
|
|
@@ -1,263 +1,71 @@
|
|
|
1
1
|
import {Flex} from '@gravity-ui/uikit';
|
|
2
2
|
|
|
3
3
|
import {useBlobStorageCapacityMetricsEnabled} from '../../store/reducers/capabilities/hooks';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {formatStorageValuesToGb} from '../../utils/dataFormatters/dataFormatters';
|
|
7
|
-
import {createPDiskDeveloperUILink, useHasDeveloperUi} from '../../utils/developerUI/developerUI';
|
|
8
|
-
import {formatPDiskType} from '../../utils/disks/getPDiskType';
|
|
4
|
+
import {cn} from '../../utils/cn';
|
|
5
|
+
import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
|
|
9
6
|
import type {PreparedPDisk} from '../../utils/disks/types';
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
|
|
16
|
-
import {StatusIcon} from '../StatusIcon/StatusIcon';
|
|
7
|
+
import {formatMetricPercent} from '../../utils/storageMetrics';
|
|
8
|
+
import {CopyableValue} from '../CopyableValue/CopyableValue';
|
|
9
|
+
import {getPDiskCapacityItems} from '../DiskCapacityInfo/DiskCapacityInfo';
|
|
10
|
+
import type {YDBDefinitionListItem} from '../YDBDefinitionList/YDBDefinitionList';
|
|
11
|
+
import {YDBDefinitionList} from '../YDBDefinitionList/YDBDefinitionList';
|
|
17
12
|
|
|
13
|
+
import {getPDiskLogItems, getPDiskRuntimeItems} from './getPDiskDetails';
|
|
18
14
|
import {pDiskInfoKeyset} from './i18n';
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
pDisk?: T;
|
|
22
|
-
nodeId?: number | string | null;
|
|
23
|
-
withPDiskPageLink?: boolean;
|
|
24
|
-
hasDeveloperUi?: boolean;
|
|
25
|
-
capacityMetricsEnabled?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// eslint-disable-next-line complexity
|
|
29
|
-
function getPDiskInfo<T extends PreparedPDisk>({
|
|
30
|
-
pDisk,
|
|
31
|
-
nodeId,
|
|
32
|
-
withPDiskPageLink,
|
|
33
|
-
hasDeveloperUi,
|
|
34
|
-
capacityMetricsEnabled,
|
|
35
|
-
}: GetPDiskInfoOptions<T>) {
|
|
36
|
-
const {
|
|
37
|
-
PDiskId,
|
|
38
|
-
Path,
|
|
39
|
-
Guid,
|
|
40
|
-
Category,
|
|
41
|
-
Type,
|
|
42
|
-
Device,
|
|
43
|
-
Realtime,
|
|
44
|
-
State,
|
|
45
|
-
SerialNumber,
|
|
46
|
-
TotalSize,
|
|
47
|
-
AllocatedSize,
|
|
48
|
-
AllocatedPercent,
|
|
49
|
-
StatusV2,
|
|
50
|
-
NumActiveSlots,
|
|
51
|
-
ExpectedSlotCount,
|
|
52
|
-
LogUsedSize,
|
|
53
|
-
LogTotalSize,
|
|
54
|
-
SystemSize,
|
|
55
|
-
SharedWithOs,
|
|
56
|
-
} = pDisk || {};
|
|
16
|
+
import './PDiskInfo.scss';
|
|
57
17
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (valueIsDefined(Category)) {
|
|
61
|
-
generalInfo.push({label: pDiskInfoKeyset('type'), value: formatPDiskType(Type)});
|
|
62
|
-
}
|
|
63
|
-
if (valueIsDefined(Path)) {
|
|
64
|
-
generalInfo.push({label: pDiskInfoKeyset('path'), value: Path});
|
|
65
|
-
}
|
|
66
|
-
if (valueIsDefined(Guid)) {
|
|
67
|
-
generalInfo.push({label: pDiskInfoKeyset('guid'), value: Guid});
|
|
68
|
-
}
|
|
69
|
-
// SerialNumber could be an empty string ""
|
|
70
|
-
if (SerialNumber) {
|
|
71
|
-
generalInfo.push({
|
|
72
|
-
label: pDiskInfoKeyset('serial-number'),
|
|
73
|
-
value: SerialNumber,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
if (SharedWithOs) {
|
|
77
|
-
generalInfo.push({
|
|
78
|
-
label: pDiskInfoKeyset('shared-with-os'),
|
|
79
|
-
value: pDiskInfoKeyset('yes'),
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const statusInfo: InfoViewerItem[] = [];
|
|
84
|
-
|
|
85
|
-
if (valueIsDefined(StatusV2)) {
|
|
86
|
-
statusInfo.push({label: pDiskInfoKeyset('drive-status'), value: StatusV2});
|
|
87
|
-
}
|
|
88
|
-
if (valueIsDefined(State)) {
|
|
89
|
-
statusInfo.push({label: pDiskInfoKeyset('state'), value: State});
|
|
90
|
-
}
|
|
91
|
-
if (valueIsDefined(Device)) {
|
|
92
|
-
statusInfo.push({
|
|
93
|
-
label: pDiskInfoKeyset('device'),
|
|
94
|
-
value: <StatusIcon status={Device} />,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
if (valueIsDefined(Realtime)) {
|
|
98
|
-
statusInfo.push({
|
|
99
|
-
label: pDiskInfoKeyset('realtime'),
|
|
100
|
-
value: <StatusIcon status={Realtime} />,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const additionalInfo: InfoViewerItem[] = [];
|
|
105
|
-
|
|
106
|
-
const shouldDisplayLinks =
|
|
107
|
-
(withPDiskPageLink || hasDeveloperUi) && valueIsDefined(PDiskId) && valueIsDefined(nodeId);
|
|
108
|
-
|
|
109
|
-
if (shouldDisplayLinks) {
|
|
110
|
-
const pDiskInternalViewerPath = createPDiskDeveloperUILink({
|
|
111
|
-
nodeId,
|
|
112
|
-
pDiskId: PDiskId,
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
additionalInfo.push({
|
|
116
|
-
label: pDiskInfoKeyset('links'),
|
|
117
|
-
value: (
|
|
118
|
-
<Flex wrap="wrap" gap={2}>
|
|
119
|
-
{withPDiskPageLink && <PDiskPageLink pDiskId={PDiskId} nodeId={nodeId} />}
|
|
120
|
-
{hasDeveloperUi && (
|
|
121
|
-
<LinkWithIcon
|
|
122
|
-
title={pDiskInfoKeyset('developer-ui')}
|
|
123
|
-
url={pDiskInternalViewerPath}
|
|
124
|
-
/>
|
|
125
|
-
)}
|
|
126
|
-
</Flex>
|
|
127
|
-
),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
18
|
+
const b = cn('ydb-pdisk-info');
|
|
130
19
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
withUsage: true,
|
|
136
|
-
withCapacityAlert: false,
|
|
137
|
-
});
|
|
138
|
-
const slotSizeItem = capacityItems.find(({id}) => id === 'slot-size-in-units');
|
|
139
|
-
const runtimeCapacityItems = capacityItems.filter(({id}) => id !== 'slot-size-in-units');
|
|
140
|
-
|
|
141
|
-
if (slotSizeItem) {
|
|
142
|
-
configurationInfo.push(...toInfoViewerItems([slotSizeItem]));
|
|
143
|
-
}
|
|
144
|
-
configurationInfo.push(...additionalInfo);
|
|
145
|
-
runtimeInfo.push(...toInfoViewerItems(runtimeCapacityItems));
|
|
146
|
-
|
|
147
|
-
if (valueIsDefined(LogUsedSize) && valueIsDefined(LogTotalSize)) {
|
|
148
|
-
runtimeInfo.push({
|
|
149
|
-
label: pDiskInfoKeyset('log-size'),
|
|
150
|
-
value: (
|
|
151
|
-
<ProgressViewer
|
|
152
|
-
value={LogUsedSize}
|
|
153
|
-
capacity={LogTotalSize}
|
|
154
|
-
formatValues={formatStorageValuesToGb}
|
|
155
|
-
/>
|
|
156
|
-
),
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
if (valueIsDefined(SystemSize)) {
|
|
160
|
-
runtimeInfo.push({
|
|
161
|
-
label: pDiskInfoKeyset('system-size'),
|
|
162
|
-
value: formatBytes({value: SystemSize}),
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return [configurationInfo, runtimeInfo];
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const spaceInfo: InfoViewerItem[] = [];
|
|
20
|
+
interface PDiskInfoProps {
|
|
21
|
+
pDisk?: PreparedPDisk;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
170
24
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
spaceInfo.push({
|
|
181
|
-
label: pDiskInfoKeyset('usage'),
|
|
182
|
-
value: `${AllocatedPercent}%`,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
if (valueIsDefined(NumActiveSlots) && valueIsDefined(ExpectedSlotCount)) {
|
|
186
|
-
spaceInfo.push({
|
|
187
|
-
label: pDiskInfoKeyset('slots'),
|
|
188
|
-
value: <ProgressViewer value={NumActiveSlots} capacity={ExpectedSlotCount} />,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
if (valueIsDefined(LogUsedSize) && valueIsDefined(LogTotalSize)) {
|
|
192
|
-
spaceInfo.push({
|
|
193
|
-
label: pDiskInfoKeyset('log-size'),
|
|
194
|
-
value: (
|
|
195
|
-
<ProgressViewer
|
|
196
|
-
value={LogUsedSize}
|
|
197
|
-
capacity={LogTotalSize}
|
|
198
|
-
formatValues={formatStorageValuesToGb}
|
|
199
|
-
/>
|
|
200
|
-
),
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
if (valueIsDefined(SystemSize)) {
|
|
204
|
-
spaceInfo.push({
|
|
205
|
-
label: pDiskInfoKeyset('system-size'),
|
|
206
|
-
value: formatBytes({value: SystemSize}),
|
|
25
|
+
function getPageCapacityItems(data: PreparedPDisk, capacityMetricsEnabled: boolean) {
|
|
26
|
+
const items = getPDiskCapacityItems(data, {useWhiteboardSize: capacityMetricsEnabled}).filter(
|
|
27
|
+
({id}) => capacityMetricsEnabled || id === 'space' || id === 'slots',
|
|
28
|
+
);
|
|
29
|
+
if (!capacityMetricsEnabled) {
|
|
30
|
+
items.splice(1, 0, {
|
|
31
|
+
id: 'usage',
|
|
32
|
+
name: pDiskInfoKeyset('usage'),
|
|
33
|
+
content: formatMetricPercent(data.AllocatedPercent, 2),
|
|
207
34
|
});
|
|
208
35
|
}
|
|
209
|
-
|
|
210
|
-
return [generalInfo, statusInfo, spaceInfo, additionalInfo];
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
interface PDiskInfoProps<T extends PreparedPDisk> extends GetPDiskInfoOptions<T> {
|
|
214
|
-
className?: string;
|
|
36
|
+
return [...items, ...getPDiskLogItems(data)];
|
|
215
37
|
}
|
|
216
38
|
|
|
217
|
-
export function PDiskInfo
|
|
218
|
-
pDisk,
|
|
219
|
-
nodeId,
|
|
220
|
-
withPDiskPageLink,
|
|
221
|
-
className,
|
|
222
|
-
}: PDiskInfoProps<T>) {
|
|
223
|
-
const hasDeveloperUi = useHasDeveloperUi();
|
|
39
|
+
export function PDiskInfo({pDisk = {}, className}: PDiskInfoProps) {
|
|
224
40
|
const capacityMetricsEnabled = useBlobStorageCapacityMetricsEnabled();
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
pDisk,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
<InfoViewer info={configurationInfo} renderEmptyState={() => null} />
|
|
241
|
-
</Flex>
|
|
242
|
-
<Flex direction="column" gap={2} width={500}>
|
|
243
|
-
<InfoViewer info={runtimeInfo} renderEmptyState={() => null} />
|
|
244
|
-
</Flex>
|
|
245
|
-
</Flex>
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
const [generalInfo, statusInfo, spaceInfo, additionalInfo] = infoGroups;
|
|
41
|
+
const identityItems = [
|
|
42
|
+
{name: pDiskInfoKeyset('guid'), value: pDisk.Guid},
|
|
43
|
+
{name: pDiskInfoKeyset('serial-number'), value: pDisk.SerialNumber},
|
|
44
|
+
].map(({name, value}) => ({
|
|
45
|
+
name,
|
|
46
|
+
content: (
|
|
47
|
+
<CopyableValue copyText={value || undefined} fieldName={name}>
|
|
48
|
+
<span className={b('identity-value')}>{value || EMPTY_DATA_PLACEHOLDER}</span>
|
|
49
|
+
</CopyableValue>
|
|
50
|
+
),
|
|
51
|
+
}));
|
|
52
|
+
const runtimeItems: YDBDefinitionListItem[] = [
|
|
53
|
+
...getPDiskRuntimeItems(pDisk),
|
|
54
|
+
...identityItems,
|
|
55
|
+
];
|
|
250
56
|
|
|
251
57
|
return (
|
|
252
|
-
<Flex className={className} gap={
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
58
|
+
<Flex className={b(null, className)} gap={6} gapRow={3} wrap="wrap" qa="pdisk-page-info">
|
|
59
|
+
<YDBDefinitionList
|
|
60
|
+
items={runtimeItems}
|
|
61
|
+
nameMaxWidth={200}
|
|
62
|
+
wrapperClassName={b('column')}
|
|
63
|
+
/>
|
|
64
|
+
<YDBDefinitionList
|
|
65
|
+
items={getPageCapacityItems(pDisk, capacityMetricsEnabled)}
|
|
66
|
+
nameMaxWidth={200}
|
|
67
|
+
wrapperClassName={b('column')}
|
|
68
|
+
/>
|
|
261
69
|
</Flex>
|
|
262
70
|
);
|
|
263
71
|
}
|
|
@@ -23,14 +23,18 @@ export function PDiskLogSize({used, total}: {used?: string; total?: string}) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<Flex
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
<Flex
|
|
27
|
+
gap={1}
|
|
28
|
+
alignItems="center"
|
|
29
|
+
className={b()}
|
|
30
|
+
role="meter"
|
|
31
|
+
aria-label={i18n('log-size')}
|
|
32
|
+
aria-valuemin={0}
|
|
33
|
+
aria-valuemax={100}
|
|
34
|
+
aria-valuenow={percentage}
|
|
35
|
+
aria-valuetext={formatStorageMetricPair(usedSize, totalSize, 2)}
|
|
36
|
+
>
|
|
37
|
+
<Progress className={b('progress')} value={percentage} theme="success" size="s" />
|
|
34
38
|
<span>{formatStorageMetricPair(usedSize, totalSize, 2)}</span>
|
|
35
39
|
</Flex>
|
|
36
40
|
);
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"path": "Path",
|
|
4
4
|
"guid": "GUID",
|
|
5
5
|
"serial-number": "Serial Number",
|
|
6
|
-
"shared-with-os": "SharedWithOs",
|
|
7
6
|
"drive-status": "Drive Status",
|
|
8
7
|
"state": "State",
|
|
9
8
|
"device": "Device",
|
|
@@ -14,12 +13,16 @@
|
|
|
14
13
|
"slots": "Slots",
|
|
15
14
|
"log-size": "Log Size",
|
|
16
15
|
"system-size": "System Size",
|
|
17
|
-
"links": "Links",
|
|
18
16
|
"developer-ui": "Developer UI",
|
|
19
|
-
"yes": "Yes",
|
|
20
17
|
"context_slots": "The number of VDisks residing on this PDisk",
|
|
21
18
|
"context_log-size": "The size of the Common Log shared by the residing VDisks",
|
|
22
19
|
"context_system-size": "The size reserved for the PDisk system components. Includes SysLog",
|
|
20
|
+
"field_drive": "Drive status",
|
|
21
|
+
"field_decommit": "Decommission",
|
|
22
|
+
"value_not-available": "N/A",
|
|
23
|
+
"context_drive-not-available": "Drive is not available",
|
|
24
|
+
"context_decommit-not-available": "Decommission status is not available",
|
|
25
|
+
"context_maintenance-not-available": "Maintenance status is not available",
|
|
23
26
|
"value_unknown": "Unknown",
|
|
24
27
|
"value_ok": "Ok",
|
|
25
28
|
"value_initial": "Initial",
|
|
@@ -24,6 +24,16 @@ function unknownLabel(): DiskStatusLabelData {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
function unavailableLabel(title: string, tooltip: string): DiskStatusLabelData {
|
|
28
|
+
return {
|
|
29
|
+
title,
|
|
30
|
+
value: i18n('value_not-available'),
|
|
31
|
+
tooltip,
|
|
32
|
+
theme: 'unknown',
|
|
33
|
+
icon: CircleQuestionFill,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
function getLabelView({
|
|
28
38
|
severity,
|
|
29
39
|
icon,
|
|
@@ -112,7 +122,7 @@ export function getPDiskStateLabel(state?: TPDiskState): DiskStatusLabelData {
|
|
|
112
122
|
|
|
113
123
|
export function getPDiskDriveLabel(status?: EDriveStatus): DiskStatusLabelData | undefined {
|
|
114
124
|
if (!status || status === 'UNKNOWN') {
|
|
115
|
-
return
|
|
125
|
+
return unavailableLabel(i18n('field_drive'), i18n('context_drive-not-available'));
|
|
116
126
|
}
|
|
117
127
|
const labels: Record<Exclude<EDriveStatus, 'UNKNOWN'>, StatusText> = {
|
|
118
128
|
ACTIVE: {value: i18n('value_active'), tooltip: i18n('context_active')},
|
|
@@ -141,7 +151,7 @@ export function getPDiskDriveLabel(status?: EDriveStatus): DiskStatusLabelData |
|
|
|
141
151
|
|
|
142
152
|
export function getPDiskDecommitLabel(status?: EDecommitStatus): DiskStatusLabelData | undefined {
|
|
143
153
|
if (!status || status === 'DECOMMIT_UNSET') {
|
|
144
|
-
return
|
|
154
|
+
return unavailableLabel(i18n('field_decommit'), i18n('context_decommit-not-available'));
|
|
145
155
|
}
|
|
146
156
|
const labels: Record<Exclude<EDecommitStatus, 'DECOMMIT_UNSET'>, StatusText> = {
|
|
147
157
|
DECOMMIT_NONE: {value: i18n('value_decommit-none'), tooltip: i18n('context_decommit-none')},
|
|
@@ -174,7 +184,10 @@ export function getPDiskMaintenanceLabel(
|
|
|
174
184
|
status?: EMaintenanceStatus,
|
|
175
185
|
): DiskStatusLabelData | undefined {
|
|
176
186
|
if (!status) {
|
|
177
|
-
return
|
|
187
|
+
return unavailableLabel(
|
|
188
|
+
i18n('label_maintenance'),
|
|
189
|
+
i18n('context_maintenance-not-available'),
|
|
190
|
+
);
|
|
178
191
|
}
|
|
179
192
|
const labels: Record<EMaintenanceStatus, StatusText> = {
|
|
180
193
|
NO_REQUEST: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import type {TextInputProps} from '@gravity-ui/uikit';
|
|
4
|
+
import {TextInput} from '@gravity-ui/uikit';
|
|
4
5
|
|
|
5
6
|
import {cn} from '../../utils/cn';
|
|
6
7
|
import {DebouncedTextInput} from '../DebouncedInput/DebouncedTextInput';
|
|
@@ -40,9 +41,11 @@ export const Search = ({
|
|
|
40
41
|
[onChange],
|
|
41
42
|
);
|
|
42
43
|
|
|
44
|
+
const Input = debounce === 0 ? TextInput : DebouncedTextInput;
|
|
45
|
+
|
|
43
46
|
return (
|
|
44
|
-
<
|
|
45
|
-
debounce
|
|
47
|
+
<Input
|
|
48
|
+
{...(debounce === 0 ? {} : {debounce})}
|
|
46
49
|
hasClear
|
|
47
50
|
autoFocus
|
|
48
51
|
controlRef={controlRef}
|