ydb-embedded-ui 22.3.0 → 22.4.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/DiskCapacityInfo/DiskCapacityInfo.d.ts +10 -1
- package/dist/components/DiskCapacityInfo/DiskCapacityInfo.js +75 -13
- package/dist/components/DiskCapacityInfo/DiskCapacityInfo.js.map +1 -1
- package/dist/components/DiskCapacityInfo/i18n/index.d.ts +1 -1
- package/dist/components/DiskPopup/DiskPopup.d.ts +25 -0
- package/dist/components/DiskPopup/DiskPopup.js +44 -0
- package/dist/components/DiskPopup/DiskPopup.js.map +1 -0
- package/dist/components/DiskPopup/DiskPopup.scss +203 -0
- package/dist/components/DiskPopup/i18n/en.json +3 -0
- package/dist/components/DiskPopup/i18n/index.d.ts +2 -0
- package/dist/components/DiskPopup/i18n/index.js +4 -0
- package/dist/components/DiskPopup/i18n/index.js.map +1 -0
- package/dist/components/DiskStatus/DiskStatus.d.ts +31 -0
- package/dist/components/DiskStatus/DiskStatus.js +61 -0
- package/dist/components/DiskStatus/DiskStatus.js.map +1 -0
- package/dist/components/DiskStatus/DiskStatus.scss +59 -0
- package/dist/components/DiskStatus/i18n/en.json +6 -0
- package/dist/components/DiskStatus/i18n/index.d.ts +2 -0
- package/dist/components/DiskStatus/i18n/index.js +4 -0
- package/dist/components/DiskStatus/i18n/index.js.map +1 -0
- package/dist/components/EntityStatus/EntityStatus.d.ts +1 -0
- package/dist/components/EntityStatus/EntityStatus.js +1 -1
- package/dist/components/EntityStatus/EntityStatus.js.map +1 -1
- package/dist/components/EvictVDiskButton/i18n/en.json +1 -1
- package/dist/components/FullNodeViewer/i18n/index.d.ts +1 -1
- package/dist/components/HoverPopup/HoverPopup.d.ts +2 -1
- package/dist/components/HoverPopup/HoverPopup.js +49 -17
- package/dist/components/HoverPopup/HoverPopup.js.map +1 -1
- package/dist/components/HoverPopup/usePopupPriority.d.ts +4 -0
- package/dist/components/HoverPopup/usePopupPriority.js +30 -0
- package/dist/components/HoverPopup/usePopupPriority.js.map +1 -0
- package/dist/components/PDiskInfo/PDiskLogSize.d.ts +5 -0
- package/dist/components/PDiskInfo/PDiskLogSize.js +20 -0
- package/dist/components/PDiskInfo/PDiskLogSize.js.map +1 -0
- package/dist/components/PDiskInfo/PDiskLogSize.scss +12 -0
- package/dist/components/PDiskInfo/getPDiskDetails.d.ts +4 -0
- package/dist/components/PDiskInfo/getPDiskDetails.js +33 -0
- package/dist/components/PDiskInfo/getPDiskDetails.js.map +1 -0
- package/dist/components/PDiskInfo/i18n/en.json +64 -2
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/PDiskInfo/statuses.d.ts +7 -0
- package/dist/components/PDiskInfo/statuses.js +185 -0
- package/dist/components/PDiskInfo/statuses.js.map +1 -0
- package/dist/components/PDiskPopup/PDiskPopup.d.ts +4 -7
- package/dist/components/PDiskPopup/PDiskPopup.js +28 -99
- package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
- package/dist/components/PDiskPopup/i18n/en.json +2 -12
- package/dist/components/PDiskPopup/i18n/index.d.ts +1 -1
- package/dist/components/StorageGroupInfo/StorageGroupInfo.d.ts +3 -3
- package/dist/components/StorageGroupInfo/StorageGroupInfo.js +78 -218
- package/dist/components/StorageGroupInfo/StorageGroupInfo.js.map +1 -1
- package/dist/components/StorageGroupInfo/StorageGroupInfo.scss +21 -0
- package/dist/components/StorageGroupInfo/i18n/en.json +1 -9
- package/dist/components/StorageGroupInfo/i18n/index.d.ts +1 -1
- package/dist/components/VDisk/VDisk.d.ts +2 -1
- package/dist/components/VDisk/VDisk.js +23 -32
- package/dist/components/VDisk/VDisk.js.map +1 -1
- package/dist/components/VDisk/VDiskWithDonorsStack.d.ts +1 -1
- package/dist/components/VDisk/VDiskWithDonorsStack.js +2 -1
- package/dist/components/VDisk/VDiskWithDonorsStack.js.map +1 -1
- package/dist/components/VDisk/getFlagStatusText.d.ts +2 -0
- package/dist/components/VDisk/getFlagStatusText.js +18 -0
- package/dist/components/VDisk/getFlagStatusText.js.map +1 -0
- package/dist/components/VDisk/i18n/en.json +1 -1
- package/dist/components/VDisk/i18n/index.d.ts +1 -1
- package/dist/components/VDiskInfo/getVDiskDetails.d.ts +5 -0
- package/dist/components/VDiskInfo/getVDiskDetails.js +29 -0
- package/dist/components/VDiskInfo/getVDiskDetails.js.map +1 -0
- package/dist/components/VDiskInfo/i18n/en.json +3 -1
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.d.ts +6 -8
- package/dist/components/VDiskPopup/VDiskPopup.js +106 -240
- package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.scss +3 -10
- package/dist/components/VDiskPopup/i18n/en.json +6 -22
- package/dist/components/VDiskPopup/i18n/index.d.ts +1 -1
- package/dist/components/VDiskStatus/VDiskReplicationStatus.d.ts +8 -0
- package/dist/components/VDiskStatus/VDiskReplicationStatus.js +32 -0
- package/dist/components/VDiskStatus/VDiskReplicationStatus.js.map +1 -0
- package/dist/components/VDiskStatus/VDiskStatus.d.ts +16 -0
- package/dist/components/VDiskStatus/VDiskStatus.js +20 -0
- package/dist/components/VDiskStatus/VDiskStatus.js.map +1 -0
- package/dist/components/VDiskStatus/VDiskStatus.scss +32 -0
- package/dist/components/VDiskStatus/i18n/en.json +33 -0
- package/dist/components/VDiskStatus/i18n/index.d.ts +1 -0
- package/dist/components/VDiskStatus/i18n/index.js +5 -0
- package/dist/components/VDiskStatus/i18n/index.js.map +1 -0
- package/dist/components/VDiskStatus/index.d.ts +2 -0
- package/dist/components/VDiskStatus/index.js +3 -0
- package/dist/components/VDiskStatus/index.js.map +1 -0
- package/dist/components/VDiskStatus/statuses.d.ts +4 -0
- package/dist/components/VDiskStatus/statuses.js +120 -0
- package/dist/components/VDiskStatus/statuses.js.map +1 -0
- package/dist/components/capacityMetricsColumns/i18n/en.json +4 -4
- package/dist/containers/Cluster/ClusterDrawerHealthcheck.js +6 -1
- package/dist/containers/Cluster/ClusterDrawerHealthcheck.js.map +1 -1
- package/dist/containers/Clusters/ClusterDrawerHealthcheck.js +1 -1
- package/dist/containers/Clusters/ClusterDrawerHealthcheck.js.map +1 -1
- package/dist/containers/Header/Header.js +8 -2
- package/dist/containers/Header/Header.js.map +1 -1
- package/dist/containers/Header/StorageGroupLeftControls.d.ts +1 -0
- package/dist/containers/Header/StorageGroupLeftControls.js +23 -0
- package/dist/containers/Header/StorageGroupLeftControls.js.map +1 -0
- package/dist/containers/Header/i18n/en.json +3 -1
- package/dist/containers/Header/i18n/index.d.ts +1 -1
- package/dist/containers/Operations/constants.d.ts +1 -1
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js +4 -4
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js.map +1 -1
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/Disks/Disks.js +36 -9
- package/dist/containers/Storage/Disks/Disks.js.map +1 -1
- package/dist/containers/Storage/PDisk/PDisk.d.ts +2 -1
- package/dist/containers/Storage/PDisk/PDisk.js +2 -2
- package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
- package/dist/containers/Storage/PDisk/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/columns.js +7 -2
- package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/columns.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/components/SpaceLegend.scss +14 -82
- package/dist/containers/Storage/StorageExpertModePanel/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageGroupStateLabel.d.ts +4 -0
- package/dist/containers/Storage/StorageGroupStateLabel.js +9 -0
- package/dist/containers/Storage/StorageGroupStateLabel.js.map +1 -0
- package/dist/containers/Storage/utils/getStorageGroupStateLabel.d.ts +2 -0
- package/dist/containers/Storage/utils/getStorageGroupStateLabel.js +35 -0
- package/dist/containers/Storage/utils/getStorageGroupStateLabel.js.map +1 -0
- package/dist/containers/StorageGroupPage/StorageGroupPage.js +17 -12
- package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
- package/dist/containers/StorageGroupPage/StorageGroupPage.scss +9 -13
- package/dist/containers/StorageGroupPage/i18n/en.json +3 -1
- package/dist/containers/StorageGroupPage/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +4 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/SchemaObjectInfo.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/SchemaObjectInfo.js +11 -2
- package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/SchemaObjectInfo.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/prepareSchemaObjectInfo.d.ts +2 -1
- package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/prepareSchemaObjectInfo.js +9 -8
- package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/prepareSchemaObjectInfo.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.d.ts +16 -1
- package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.js +56 -19
- package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/i18n/en.json +5 -1
- package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.d.ts +3 -1
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.js +3 -3
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.js.map +1 -1
- package/dist/containers/Tenant/TenantDrawerHealthcheck.js +8 -1
- package/dist/containers/Tenant/TenantDrawerHealthcheck.js.map +1 -1
- package/dist/containers/Tenants/DatabaseDrawerHealthcheck.js +8 -1
- package/dist/containers/Tenants/DatabaseDrawerHealthcheck.js.map +1 -1
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/store/configureStore.d.ts +2 -2
- package/dist/store/defaultStore.d.ts +1 -1
- package/dist/store/reducers/header/types.d.ts +1 -1
- package/dist/store/reducers/index.d.ts +2 -2
- package/dist/store/reducers/pdisk/types.d.ts +1 -0
- package/dist/store/reducers/pdisk/utils.js +6 -1
- package/dist/store/reducers/pdisk/utils.js.map +1 -1
- package/dist/store/reducers/storage/prepareGroupsDisks.d.ts +1 -0
- package/dist/store/reducers/storage/prepareGroupsDisks.js +7 -18
- package/dist/store/reducers/storage/prepareGroupsDisks.js.map +1 -1
- package/dist/store/reducers/storage/utils.js +4 -0
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/store/reducers/streamingQuery/streamingQuery.js +2 -4
- package/dist/store/reducers/streamingQuery/streamingQuery.js.map +1 -1
- package/dist/styles/mixins.scss +22 -0
- package/dist/types/api/pdisk.d.ts +4 -0
- package/dist/types/api/pdisk.js.map +1 -1
- package/dist/types/api/vdisk.d.ts +8 -0
- package/dist/types/api/vdisk.js +7 -0
- package/dist/types/api/vdisk.js.map +1 -1
- package/dist/types/store/nodesList.d.ts +4 -2
- package/dist/uiFactory/types.d.ts +5 -2
- package/dist/utils/bytesParsers/formatBytes.d.ts +3 -1
- package/dist/utils/bytesParsers/formatBytes.js +12 -3
- package/dist/utils/bytesParsers/formatBytes.js.map +1 -1
- package/dist/utils/disks/constants.d.ts +1 -0
- package/dist/utils/disks/constants.js +4 -0
- package/dist/utils/disks/constants.js.map +1 -1
- package/dist/utils/disks/diskInfo/getDiskLocationItems.d.ts +16 -0
- package/dist/utils/disks/diskInfo/getDiskLocationItems.js +30 -0
- package/dist/utils/disks/diskInfo/getDiskLocationItems.js.map +1 -0
- package/dist/utils/disks/diskInfo/i18n/en.json +9 -0
- package/dist/utils/disks/diskInfo/i18n/index.d.ts +2 -0
- package/dist/utils/disks/diskInfo/i18n/index.js +4 -0
- package/dist/utils/disks/diskInfo/i18n/index.js.map +1 -0
- package/dist/utils/disks/iconCalculators.d.ts +5 -0
- package/dist/utils/disks/iconCalculators.js +1 -1
- package/dist/utils/disks/iconCalculators.js.map +1 -1
- package/dist/utils/disks/prepareDisks.d.ts +6 -2
- package/dist/utils/disks/prepareDisks.js +22 -35
- package/dist/utils/disks/prepareDisks.js.map +1 -1
- package/dist/utils/disks/types.d.ts +9 -2
- package/dist/utils/hooks/useNodeMetadata.d.ts +2 -0
- package/dist/utils/hooks/useNodeMetadata.js +15 -0
- package/dist/utils/hooks/useNodeMetadata.js.map +1 -0
- package/dist/utils/nodes.js +6 -2
- package/dist/utils/nodes.js.map +1 -1
- package/dist/utils/storageMetrics.d.ts +2 -2
- package/dist/utils/storageMetrics.js +22 -10
- package/dist/utils/storageMetrics.js.map +1 -1
- package/dist/utils/timeParsers/formatDuration.d.ts +4 -1
- package/dist/utils/timeParsers/formatDuration.js +16 -1
- package/dist/utils/timeParsers/formatDuration.js.map +1 -1
- package/dist/utils/timeParsers/i18n/en.json +5 -1
- package/dist/utils/timeParsers/i18n/index.d.ts +1 -1
- package/dist/utils/timeParsers/i18n/ru.json +5 -1
- package/package.json +2 -2
- package/src/components/DiskCapacityInfo/DiskCapacityInfo.tsx +106 -15
- package/src/components/DiskPopup/DiskPopup.scss +203 -0
- package/src/components/DiskPopup/DiskPopup.tsx +123 -0
- package/src/components/DiskPopup/i18n/en.json +3 -0
- package/src/components/DiskPopup/i18n/index.ts +5 -0
- package/src/components/DiskStatus/DiskStatus.scss +59 -0
- package/src/components/DiskStatus/DiskStatus.tsx +149 -0
- package/src/components/DiskStatus/i18n/en.json +6 -0
- package/src/components/DiskStatus/i18n/index.ts +5 -0
- package/src/components/EntityStatus/EntityStatus.tsx +1 -1
- package/src/components/EvictVDiskButton/i18n/en.json +1 -1
- package/src/components/HoverPopup/HoverPopup.tsx +67 -20
- package/src/components/HoverPopup/usePopupPriority.ts +39 -0
- package/src/components/PDiskInfo/PDiskLogSize.scss +12 -0
- package/src/components/PDiskInfo/PDiskLogSize.tsx +37 -0
- package/src/components/PDiskInfo/getPDiskDetails.tsx +37 -0
- package/src/components/PDiskInfo/i18n/en.json +64 -8
- package/src/components/PDiskInfo/statuses.ts +209 -0
- package/src/components/PDiskPopup/PDiskPopup.tsx +62 -147
- package/src/components/PDiskPopup/i18n/en.json +2 -12
- package/src/components/StorageGroupInfo/StorageGroupInfo.scss +21 -0
- package/src/components/StorageGroupInfo/StorageGroupInfo.tsx +121 -260
- package/src/components/StorageGroupInfo/i18n/en.json +1 -9
- package/src/components/VDisk/VDisk.tsx +31 -34
- package/src/components/VDisk/VDiskWithDonorsStack.tsx +2 -0
- package/src/components/VDisk/getFlagStatusText.ts +19 -0
- package/src/components/VDisk/i18n/en.json +1 -1
- package/src/components/VDiskInfo/getVDiskDetails.tsx +41 -0
- package/src/components/VDiskInfo/i18n/en.json +3 -10
- package/src/components/VDiskPopup/VDiskPopup.scss +3 -10
- package/src/components/VDiskPopup/VDiskPopup.tsx +197 -421
- package/src/components/VDiskPopup/i18n/en.json +6 -22
- package/src/components/VDiskStatus/VDiskReplicationStatus.tsx +77 -0
- package/src/components/VDiskStatus/VDiskStatus.scss +32 -0
- package/src/components/VDiskStatus/VDiskStatus.tsx +38 -0
- package/src/components/VDiskStatus/i18n/en.json +33 -0
- package/src/components/VDiskStatus/i18n/index.ts +7 -0
- package/src/components/VDiskStatus/index.ts +7 -0
- package/src/components/VDiskStatus/statuses.ts +139 -0
- package/src/components/capacityMetricsColumns/i18n/en.json +4 -4
- package/src/containers/Cluster/ClusterDrawerHealthcheck.tsx +6 -0
- package/src/containers/Clusters/ClusterDrawerHealthcheck.tsx +1 -0
- package/src/containers/Header/Header.tsx +11 -3
- package/src/containers/Header/StorageGroupLeftControls.tsx +38 -0
- package/src/containers/Header/i18n/en.json +3 -1
- package/src/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.tsx +13 -2
- package/src/containers/Storage/Disks/Disks.tsx +66 -12
- package/src/containers/Storage/PDisk/PDisk.tsx +3 -0
- package/src/containers/Storage/PaginatedStorageGroupsTable/columns/columns.tsx +24 -3
- package/src/containers/Storage/StorageExpertModePanel/components/SpaceLegend.scss +14 -82
- package/src/containers/Storage/StorageGroupStateLabel.tsx +22 -0
- package/src/containers/Storage/utils/getStorageGroupStateLabel.ts +49 -0
- package/src/containers/StorageGroupPage/StorageGroupPage.scss +9 -13
- package/src/containers/StorageGroupPage/StorageGroupPage.tsx +53 -25
- package/src/containers/StorageGroupPage/i18n/en.json +3 -1
- package/src/containers/Tenant/Diagnostics/Overview/Overview.tsx +5 -1
- package/src/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/SchemaObjectInfo.tsx +12 -1
- package/src/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/prepareSchemaObjectInfo.tsx +11 -10
- package/src/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.tsx +83 -20
- package/src/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/i18n/en.json +5 -1
- package/src/containers/Tenant/Healthcheck/components/HealthcheckDrawer.tsx +5 -2
- package/src/containers/Tenant/TenantDrawerHealthcheck.tsx +10 -0
- package/src/containers/Tenants/DatabaseDrawerHealthcheck.tsx +10 -0
- package/src/lib.ts +1 -0
- package/src/store/reducers/header/types.ts +3 -1
- package/src/store/reducers/pdisk/types.ts +1 -0
- package/src/store/reducers/pdisk/utils.ts +6 -3
- package/src/store/reducers/storage/prepareGroupsDisks.ts +7 -22
- package/src/store/reducers/storage/utils.ts +4 -0
- package/src/store/reducers/streamingQuery/streamingQuery.ts +2 -4
- package/src/styles/mixins.scss +22 -0
- package/src/types/api/pdisk.ts +4 -0
- package/src/types/api/vdisk.ts +9 -0
- package/src/types/store/nodesList.ts +7 -7
- package/src/uiFactory/types.ts +9 -2
- package/src/utils/bytesParsers/formatBytes.ts +23 -4
- package/src/utils/disks/constants.ts +5 -0
- package/src/utils/disks/diskInfo/getDiskLocationItems.ts +50 -0
- package/src/utils/disks/diskInfo/i18n/en.json +9 -0
- package/src/utils/disks/diskInfo/i18n/index.ts +5 -0
- package/src/utils/disks/iconCalculators.ts +1 -1
- package/src/utils/disks/prepareDisks.ts +21 -47
- package/src/utils/disks/types.ts +10 -2
- package/src/utils/hooks/useNodeMetadata.ts +21 -0
- package/src/utils/nodes.ts +6 -1
- package/src/utils/storageMetrics.ts +27 -14
- package/src/utils/timeParsers/formatDuration.ts +22 -1
- package/src/utils/timeParsers/i18n/en.json +5 -1
- package/src/utils/timeParsers/i18n/ru.json +5 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {isNil} from 'lodash';
|
|
2
|
+
|
|
3
|
+
import type {YDBDefinitionListItem} from '../../../components/YDBDefinitionList/YDBDefinitionList';
|
|
4
|
+
import type {NodeMetadata} from '../../../types/store/nodesList';
|
|
5
|
+
import {EMPTY_DATA_PLACEHOLDER} from '../../constants';
|
|
6
|
+
|
|
7
|
+
import i18n from './i18n';
|
|
8
|
+
|
|
9
|
+
export interface DiskDetailItem extends YDBDefinitionListItem {
|
|
10
|
+
/** Stable field identifier for ordering and grouping independently of translated names. */
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface DiskLocationData {
|
|
15
|
+
NodeId?: number;
|
|
16
|
+
PDiskId?: number;
|
|
17
|
+
Path?: string;
|
|
18
|
+
VDiskSlotId?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function getDiskLocationItems(
|
|
22
|
+
data: DiskLocationData,
|
|
23
|
+
nodeData: NodeMetadata,
|
|
24
|
+
{withVDiskSlotId = false}: {withVDiskSlotId?: boolean} = {},
|
|
25
|
+
): DiskDetailItem[] {
|
|
26
|
+
const entries = [
|
|
27
|
+
{id: 'fqdn', name: i18n('field_fqdn'), value: nodeData.Host},
|
|
28
|
+
{id: 'rack', name: i18n('field_rack'), value: nodeData.Rack},
|
|
29
|
+
{id: 'datacenter', name: i18n('field_datacenter'), value: nodeData.DC},
|
|
30
|
+
{id: 'pdisk-path', name: i18n('field_pdisk-path'), value: data.Path},
|
|
31
|
+
{id: 'node-id', name: i18n('field_node-id'), value: data.NodeId || undefined},
|
|
32
|
+
{id: 'pdisk-id', name: i18n('field_pdisk-id'), value: data.PDiskId},
|
|
33
|
+
];
|
|
34
|
+
if (withVDiskSlotId) {
|
|
35
|
+
entries.push({
|
|
36
|
+
id: 'vdisk-slot-id',
|
|
37
|
+
name: i18n('field_vdisk-slot-id'),
|
|
38
|
+
value: data.VDiskSlotId,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return entries.map(({id, name, value}) => {
|
|
42
|
+
const missing = isNil(value) || value === '';
|
|
43
|
+
return {
|
|
44
|
+
id,
|
|
45
|
+
name,
|
|
46
|
+
content: missing ? EMPTY_DATA_PLACEHOLDER : value,
|
|
47
|
+
copyText: missing ? undefined : value,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -161,7 +161,7 @@ export function calculateFrontQueuesIcon(
|
|
|
161
161
|
* Get icon and color for a single status flag.
|
|
162
162
|
* Maps EFlag to the corresponding pair-legend icon and color.
|
|
163
163
|
*/
|
|
164
|
-
function getFlagIconWithColor(flag: EFlag | undefined): IconWithColor | undefined {
|
|
164
|
+
export function getFlagIconWithColor(flag: EFlag | undefined): IconWithColor | undefined {
|
|
165
165
|
if (!flag || flag === EFlag.Grey) {
|
|
166
166
|
return {
|
|
167
167
|
icon: CircleQuestionFill,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {isNil} from 'lodash';
|
|
2
2
|
|
|
3
|
-
import type {TPDiskStateInfo} from '../../types/api/pdisk';
|
|
3
|
+
import type {TPDiskInfo, TPDiskStateInfo} from '../../types/api/pdisk';
|
|
4
4
|
import type {TVDiskStateInfo, TVSlotId} from '../../types/api/vdisk';
|
|
5
5
|
import {stringifyVdiskId} from '../dataFormatters/dataFormatters';
|
|
6
6
|
import {isNumeric, parseOptionalNonNegativeNumber} from '../utils';
|
|
@@ -8,7 +8,7 @@ import {isNumeric, parseOptionalNonNegativeNumber} from '../utils';
|
|
|
8
8
|
import {calculatePDiskSeverity} from './calculatePDiskSeverity';
|
|
9
9
|
import {calculateVDiskSeverity} from './calculateVDiskSeverity';
|
|
10
10
|
import {getPDiskType} from './getPDiskType';
|
|
11
|
-
import {getPDiskId, isFullVDiskData} from './helpers';
|
|
11
|
+
import {getPDiskId, isFullVDiskData, makeVDiskLocationKey} from './helpers';
|
|
12
12
|
import type {PreparedPDisk, PreparedVDisk} from './types';
|
|
13
13
|
|
|
14
14
|
export function prepareWhiteboardVDiskData(
|
|
@@ -21,16 +21,7 @@ export function prepareWhiteboardVDiskData(
|
|
|
21
21
|
if (!isFullVDiskData(vDiskState)) {
|
|
22
22
|
const {NodeId, PDiskId, VSlotId, ...restVDiskFields} = vDiskState;
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
!isNil(VSlotId) && !isNil(PDiskId) && !isNil(NodeId)
|
|
26
|
-
? {
|
|
27
|
-
NodeId,
|
|
28
|
-
PDiskId,
|
|
29
|
-
VSlotId,
|
|
30
|
-
}
|
|
31
|
-
: undefined;
|
|
32
|
-
|
|
33
|
-
const StringifiedId = stringifyVdiskId(vDiskId);
|
|
24
|
+
const StringifiedId = makeVDiskLocationKey(NodeId, PDiskId, VSlotId) ?? '';
|
|
34
25
|
|
|
35
26
|
return {
|
|
36
27
|
...restVDiskFields,
|
|
@@ -66,13 +57,7 @@ export function prepareWhiteboardVDiskData(
|
|
|
66
57
|
AllocatedSize: AllocatedSize,
|
|
67
58
|
SlotSize: PDisk?.EnforcedDynamicSlotSize,
|
|
68
59
|
});
|
|
69
|
-
const WhiteboardSize = hasWhiteboardData
|
|
70
|
-
? prepareWhiteboardVDiskSizeFields({
|
|
71
|
-
AvailableSize,
|
|
72
|
-
AllocatedSize,
|
|
73
|
-
SlotSize: PDisk?.EnforcedDynamicSlotSize,
|
|
74
|
-
})
|
|
75
|
-
: undefined;
|
|
60
|
+
const WhiteboardSize = hasWhiteboardData ? vDiskSizeFields.DisplaySize : undefined;
|
|
76
61
|
|
|
77
62
|
const Severity = calculateVDiskSeverity(vDiskState);
|
|
78
63
|
|
|
@@ -124,7 +109,7 @@ export function prepareWhiteboardVDiskData(
|
|
|
124
109
|
}
|
|
125
110
|
|
|
126
111
|
export function prepareWhiteboardPDiskData(
|
|
127
|
-
pdiskState: TPDiskStateInfo = {},
|
|
112
|
+
pdiskState: TPDiskStateInfo & Pick<TPDiskInfo, 'StatusV2'> = {},
|
|
128
113
|
whiteboardSizeSource: Pick<TPDiskStateInfo, 'AvailableSize' | 'TotalSize'> | null = pdiskState,
|
|
129
114
|
): PreparedPDisk {
|
|
130
115
|
const hasWhiteboardData = pdiskState.HasWhiteboardData ?? Boolean(whiteboardSizeSource);
|
|
@@ -170,33 +155,7 @@ export function prepareWhiteboardPDiskData(
|
|
|
170
155
|
State,
|
|
171
156
|
Severity,
|
|
172
157
|
SlotSize: EnforcedDynamicSlotSize,
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function prepareWhiteboardVDiskSizeFields({
|
|
177
|
-
AvailableSize,
|
|
178
|
-
AllocatedSize,
|
|
179
|
-
SlotSize,
|
|
180
|
-
}: {
|
|
181
|
-
AvailableSize: unknown;
|
|
182
|
-
AllocatedSize: unknown;
|
|
183
|
-
SlotSize: unknown;
|
|
184
|
-
}) {
|
|
185
|
-
const allocatedSize = parseOptionalNonNegativeNumber(AllocatedSize);
|
|
186
|
-
const availableSize = parseOptionalNonNegativeNumber(AvailableSize);
|
|
187
|
-
const slotSize = parseOptionalNonNegativeNumber(SlotSize);
|
|
188
|
-
const preparedSizeFields = prepareVDiskSizeFields({
|
|
189
|
-
AvailableSize: availableSize,
|
|
190
|
-
AllocatedSize: allocatedSize,
|
|
191
|
-
SlotSize: slotSize,
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
AllocatedSize: allocatedSize === undefined ? undefined : preparedSizeFields.AllocatedSize,
|
|
196
|
-
SizeLimit:
|
|
197
|
-
availableSize === undefined && slotSize === undefined
|
|
198
|
-
? undefined
|
|
199
|
-
: preparedSizeFields.SizeLimit,
|
|
158
|
+
DriveStatus: pdiskState.Status ?? pdiskState.StatusV2,
|
|
200
159
|
};
|
|
201
160
|
}
|
|
202
161
|
|
|
@@ -253,12 +212,27 @@ export function prepareVDiskSizeFields({
|
|
|
253
212
|
});
|
|
254
213
|
const allocatedPercent = sizeLimit > 0 ? Math.floor((allocated * 100) / sizeLimit) : NaN;
|
|
255
214
|
|
|
215
|
+
// Preserve missing values for display without changing the legacy calculations above.
|
|
216
|
+
const displayAllocatedSize = parseOptionalNonNegativeNumber(AllocatedSize);
|
|
217
|
+
const displayAvailableSize = parseOptionalNonNegativeNumber(AvailableSize);
|
|
218
|
+
const displaySlotSize = parseOptionalNonNegativeNumber(SlotSize);
|
|
219
|
+
let displaySizeLimit: number | undefined;
|
|
220
|
+
if (!displayAvailableSize && displaySlotSize) {
|
|
221
|
+
displaySizeLimit = displaySlotSize;
|
|
222
|
+
} else if (displayAllocatedSize !== undefined && displayAvailableSize !== undefined) {
|
|
223
|
+
displaySizeLimit = displayAllocatedSize + displayAvailableSize;
|
|
224
|
+
}
|
|
225
|
+
|
|
256
226
|
return {
|
|
257
227
|
AvailableSize: available,
|
|
258
228
|
AllocatedSize: allocated,
|
|
259
229
|
SizeLimit: sizeLimit,
|
|
260
230
|
FreeSize: freeSize,
|
|
261
231
|
AllocatedPercent: allocatedPercent,
|
|
232
|
+
DisplaySize: {
|
|
233
|
+
AllocatedSize: displayAllocatedSize,
|
|
234
|
+
SizeLimit: displaySizeLimit,
|
|
235
|
+
},
|
|
262
236
|
};
|
|
263
237
|
}
|
|
264
238
|
|
package/src/utils/disks/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type {EFlag} from '../../types/api/enums';
|
|
2
2
|
import type {EDriveStatus, TPDiskInfo, TPDiskStateInfo} from '../../types/api/pdisk';
|
|
3
|
-
import type {EVDiskStatus, TVDiskStateInfo
|
|
3
|
+
import type {EVDiskStatus, TVDiskStateInfo} from '../../types/api/vdisk';
|
|
4
4
|
import type {ValueOf} from '../../types/common';
|
|
5
5
|
|
|
6
6
|
import type {PDISK_TYPES} from './getPDiskType';
|
|
@@ -98,6 +98,8 @@ export interface PreparedVDisk
|
|
|
98
98
|
extends Omit<TVDiskStateInfo, 'PDisk' | 'AvailableSize' | 'AllocatedSize' | 'Donors'> {
|
|
99
99
|
Status?: EVDiskStatus;
|
|
100
100
|
PDisk?: PreparedPDisk;
|
|
101
|
+
PDiskType?: string;
|
|
102
|
+
PDiskPath?: string;
|
|
101
103
|
Severity?: number;
|
|
102
104
|
StringifiedId?: string;
|
|
103
105
|
|
|
@@ -106,6 +108,11 @@ export interface PreparedVDisk
|
|
|
106
108
|
AllocatedPercent?: number;
|
|
107
109
|
SizeLimit?: number;
|
|
108
110
|
FreeSize?: number;
|
|
111
|
+
/** Size values for display, preserving missing source values independently. */
|
|
112
|
+
DisplaySize?: {
|
|
113
|
+
AllocatedSize?: number;
|
|
114
|
+
SizeLimit?: number;
|
|
115
|
+
};
|
|
109
116
|
WhiteboardSize?: {
|
|
110
117
|
AllocatedSize?: number;
|
|
111
118
|
SizeLimit?: number;
|
|
@@ -118,7 +125,8 @@ export interface PreparedVDisk
|
|
|
118
125
|
|
|
119
126
|
export type PDiskType = ValueOf<typeof PDISK_TYPES>;
|
|
120
127
|
|
|
121
|
-
export interface UnavailableDonor
|
|
128
|
+
export interface UnavailableDonor
|
|
129
|
+
extends Pick<PreparedVDisk, 'NodeId' | 'PDiskId' | 'VDiskSlotId'> {
|
|
122
130
|
DonorMode?: boolean;
|
|
123
131
|
StoragePoolName?: string;
|
|
124
132
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {isNil} from 'lodash';
|
|
2
|
+
|
|
3
|
+
import {selectNodesMap} from '../../store/reducers/nodesList';
|
|
4
|
+
import type {NodeMetadata} from '../../types/store/nodesList';
|
|
5
|
+
import {useTypedSelector} from '../hooks';
|
|
6
|
+
|
|
7
|
+
import {useDatabaseFromQuery} from './useDatabaseFromQuery';
|
|
8
|
+
|
|
9
|
+
export function useNodeMetadata(
|
|
10
|
+
nodeId: number | undefined,
|
|
11
|
+
parentNodeData?: NodeMetadata,
|
|
12
|
+
): NodeMetadata {
|
|
13
|
+
const database = useDatabaseFromQuery();
|
|
14
|
+
const nodesMap = useTypedSelector((state) => selectNodesMap(state, database));
|
|
15
|
+
const storedNodeData = isNil(nodeId) ? undefined : nodesMap?.get(nodeId);
|
|
16
|
+
return {
|
|
17
|
+
Host: parentNodeData?.Host || storedNodeData?.Host,
|
|
18
|
+
DC: parentNodeData?.DC || storedNodeData?.DC,
|
|
19
|
+
Rack: parentNodeData?.Rack || storedNodeData?.Rack,
|
|
20
|
+
};
|
|
21
|
+
}
|
package/src/utils/nodes.ts
CHANGED
|
@@ -32,9 +32,14 @@ export const isUnavailableNode = <
|
|
|
32
32
|
export const prepareNodesMap = (nodesList?: TNodeInfo[]) => {
|
|
33
33
|
return nodesList?.reduce<NodesMap>((nodeHosts, node) => {
|
|
34
34
|
if (valueIsDefined(node.Id)) {
|
|
35
|
+
const physicalLocation = node.PhysicalLocation;
|
|
36
|
+
// The legacy numeric Rack can be a hash of the actual rack name.
|
|
37
|
+
const Rack = physicalLocation?.Location?.match(/(?:^|\/)R=([^/]+)/)?.[1];
|
|
38
|
+
|
|
35
39
|
nodeHosts.set(node.Id, {
|
|
36
40
|
Host: node.Host,
|
|
37
|
-
DC:
|
|
41
|
+
DC: physicalLocation?.DataCenterId,
|
|
42
|
+
Rack,
|
|
38
43
|
});
|
|
39
44
|
}
|
|
40
45
|
return nodeHosts;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type {BytesSizes} from './bytesParsers';
|
|
2
|
-
import {bytesSizes, getBytesSizeUnit, sizes} from './bytesParsers';
|
|
2
|
+
import {bytesSizes, formatBytes, getBytesSizeUnit, sizes} from './bytesParsers';
|
|
3
3
|
import {EMPTY_DATA_PLACEHOLDER, UNBREAKABLE_GAP} from './constants';
|
|
4
|
-
import {
|
|
5
|
-
formatNumber,
|
|
6
|
-
formatPercent,
|
|
7
|
-
formatStorageValuesToGb,
|
|
8
|
-
} from './dataFormatters/dataFormatters';
|
|
4
|
+
import {formatNumber, formatPercent, roundToDecimalPlaces} from './dataFormatters/dataFormatters';
|
|
9
5
|
import {parseOptionalNonNegativeNumber} from './utils';
|
|
10
6
|
|
|
11
7
|
export interface FormatMetricBytesOptions {
|
|
@@ -165,27 +161,44 @@ export function formatMetricBytes(
|
|
|
165
161
|
: EMPTY_DATA_PLACEHOLDER;
|
|
166
162
|
}
|
|
167
163
|
|
|
168
|
-
export function formatMetricPercent(value?: unknown) {
|
|
164
|
+
export function formatMetricPercent(value?: unknown, fixedDecimalPlaces?: number) {
|
|
169
165
|
const numericValue = parseOptionalNonNegativeNumber(value);
|
|
170
166
|
|
|
171
167
|
if (numericValue === undefined) {
|
|
172
168
|
return EMPTY_DATA_PLACEHOLDER;
|
|
173
169
|
}
|
|
174
170
|
|
|
175
|
-
const precision = Number.isInteger(numericValue) ? 0 : 1;
|
|
171
|
+
const precision = fixedDecimalPlaces ?? (Number.isInteger(numericValue) ? 0 : 1);
|
|
172
|
+
const fixed =
|
|
173
|
+
fixedDecimalPlaces !== undefined && roundToDecimalPlaces(numericValue, precision) !== 0;
|
|
176
174
|
|
|
177
|
-
return formatPercent(numericValue / 100, precision) || EMPTY_DATA_PLACEHOLDER;
|
|
175
|
+
return formatPercent(numericValue / 100, precision, {fixed}) || EMPTY_DATA_PLACEHOLDER;
|
|
178
176
|
}
|
|
179
177
|
|
|
180
|
-
export function formatStorageMetricPair(
|
|
178
|
+
export function formatStorageMetricPair(
|
|
179
|
+
value?: string | number,
|
|
180
|
+
capacity?: string | number,
|
|
181
|
+
fixedDecimalPlaces?: number,
|
|
182
|
+
) {
|
|
181
183
|
const parsedValue = parseOptionalNonNegativeNumber(value);
|
|
182
184
|
const parsedCapacity = parseOptionalNonNegativeNumber(capacity);
|
|
183
185
|
|
|
184
|
-
if (parsedValue === undefined
|
|
186
|
+
if (parsedValue === undefined && parsedCapacity === undefined) {
|
|
185
187
|
return EMPTY_DATA_PLACEHOLDER;
|
|
186
188
|
}
|
|
187
189
|
|
|
188
|
-
return
|
|
190
|
+
return [
|
|
191
|
+
formatBytes({
|
|
192
|
+
value: parsedValue,
|
|
193
|
+
size: 'gb',
|
|
194
|
+
precision: 1,
|
|
195
|
+
withSizeLabel: parsedCapacity === undefined,
|
|
196
|
+
fixedDecimalPlaces,
|
|
197
|
+
}),
|
|
198
|
+
formatBytes({value: parsedCapacity, size: 'gb', fixedDecimalPlaces}),
|
|
199
|
+
]
|
|
200
|
+
.map((formattedValue) => formattedValue || EMPTY_DATA_PLACEHOLDER)
|
|
201
|
+
.join(' / ');
|
|
189
202
|
}
|
|
190
203
|
|
|
191
204
|
export function formatNormalizedMetricPercent(value?: number) {
|
|
@@ -195,7 +208,7 @@ export function formatNormalizedMetricPercent(value?: number) {
|
|
|
195
208
|
return EMPTY_DATA_PLACEHOLDER;
|
|
196
209
|
}
|
|
197
210
|
|
|
198
|
-
return
|
|
211
|
+
return formatMetricPercent(parsedValue * 100, 2);
|
|
199
212
|
}
|
|
200
213
|
|
|
201
214
|
export function formatMetricCount(value?: unknown) {
|
|
@@ -212,7 +225,7 @@ export function formatMetricCountPair(value?: unknown, capacity?: unknown) {
|
|
|
212
225
|
const formattedValue = formatMetricCount(value);
|
|
213
226
|
const formattedCapacity = formatMetricCount(capacity);
|
|
214
227
|
|
|
215
|
-
if (formattedValue === EMPTY_DATA_PLACEHOLDER
|
|
228
|
+
if (formattedValue === EMPTY_DATA_PLACEHOLDER && formattedCapacity === EMPTY_DATA_PLACEHOLDER) {
|
|
216
229
|
return EMPTY_DATA_PLACEHOLDER;
|
|
217
230
|
}
|
|
218
231
|
|
|
@@ -7,10 +7,15 @@ import i18n from './i18n';
|
|
|
7
7
|
* Process time difference in ms and returns formated time.
|
|
8
8
|
* By default only two major values are returned (days & hours, hours & minutes, minutes & seconds, etc.).
|
|
9
9
|
* It can be altered with valuesCount arg
|
|
10
|
+
* Compact format omits milliseconds and spaces between numbers and unit labels.
|
|
10
11
|
*
|
|
11
12
|
* value - duration in ms
|
|
12
13
|
*/
|
|
13
|
-
export const formatDurationToShortTimeFormat = (
|
|
14
|
+
export const formatDurationToShortTimeFormat = (
|
|
15
|
+
value: number,
|
|
16
|
+
valuesCount: 1 | 2 = 2,
|
|
17
|
+
{compact = false}: {compact?: boolean} = {},
|
|
18
|
+
) => {
|
|
14
19
|
const ms = value % 1000;
|
|
15
20
|
let remain = Math.floor(value / 1000);
|
|
16
21
|
|
|
@@ -33,6 +38,22 @@ export const formatDurationToShortTimeFormat = (value: number, valuesCount: 1 |
|
|
|
33
38
|
ms,
|
|
34
39
|
};
|
|
35
40
|
|
|
41
|
+
if (compact) {
|
|
42
|
+
const units = [
|
|
43
|
+
{value: days, key: 'value_compact-days'},
|
|
44
|
+
{value: hours, key: 'value_compact-hours'},
|
|
45
|
+
{value: minutes, key: 'value_compact-minutes'},
|
|
46
|
+
{value: seconds, key: 'value_compact-seconds'},
|
|
47
|
+
] as const;
|
|
48
|
+
const firstNonZeroUnit = units.findIndex((unit) => unit.value > 0);
|
|
49
|
+
|
|
50
|
+
return units
|
|
51
|
+
.slice(firstNonZeroUnit < 0 ? -1 : firstNonZeroUnit)
|
|
52
|
+
.slice(0, valuesCount)
|
|
53
|
+
.map(({key}) => i18n(key, duration))
|
|
54
|
+
.join(' ');
|
|
55
|
+
}
|
|
56
|
+
|
|
36
57
|
if (valuesCount === 2) {
|
|
37
58
|
if (days > 0) {
|
|
38
59
|
return i18n('daysHours', duration);
|
|
@@ -7,5 +7,9 @@
|
|
|
7
7
|
"hours": "{{hours}}\u00a0h",
|
|
8
8
|
"min": "{{minutes}}\u00a0m",
|
|
9
9
|
"sec": "{{seconds}}\u00a0s",
|
|
10
|
-
"ms": "{{ms}}\u00a0ms"
|
|
10
|
+
"ms": "{{ms}}\u00a0ms",
|
|
11
|
+
"value_compact-days": "{{days}}d",
|
|
12
|
+
"value_compact-hours": "{{hours}}h",
|
|
13
|
+
"value_compact-minutes": "{{minutes}}min",
|
|
14
|
+
"value_compact-seconds": "{{seconds}}s"
|
|
11
15
|
}
|
|
@@ -7,5 +7,9 @@
|
|
|
7
7
|
"hours": "{{hours}}\u00a0ч",
|
|
8
8
|
"min": "{{minutes}}\u00a0м",
|
|
9
9
|
"sec": "{{seconds}}\u00a0с",
|
|
10
|
-
"ms": "{{ms}}\u00a0мс"
|
|
10
|
+
"ms": "{{ms}}\u00a0мс",
|
|
11
|
+
"value_compact-days": "{{days}}д",
|
|
12
|
+
"value_compact-hours": "{{hours}}ч",
|
|
13
|
+
"value_compact-minutes": "{{minutes}}мин",
|
|
14
|
+
"value_compact-seconds": "{{seconds}}с"
|
|
11
15
|
}
|