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
|
@@ -31,6 +31,19 @@ import './Disks.scss';
|
|
|
31
31
|
|
|
32
32
|
const b = cn('ydb-storage-disks');
|
|
33
33
|
|
|
34
|
+
interface DiskPopupState {
|
|
35
|
+
id: string;
|
|
36
|
+
vdisk: boolean;
|
|
37
|
+
pdisk: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type DiskPopupChangeHandler = (
|
|
41
|
+
id: string | undefined,
|
|
42
|
+
source: 'vdisk' | 'pdisk',
|
|
43
|
+
open: boolean,
|
|
44
|
+
closePair?: boolean,
|
|
45
|
+
) => void;
|
|
46
|
+
|
|
34
47
|
interface DisksProps {
|
|
35
48
|
vDisks?: PreparedVDisk[];
|
|
36
49
|
viewContext?: StorageViewContext;
|
|
@@ -44,7 +57,7 @@ interface DisksItemProps {
|
|
|
44
57
|
viewContext?: StorageViewContext;
|
|
45
58
|
inactive?: boolean;
|
|
46
59
|
highlighted: boolean;
|
|
47
|
-
|
|
60
|
+
onPopupChange: DiskPopupChangeHandler;
|
|
48
61
|
compactVDiskWidth?: number;
|
|
49
62
|
withDCMargin?: boolean;
|
|
50
63
|
withIcon?: boolean;
|
|
@@ -58,7 +71,7 @@ const VDiskItem = React.memo(function VDiskItem({
|
|
|
58
71
|
vDisk,
|
|
59
72
|
highlighted,
|
|
60
73
|
inactive,
|
|
61
|
-
|
|
74
|
+
onPopupChange,
|
|
62
75
|
compactVDiskWidth,
|
|
63
76
|
withIcon,
|
|
64
77
|
getDisplayState,
|
|
@@ -66,6 +79,15 @@ const VDiskItem = React.memo(function VDiskItem({
|
|
|
66
79
|
renderContent,
|
|
67
80
|
placeholderProps,
|
|
68
81
|
}: DisksItemProps) {
|
|
82
|
+
const vDiskId = vDisk.StringifiedId;
|
|
83
|
+
const setHighlightedVDisk = React.useCallback(
|
|
84
|
+
(id?: string) => onPopupChange(vDiskId, 'vdisk', Boolean(id)),
|
|
85
|
+
[onPopupChange, vDiskId],
|
|
86
|
+
);
|
|
87
|
+
const onClosePopup = React.useCallback(
|
|
88
|
+
() => onPopupChange(vDiskId, 'vdisk', false, true),
|
|
89
|
+
[onPopupChange, vDiskId],
|
|
90
|
+
);
|
|
69
91
|
const style: React.CSSProperties = isAllVDisksLayout
|
|
70
92
|
? {width: ALL_VDISK_WIDTH, flexBasis: ALL_VDISK_WIDTH}
|
|
71
93
|
: {width: compactVDiskWidth, flexBasis: compactVDiskWidth};
|
|
@@ -98,6 +120,7 @@ const VDiskItem = React.memo(function VDiskItem({
|
|
|
98
120
|
delayClose={DISKS_POPUP_DEBOUNCE_TIMEOUT}
|
|
99
121
|
highlightedVDisk={highlighted ? vDisk.StringifiedId : undefined}
|
|
100
122
|
setHighlightedVDisk={setHighlightedVDisk}
|
|
123
|
+
onClosePopup={onClosePopup}
|
|
101
124
|
progressBarClassName={b('vdisk-progress-bar')}
|
|
102
125
|
getDisplayState={getDisplayState}
|
|
103
126
|
/>
|
|
@@ -109,7 +132,7 @@ const PDiskItem = React.memo(function PDiskItem({
|
|
|
109
132
|
vDisk,
|
|
110
133
|
viewContext,
|
|
111
134
|
highlighted,
|
|
112
|
-
|
|
135
|
+
onPopupChange,
|
|
113
136
|
withDCMargin,
|
|
114
137
|
withIcon,
|
|
115
138
|
getDisplayState,
|
|
@@ -119,12 +142,16 @@ const PDiskItem = React.memo(function PDiskItem({
|
|
|
119
142
|
const vDiskId = vDisk.StringifiedId;
|
|
120
143
|
|
|
121
144
|
const onShowPopup = React.useCallback(
|
|
122
|
-
() =>
|
|
123
|
-
[
|
|
145
|
+
() => onPopupChange(vDiskId, 'pdisk', true),
|
|
146
|
+
[onPopupChange, vDiskId],
|
|
124
147
|
);
|
|
125
148
|
const onHidePopup = React.useCallback(
|
|
126
|
-
() =>
|
|
127
|
-
[
|
|
149
|
+
() => onPopupChange(vDiskId, 'pdisk', false),
|
|
150
|
+
[onPopupChange, vDiskId],
|
|
151
|
+
);
|
|
152
|
+
const onClosePopup = React.useCallback(
|
|
153
|
+
() => onPopupChange(vDiskId, 'pdisk', false, true),
|
|
154
|
+
[onPopupChange, vDiskId],
|
|
128
155
|
);
|
|
129
156
|
|
|
130
157
|
if (!vDisk.PDisk) {
|
|
@@ -150,6 +177,7 @@ const PDiskItem = React.memo(function PDiskItem({
|
|
|
150
177
|
delayClose={DISKS_POPUP_DEBOUNCE_TIMEOUT}
|
|
151
178
|
onShowPopup={onShowPopup}
|
|
152
179
|
onHidePopup={onHidePopup}
|
|
180
|
+
onClosePopup={onClosePopup}
|
|
153
181
|
withIcon={withIcon}
|
|
154
182
|
highlighted={highlighted}
|
|
155
183
|
getDisplayState={getDisplayState}
|
|
@@ -170,7 +198,33 @@ export const Disks = React.memo(function Disks({
|
|
|
170
198
|
const getVDiskDisplayState = useStorageVDiskDisplayStateGetter();
|
|
171
199
|
const getPDiskDisplayState = useStoragePDiskDisplayStateGetter();
|
|
172
200
|
|
|
173
|
-
const [
|
|
201
|
+
const [popupState, setPopupState] = React.useState<DiskPopupState>();
|
|
202
|
+
const highlightedVDisk = popupState?.id;
|
|
203
|
+
const onPopupChange = React.useCallback<DiskPopupChangeHandler>(
|
|
204
|
+
(id, source, open, closePair) => {
|
|
205
|
+
if (!id) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
setPopupState((current) => {
|
|
209
|
+
// A delayed close from another pair must not clear the current pair.
|
|
210
|
+
if (!open && current?.id !== id) {
|
|
211
|
+
return current;
|
|
212
|
+
}
|
|
213
|
+
if (closePair) {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
const next = {
|
|
217
|
+
id,
|
|
218
|
+
vdisk: false,
|
|
219
|
+
pdisk: false,
|
|
220
|
+
...(current?.id === id ? current : {}),
|
|
221
|
+
[source]: open,
|
|
222
|
+
};
|
|
223
|
+
return next.vdisk || next.pdisk ? next : undefined;
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
[],
|
|
227
|
+
);
|
|
174
228
|
const vDiskList = useVirtualizedDiskList(
|
|
175
229
|
vDisks,
|
|
176
230
|
vDisks.every((disk) => Boolean(disk.StringifiedId)),
|
|
@@ -182,8 +236,8 @@ export const Disks = React.memo(function Disks({
|
|
|
182
236
|
);
|
|
183
237
|
|
|
184
238
|
React.useEffect(() => {
|
|
185
|
-
|
|
186
|
-
vDisks.some((disk) => disk.StringifiedId === id) ?
|
|
239
|
+
setPopupState((current) =>
|
|
240
|
+
vDisks.some((disk) => disk.StringifiedId === current?.id) ? current : undefined,
|
|
187
241
|
);
|
|
188
242
|
}, [vDisks]);
|
|
189
243
|
|
|
@@ -218,7 +272,7 @@ export const Disks = React.memo(function Disks({
|
|
|
218
272
|
vDisk={vDisk}
|
|
219
273
|
inactive={!isVdiskActive(vDisk, viewContext)}
|
|
220
274
|
highlighted={highlightedVDisk === vDisk.StringifiedId}
|
|
221
|
-
|
|
275
|
+
onPopupChange={onPopupChange}
|
|
222
276
|
compactVDiskWidth={compactVDiskWidths[index]}
|
|
223
277
|
withIcon={withIcon}
|
|
224
278
|
getDisplayState={getVDiskDisplayState}
|
|
@@ -236,7 +290,7 @@ export const Disks = React.memo(function Disks({
|
|
|
236
290
|
vDisk={vDisk}
|
|
237
291
|
viewContext={viewContext}
|
|
238
292
|
highlighted={highlightedVDisk === vDisk.StringifiedId}
|
|
239
|
-
|
|
293
|
+
onPopupChange={onPopupChange}
|
|
240
294
|
withDCMargin={vDisksWithDCMargins.includes(index)}
|
|
241
295
|
withIcon={withIcon}
|
|
242
296
|
getDisplayState={getPDiskDisplayState}
|
|
@@ -257,6 +257,7 @@ export interface PDiskProps {
|
|
|
257
257
|
showPopup?: boolean;
|
|
258
258
|
onShowPopup?: VoidFunction;
|
|
259
259
|
onHidePopup?: VoidFunction;
|
|
260
|
+
onClosePopup?: VoidFunction;
|
|
260
261
|
className?: string;
|
|
261
262
|
progressBarClassName?: string;
|
|
262
263
|
// Nodes derive this width from their VDisk rows, overriding the Groups mode defaults.
|
|
@@ -276,6 +277,7 @@ export const PDisk = ({
|
|
|
276
277
|
showPopup,
|
|
277
278
|
onShowPopup,
|
|
278
279
|
onHidePopup,
|
|
280
|
+
onClosePopup,
|
|
279
281
|
className,
|
|
280
282
|
progressBarClassName,
|
|
281
283
|
width,
|
|
@@ -359,6 +361,7 @@ export const PDisk = ({
|
|
|
359
361
|
anchorRef={anchorRef}
|
|
360
362
|
onShowPopup={onShowPopup}
|
|
361
363
|
onHidePopup={onHidePopup}
|
|
364
|
+
onClosePopup={onClosePopup}
|
|
362
365
|
renderPopupContent={() => <PDiskPopup data={data} />}
|
|
363
366
|
delayOpen={delayOpen}
|
|
364
367
|
delayClose={delayClose}
|
|
@@ -6,6 +6,7 @@ import {Flex, Icon, Label, Popover} from '@gravity-ui/uikit';
|
|
|
6
6
|
import {isNil} from 'lodash';
|
|
7
7
|
|
|
8
8
|
import {CellWithPopover} from '../../../../components/CellWithPopover/CellWithPopover';
|
|
9
|
+
import {DiskStatusLabel} from '../../../../components/DiskStatus/DiskStatus';
|
|
9
10
|
import {EntityName} from '../../../../components/EntityName/EntityName';
|
|
10
11
|
import {StatusIcon} from '../../../../components/StatusIcon/StatusIcon';
|
|
11
12
|
import {TitleWithHelpMark} from '../../../../components/TitleWithHelpmark/TitleWithHelpmark';
|
|
@@ -35,6 +36,7 @@ import {
|
|
|
35
36
|
} from '../../Disks/constants';
|
|
36
37
|
import {VDisks} from '../../VDisks/VDisks';
|
|
37
38
|
import {getDegradedSeverity} from '../../utils';
|
|
39
|
+
import {getStorageGroupStateLabel} from '../../utils/getStorageGroupStateLabel';
|
|
38
40
|
import i18n from '../i18n';
|
|
39
41
|
|
|
40
42
|
import {
|
|
@@ -122,9 +124,14 @@ const degradedColumn: StorageGroupsColumn = {
|
|
|
122
124
|
resizeMinWidth: 110,
|
|
123
125
|
render: ({row}) =>
|
|
124
126
|
row.Degraded ? (
|
|
125
|
-
<
|
|
127
|
+
<DiskStatusLabel
|
|
128
|
+
size="xs"
|
|
129
|
+
title="Degraded"
|
|
130
|
+
value={String(row.Degraded)}
|
|
131
|
+
theme={getDegradedSeverity(row)}
|
|
132
|
+
/>
|
|
126
133
|
) : (
|
|
127
|
-
|
|
134
|
+
EMPTY_DATA_PLACEHOLDER
|
|
128
135
|
),
|
|
129
136
|
align: DataTable.LEFT,
|
|
130
137
|
defaultOrder: DataTable.DESCENDING,
|
|
@@ -133,7 +140,21 @@ const stateColumn: StorageGroupsColumn = {
|
|
|
133
140
|
name: STORAGE_GROUPS_COLUMNS_IDS.State,
|
|
134
141
|
header: STORAGE_GROUPS_COLUMNS_TITLES.State,
|
|
135
142
|
width: 150,
|
|
136
|
-
render: ({row}) =>
|
|
143
|
+
render: ({row}) => {
|
|
144
|
+
const state = getStorageGroupStateLabel(row.State);
|
|
145
|
+
|
|
146
|
+
return state ? (
|
|
147
|
+
<DiskStatusLabel
|
|
148
|
+
size="xs"
|
|
149
|
+
title={state.title}
|
|
150
|
+
value={state.value}
|
|
151
|
+
theme={state.theme}
|
|
152
|
+
dangerHeavy={state.dangerHeavy}
|
|
153
|
+
/>
|
|
154
|
+
) : (
|
|
155
|
+
EMPTY_DATA_PLACEHOLDER
|
|
156
|
+
);
|
|
157
|
+
},
|
|
137
158
|
align: DataTable.LEFT,
|
|
138
159
|
defaultOrder: DataTable.DESCENDING,
|
|
139
160
|
};
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
@use '../../../../styles/mixins';
|
|
2
|
+
|
|
1
3
|
.ydb-storage-expert-mode-panel {
|
|
2
4
|
--label-checkbox-size: 14px;
|
|
3
5
|
|
|
6
|
+
@each $color in 'green', 'cyan', 'light-yellow', 'yellow', 'light-orange', 'pre-orange',
|
|
7
|
+
'orange', 'red', 'black'
|
|
8
|
+
{
|
|
9
|
+
&__label_#{$color} {
|
|
10
|
+
@include mixins.capacity-alert-label-colors($color);
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
background-color: var(--ydb-capacity-alert-label-background) !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
4
18
|
&__label {
|
|
5
19
|
border-radius: var(--g-border-radius-s);
|
|
6
20
|
.g-label__addon_side_start {
|
|
@@ -30,86 +44,4 @@
|
|
|
30
44
|
border: none;
|
|
31
45
|
background-color: var(--g-color-base-generic-medium);
|
|
32
46
|
}
|
|
33
|
-
|
|
34
|
-
// Custom color labels
|
|
35
|
-
&__label_green {
|
|
36
|
-
color: var(--g-color-text-positive-heavy);
|
|
37
|
-
background-color: var(--g-color-base-positive-light);
|
|
38
|
-
|
|
39
|
-
&:hover {
|
|
40
|
-
background-color: var(--g-color-base-positive-light) !important;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&__label_cyan {
|
|
45
|
-
color: var(--ydb-space-cyan-text);
|
|
46
|
-
background-color: var(--ydb-space-cyan-bg);
|
|
47
|
-
|
|
48
|
-
&:hover {
|
|
49
|
-
background-color: var(--ydb-space-cyan-bg) !important;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&__label_light-yellow {
|
|
54
|
-
color: var(--ydb-space-light-yellow-text);
|
|
55
|
-
background-color: var(--ydb-space-light-yellow-bg);
|
|
56
|
-
|
|
57
|
-
&:hover {
|
|
58
|
-
background-color: var(--ydb-space-light-yellow-bg) !important;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&__label_yellow {
|
|
63
|
-
color: var(--g-color-text-warning-heavy);
|
|
64
|
-
background-color: var(--g-color-base-warning-light);
|
|
65
|
-
|
|
66
|
-
&:hover {
|
|
67
|
-
background-color: var(--g-color-base-warning-light) !important;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&__label_light-orange {
|
|
72
|
-
color: var(--ydb-space-light-orange-text);
|
|
73
|
-
background-color: var(--ydb-space-light-orange-bg);
|
|
74
|
-
|
|
75
|
-
&:hover {
|
|
76
|
-
background-color: var(--ydb-space-light-orange-bg) !important;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&__label_pre-orange {
|
|
81
|
-
color: var(--ydb-space-pre-orange-text);
|
|
82
|
-
background-color: var(--ydb-space-pre-orange-bg);
|
|
83
|
-
|
|
84
|
-
&:hover {
|
|
85
|
-
background-color: var(--ydb-space-pre-orange-bg) !important;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&__label_orange {
|
|
90
|
-
color: var(--ydb-space-orange-text);
|
|
91
|
-
background-color: var(--ydb-space-orange-bg);
|
|
92
|
-
|
|
93
|
-
&:hover {
|
|
94
|
-
background-color: var(--ydb-space-orange-bg) !important;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&__label_red {
|
|
99
|
-
color: var(--g-color-base-danger-heavy);
|
|
100
|
-
background-color: var(--g-color-base-danger-light);
|
|
101
|
-
|
|
102
|
-
&:hover {
|
|
103
|
-
background-color: var(--g-color-base-danger-light) !important;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
&__label_black {
|
|
108
|
-
color: var(--g-color-text-primary);
|
|
109
|
-
background-color: var(--g-color-text-dark-hint);
|
|
110
|
-
|
|
111
|
-
&:hover {
|
|
112
|
-
background-color: var(--g-color-text-dark-hint) !important;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
47
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {Check} from '@gravity-ui/icons';
|
|
2
|
+
import type {LabelProps} from '@gravity-ui/uikit';
|
|
3
|
+
|
|
4
|
+
import {DiskStatusLabel} from '../../components/DiskStatus/DiskStatus';
|
|
5
|
+
|
|
6
|
+
import {getStorageGroupStateLabel} from './utils/getStorageGroupStateLabel';
|
|
7
|
+
|
|
8
|
+
export function StorageGroupStateLabel({
|
|
9
|
+
state,
|
|
10
|
+
size = 's',
|
|
11
|
+
}: {state?: string} & Pick<LabelProps, 'size'>) {
|
|
12
|
+
const label = getStorageGroupStateLabel(state);
|
|
13
|
+
|
|
14
|
+
return label ? (
|
|
15
|
+
<DiskStatusLabel
|
|
16
|
+
{...label}
|
|
17
|
+
size={size}
|
|
18
|
+
iconSize={size === 'xs' ? 12 : 14}
|
|
19
|
+
icon={label.theme === 'success' ? Check : undefined}
|
|
20
|
+
/>
|
|
21
|
+
) : null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type {TitledDiskStatusLabelData} from '../../../components/DiskStatus/DiskStatus';
|
|
2
|
+
import {
|
|
3
|
+
DATA_SEVERITY,
|
|
4
|
+
NUMERIC_SEVERITY_TO_LABEL_VIEW,
|
|
5
|
+
SOLID_RED_SEVERITY,
|
|
6
|
+
} from '../../../utils/disks/constants';
|
|
7
|
+
import type {DisplaySeverity} from '../../../utils/disks/types';
|
|
8
|
+
|
|
9
|
+
const stateSeverities = new Map<string, DisplaySeverity>([
|
|
10
|
+
['ok', DATA_SEVERITY.GREEN],
|
|
11
|
+
['replicating', DATA_SEVERITY.BLUE],
|
|
12
|
+
['starting', DATA_SEVERITY.YELLOW],
|
|
13
|
+
['degraded', DATA_SEVERITY.YELLOW],
|
|
14
|
+
['dead', SOLID_RED_SEVERITY],
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
export function getStorageGroupStateLabel(
|
|
18
|
+
state?: string | null,
|
|
19
|
+
): TitledDiskStatusLabelData | undefined {
|
|
20
|
+
const normalizedState = state?.trim();
|
|
21
|
+
|
|
22
|
+
if (!normalizedState) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const match = normalizedState.match(/^([^:]+)(?::\s*(.+))?$/);
|
|
27
|
+
const status = (match?.[1] ?? normalizedState).trim();
|
|
28
|
+
const value = match?.[2]?.trim();
|
|
29
|
+
let severity = stateSeverities.get(status) ?? DATA_SEVERITY.GREY;
|
|
30
|
+
|
|
31
|
+
if (status === 'degraded') {
|
|
32
|
+
const count = value?.split('(', 1)[0].trim();
|
|
33
|
+
|
|
34
|
+
if (count === '2') {
|
|
35
|
+
severity = DATA_SEVERITY.RED;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const labelView = NUMERIC_SEVERITY_TO_LABEL_VIEW[severity];
|
|
40
|
+
const title = status[0].toUpperCase() + status.slice(1);
|
|
41
|
+
const formattedValue = value?.replace(/\s*\(/g, ' (');
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
title,
|
|
45
|
+
value: formattedValue,
|
|
46
|
+
theme: labelView.theme,
|
|
47
|
+
dangerHeavy: Boolean(labelView.dangerHeavy),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@use '../../styles/mixins.scss';
|
|
2
|
-
|
|
3
1
|
.ydb-storage-group-page {
|
|
4
2
|
position: relative;
|
|
5
3
|
|
|
@@ -8,9 +6,7 @@
|
|
|
8
6
|
height: 100%;
|
|
9
7
|
padding: 0 20px;
|
|
10
8
|
|
|
11
|
-
&
|
|
12
|
-
&__title,
|
|
13
|
-
&__info,
|
|
9
|
+
&__summary,
|
|
14
10
|
&__storage-title {
|
|
15
11
|
position: sticky;
|
|
16
12
|
left: 0;
|
|
@@ -18,20 +14,20 @@
|
|
|
18
14
|
margin-bottom: 20px;
|
|
19
15
|
}
|
|
20
16
|
|
|
17
|
+
&__summary {
|
|
18
|
+
margin-top: var(--g-spacing-4);
|
|
19
|
+
margin-bottom: var(--g-spacing-6);
|
|
20
|
+
}
|
|
21
|
+
|
|
21
22
|
&__meta {
|
|
22
|
-
margin-
|
|
23
|
+
margin-bottom: var(--g-spacing-4);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
&__title {
|
|
26
|
-
margin-bottom:
|
|
27
|
+
margin-bottom: var(--g-spacing-4);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
&__storage-title {
|
|
30
|
-
margin
|
|
31
|
-
@include mixins.header-1-typography();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&__info {
|
|
35
|
-
margin-top: var(--g-spacing-10);
|
|
31
|
+
margin: 0;
|
|
36
32
|
}
|
|
37
33
|
}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
import {ArrowLeft} from '@gravity-ui/icons';
|
|
4
|
+
import {Button, ClipboardButton, Flex, Icon, Text} from '@gravity-ui/uikit';
|
|
3
5
|
import {skipToken} from '@reduxjs/toolkit/query';
|
|
4
6
|
import {Helmet} from 'react-helmet-async';
|
|
7
|
+
import {useHistory} from 'react-router-dom';
|
|
5
8
|
import {StringParam, useQueryParams} from 'use-query-params';
|
|
6
9
|
|
|
7
|
-
import {
|
|
10
|
+
import {AutoRefreshControl} from '../../components/AutoRefreshControl/AutoRefreshControl';
|
|
8
11
|
import {ResponseError} from '../../components/Errors/ResponseError';
|
|
9
12
|
import {InfoViewerSkeleton} from '../../components/InfoViewerSkeleton/InfoViewerSkeleton';
|
|
10
|
-
import {PageMetaWithAutorefresh} from '../../components/PageMeta/PageMeta';
|
|
11
13
|
import {StorageGroupInfo} from '../../components/StorageGroupInfo/StorageGroupInfo';
|
|
12
14
|
import {useCapabilitiesLoaded} from '../../store/reducers/capabilities/hooks';
|
|
13
15
|
import {setHeaderBreadcrumbs} from '../../store/reducers/header/header';
|
|
14
16
|
import {storageApi} from '../../store/reducers/storage/storage';
|
|
15
|
-
import {EFlag} from '../../types/api/enums';
|
|
16
17
|
import {valueIsDefined} from '../../utils';
|
|
17
18
|
import {cn} from '../../utils/cn';
|
|
19
|
+
import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
|
|
18
20
|
import {useAutoRefreshInterval, useTypedDispatch} from '../../utils/hooks';
|
|
19
21
|
import {useDatabaseFromQuery} from '../../utils/hooks/useDatabaseFromQuery';
|
|
20
22
|
import {useAppTitle} from '../App/AppTitleContext';
|
|
21
23
|
import {PaginatedStorage} from '../Storage/PaginatedStorage';
|
|
24
|
+
import {StorageGroupStateLabel} from '../Storage/StorageGroupStateLabel';
|
|
22
25
|
|
|
23
26
|
import {storageGroupPageKeyset} from './i18n';
|
|
24
27
|
|
|
@@ -28,15 +31,12 @@ const storageGroupPageCn = cn('ydb-storage-group-page');
|
|
|
28
31
|
|
|
29
32
|
export function StorageGroupPage() {
|
|
30
33
|
const dispatch = useTypedDispatch();
|
|
34
|
+
const history = useHistory();
|
|
31
35
|
const database = useDatabaseFromQuery();
|
|
32
36
|
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
33
37
|
|
|
34
38
|
const [{groupId}] = useQueryParams({groupId: StringParam});
|
|
35
39
|
|
|
36
|
-
React.useEffect(() => {
|
|
37
|
-
dispatch(setHeaderBreadcrumbs('storageGroup', {groupId, database}));
|
|
38
|
-
}, [dispatch, groupId, database]);
|
|
39
|
-
|
|
40
40
|
const [autoRefreshInterval] = useAutoRefreshInterval();
|
|
41
41
|
const capabilitiesLoaded = useCapabilitiesLoaded();
|
|
42
42
|
const groupQuery = storageApi.useGetStorageGroupsInfoQuery(
|
|
@@ -49,7 +49,12 @@ export function StorageGroupPage() {
|
|
|
49
49
|
},
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
const storageGroupData = groupQuery.
|
|
52
|
+
const storageGroupData = groupQuery.currentData?.groups?.[0];
|
|
53
|
+
const state = storageGroupData?.State;
|
|
54
|
+
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
dispatch(setHeaderBreadcrumbs('storageGroup', {groupId: groupId ?? undefined, database}));
|
|
57
|
+
}, [dispatch, groupId, database]);
|
|
53
58
|
|
|
54
59
|
const loading = groupQuery.isFetching && storageGroupData === undefined;
|
|
55
60
|
const {appTitle} = useAppTitle();
|
|
@@ -72,25 +77,46 @@ export function StorageGroupPage() {
|
|
|
72
77
|
return null;
|
|
73
78
|
}
|
|
74
79
|
|
|
75
|
-
const
|
|
80
|
+
const hasPreviousPage = history.length > 1;
|
|
76
81
|
|
|
77
82
|
return (
|
|
78
|
-
<
|
|
83
|
+
<Flex
|
|
79
84
|
className={storageGroupPageCn('meta')}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
alignItems="center"
|
|
86
|
+
justifyContent={hasPreviousPage ? 'space-between' : 'flex-end'}
|
|
87
|
+
gap={2}
|
|
88
|
+
>
|
|
89
|
+
{hasPreviousPage && (
|
|
90
|
+
<Button view="outlined" onClick={() => history.goBack()}>
|
|
91
|
+
<Icon data={ArrowLeft} />
|
|
92
|
+
{storageGroupPageKeyset('action_back')}
|
|
93
|
+
</Button>
|
|
94
|
+
)}
|
|
95
|
+
<AutoRefreshControl />
|
|
96
|
+
</Flex>
|
|
83
97
|
);
|
|
84
98
|
};
|
|
85
99
|
|
|
86
100
|
const renderPageTitle = () => {
|
|
87
101
|
return (
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
<Flex className={storageGroupPageCn('title')} alignItems="center" gap={2} wrap="wrap">
|
|
103
|
+
<Text variant="header-1">{storageGroupPageKeyset('storage-group')}</Text>
|
|
104
|
+
<Flex alignItems="center" gap={1}>
|
|
105
|
+
<Text variant="header-1" color="hint">
|
|
106
|
+
{groupId || EMPTY_DATA_PLACEHOLDER}
|
|
107
|
+
</Text>
|
|
108
|
+
{groupId && (
|
|
109
|
+
<ClipboardButton
|
|
110
|
+
text={groupId}
|
|
111
|
+
view="flat-secondary"
|
|
112
|
+
size="s"
|
|
113
|
+
aria-label={storageGroupPageKeyset('action_copy-group-id-from-title')}
|
|
114
|
+
tooltipInitialText={storageGroupPageKeyset('action_copy-group-id')}
|
|
115
|
+
/>
|
|
116
|
+
)}
|
|
117
|
+
</Flex>
|
|
118
|
+
<StorageGroupStateLabel state={state} />
|
|
119
|
+
</Flex>
|
|
94
120
|
);
|
|
95
121
|
};
|
|
96
122
|
|
|
@@ -107,9 +133,9 @@ export function StorageGroupPage() {
|
|
|
107
133
|
}
|
|
108
134
|
return (
|
|
109
135
|
<React.Fragment>
|
|
110
|
-
<
|
|
136
|
+
<Text as="h2" variant="subheader-3" className={storageGroupPageCn('storage-title')}>
|
|
111
137
|
{storageGroupPageKeyset('storage')}
|
|
112
|
-
</
|
|
138
|
+
</Text>
|
|
113
139
|
<PaginatedStorage
|
|
114
140
|
database={database}
|
|
115
141
|
groupId={groupId}
|
|
@@ -132,10 +158,12 @@ export function StorageGroupPage() {
|
|
|
132
158
|
return (
|
|
133
159
|
<div className={storageGroupPageCn(null)} ref={containerRef}>
|
|
134
160
|
{renderHelmet()}
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
161
|
+
<div className={storageGroupPageCn('summary')}>
|
|
162
|
+
{renderPageMeta()}
|
|
163
|
+
{renderPageTitle()}
|
|
164
|
+
{renderError()}
|
|
165
|
+
{renderInfo()}
|
|
166
|
+
</div>
|
|
139
167
|
{renderStorage()}
|
|
140
168
|
</div>
|
|
141
169
|
);
|
|
@@ -110,7 +110,7 @@ function Overview({type, path, database, databaseFullPath}: OverviewProps) {
|
|
|
110
110
|
/>
|
|
111
111
|
),
|
|
112
112
|
[EPathType.EPathTypeStreamingQuery]: () => (
|
|
113
|
-
<StreamingQueryInfo path={path} database={database} />
|
|
113
|
+
<StreamingQueryInfo path={path} database={database} data={data} />
|
|
114
114
|
),
|
|
115
115
|
};
|
|
116
116
|
|
|
@@ -129,6 +129,10 @@ function Overview({type, path, database, databaseFullPath}: OverviewProps) {
|
|
|
129
129
|
|
|
130
130
|
const content = pathTypeToComponent[type]?.();
|
|
131
131
|
|
|
132
|
+
if (isStreamingQuery) {
|
|
133
|
+
return content;
|
|
134
|
+
}
|
|
135
|
+
|
|
132
136
|
const commonInfo = (
|
|
133
137
|
<SchemaObjectInfoContainer data={currentData ?? undefined} type={type} path={path} />
|
|
134
138
|
);
|
|
@@ -18,6 +18,7 @@ export interface SchemaObjectInfoProps {
|
|
|
18
18
|
path: string;
|
|
19
19
|
itemsAfterType?: YDBDefinitionListItem[];
|
|
20
20
|
additionalItems?: YDBDefinitionListItem[];
|
|
21
|
+
createdContent?: YDBDefinitionListItem['content'];
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export function SchemaObjectInfo({
|
|
@@ -26,6 +27,7 @@ export function SchemaObjectInfo({
|
|
|
26
27
|
path,
|
|
27
28
|
itemsAfterType,
|
|
28
29
|
additionalItems,
|
|
30
|
+
createdContent,
|
|
29
31
|
}: SchemaObjectInfoProps) {
|
|
30
32
|
const showAdministrativeFields = useUserPermissions()?.IsAdministrationAllowed === true;
|
|
31
33
|
const items = React.useMemo(
|
|
@@ -37,8 +39,17 @@ export function SchemaObjectInfo({
|
|
|
37
39
|
itemsAfterType,
|
|
38
40
|
additionalItems,
|
|
39
41
|
showAdministrativeFields,
|
|
42
|
+
createdContent,
|
|
40
43
|
}),
|
|
41
|
-
[
|
|
44
|
+
[
|
|
45
|
+
additionalItems,
|
|
46
|
+
createdContent,
|
|
47
|
+
data,
|
|
48
|
+
fallbackType,
|
|
49
|
+
itemsAfterType,
|
|
50
|
+
path,
|
|
51
|
+
showAdministrativeFields,
|
|
52
|
+
],
|
|
42
53
|
);
|
|
43
54
|
|
|
44
55
|
return (
|