ydb-embedded-ui 22.6.0 → 22.8.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/Datacenter/DatacenterLabel.d.ts +9 -0
- package/dist/components/Datacenter/DatacenterLabel.js +23 -0
- package/dist/components/Datacenter/DatacenterLabel.js.map +1 -0
- package/dist/components/Datacenter/DatacenterLabel.scss +8 -0
- package/dist/components/Datacenter/datacenterColors.scss +27 -0
- package/dist/components/Datacenter/i18n/en.json +5 -0
- package/dist/components/Datacenter/i18n/index.d.ts +2 -0
- package/dist/components/Datacenter/i18n/index.js +4 -0
- package/dist/components/Datacenter/i18n/index.js.map +1 -0
- package/dist/components/DiskPopup/DiskPopup.d.ts +4 -2
- package/dist/components/DiskPopup/DiskPopup.js +12 -4
- package/dist/components/DiskPopup/DiskPopup.js.map +1 -1
- package/dist/components/DiskPopup/DiskPopup.scss +6 -0
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.d.ts +5 -3
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.js +17 -3
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.js.map +1 -1
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.scss +29 -0
- package/dist/components/PDiskPopup/PDiskPopup.js +1 -1
- package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
- package/dist/components/TenantNameWrapper/TenantNameWrapper.js +3 -1
- package/dist/components/TenantNameWrapper/TenantNameWrapper.js.map +1 -1
- package/dist/components/TenantNameWrapper/utils.d.ts +4 -1
- package/dist/components/TenantNameWrapper/utils.js +9 -2
- package/dist/components/TenantNameWrapper/utils.js.map +1 -1
- package/dist/components/TooltipsContent/NodeEndpointsTooltipContent/i18n/index.d.ts +1 -1
- package/dist/components/VDisk/VDisk.js +8 -2
- package/dist/components/VDisk/VDisk.js.map +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.js +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
- package/dist/components/nodesColumns/columns.d.ts +4 -0
- package/dist/components/nodesColumns/columns.js +18 -1
- package/dist/components/nodesColumns/columns.js.map +1 -1
- package/dist/components/nodesColumns/constants.d.ts +2 -0
- package/dist/components/nodesColumns/constants.js +6 -0
- package/dist/components/nodesColumns/constants.js.map +1 -1
- package/dist/components/nodesColumns/i18n/en.json +1 -0
- package/dist/components/nodesColumns/i18n/index.d.ts +1 -1
- package/dist/containers/App/Content.js +7 -3
- package/dist/containers/App/Content.js.map +1 -1
- package/dist/containers/Cluster/Cluster.js +3 -2
- package/dist/containers/Cluster/Cluster.js.map +1 -1
- package/dist/containers/Cluster/ClusterDrawerHealthcheck.js +18 -2
- package/dist/containers/Cluster/ClusterDrawerHealthcheck.js.map +1 -1
- package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.js +10 -5
- package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.js.map +1 -1
- package/dist/containers/Clusters/Clusters.js +7 -3
- package/dist/containers/Clusters/Clusters.js.map +1 -1
- package/dist/containers/Clusters/columns.d.ts +1 -0
- package/dist/containers/Clusters/columns.js +4 -1
- package/dist/containers/Clusters/columns.js.map +1 -1
- package/dist/containers/Header/StorageGroupLeftControls.js +2 -2
- package/dist/containers/Header/StorageGroupLeftControls.js.map +1 -1
- package/dist/containers/Header/hooks/useSharedDatabasePath.js +14 -6
- package/dist/containers/Header/hooks/useSharedDatabasePath.js.map +1 -1
- package/dist/containers/Node/NodePages.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/NodesTable.js +3 -1
- package/dist/containers/Nodes/NodesTable.js.map +1 -1
- package/dist/containers/Nodes/PaginatedNodes/GroupedNodesComponent.js +11 -6
- package/dist/containers/Nodes/PaginatedNodes/GroupedNodesComponent.js.map +1 -1
- package/dist/containers/Nodes/PaginatedNodes/NodesComponent.js +2 -4
- package/dist/containers/Nodes/PaginatedNodes/NodesComponent.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js +6 -1
- package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskStorageDetails.js +2 -1
- package/dist/containers/PDiskPage/PDiskStorageDetails.js.map +1 -1
- package/dist/containers/Storage/PDisk/PDisk.js +13 -2
- package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/columns.js +1 -1
- package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/columns.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageNodesTable/PaginatedStorageNodesTable.js +3 -1
- package/dist/containers/Storage/PaginatedStorageNodesTable/PaginatedStorageNodesTable.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageNodesTable/columns/columns.js +2 -1
- package/dist/containers/Storage/PaginatedStorageNodesTable/columns/columns.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageNodesTable/columns/hooks.js +15 -8
- package/dist/containers/Storage/PaginatedStorageNodesTable/columns/hooks.js.map +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/StorageExpertModePanel.scss +6 -0
- package/dist/containers/Storage/StorageExpertModePanel/StorageGroupsExpertModePanel.js +6 -2
- package/dist/containers/Storage/StorageExpertModePanel/StorageGroupsExpertModePanel.js.map +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/components/DatacenterLegend.d.ts +4 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/DatacenterLegend.js +38 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/DatacenterLegend.js.map +1 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/DatacenterLegend.scss +54 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/renderExpertModeLegend.js +5 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/renderExpertModeLegend.js.map +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/constants.d.ts +3 -0
- package/dist/containers/Storage/StorageExpertModePanel/constants.js +1 -0
- package/dist/containers/Storage/StorageExpertModePanel/constants.js.map +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/i18n/en.json +6 -0
- package/dist/containers/Storage/StorageExpertModePanel/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageGroupStateLabel.d.ts +4 -2
- package/dist/containers/Storage/StorageGroupStateLabel.js +4 -3
- package/dist/containers/Storage/StorageGroupStateLabel.js.map +1 -1
- package/dist/containers/Storage/useStorageDatacenter.d.ts +2 -0
- package/dist/containers/Storage/useStorageDatacenter.js +28 -0
- package/dist/containers/Storage/useStorageDatacenter.js.map +1 -0
- package/dist/containers/Storage/useStoragePDiskDisplayStateGetter.js +6 -1
- package/dist/containers/Storage/useStoragePDiskDisplayStateGetter.js.map +1 -1
- package/dist/containers/Storage/useStorageQueryParams.d.ts +4 -4
- package/dist/containers/Storage/useStorageVDiskDisplayStateGetter.js +6 -1
- package/dist/containers/Storage/useStorageVDiskDisplayStateGetter.js.map +1 -1
- package/dist/containers/Storage/utils/getStorageGroupStateLabel.d.ts +2 -1
- package/dist/containers/Storage/utils/getStorageGroupStateLabel.js +47 -11
- package/dist/containers/Storage/utils/getStorageGroupStateLabel.js.map +1 -1
- package/dist/containers/Storage/utils/index.js +2 -5
- package/dist/containers/Storage/utils/index.js.map +1 -1
- package/dist/containers/StorageGroupPage/StorageGroupPage.js +1 -2
- package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.d.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +18 -11
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/DatabaseDatacenters.d.ts +4 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/DatabaseDatacenters.js +11 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/DatabaseDatacenters.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/DatabaseInfo.d.ts +1 -2
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/DatabaseInfo.js +20 -2
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/DatabaseInfo.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/i18n/en.json +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/utils.d.ts +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/utils.js +23 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DatabaseInfo/utils.js.map +1 -1
- package/dist/containers/Tenant/Query/QueryEditor/hooks/useEditorOptions.js +3 -1
- package/dist/containers/Tenant/Query/QueryEditor/hooks/useEditorOptions.js.map +1 -1
- package/dist/containers/Tenant/utils/schemaQueryTemplates.js +1 -6
- package/dist/containers/Tenant/utils/schemaQueryTemplates.js.map +1 -1
- package/dist/containers/Tenants/TenantsTable.js +20 -6
- package/dist/containers/Tenants/TenantsTable.js.map +1 -1
- package/dist/containers/UserSettings/i18n/en.json +3 -0
- package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
- package/dist/containers/UserSettings/settings.d.ts +1 -0
- package/dist/containers/UserSettings/settings.js +15 -1
- package/dist/containers/UserSettings/settings.js.map +1 -1
- package/dist/containers/VDiskPage/VDiskStorageDetails.js +4 -3
- package/dist/containers/VDiskPage/VDiskStorageDetails.js.map +1 -1
- package/dist/lib.d.ts +1 -0
- package/dist/services/api/viewer.d.ts +2 -1
- package/dist/services/api/viewer.js +2 -1
- package/dist/services/api/viewer.js.map +1 -1
- package/dist/store/configureStore.d.ts +4 -0
- package/dist/store/datacenterQueryContext.d.ts +7 -0
- package/dist/store/datacenterQueryContext.js +10 -0
- package/dist/store/datacenterQueryContext.js.map +1 -0
- package/dist/store/defaultStore.d.ts +2 -0
- package/dist/store/reducers/capabilities/capabilities.d.ts +28 -0
- package/dist/store/reducers/cluster/cluster.d.ts +2 -0
- package/dist/store/reducers/cluster/cluster.js +10 -6
- package/dist/store/reducers/cluster/cluster.js.map +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/datacenters.d.ts +13 -0
- package/dist/store/reducers/datacenters.js +82 -0
- package/dist/store/reducers/datacenters.js.map +1 -0
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +36 -0
- package/dist/store/reducers/index.d.ts +3 -0
- package/dist/store/reducers/index.js +2 -0
- package/dist/store/reducers/index.js.map +1 -1
- package/dist/store/reducers/nodes/nodes.js +4 -2
- package/dist/store/reducers/nodes/nodes.js.map +1 -1
- package/dist/store/reducers/nodesList.d.ts +8 -3
- package/dist/store/reducers/nodesList.js +10 -5
- package/dist/store/reducers/nodesList.js.map +1 -1
- package/dist/store/reducers/pdisk/pdisk.js +3 -1
- package/dist/store/reducers/pdisk/pdisk.js.map +1 -1
- package/dist/store/reducers/pdisk/types.d.ts +1 -0
- package/dist/store/reducers/pdisk/utils.js +1 -0
- package/dist/store/reducers/pdisk/utils.js.map +1 -1
- package/dist/store/reducers/schema/schema.d.ts +4 -0
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +12 -0
- package/dist/store/reducers/settings/constants.d.ts +2 -0
- package/dist/store/reducers/settings/constants.js +2 -0
- package/dist/store/reducers/settings/constants.js.map +1 -1
- package/dist/store/reducers/settings/settings.d.ts +1 -0
- package/dist/store/reducers/settings/utils.d.ts +1 -1
- package/dist/store/reducers/storage/storage.js +4 -2
- package/dist/store/reducers/storage/storage.js.map +1 -1
- package/dist/store/reducers/storage/types.d.ts +2 -1
- package/dist/store/reducers/storage/utils.js +2 -0
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/store/reducers/tablets.d.ts +1 -0
- package/dist/store/reducers/tenant/tenant.js +6 -1
- package/dist/store/reducers/tenant/tenant.js.map +1 -1
- package/dist/store/reducers/tenants/types.d.ts +2 -0
- package/dist/store/reducers/tenants/utils.js +3 -0
- package/dist/store/reducers/tenants/utils.js.map +1 -1
- package/dist/store/reducers/topic/topic.d.ts +19 -0
- package/dist/store/reducers/vdisk/types.d.ts +1 -0
- package/dist/store/reducers/vdisk/utils.js +2 -0
- package/dist/store/reducers/vdisk/utils.js.map +1 -1
- package/dist/store/reducers/vdisk/vdisk.js +4 -2
- package/dist/store/reducers/vdisk/vdisk.js.map +1 -1
- package/dist/styles/datacenters.scss +247 -0
- package/dist/types/api/meta.d.ts +1 -0
- package/dist/types/api/storage.d.ts +20 -0
- package/dist/types/api/storage.js.map +1 -1
- package/dist/types/store/nodesList.d.ts +2 -0
- package/dist/uiFactory/types.d.ts +8 -0
- package/dist/utils/databaseId.d.ts +8 -0
- package/dist/utils/databaseId.js +10 -0
- package/dist/utils/databaseId.js.map +1 -0
- package/dist/utils/datacenters.d.ts +15 -0
- package/dist/utils/datacenters.js +70 -0
- package/dist/utils/datacenters.js.map +1 -0
- package/dist/utils/disks/diskInfo/getDiskLocationItems.js +3 -0
- package/dist/utils/disks/diskInfo/getDiskLocationItems.js.map +1 -1
- package/dist/utils/disks/diskInfo/i18n/en.json +1 -0
- package/dist/utils/disks/diskInfo/i18n/index.d.ts +1 -1
- package/dist/utils/disks/displayState.d.ts +7 -1
- package/dist/utils/disks/displayState.js.map +1 -1
- package/dist/utils/disks/groupBy.d.ts +1 -0
- package/dist/utils/disks/groupBy.js +1 -0
- package/dist/utils/disks/groupBy.js.map +1 -1
- package/dist/utils/hooks/useDatacenterColorIndexes.d.ts +3 -0
- package/dist/utils/hooks/useDatacenterColorIndexes.js +9 -0
- package/dist/utils/hooks/useDatacenterColorIndexes.js.map +1 -0
- package/dist/utils/hooks/useDatacenterNodesFetcher.d.ts +6 -0
- package/dist/utils/hooks/useDatacenterNodesFetcher.js +14 -0
- package/dist/utils/hooks/useDatacenterNodesFetcher.js.map +1 -0
- package/dist/utils/hooks/useDebouncedValue.js +12 -0
- package/dist/utils/hooks/useDebouncedValue.js.map +1 -1
- package/dist/utils/hooks/useNodeMetadata.js +4 -5
- package/dist/utils/hooks/useNodeMetadata.js.map +1 -1
- package/dist/utils/hooks/useNodesListQueryArgs.d.ts +3 -0
- package/dist/utils/hooks/useNodesListQueryArgs.js +62 -0
- package/dist/utils/hooks/useNodesListQueryArgs.js.map +1 -0
- package/dist/utils/hooks/useNodesMap.d.ts +1 -0
- package/dist/utils/hooks/useNodesMap.js +8 -0
- package/dist/utils/hooks/useNodesMap.js.map +1 -0
- package/dist/utils/nodes.d.ts +1 -0
- package/dist/utils/nodes.js +9 -0
- package/dist/utils/nodes.js.map +1 -1
- package/dist/utils/query.d.ts +6 -6
- package/dist/utils/zod/zodParsers.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/Datacenter/DatacenterLabel.scss +8 -0
- package/src/components/Datacenter/DatacenterLabel.tsx +54 -0
- package/src/components/Datacenter/datacenterColors.scss +27 -0
- package/src/components/Datacenter/i18n/en.json +5 -0
- package/src/components/Datacenter/i18n/index.ts +5 -0
- package/src/components/DiskPopup/DiskPopup.scss +6 -0
- package/src/components/DiskPopup/DiskPopup.tsx +25 -3
- package/src/components/DiskStateProgressBar/DiskStateProgressBar.scss +29 -0
- package/src/components/DiskStateProgressBar/DiskStateProgressBar.tsx +41 -4
- package/src/components/PDiskPopup/PDiskPopup.tsx +1 -1
- package/src/components/TenantNameWrapper/TenantNameWrapper.tsx +3 -1
- package/src/components/TenantNameWrapper/utils.ts +13 -1
- package/src/components/VDisk/VDisk.tsx +8 -1
- package/src/components/VDiskPopup/VDiskPopup.tsx +1 -1
- package/src/components/nodesColumns/columns.tsx +18 -2
- package/src/components/nodesColumns/constants.ts +6 -0
- package/src/components/nodesColumns/i18n/en.json +1 -0
- package/src/containers/App/Content.tsx +7 -3
- package/src/containers/Cluster/Cluster.tsx +8 -2
- package/src/containers/Cluster/ClusterDrawerHealthcheck.tsx +30 -3
- package/src/containers/Cluster/ClusterOverview/components/BridgeInfoTable.tsx +33 -24
- package/src/containers/Clusters/Clusters.tsx +7 -3
- package/src/containers/Clusters/columns.tsx +6 -0
- package/src/containers/Header/StorageGroupLeftControls.tsx +5 -1
- package/src/containers/Header/hooks/useSharedDatabasePath.ts +16 -7
- package/src/containers/Nodes/NodesControls/NodesControls.tsx +0 -1
- package/src/containers/Nodes/NodesTable.tsx +3 -1
- package/src/containers/Nodes/PaginatedNodes/GroupedNodesComponent.tsx +21 -7
- package/src/containers/Nodes/PaginatedNodes/NodesComponent.tsx +2 -4
- package/src/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.tsx +6 -1
- package/src/containers/PDiskPage/PDiskStorageDetails.tsx +12 -1
- package/src/containers/Storage/PDisk/PDisk.tsx +19 -4
- package/src/containers/Storage/PaginatedStorageGroupsTable/columns/columns.tsx +1 -1
- package/src/containers/Storage/PaginatedStorageNodesTable/PaginatedStorageNodesTable.tsx +3 -1
- package/src/containers/Storage/PaginatedStorageNodesTable/columns/columns.tsx +2 -0
- package/src/containers/Storage/PaginatedStorageNodesTable/columns/hooks.ts +16 -8
- package/src/containers/Storage/StorageExpertModePanel/StorageExpertModePanel.scss +6 -0
- package/src/containers/Storage/StorageExpertModePanel/StorageGroupsExpertModePanel.tsx +9 -2
- package/src/containers/Storage/StorageExpertModePanel/components/DatacenterLegend.scss +54 -0
- package/src/containers/Storage/StorageExpertModePanel/components/DatacenterLegend.tsx +102 -0
- package/src/containers/Storage/StorageExpertModePanel/components/renderExpertModeLegend.tsx +5 -0
- package/src/containers/Storage/StorageExpertModePanel/constants.ts +1 -0
- package/src/containers/Storage/StorageExpertModePanel/i18n/en.json +6 -0
- package/src/containers/Storage/StorageGroupStateLabel.tsx +8 -3
- package/src/containers/Storage/useStorageDatacenter.ts +38 -0
- package/src/containers/Storage/useStoragePDiskDisplayStateGetter.ts +7 -1
- package/src/containers/Storage/useStorageVDiskDisplayStateGetter.ts +7 -1
- package/src/containers/Storage/utils/getStorageGroupStateLabel.ts +67 -12
- package/src/containers/Storage/utils/index.ts +2 -5
- package/src/containers/StorageGroupPage/StorageGroupPage.tsx +4 -2
- package/src/containers/Tenant/Diagnostics/Describe/Describe.tsx +39 -24
- package/src/containers/Tenant/Diagnostics/Overview/DatabaseInfo/DatabaseDatacenters.tsx +19 -0
- package/src/containers/Tenant/Diagnostics/Overview/DatabaseInfo/DatabaseInfo.tsx +19 -4
- package/src/containers/Tenant/Diagnostics/Overview/DatabaseInfo/i18n/en.json +1 -0
- package/src/containers/Tenant/Diagnostics/Overview/DatabaseInfo/utils.ts +28 -0
- package/src/containers/Tenant/Query/QueryEditor/hooks/useEditorOptions.ts +3 -1
- package/src/containers/Tenant/utils/schemaQueryTemplates.ts +1 -6
- package/src/containers/Tenants/TenantsTable.tsx +20 -7
- package/src/containers/UserSettings/i18n/en.json +4 -0
- package/src/containers/UserSettings/settings.tsx +16 -1
- package/src/containers/VDiskPage/VDiskStorageDetails.tsx +22 -3
- package/src/lib.ts +2 -0
- package/src/services/api/viewer.ts +5 -1
- package/src/store/datacenterQueryContext.ts +16 -0
- package/src/store/reducers/cluster/cluster.ts +12 -6
- package/src/store/reducers/cluster/parseFields.ts +1 -0
- package/src/store/reducers/datacenters.ts +139 -0
- package/src/store/reducers/index.ts +2 -0
- package/src/store/reducers/nodes/nodes.ts +4 -2
- package/src/store/reducers/nodesList.ts +25 -6
- package/src/store/reducers/pdisk/pdisk.ts +3 -1
- package/src/store/reducers/pdisk/types.ts +1 -0
- package/src/store/reducers/pdisk/utils.ts +1 -0
- package/src/store/reducers/settings/constants.ts +2 -0
- package/src/store/reducers/storage/storage.ts +4 -2
- package/src/store/reducers/storage/types.ts +2 -1
- package/src/store/reducers/storage/utils.ts +2 -0
- package/src/store/reducers/tenant/tenant.ts +4 -1
- package/src/store/reducers/tenants/types.ts +2 -0
- package/src/store/reducers/tenants/utils.ts +3 -0
- package/src/store/reducers/vdisk/types.ts +1 -0
- package/src/store/reducers/vdisk/utils.ts +2 -0
- package/src/store/reducers/vdisk/vdisk.ts +4 -2
- package/src/styles/datacenters.scss +247 -0
- package/src/types/api/meta.ts +1 -0
- package/src/types/api/storage.ts +14 -0
- package/src/types/store/nodesList.ts +2 -0
- package/src/uiFactory/types.ts +9 -0
- package/src/utils/databaseId.ts +27 -0
- package/src/utils/datacenters.ts +99 -0
- package/src/utils/disks/diskInfo/getDiskLocationItems.ts +3 -0
- package/src/utils/disks/diskInfo/i18n/en.json +1 -0
- package/src/utils/disks/displayState.ts +4 -0
- package/src/utils/disks/groupBy.ts +1 -0
- package/src/utils/hooks/useDatacenterColorIndexes.ts +11 -0
- package/src/utils/hooks/useDatacenterNodesFetcher.ts +22 -0
- package/src/utils/hooks/useDebouncedValue.ts +16 -0
- package/src/utils/hooks/useNodeMetadata.ts +4 -5
- package/src/utils/hooks/useNodesListQueryArgs.ts +78 -0
- package/src/utils/hooks/useNodesMap.ts +9 -0
- package/src/utils/nodes.ts +10 -0
- package/dist/containers/Nodes/useDebouncedSearch.d.ts +0 -2
- package/dist/containers/Nodes/useDebouncedSearch.js +0 -11
- package/dist/containers/Nodes/useDebouncedSearch.js.map +0 -1
- package/src/containers/Nodes/useDebouncedSearch.ts +0 -13
|
@@ -2,7 +2,16 @@ import React from 'react';
|
|
|
2
2
|
export function useDebouncedValue({ value, onUpdate, debounce = 200, }) {
|
|
3
3
|
const [currentValue, setCurrentValue] = React.useState(value);
|
|
4
4
|
const timer = React.useRef();
|
|
5
|
+
const submittedValue = React.useRef();
|
|
5
6
|
React.useEffect(() => {
|
|
7
|
+
const isAcknowledgement = submittedValue.current === value;
|
|
8
|
+
submittedValue.current = undefined;
|
|
9
|
+
// Preserve a newer pending edit when the parent acknowledges an earlier one.
|
|
10
|
+
if (isAcknowledgement && timer.current !== undefined) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
window.clearTimeout(timer.current);
|
|
14
|
+
timer.current = undefined;
|
|
6
15
|
setCurrentValue((prevValue) => {
|
|
7
16
|
if (prevValue !== value) {
|
|
8
17
|
return value;
|
|
@@ -10,10 +19,13 @@ export function useDebouncedValue({ value, onUpdate, debounce = 200, }) {
|
|
|
10
19
|
return prevValue;
|
|
11
20
|
});
|
|
12
21
|
}, [value]);
|
|
22
|
+
React.useEffect(() => () => window.clearTimeout(timer.current), []);
|
|
13
23
|
const handleUpdate = (newValue) => {
|
|
14
24
|
setCurrentValue(newValue);
|
|
15
25
|
window.clearTimeout(timer.current);
|
|
16
26
|
timer.current = window.setTimeout(() => {
|
|
27
|
+
timer.current = undefined;
|
|
28
|
+
submittedValue.current = newValue;
|
|
17
29
|
onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(newValue);
|
|
18
30
|
}, debounce);
|
|
19
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebouncedValue.js","sourceRoot":"","sources":["../../../src/utils/hooks/useDebouncedValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,iBAAiB,CAAmC,EAChE,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,GAAG,GAKjB;IACG,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAI,KAAK,CAAC,CAAC;IAEjE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,EAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useDebouncedValue.js","sourceRoot":"","sources":["../../../src/utils/hooks/useDebouncedValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,iBAAiB,CAAmC,EAChE,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,GAAG,GAKjB;IACG,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAI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AQ,CAAC,CAAC;IACjB,CAAC,CAAC;IACF,OAAO,CAAC,YAAY,EAAE,YAAY,CAAU,CAAC;AACjD,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { isNil } from 'lodash';
|
|
2
|
-
import {
|
|
3
|
-
import { useTypedSelector } from '../hooks';
|
|
4
|
-
import { useDatabaseFromQuery } from './useDatabaseFromQuery';
|
|
2
|
+
import { useNodesMap } from './useNodesMap';
|
|
5
3
|
export function useNodeMetadata(nodeId, parentNodeData) {
|
|
6
|
-
const
|
|
7
|
-
const nodesMap = useTypedSelector((state) => selectNodesMap(state, database));
|
|
4
|
+
const nodesMap = useNodesMap();
|
|
8
5
|
const storedNodeData = isNil(nodeId) ? undefined : nodesMap === null || nodesMap === void 0 ? void 0 : nodesMap.get(nodeId);
|
|
9
6
|
return {
|
|
10
7
|
Host: (parentNodeData === null || parentNodeData === void 0 ? void 0 : parentNodeData.Host) || (storedNodeData === null || storedNodeData === void 0 ? void 0 : storedNodeData.Host),
|
|
11
8
|
DC: (parentNodeData === null || parentNodeData === void 0 ? void 0 : parentNodeData.DC) || (storedNodeData === null || storedNodeData === void 0 ? void 0 : storedNodeData.DC),
|
|
9
|
+
DCKey: (parentNodeData === null || parentNodeData === void 0 ? void 0 : parentNodeData.DCKey) || (storedNodeData === null || storedNodeData === void 0 ? void 0 : storedNodeData.DCKey),
|
|
12
10
|
Rack: (parentNodeData === null || parentNodeData === void 0 ? void 0 : parentNodeData.Rack) || (storedNodeData === null || storedNodeData === void 0 ? void 0 : storedNodeData.Rack),
|
|
11
|
+
PileName: (parentNodeData === null || parentNodeData === void 0 ? void 0 : parentNodeData.PileName) || (storedNodeData === null || storedNodeData === void 0 ? void 0 : storedNodeData.PileName),
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
14
|
//# sourceMappingURL=useNodeMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNodeMetadata.js","sourceRoot":"","sources":["../../../src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
|
+
import { matchPath, useLocation } from 'react-router-dom';
|
|
2
|
+
import { StringParam, useQueryParams } from 'use-query-params';
|
|
3
|
+
import routes from '../../routes';
|
|
4
|
+
import { authenticationApi } from '../../store/reducers/authentication/authentication';
|
|
5
|
+
import { SETTING_KEYS } from '../../store/reducers/settings/constants';
|
|
6
|
+
import { getSettingValue } from '../../store/reducers/settings/settings';
|
|
7
|
+
import { TENANT_DIAGNOSTICS_TABS_IDS, TENANT_PAGES_IDS } from '../../store/reducers/tenant/constants';
|
|
8
|
+
import { tenantPageSchema } from '../../store/reducers/tenant/types';
|
|
9
|
+
import { useDatabaseFromQuery } from './useDatabaseFromQuery';
|
|
10
|
+
import { useTypedSelector } from './useTypedSelector';
|
|
11
|
+
function isStoragePage(pathname, page, diagnosticsTab) {
|
|
12
|
+
if (matchPath(pathname, { path: routes.storageGroup, exact: true })) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return (Boolean(matchPath(pathname, { path: routes.database, exact: true })) &&
|
|
16
|
+
page !== TENANT_PAGES_IDS.query &&
|
|
17
|
+
diagnosticsTab === TENANT_DIAGNOSTICS_TABS_IDS.storage);
|
|
18
|
+
}
|
|
19
|
+
function isClusterStoragePage(pathname) {
|
|
20
|
+
const match = matchPath(pathname, { path: routes.cluster, exact: true });
|
|
21
|
+
return (match === null || match === void 0 ? void 0 : match.params.activeTab) === 'storage';
|
|
22
|
+
}
|
|
23
|
+
function isNodeStoragePage(pathname) {
|
|
24
|
+
const match = matchPath(pathname, { path: routes.node, exact: true });
|
|
25
|
+
// The old "structure" route is redirected to Storage by the Node page.
|
|
26
|
+
return (match === null || match === void 0 ? void 0 : match.params.activeTab) === 'storage' || (match === null || match === void 0 ? void 0 : match.params.activeTab) === 'structure';
|
|
27
|
+
}
|
|
28
|
+
function isDiskStoragePage(pathname, activeTab) {
|
|
29
|
+
if (matchPath(pathname, { path: routes.pDisk, exact: true })) {
|
|
30
|
+
return activeTab === 'storage';
|
|
31
|
+
}
|
|
32
|
+
// Storage is the default (and the invalid-value fallback) on the VDisk page.
|
|
33
|
+
return (Boolean(matchPath(pathname, { path: routes.vDisk, exact: true })) && activeTab !== 'tablets');
|
|
34
|
+
}
|
|
35
|
+
export function useIsStoragePage() {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
const { pathname } = useLocation();
|
|
38
|
+
const [query] = useQueryParams({
|
|
39
|
+
databasePage: StringParam,
|
|
40
|
+
tenantPage: StringParam,
|
|
41
|
+
diagnosticsTab: StringParam,
|
|
42
|
+
activeTab: StringParam,
|
|
43
|
+
});
|
|
44
|
+
const initialPage = useTypedSelector((state) => getSettingValue(state, SETTING_KEYS.TENANT_INITIAL_PAGE));
|
|
45
|
+
const diagnosticsTab = useTypedSelector((state) => state.tenant.diagnosticsTab);
|
|
46
|
+
const defaultPage = tenantPageSchema.catch(TENANT_PAGES_IDS.query).parse(initialPage);
|
|
47
|
+
const page = tenantPageSchema.catch(defaultPage).parse((_a = query.databasePage) !== null && _a !== void 0 ? _a : query.tenantPage);
|
|
48
|
+
return (isStoragePage(pathname, page, (_b = query.diagnosticsTab) !== null && _b !== void 0 ? _b : diagnosticsTab) ||
|
|
49
|
+
isClusterStoragePage(pathname) ||
|
|
50
|
+
isNodeStoragePage(pathname) ||
|
|
51
|
+
isDiskStoragePage(pathname, query.activeTab));
|
|
52
|
+
}
|
|
53
|
+
export function useNodesListQueryArgs() {
|
|
54
|
+
const database = useDatabaseFromQuery();
|
|
55
|
+
const storagePage = useIsStoragePage();
|
|
56
|
+
const { currentData: permissions } = authenticationApi.endpoints.whoami.useQueryState({ database });
|
|
57
|
+
return {
|
|
58
|
+
database,
|
|
59
|
+
include_storage: (storagePage && (permissions === null || permissions === void 0 ? void 0 : permissions.IsViewerAllowed) === true) || undefined,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=useNodesListQueryArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNodesListQueryArgs.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CAC3D,CAAC;IACF,MAAM,cAAc,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAChF,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACtF,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,MAAA,KAAK,CAAC,YAAY,mCAAI,KAAK,CAAC,UAAU,CAAC,CAAC;IAC/F,OAAO,CACH,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAA,KAAK,CAAC,cAAc,mCAAI,cAAc,CAAC;QACrE,oBAAoB,CAAC,QAAQ,CAAC;QAC9B,iBAAiB,CAAC,QAAQ,CAAC;QAC3B,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAC/C,CAAC;AACN,CAAC;AAED,MAAM,UAAU,qBAAqB;IACjC,MAAM,QAAQ,GAAG,oBAAoB,EAAE,CAAC;IACxC,MAAM,WAAW,GAAG,gBAAgB,EAAE,CAAC;IACvC,MAAM,EAAC,WAAW,EAAE,WAAW,EAAC,GAAG,iBAAiB,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,EAAC,QAAQ,EAAC,CAAC,CAAC;IAEhG,OAAO;QACH,QAAQ;QACR,eAAe,EAAE,CAAC,WAAW,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,MAAK,IAAI,CAAC,IAAI,SAAS;KACvF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useNodesMap(): import("../../types/store/nodesList").NodesMap | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { selectNodesMap } from '../../store/reducers/nodesList';
|
|
2
|
+
import { useNodesListQueryArgs } from './useNodesListQueryArgs';
|
|
3
|
+
import { useTypedSelector } from './useTypedSelector';
|
|
4
|
+
export function useNodesMap() {
|
|
5
|
+
const { database, include_storage: includeStorage } = useNodesListQueryArgs();
|
|
6
|
+
return useTypedSelector((state) => selectNodesMap(state, database, includeStorage));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=useNodesMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNodesMap.js","sourceRoot":"","sources":["../../../src/utils/hooks/useNodesMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAEpD,MAAM,UAAU,WAAW;IACvB,MAAM,EAAC,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAC,GAAG,qBAAqB,EAAE,CAAC;IAC5E,OAAO,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;AACxF,CAAC"}
|
package/dist/utils/nodes.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare function calculateLoadAveragePercents(node?: TSystemStateInfo): n
|
|
|
17
17
|
export interface PreparedNodeSystemState extends TSystemStateInfo {
|
|
18
18
|
Rack?: string;
|
|
19
19
|
DC?: string;
|
|
20
|
+
DCKey?: string;
|
|
20
21
|
LoadAveragePercents?: number[];
|
|
21
22
|
TenantName?: string;
|
|
22
23
|
SharedCacheLimit?: number;
|
package/dist/utils/nodes.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { EFlag } from '../types/api/enums';
|
|
3
3
|
import { HOUR_IN_SECONDS } from './constants';
|
|
4
|
+
import { getDatacenterKey } from './datacenters';
|
|
4
5
|
import { valueIsDefined } from '.';
|
|
5
6
|
export var NodesUptimeFilterValues;
|
|
6
7
|
(function (NodesUptimeFilterValues) {
|
|
@@ -15,6 +16,11 @@ export const NodesUptimeFilterTitles = {
|
|
|
15
16
|
[NodesUptimeFilterValues.SmallUptime]: 'Uptime < 1h',
|
|
16
17
|
};
|
|
17
18
|
export const isUnavailableNode = (node) => !node.SystemState || node.SystemState === EFlag.Grey;
|
|
19
|
+
function getNodePileName(node) {
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
|
+
const legacyLocation = ((_a = node.PhysicalLocation) === null || _a === void 0 ? void 0 : _a.Location) || ((_b = node.PhysicalLocation) === null || _b === void 0 ? void 0 : _b.DataCenterId);
|
|
22
|
+
return ((_c = node.Location) === null || _c === void 0 ? void 0 : _c.BridgePileName) || ((_d = legacyLocation === null || legacyLocation === void 0 ? void 0 : legacyLocation.match(/(?:^|\/)P=([^/]+)/)) === null || _d === void 0 ? void 0 : _d[1]);
|
|
23
|
+
}
|
|
18
24
|
export const prepareNodesMap = (nodesList) => {
|
|
19
25
|
return nodesList === null || nodesList === void 0 ? void 0 : nodesList.reduce((nodeHosts, node) => {
|
|
20
26
|
var _a, _b, _c, _d;
|
|
@@ -25,7 +31,9 @@ export const prepareNodesMap = (nodesList) => {
|
|
|
25
31
|
nodeHosts.set(node.Id, {
|
|
26
32
|
Host: node.Host,
|
|
27
33
|
DC: ((_d = node.Location) === null || _d === void 0 ? void 0 : _d.DataCenter) || (physicalLocation === null || physicalLocation === void 0 ? void 0 : physicalLocation.DataCenterId),
|
|
34
|
+
DCKey: getDatacenterKey(node.Location, physicalLocation === null || physicalLocation === void 0 ? void 0 : physicalLocation.DataCenterId),
|
|
28
35
|
Rack,
|
|
36
|
+
PileName: getNodePileName(node),
|
|
29
37
|
});
|
|
30
38
|
}
|
|
31
39
|
return nodeHosts;
|
|
@@ -57,6 +65,7 @@ export function prepareNodeSystemState(systemState = {}) {
|
|
|
57
65
|
...systemState,
|
|
58
66
|
Rack,
|
|
59
67
|
DC,
|
|
68
|
+
DCKey: getDatacenterKey(systemState.Location, systemState.DataCenter),
|
|
60
69
|
LoadAveragePercents,
|
|
61
70
|
TenantName,
|
|
62
71
|
SharedCacheLimit,
|
package/dist/utils/nodes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../src/utils/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAKzC,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../src/utils/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAKzC,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAC,cAAc,EAAC,MAAM,GAAG,CAAC;AAEjC,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IAC/B,sCAAa,CAAA;IACb,sDAA6B,CAAA;AACjC,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KACzC,UAAU,CAAC,uBAAuB,CAAC;KACnC,KAAK,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;AAExC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,KAAK;IACpC,CAAC,uBAAuB,CAAC,WAAW,CAAC,EAAE,aAAa;CACvD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAG7B,IAAO,EACT,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW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,gBAAgB,0CAAE,SAAS,CAAC;QAC3E,CAAC,CAAC,MAAM,CAAC,MAAA,WAAW,CAAC,gBAAgB,0CAAE,SAAS,CAAC;QACjD,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO;QACH,GAAG,WAAW;QACd,IAAI;QACJ,EAAE;QACF,KAAK,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC;QACrE,mBAAmB;QACnB,UAAU;QACV,gBAAgB;QAChB,eAAe;KAClB,CAAC;AACN,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,iBAAsD,EAAE,EAAE;IAC1F,OAAO,iBAAiB,KAAK,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;AACnG,CAAC,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAoC,IAAQ;;IAC1E,OAAO,OAAO,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAoC,IAAQ;IACzE,OAAO,OAAO,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/utils/query.d.ts
CHANGED
|
@@ -101,9 +101,9 @@ export declare const tracingLevelSchema: z.ZodEnum<{
|
|
|
101
101
|
readonly trace: "trace";
|
|
102
102
|
}>;
|
|
103
103
|
export declare const querySettingsValidationSchema: z.ZodObject<{
|
|
104
|
-
timeout: z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<string | number
|
|
105
|
-
limitRows: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<string | number
|
|
106
|
-
outputChunkMaxSize: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<string | number
|
|
104
|
+
timeout: z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<string | number>>>, unknown>;
|
|
105
|
+
limitRows: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<string | number>>, unknown>;
|
|
106
|
+
outputChunkMaxSize: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<string | number>>, unknown>;
|
|
107
107
|
queryMode: z.ZodEnum<{
|
|
108
108
|
readonly scan: "scan";
|
|
109
109
|
readonly script: "script";
|
|
@@ -136,9 +136,9 @@ export declare const querySettingsValidationSchema: z.ZodObject<{
|
|
|
136
136
|
resourcePool: z.ZodString;
|
|
137
137
|
}, z.core.$strip>;
|
|
138
138
|
export declare const querySettingsRestoreSchema: z.ZodCatch<z.ZodObject<{
|
|
139
|
-
timeout: z.ZodCatch<z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedNumber<string | number>, z.ZodTransform<number, number
|
|
140
|
-
limitRows: z.ZodCatch<z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<string | number
|
|
141
|
-
outputChunkMaxSize: z.ZodCatch<z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<string | number
|
|
139
|
+
timeout: z.ZodCatch<z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedNumber<string | number>, z.ZodTransform<number, number>>>>, unknown>>;
|
|
140
|
+
limitRows: z.ZodCatch<z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<string | number>>, unknown>>;
|
|
141
|
+
outputChunkMaxSize: z.ZodCatch<z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<string | number>>, unknown>>;
|
|
142
142
|
queryMode: z.ZodCatch<z.ZodEnum<{
|
|
143
143
|
readonly scan: "scan";
|
|
144
144
|
readonly script: "script";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const emptyStringToUndefined: (val: unknown) => unknown;
|
|
3
|
-
export declare const preprocessEmptyStringToUndefined: <T extends z.ZodTypeAny>(schema: T) => z.ZodPreprocess<T>;
|
|
3
|
+
export declare const preprocessEmptyStringToUndefined: <T extends z.ZodTypeAny>(schema: T) => z.ZodPreprocess<T, unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ydb-embedded-ui",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.8.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"numeral": "^2.0.6",
|
|
51
51
|
"path-to-regexp": "^3.3.0",
|
|
52
52
|
"qrcode": "^1.5.4",
|
|
53
|
-
"qs": "^6.16.
|
|
53
|
+
"qs": "^6.16.1",
|
|
54
54
|
"react-error-boundary": "^4.1.2",
|
|
55
55
|
"react-helmet-async": "^2.0.5",
|
|
56
56
|
"react-hook-form": "^7.55.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"uuid": "^14.0.0",
|
|
67
67
|
"web-vitals": "^1.1.2",
|
|
68
68
|
"ydb-ui-components": "^6.1.0",
|
|
69
|
-
"zod": "^4.
|
|
69
|
+
"zod": "^4.6.6"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {CircleQuestionFill} from '@gravity-ui/icons';
|
|
2
|
+
import type {LabelProps} from '@gravity-ui/uikit';
|
|
3
|
+
import {Icon, Label} from '@gravity-ui/uikit';
|
|
4
|
+
|
|
5
|
+
import {cn} from '../../utils/cn';
|
|
6
|
+
import {
|
|
7
|
+
getDatacenterColor,
|
|
8
|
+
getDatacenterColorVariant,
|
|
9
|
+
normalizeDatacenter,
|
|
10
|
+
} from '../../utils/datacenters';
|
|
11
|
+
import {useDatacenterColorIndexes} from '../../utils/hooks/useDatacenterColorIndexes';
|
|
12
|
+
|
|
13
|
+
import i18n from './i18n';
|
|
14
|
+
|
|
15
|
+
import './DatacenterLabel.scss';
|
|
16
|
+
import './datacenterColors.scss';
|
|
17
|
+
|
|
18
|
+
const b = cn('ydb-datacenter-label');
|
|
19
|
+
const colors = cn('ydb-datacenter-color');
|
|
20
|
+
|
|
21
|
+
export function DatacenterLabel({
|
|
22
|
+
name,
|
|
23
|
+
colorKey = name,
|
|
24
|
+
count,
|
|
25
|
+
size = 'xs',
|
|
26
|
+
}: {
|
|
27
|
+
name?: string;
|
|
28
|
+
colorKey?: string;
|
|
29
|
+
count?: number;
|
|
30
|
+
size?: LabelProps['size'];
|
|
31
|
+
}) {
|
|
32
|
+
const indexes = useDatacenterColorIndexes();
|
|
33
|
+
const normalized = normalizeDatacenter(name);
|
|
34
|
+
const key = normalized ? colorKey : undefined;
|
|
35
|
+
const text = normalized || i18n('value_unknown');
|
|
36
|
+
const value = count === undefined ? undefined : i18n('value_nodes', {count});
|
|
37
|
+
return (
|
|
38
|
+
<Label
|
|
39
|
+
size={size}
|
|
40
|
+
theme="unknown"
|
|
41
|
+
className={b(
|
|
42
|
+
null,
|
|
43
|
+
colors({
|
|
44
|
+
color: getDatacenterColor(key, indexes),
|
|
45
|
+
variant: getDatacenterColorVariant(key, indexes),
|
|
46
|
+
}),
|
|
47
|
+
)}
|
|
48
|
+
icon={normalized ? undefined : <Icon data={CircleQuestionFill} size={10} />}
|
|
49
|
+
value={value}
|
|
50
|
+
>
|
|
51
|
+
{text}
|
|
52
|
+
</Label>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@use '../../styles/datacenters';
|
|
2
|
+
|
|
3
|
+
.ydb-datacenter-color {
|
|
4
|
+
--ydb-dc-background: var(--g-color-base-neutral-medium);
|
|
5
|
+
--ydb-dc-text: var(--g-color-base-neutral-heavy);
|
|
6
|
+
--ydb-dc-outline: transparent;
|
|
7
|
+
--ydb-dc-hover: var(--g-color-base-neutral-medium-hover);
|
|
8
|
+
--ydb-dc-hover-text: var(--ydb-dc-text);
|
|
9
|
+
|
|
10
|
+
@each $family in 'turquoise', 'purple', 'blue', 'orange', 'red', 'pink', 'sky', 'brown',
|
|
11
|
+
'green', 'yellow', 'sage', 'slate'
|
|
12
|
+
{
|
|
13
|
+
&_color_#{$family} {
|
|
14
|
+
--ydb-dc-background: var(--ydb-dc-#{$family}-base);
|
|
15
|
+
--ydb-dc-text: var(--ydb-dc-#{$family}-text);
|
|
16
|
+
--ydb-dc-hover: var(--ydb-dc-#{$family}-base-hover);
|
|
17
|
+
|
|
18
|
+
@each $variant in 'outline', 'filled-outline' {
|
|
19
|
+
&.ydb-datacenter-color_variant_#{$variant} {
|
|
20
|
+
--ydb-dc-background: var(--ydb-dc-#{$family}-#{$variant}-base);
|
|
21
|
+
--ydb-dc-outline: var(--ydb-dc-#{$family}-#{$variant}-stroke);
|
|
22
|
+
--ydb-dc-hover: var(--ydb-dc-#{$family}-#{$variant}-base-hover);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -6,6 +6,7 @@ import {isNil} from 'lodash';
|
|
|
6
6
|
import {cn} from '../../utils/cn';
|
|
7
7
|
import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
|
|
8
8
|
import type {DiskDetailItem} from '../../utils/disks/diskInfo/getDiskLocationItems';
|
|
9
|
+
import {DatacenterLabel} from '../Datacenter/DatacenterLabel';
|
|
9
10
|
import {DiskTypeLabel} from '../DiskStatus/DiskStatus';
|
|
10
11
|
import {YDBDefinitionList} from '../YDBDefinitionList/YDBDefinitionList';
|
|
11
12
|
|
|
@@ -81,9 +82,11 @@ export function DiskPopupHeader({
|
|
|
81
82
|
export function DiskPopupText({
|
|
82
83
|
value,
|
|
83
84
|
withLeftTrim = false,
|
|
85
|
+
children,
|
|
84
86
|
}: {
|
|
85
87
|
value?: string | number;
|
|
86
88
|
withLeftTrim?: boolean;
|
|
89
|
+
children?: React.ReactNode;
|
|
87
90
|
}) {
|
|
88
91
|
const hasValue = !isNil(value) && value !== '';
|
|
89
92
|
const text = hasValue ? value : EMPTY_DATA_PLACEHOLDER;
|
|
@@ -93,18 +96,37 @@ export function DiskPopupText({
|
|
|
93
96
|
className={b('text', {'with-left-trim': withLeftTrim})}
|
|
94
97
|
tabIndex={hasValue ? 0 : undefined}
|
|
95
98
|
>
|
|
96
|
-
{withLeftTrim ? <span>{text}</span> : text}
|
|
99
|
+
{children ?? (withLeftTrim ? <span>{text}</span> : text)}
|
|
97
100
|
</span>
|
|
98
101
|
</Tooltip>
|
|
99
102
|
);
|
|
100
103
|
}
|
|
101
104
|
|
|
102
|
-
export function DiskPopupLocation({
|
|
105
|
+
export function DiskPopupLocation({
|
|
106
|
+
items,
|
|
107
|
+
datacenterColorKey,
|
|
108
|
+
}: {
|
|
109
|
+
items: DiskDetailItem[];
|
|
110
|
+
datacenterColorKey?: string;
|
|
111
|
+
}) {
|
|
103
112
|
if (!items.length) {
|
|
104
113
|
return null;
|
|
105
114
|
}
|
|
106
115
|
const locationItems = items.map((item) => {
|
|
107
|
-
if (
|
|
116
|
+
if (item.id === 'datacenter') {
|
|
117
|
+
const name = item.copyText === undefined ? undefined : String(item.copyText);
|
|
118
|
+
return {
|
|
119
|
+
...item,
|
|
120
|
+
content: (
|
|
121
|
+
<DiskPopupText value={name}>
|
|
122
|
+
{name ? (
|
|
123
|
+
<DatacenterLabel name={name} colorKey={datacenterColorKey} size="xxs" />
|
|
124
|
+
) : undefined}
|
|
125
|
+
</DiskPopupText>
|
|
126
|
+
),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (['fqdn', 'rack'].includes(item.id)) {
|
|
108
130
|
return {...item, content: <DiskPopupText value={item.copyText} />};
|
|
109
131
|
}
|
|
110
132
|
if (item.id === 'pdisk-path' && typeof item.copyText === 'string') {
|
|
@@ -684,3 +684,32 @@
|
|
|
684
684
|
color: var(--ydb-progress-bar-font-color, var(--entity-state-border-color));
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
+
|
|
688
|
+
.storage-disk-progress-bar_mode-datacenter {
|
|
689
|
+
gap: 2px;
|
|
690
|
+
|
|
691
|
+
box-sizing: border-box;
|
|
692
|
+
padding-inline: 4px 0;
|
|
693
|
+
|
|
694
|
+
color: var(--ydb-dc-text);
|
|
695
|
+
border: none;
|
|
696
|
+
border-radius: 6px;
|
|
697
|
+
background: var(--ydb-dc-background);
|
|
698
|
+
box-shadow: inset 0 0 0 1px var(--ydb-dc-outline);
|
|
699
|
+
|
|
700
|
+
&.storage-disk-progress-bar_highlighted,
|
|
701
|
+
&:hover {
|
|
702
|
+
color: var(--ydb-dc-hover-text);
|
|
703
|
+
background: var(--ydb-dc-hover);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.storage-disk-progress-bar__datacenter-name {
|
|
707
|
+
overflow: hidden;
|
|
708
|
+
|
|
709
|
+
min-width: 0;
|
|
710
|
+
|
|
711
|
+
font-size: var(--g-text-caption-2-font-size);
|
|
712
|
+
line-height: var(--g-text-caption-2-line-height);
|
|
713
|
+
white-space: nowrap;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {CircleQuestionFill} from '@gravity-ui/icons';
|
|
4
|
+
import {Flex, Icon} from '@gravity-ui/uikit';
|
|
4
5
|
|
|
5
6
|
import {SETTING_KEYS} from '../../store/reducers/settings/constants';
|
|
6
7
|
import {cn} from '../../utils/cn';
|
|
7
|
-
import type {DiskDisplayMode} from '../../utils/disks/displayState';
|
|
8
|
+
import type {BaseDiskDisplayState, DiskDisplayMode} from '../../utils/disks/displayState';
|
|
8
9
|
import type {DiskBarTone} from '../../utils/disks/types';
|
|
9
10
|
import {useSetting} from '../../utils/hooks';
|
|
10
11
|
import {isNumeric} from '../../utils/utils';
|
|
12
|
+
import datacenterI18n from '../Datacenter/i18n';
|
|
11
13
|
|
|
12
14
|
import './DiskStateProgressBar.scss';
|
|
15
|
+
import '../Datacenter/datacenterColors.scss';
|
|
13
16
|
|
|
14
17
|
const b = cn('storage-disk-progress-bar');
|
|
15
18
|
|
|
@@ -17,6 +20,7 @@ interface DiskStateProgressBarProps {
|
|
|
17
20
|
allocation?: number;
|
|
18
21
|
tone: DiskBarTone;
|
|
19
22
|
mode?: DiskDisplayMode;
|
|
23
|
+
datacenter?: BaseDiskDisplayState['datacenter'];
|
|
20
24
|
compact?: boolean;
|
|
21
25
|
faded?: boolean;
|
|
22
26
|
inactive?: boolean;
|
|
@@ -37,10 +41,39 @@ function getToneModifier(tone: DiskBarTone) {
|
|
|
37
41
|
return tone === 'LightGrey' ? 'light-grey' : tone.toLowerCase();
|
|
38
42
|
}
|
|
39
43
|
|
|
44
|
+
function DatacenterDiskBar({
|
|
45
|
+
datacenter,
|
|
46
|
+
className,
|
|
47
|
+
}: Pick<DiskStateProgressBarProps, 'datacenter' | 'className'>) {
|
|
48
|
+
const name = datacenter?.name || datacenterI18n('value_unknown');
|
|
49
|
+
const colorClass = cn('ydb-datacenter-color')({
|
|
50
|
+
color: datacenter?.color || 'neutral',
|
|
51
|
+
variant: datacenter?.variant,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Flex
|
|
56
|
+
alignItems="center"
|
|
57
|
+
justifyContent="flex-start"
|
|
58
|
+
className={[className, colorClass].filter(Boolean).join(' ')}
|
|
59
|
+
role="img"
|
|
60
|
+
aria-label={name}
|
|
61
|
+
title={name}
|
|
62
|
+
>
|
|
63
|
+
{datacenter?.name ? (
|
|
64
|
+
<span className={b('datacenter-name')}>{name}</span>
|
|
65
|
+
) : (
|
|
66
|
+
<Icon data={CircleQuestionFill} size={10} />
|
|
67
|
+
)}
|
|
68
|
+
</Flex>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
40
72
|
export function DiskStateProgressBar({
|
|
41
73
|
allocation,
|
|
42
74
|
tone,
|
|
43
75
|
mode,
|
|
76
|
+
datacenter,
|
|
44
77
|
compact,
|
|
45
78
|
faded,
|
|
46
79
|
inactive,
|
|
@@ -70,7 +103,7 @@ export function DiskStateProgressBar({
|
|
|
70
103
|
borderless,
|
|
71
104
|
'all-mode-has-issues': mode === 'all' && strongFill,
|
|
72
105
|
'overlap-icon-at-top-left': overflowVisible,
|
|
73
|
-
[getToneModifier(tone)]:
|
|
106
|
+
[getToneModifier(tone)]: mode !== 'datacenter',
|
|
74
107
|
};
|
|
75
108
|
|
|
76
109
|
if (mode) {
|
|
@@ -78,6 +111,10 @@ export function DiskStateProgressBar({
|
|
|
78
111
|
mods['expert-mode'] = true;
|
|
79
112
|
}
|
|
80
113
|
|
|
114
|
+
if (mode === 'datacenter') {
|
|
115
|
+
return <DatacenterDiskBar datacenter={datacenter} className={b(mods, className)} />;
|
|
116
|
+
}
|
|
117
|
+
|
|
81
118
|
const hasAllocation = isNumeric(allocation) && allocation >= 0;
|
|
82
119
|
|
|
83
120
|
let allocationElement: React.ReactNode = null;
|
|
@@ -109,7 +109,7 @@ export function PDiskPopupContent({data, nodeData: parentNodeData}: PDiskPopupPr
|
|
|
109
109
|
label ? <DiskStatusLabel key={id} {...label} size="xs" /> : null,
|
|
110
110
|
)}
|
|
111
111
|
/>
|
|
112
|
-
<DiskPopupLocation items={locationItems} />
|
|
112
|
+
<DiskPopupLocation items={locationItems} datacenterColorKey={nodeData.DCKey} />
|
|
113
113
|
<YDBDefinitionList items={getPDiskRuntimeItems(data)} nameMaxWidth={150} />
|
|
114
114
|
{storageItems.length > 0 && (
|
|
115
115
|
<React.Fragment>
|
|
@@ -61,7 +61,9 @@ export function TenantNameWrapper({
|
|
|
61
61
|
tenant,
|
|
62
62
|
additionalTenantsProps,
|
|
63
63
|
externalLink,
|
|
64
|
-
useDatabaseId: uiFactory.useDatabaseId
|
|
64
|
+
useDatabaseId: uiFactory.useDatabaseId,
|
|
65
|
+
isMetaDatabasesAvailable: emMetaAvailable,
|
|
66
|
+
settings,
|
|
65
67
|
});
|
|
66
68
|
const useMetaProxy = uiFactory.useMetaProxy && settings?.use_meta_proxy !== false;
|
|
67
69
|
|