ydb-embedded-ui 22.7.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/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/Node/NodePages.d.ts +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 +8 -1
- package/dist/containers/Nodes/PaginatedNodes/GroupedNodesComponent.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/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 +8 -4
- package/dist/store/reducers/cluster/cluster.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/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/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/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/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/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/Nodes/NodesTable.tsx +3 -1
- package/src/containers/Nodes/PaginatedNodes/GroupedNodesComponent.tsx +18 -2
- 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/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 +8 -4
- 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/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/storage.ts +14 -0
- package/src/types/store/nodesList.ts +2 -0
- package/src/uiFactory/types.ts +9 -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/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
|
@@ -3,30 +3,45 @@ import React from 'react';
|
|
|
3
3
|
import {Alert, Card, Flex, Text} from '@gravity-ui/uikit';
|
|
4
4
|
|
|
5
5
|
import {SegmentedProgress} from '../../../../../components/SegmentedProgress/SegmentedProgress';
|
|
6
|
+
import {selectNodesMap} from '../../../../../store/reducers/nodesList';
|
|
6
7
|
import {useTenantBaseInfo} from '../../../../../store/reducers/tenant/tenant';
|
|
7
8
|
import type {TEvDescribeSchemeResult} from '../../../../../types/api/schema';
|
|
8
9
|
import {cn} from '../../../../../utils/cn';
|
|
9
10
|
import {formatNumber} from '../../../../../utils/dataFormatters/dataFormatters';
|
|
11
|
+
import {useTypedSelector} from '../../../../../utils/hooks/useTypedSelector';
|
|
10
12
|
import {SchemaObjectInfo} from '../SchemaObjectInfo';
|
|
11
13
|
|
|
14
|
+
import {DatabaseDatacenters} from './DatabaseDatacenters';
|
|
12
15
|
import {dbInfoKeyset} from './i18n';
|
|
13
|
-
import {prepareAdditionalDatabaseInfoItems} from './utils';
|
|
16
|
+
import {countDatacenterNodes, prepareAdditionalDatabaseInfoItems} from './utils';
|
|
14
17
|
|
|
15
18
|
import './DatabaseInfo.scss';
|
|
16
19
|
|
|
17
20
|
const b = cn('ydb-diagnostics-database-info');
|
|
18
21
|
|
|
19
|
-
interface DBInfoProps {
|
|
22
|
+
export interface DBInfoProps {
|
|
20
23
|
data?: TEvDescribeSchemeResult;
|
|
21
24
|
path: string;
|
|
22
25
|
database: string;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export function DatabaseInfo({data, path, database}: DBInfoProps) {
|
|
29
|
+
const nodes = useTypedSelector((state) => selectNodesMap(state, database));
|
|
30
|
+
const datacenters = React.useMemo(() => countDatacenterNodes(nodes?.values() ?? []), [nodes]);
|
|
26
31
|
const {databaseData} = useTenantBaseInfo(database);
|
|
27
32
|
const additionalItems = React.useMemo(
|
|
28
|
-
() =>
|
|
29
|
-
|
|
33
|
+
() => [
|
|
34
|
+
...(databaseData && databaseData.Type !== 'Serverless'
|
|
35
|
+
? [
|
|
36
|
+
{
|
|
37
|
+
name: dbInfoKeyset('field_datacenters'),
|
|
38
|
+
content: <DatabaseDatacenters datacenters={datacenters} />,
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
: []),
|
|
42
|
+
...(prepareAdditionalDatabaseInfoItems(databaseData) ?? []),
|
|
43
|
+
],
|
|
44
|
+
[databaseData, datacenters],
|
|
30
45
|
);
|
|
31
46
|
|
|
32
47
|
const {PathsInside, PathsLimit, ShardsInside, ShardsLimit} =
|
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import type {PreparedTenant} from '../../../../../store/reducers/tenants/types';
|
|
2
2
|
import {uiFactory} from '../../../../../uiFactory/uiFactory';
|
|
3
|
+
import {normalizeDatacenter} from '../../../../../utils/datacenters';
|
|
4
|
+
|
|
5
|
+
export interface DatacenterNodes {
|
|
6
|
+
name?: string;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function countDatacenterNodes(nodes: Iterable<{DCKey?: string}>): DatacenterNodes[] {
|
|
11
|
+
const counts = new Map<string | undefined, number>();
|
|
12
|
+
for (const {DCKey} of nodes) {
|
|
13
|
+
const name = normalizeDatacenter(DCKey);
|
|
14
|
+
counts.set(name, (counts.get(name) ?? 0) + 1);
|
|
15
|
+
}
|
|
16
|
+
return [...counts]
|
|
17
|
+
.sort(([a], [b]) => {
|
|
18
|
+
if (a === b) {
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
if (a === undefined) {
|
|
22
|
+
return 1;
|
|
23
|
+
}
|
|
24
|
+
if (b === undefined) {
|
|
25
|
+
return -1;
|
|
26
|
+
}
|
|
27
|
+
return a < b ? -1 : 1;
|
|
28
|
+
})
|
|
29
|
+
.map(([name, count]) => ({name, count}));
|
|
30
|
+
}
|
|
3
31
|
|
|
4
32
|
export function prepareAdditionalDatabaseInfoItems(databaseData?: PreparedTenant) {
|
|
5
33
|
if (!databaseData) {
|
|
@@ -22,6 +22,7 @@ const EDITOR_OPTIONS: EditorOptions = {
|
|
|
22
22
|
export function useEditorOptions() {
|
|
23
23
|
const [enableAutocomplete] = useSetting(SETTING_KEYS.ENABLE_AUTOCOMPLETE);
|
|
24
24
|
const [autocompleteOnEnter] = useSetting(SETTING_KEYS.AUTOCOMPLETE_ON_ENTER);
|
|
25
|
+
const [wordWrap] = useSetting(SETTING_KEYS.WORD_WRAP);
|
|
25
26
|
const isMultiTabQueryEditorEnabled = useMultiTabQueryEditorEnabled();
|
|
26
27
|
|
|
27
28
|
const options = React.useMemo<EditorOptions>(() => {
|
|
@@ -30,6 +31,7 @@ export function useEditorOptions() {
|
|
|
30
31
|
quickSuggestions: useAutocomplete,
|
|
31
32
|
suggestOnTriggerCharacters: useAutocomplete,
|
|
32
33
|
acceptSuggestionOnEnter: autocompleteOnEnter ? 'on' : 'off',
|
|
34
|
+
wordWrap: wordWrap === 'off' ? 'off' : 'on',
|
|
33
35
|
...EDITOR_OPTIONS,
|
|
34
36
|
};
|
|
35
37
|
|
|
@@ -42,7 +44,7 @@ export function useEditorOptions() {
|
|
|
42
44
|
padding: {top: MULTI_TAB_EDITOR_PADDING_TOP_PX},
|
|
43
45
|
scrollBeyondLastLine: false,
|
|
44
46
|
};
|
|
45
|
-
}, [enableAutocomplete, autocompleteOnEnter, isMultiTabQueryEditorEnabled]);
|
|
47
|
+
}, [enableAutocomplete, autocompleteOnEnter, wordWrap, isMultiTabQueryEditorEnabled]);
|
|
46
48
|
|
|
47
49
|
return options;
|
|
48
50
|
}
|
|
@@ -515,12 +515,7 @@ ADD INDEX \${2:my_vector_index}
|
|
|
515
515
|
GLOBAL USING vector_kmeans_tree
|
|
516
516
|
ON (\${3:embedding})
|
|
517
517
|
WITH (
|
|
518
|
-
distance=cosine
|
|
519
|
-
vector_type="uint8",
|
|
520
|
-
vector_dimension=\${4:512},
|
|
521
|
-
levels=\${5:2},
|
|
522
|
-
clusters=\${6:128},
|
|
523
|
-
overlap_clusters=\${7:3}
|
|
518
|
+
distance=cosine
|
|
524
519
|
);`;
|
|
525
520
|
};
|
|
526
521
|
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"settings.editor.autocomplete-on-enter.title": "Accept suggestion on Enter",
|
|
25
25
|
"settings.editor.autocomplete-on-enter.description": "Controls whether suggestions should be accepted on Enter, in addition to Tab. Helps to avoid ambiguity between inserting new lines or accepting suggestions.",
|
|
26
26
|
|
|
27
|
+
"field_word-wrap": "Word wrap",
|
|
28
|
+
"value_on": "On",
|
|
29
|
+
"value_off": "Off",
|
|
30
|
+
|
|
27
31
|
"settings.theme.title": "Interface theme",
|
|
28
32
|
"settings.theme.option-dark": "Dark",
|
|
29
33
|
"settings.theme.option-light": "Light",
|
|
@@ -200,6 +200,16 @@ export const autocompleteOnEnterSetting: SettingProps = {
|
|
|
200
200
|
description: i18n('settings.editor.autocomplete-on-enter.description'),
|
|
201
201
|
};
|
|
202
202
|
|
|
203
|
+
export const wordWrapSetting: SettingProps = {
|
|
204
|
+
settingKey: SETTING_KEYS.WORD_WRAP,
|
|
205
|
+
title: i18n('field_word-wrap'),
|
|
206
|
+
type: 'radio',
|
|
207
|
+
options: [
|
|
208
|
+
{value: 'on', content: i18n('value_on')},
|
|
209
|
+
{value: 'off', content: i18n('value_off')},
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
|
|
203
213
|
const aclSyntaxOptions = [
|
|
204
214
|
{
|
|
205
215
|
value: AclSyntax.Kikimr,
|
|
@@ -252,7 +262,12 @@ export const experimentsSection: SettingsSection = {
|
|
|
252
262
|
export const devSettingsSection: SettingsSection = {
|
|
253
263
|
id: SECTION_IDS.DEV_SETTINGS,
|
|
254
264
|
title: i18n('section.dev-setting'),
|
|
255
|
-
settings: [
|
|
265
|
+
settings: [
|
|
266
|
+
enableAutocompleteSetting,
|
|
267
|
+
autocompleteOnEnterSetting,
|
|
268
|
+
wordWrapSetting,
|
|
269
|
+
enableQueryStreamingSetting,
|
|
270
|
+
],
|
|
256
271
|
};
|
|
257
272
|
|
|
258
273
|
export const resultsSettingsSection: SettingsSection = {
|
|
@@ -3,6 +3,7 @@ import {isNil} from 'lodash';
|
|
|
3
3
|
|
|
4
4
|
import {CellWithPopover} from '../../components/CellWithPopover/CellWithPopover';
|
|
5
5
|
import {CopyableValue} from '../../components/CopyableValue/CopyableValue';
|
|
6
|
+
import {DatacenterLabel} from '../../components/Datacenter/DatacenterLabel';
|
|
6
7
|
import {InternalLinkButton} from '../../components/InternalLinkButton';
|
|
7
8
|
import {getVDiskLocationItems} from '../../components/VDiskInfo/getVDiskDetails';
|
|
8
9
|
import {getPDiskPagePath} from '../../routes';
|
|
@@ -24,7 +25,13 @@ interface VDiskStorageDetailsProps {
|
|
|
24
25
|
data?: VDiskData;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
function DetailItem({
|
|
28
|
+
function DetailItem({
|
|
29
|
+
item,
|
|
30
|
+
datacenterColorKey,
|
|
31
|
+
}: {
|
|
32
|
+
item: DiskDetailItem;
|
|
33
|
+
datacenterColorKey?: string;
|
|
34
|
+
}) {
|
|
28
35
|
const copyText = item.copyText === undefined ? undefined : String(item.copyText);
|
|
29
36
|
return (
|
|
30
37
|
<div
|
|
@@ -43,7 +50,17 @@ function DetailItem({item}: {item: DiskDetailItem}) {
|
|
|
43
50
|
'with-left-trim': item.id === 'pdisk-path',
|
|
44
51
|
})}
|
|
45
52
|
>
|
|
46
|
-
<span tabIndex={copyText ? 0 : undefined}>
|
|
53
|
+
<span tabIndex={copyText ? 0 : undefined}>
|
|
54
|
+
{item.id === 'datacenter' && copyText ? (
|
|
55
|
+
<DatacenterLabel
|
|
56
|
+
name={copyText}
|
|
57
|
+
colorKey={datacenterColorKey}
|
|
58
|
+
size="xxs"
|
|
59
|
+
/>
|
|
60
|
+
) : (
|
|
61
|
+
item.content
|
|
62
|
+
)}
|
|
63
|
+
</span>
|
|
47
64
|
</CellWithPopover>
|
|
48
65
|
</CopyableValue>
|
|
49
66
|
</div>
|
|
@@ -68,7 +85,9 @@ export function VDiskStorageDetails({className, data = {}}: VDiskStorageDetailsP
|
|
|
68
85
|
<div className={b('card')}>
|
|
69
86
|
{LOCATION_IDS.map((id) => {
|
|
70
87
|
const item = items.find((entry) => entry.id === id);
|
|
71
|
-
return item ?
|
|
88
|
+
return item ? (
|
|
89
|
+
<DetailItem key={id} item={item} datacenterColorKey={data.NodeDCKey} />
|
|
90
|
+
) : null;
|
|
72
91
|
})}
|
|
73
92
|
</div>
|
|
74
93
|
<div className={b('card', {ids: true})}>
|
package/src/lib.ts
CHANGED
|
@@ -430,12 +430,16 @@ export class ViewerAPI extends BaseYdbAPI {
|
|
|
430
430
|
);
|
|
431
431
|
}
|
|
432
432
|
|
|
433
|
-
getNodesList(
|
|
433
|
+
getNodesList(
|
|
434
|
+
{database, include_storage: includeStorage}: {database?: string; include_storage?: boolean},
|
|
435
|
+
{concurrentId, signal}: AxiosOptions = {},
|
|
436
|
+
) {
|
|
434
437
|
return this.get<TEvNodesInfo>(
|
|
435
438
|
this.getPath('/viewer/json/nodelist'),
|
|
436
439
|
{
|
|
437
440
|
enums: true,
|
|
438
441
|
database,
|
|
442
|
+
include_storage: includeStorage,
|
|
439
443
|
},
|
|
440
444
|
{
|
|
441
445
|
concurrentId,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {uiFactory} from '../uiFactory/uiFactory';
|
|
2
|
+
import type {DatacenterColorIndexes} from '../utils/datacenters';
|
|
3
|
+
|
|
4
|
+
export interface DatacenterQueryContext {
|
|
5
|
+
generation: number;
|
|
6
|
+
configuredIndexes?: DatacenterColorIndexes;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Request metadata only: registration is handled by the fulfilled action. */
|
|
10
|
+
export function getDatacenterQueryContext(getState: () => unknown): DatacenterQueryContext {
|
|
11
|
+
const {generation} = (getState() as {datacenters: {generation: number}}).datacenters;
|
|
12
|
+
return {
|
|
13
|
+
generation,
|
|
14
|
+
configuredIndexes: uiFactory.datacenterColorIndexes,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -11,6 +11,7 @@ import {CLUSTER_DEFAULT_TITLE} from '../../../utils/constants';
|
|
|
11
11
|
import {useClusterNameFromQuery} from '../../../utils/hooks/useDatabaseFromQuery';
|
|
12
12
|
import {useIsViewerUser} from '../../../utils/hooks/useIsUserAllowedToMakeChanges';
|
|
13
13
|
import {isQueryErrorResponse} from '../../../utils/query';
|
|
14
|
+
import {getDatacenterQueryContext} from '../../datacenterQueryContext';
|
|
14
15
|
import type {RootState} from '../../defaultStore';
|
|
15
16
|
import {api} from '../api';
|
|
16
17
|
import {getClusterDataTag} from '../entityDataTags';
|
|
@@ -66,7 +67,8 @@ export const clusterApi = api.injectEndpoints({
|
|
|
66
67
|
},
|
|
67
68
|
string | undefined
|
|
68
69
|
>({
|
|
69
|
-
queryFn: async (clusterName, {signal}) => {
|
|
70
|
+
queryFn: async (clusterName, {signal, getState}) => {
|
|
71
|
+
const meta = getDatacenterQueryContext(getState);
|
|
70
72
|
try {
|
|
71
73
|
const rawClusterData = await window.api.viewer.getClusterInfo(clusterName, {
|
|
72
74
|
signal,
|
|
@@ -76,7 +78,7 @@ export const clusterApi = api.injectEndpoints({
|
|
|
76
78
|
const clusterRoot = clusterData.Domain;
|
|
77
79
|
// Without domain we cannot get stats from system tables
|
|
78
80
|
if (!clusterRoot) {
|
|
79
|
-
return {data: {clusterData}};
|
|
81
|
+
return {data: {clusterData}, meta};
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
if (isClusterInfoV2(clusterData)) {
|
|
@@ -85,6 +87,7 @@ export const clusterApi = api.injectEndpoints({
|
|
|
85
87
|
clusterData,
|
|
86
88
|
groupsStats: getGroupStatsFromClusterInfo(clusterData),
|
|
87
89
|
},
|
|
90
|
+
meta,
|
|
88
91
|
};
|
|
89
92
|
}
|
|
90
93
|
|
|
@@ -102,7 +105,7 @@ export const clusterApi = api.injectEndpoints({
|
|
|
102
105
|
});
|
|
103
106
|
|
|
104
107
|
if (isQueryErrorResponse(groupsStatsResponse)) {
|
|
105
|
-
return {data: {clusterData}};
|
|
108
|
+
return {data: {clusterData}, meta};
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
return {
|
|
@@ -110,9 +113,10 @@ export const clusterApi = api.injectEndpoints({
|
|
|
110
113
|
clusterData,
|
|
111
114
|
groupsStats: parseGroupsStatsQueryResponse(groupsStatsResponse),
|
|
112
115
|
},
|
|
116
|
+
meta,
|
|
113
117
|
};
|
|
114
118
|
} catch {
|
|
115
|
-
return {data: {clusterData}};
|
|
119
|
+
return {data: {clusterData}, meta};
|
|
116
120
|
}
|
|
117
121
|
} catch (error) {
|
|
118
122
|
return {error};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {createSlice} from '@reduxjs/toolkit';
|
|
2
|
+
import type {Dispatch, PayloadAction} from '@reduxjs/toolkit';
|
|
3
|
+
|
|
4
|
+
import type {DatacenterColorIndexes} from '../../utils/datacenters';
|
|
5
|
+
import {createDatacenterColorIndexes, getDatacenterKey} from '../../utils/datacenters';
|
|
6
|
+
import type {DatacenterQueryContext} from '../datacenterQueryContext';
|
|
7
|
+
import {getDatacenterQueryContext} from '../datacenterQueryContext';
|
|
8
|
+
|
|
9
|
+
import {setIsAuthenticated} from './authentication/authentication';
|
|
10
|
+
import {clusterApi} from './cluster/cluster';
|
|
11
|
+
import {nodesApi} from './nodes/nodes';
|
|
12
|
+
import {nodesListApi} from './nodesList';
|
|
13
|
+
import {pDiskApi} from './pdisk/pdisk';
|
|
14
|
+
import {storageApi} from './storage/storage';
|
|
15
|
+
import {vDiskApi} from './vdisk/vdisk';
|
|
16
|
+
|
|
17
|
+
export interface DatacentersState {
|
|
18
|
+
indexes: DatacenterColorIndexes;
|
|
19
|
+
generation: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface RegisterDatacentersPayload extends DatacenterQueryContext {
|
|
23
|
+
names: readonly (string | undefined)[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const initialState: DatacentersState = {indexes: {}, generation: 0};
|
|
27
|
+
|
|
28
|
+
function registerDatacenters(state: DatacentersState, payload: RegisterDatacentersPayload) {
|
|
29
|
+
if (payload.generation !== state.generation) {
|
|
30
|
+
return state;
|
|
31
|
+
}
|
|
32
|
+
const current = state.indexes;
|
|
33
|
+
const indexes = createDatacenterColorIndexes(payload.names, {
|
|
34
|
+
...current,
|
|
35
|
+
...payload.configuredIndexes,
|
|
36
|
+
});
|
|
37
|
+
// Polling and duplicate batches should not invalidate every color selector.
|
|
38
|
+
if (Object.keys(indexes).some((name) => current[name] !== indexes[name])) {
|
|
39
|
+
return {...state, indexes};
|
|
40
|
+
}
|
|
41
|
+
return state;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function registerQueryDatacenters(
|
|
45
|
+
state: DatacentersState,
|
|
46
|
+
meta: unknown,
|
|
47
|
+
names: readonly (string | undefined)[] = [],
|
|
48
|
+
) {
|
|
49
|
+
// These endpoints attach this snapshot before the request starts. Cache-only
|
|
50
|
+
// updates without request metadata must not revive a previous session's data.
|
|
51
|
+
const context = meta as DatacenterQueryContext | undefined;
|
|
52
|
+
if (!context) {
|
|
53
|
+
return state;
|
|
54
|
+
}
|
|
55
|
+
return registerDatacenters(state, {
|
|
56
|
+
...context,
|
|
57
|
+
names,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const datacentersSlice = createSlice({
|
|
62
|
+
name: 'datacenters',
|
|
63
|
+
initialState,
|
|
64
|
+
reducers: {
|
|
65
|
+
registerDatacenters(state, {payload}: PayloadAction<RegisterDatacentersPayload>) {
|
|
66
|
+
return registerDatacenters(state, payload);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
extraReducers: (builder) => {
|
|
70
|
+
builder.addCase(setIsAuthenticated, (state, {payload}) => {
|
|
71
|
+
if (!payload) {
|
|
72
|
+
// Ignore responses from requests started before logout.
|
|
73
|
+
return {indexes: {}, generation: state.generation + 1};
|
|
74
|
+
}
|
|
75
|
+
return state;
|
|
76
|
+
});
|
|
77
|
+
builder.addMatcher(nodesListApi.endpoints.getNodesList.matchFulfilled, (state, action) =>
|
|
78
|
+
registerQueryDatacenters(
|
|
79
|
+
state,
|
|
80
|
+
action.meta.baseQueryMeta,
|
|
81
|
+
Array.isArray(action.payload)
|
|
82
|
+
? action.payload.map((node) =>
|
|
83
|
+
getDatacenterKey(node.Location, node.PhysicalLocation?.DataCenterId),
|
|
84
|
+
)
|
|
85
|
+
: undefined,
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
builder.addMatcher(nodesApi.endpoints.getNodes.matchFulfilled, (state, action) =>
|
|
89
|
+
registerQueryDatacenters(
|
|
90
|
+
state,
|
|
91
|
+
action.meta.baseQueryMeta,
|
|
92
|
+
action.payload?.nodes?.map((node) => node.DCKey),
|
|
93
|
+
),
|
|
94
|
+
);
|
|
95
|
+
builder.addMatcher(
|
|
96
|
+
storageApi.endpoints.getStorageNodesInfo.matchFulfilled,
|
|
97
|
+
(state, action) =>
|
|
98
|
+
registerQueryDatacenters(
|
|
99
|
+
state,
|
|
100
|
+
action.meta.baseQueryMeta,
|
|
101
|
+
action.payload?.nodes?.map((node) => node.DCKey),
|
|
102
|
+
),
|
|
103
|
+
);
|
|
104
|
+
builder.addMatcher(clusterApi.endpoints.getClusterInfo.matchFulfilled, (state, action) =>
|
|
105
|
+
registerQueryDatacenters(
|
|
106
|
+
state,
|
|
107
|
+
action.meta.baseQueryMeta,
|
|
108
|
+
action.payload.clusterData.DataCenters,
|
|
109
|
+
),
|
|
110
|
+
);
|
|
111
|
+
builder.addMatcher(pDiskApi.endpoints.getPdiskInfo.matchFulfilled, (state, action) =>
|
|
112
|
+
registerQueryDatacenters(state, action.meta.baseQueryMeta, [action.payload?.NodeDCKey]),
|
|
113
|
+
);
|
|
114
|
+
builder.addMatcher(vDiskApi.endpoints.getVDiskData.matchFulfilled, (state, action) =>
|
|
115
|
+
registerQueryDatacenters(state, action.meta.baseQueryMeta, [action.payload?.NodeDCKey]),
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export default datacentersSlice.reducer;
|
|
121
|
+
|
|
122
|
+
/** Capture the session before awaiting the response. */
|
|
123
|
+
export function createDatacenterRegistrar({
|
|
124
|
+
dispatch,
|
|
125
|
+
getState,
|
|
126
|
+
}: {
|
|
127
|
+
dispatch: Dispatch;
|
|
128
|
+
getState: () => unknown;
|
|
129
|
+
}) {
|
|
130
|
+
const context = getDatacenterQueryContext(getState);
|
|
131
|
+
return (names: readonly (string | undefined)[] = []) => {
|
|
132
|
+
dispatch(
|
|
133
|
+
datacentersSlice.actions.registerDatacenters({
|
|
134
|
+
...context,
|
|
135
|
+
names,
|
|
136
|
+
}),
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
}
|
|
@@ -4,6 +4,7 @@ import {api} from './api';
|
|
|
4
4
|
import authentication from './authentication/authentication';
|
|
5
5
|
import cluster from './cluster/cluster';
|
|
6
6
|
import clusters from './clusters/clusters';
|
|
7
|
+
import datacenters from './datacenters';
|
|
7
8
|
import executeTopQueries from './executeTopQueries/executeTopQueries';
|
|
8
9
|
import fullscreen from './fullscreen';
|
|
9
10
|
import header from './header/header';
|
|
@@ -21,6 +22,7 @@ export const rootReducer = {
|
|
|
21
22
|
[api.reducerPath]: api.reducer,
|
|
22
23
|
singleClusterMode,
|
|
23
24
|
cluster,
|
|
25
|
+
datacenters,
|
|
24
26
|
tenant,
|
|
25
27
|
schema,
|
|
26
28
|
partitions,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type {NodesRequestParams} from '../../../types/api/nodes';
|
|
2
|
+
import {getDatacenterQueryContext} from '../../datacenterQueryContext';
|
|
2
3
|
import {api} from '../api';
|
|
3
4
|
import {prepareStorageNodesResponse} from '../storage/utils';
|
|
4
5
|
|
|
5
6
|
export const nodesApi = api.injectEndpoints({
|
|
6
7
|
endpoints: (builder) => ({
|
|
7
8
|
getNodes: builder.query({
|
|
8
|
-
queryFn: async (params: NodesRequestParams, {signal}) => {
|
|
9
|
+
queryFn: async (params: NodesRequestParams, {signal, getState}) => {
|
|
10
|
+
const meta = getDatacenterQueryContext(getState);
|
|
9
11
|
try {
|
|
10
12
|
const data = await window.api.viewer.getNodes(
|
|
11
13
|
{
|
|
@@ -16,7 +18,7 @@ export const nodesApi = api.injectEndpoints({
|
|
|
16
18
|
},
|
|
17
19
|
{signal},
|
|
18
20
|
);
|
|
19
|
-
return {data: prepareStorageNodesResponse(data)};
|
|
21
|
+
return {data: prepareStorageNodesResponse(data), meta};
|
|
20
22
|
} catch (error) {
|
|
21
23
|
return {error};
|
|
22
24
|
}
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import {createSelector} from '@reduxjs/toolkit';
|
|
2
2
|
|
|
3
3
|
import {prepareNodesMap} from '../../utils/nodes';
|
|
4
|
+
import {getDatacenterQueryContext} from '../datacenterQueryContext';
|
|
4
5
|
import type {RootState} from '../defaultStore';
|
|
5
6
|
|
|
6
7
|
import {api} from './api';
|
|
7
8
|
|
|
9
|
+
export interface NodesListQueryArgs {
|
|
10
|
+
database?: string;
|
|
11
|
+
include_storage?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
export const nodesListApi = api.injectEndpoints({
|
|
9
15
|
endpoints: (build) => ({
|
|
10
16
|
getNodesList: build.query({
|
|
11
|
-
queryFn: async (
|
|
17
|
+
queryFn: async (
|
|
18
|
+
{database, include_storage: includeStorage}: NodesListQueryArgs,
|
|
19
|
+
{signal, getState},
|
|
20
|
+
) => {
|
|
21
|
+
const meta = getDatacenterQueryContext(getState);
|
|
12
22
|
try {
|
|
13
|
-
const data = await window.api.viewer.getNodesList(
|
|
14
|
-
|
|
23
|
+
const data = await window.api.viewer.getNodesList(
|
|
24
|
+
{database, include_storage: includeStorage},
|
|
25
|
+
{signal},
|
|
26
|
+
);
|
|
27
|
+
return {data, meta};
|
|
15
28
|
} catch (error) {
|
|
16
29
|
return {error};
|
|
17
30
|
}
|
|
@@ -22,11 +35,17 @@ export const nodesListApi = api.injectEndpoints({
|
|
|
22
35
|
});
|
|
23
36
|
|
|
24
37
|
const createGetNodesListSelector = createSelector(
|
|
25
|
-
(database
|
|
26
|
-
(
|
|
38
|
+
(database: string | undefined) => database,
|
|
39
|
+
(_database: string | undefined, includeStorage?: boolean) => includeStorage,
|
|
40
|
+
(database, includeStorage) =>
|
|
41
|
+
nodesListApi.endpoints.getNodesList.select({
|
|
42
|
+
database,
|
|
43
|
+
include_storage: includeStorage,
|
|
44
|
+
}),
|
|
27
45
|
);
|
|
28
46
|
|
|
29
47
|
export const selectNodesMap = createSelector(
|
|
30
|
-
(state: RootState, database?: string) =>
|
|
48
|
+
(state: RootState, database?: string, includeStorage?: boolean) =>
|
|
49
|
+
createGetNodesListSelector(database, includeStorage)(state).data,
|
|
31
50
|
prepareNodesMap,
|
|
32
51
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {TPDiskInfoResponse} from '../../../types/api/pdisk';
|
|
2
2
|
import {getPDiskId} from '../../../utils/disks/helpers';
|
|
3
|
+
import {getDatacenterQueryContext} from '../../datacenterQueryContext';
|
|
3
4
|
import type {GetState} from '../../defaultStore';
|
|
4
5
|
import {api} from '../api';
|
|
5
6
|
import {queryCapability} from '../capabilities/capabilities';
|
|
@@ -15,6 +16,7 @@ export const pDiskApi = api.injectEndpoints({
|
|
|
15
16
|
endpoints: (build) => ({
|
|
16
17
|
getPdiskInfo: build.query({
|
|
17
18
|
queryFn: async ({nodeId, pDiskId}: PDiskParams, {signal, getState, dispatch}) => {
|
|
19
|
+
const meta = getDatacenterQueryContext(getState);
|
|
18
20
|
const pDiskInfoHandlerVersion = await queryCapability('/pdisk/info', undefined, {
|
|
19
21
|
getState: getState as GetState,
|
|
20
22
|
dispatch,
|
|
@@ -48,7 +50,7 @@ export const pDiskApi = api.injectEndpoints({
|
|
|
48
50
|
window.api.viewer.getNodeInfo({nodeId}, {signal}),
|
|
49
51
|
]);
|
|
50
52
|
const data = preparePDiskDataResponse(response);
|
|
51
|
-
return {data};
|
|
53
|
+
return {data, meta};
|
|
52
54
|
} catch (error) {
|
|
53
55
|
return {error};
|
|
54
56
|
}
|
|
@@ -147,6 +147,7 @@ export function preparePDiskDataResponse([pdiskResponse = {}, nodeResponse]: [
|
|
|
147
147
|
NodeHost: preparedNode.Host,
|
|
148
148
|
NodeType: preparedNode.Roles?.[0],
|
|
149
149
|
NodeDC: preparedNode.DC,
|
|
150
|
+
NodeDCKey: preparedNode.DCKey,
|
|
150
151
|
NodeRack: preparedNode.Rack,
|
|
151
152
|
SlotItems: diskSlots,
|
|
152
153
|
};
|
|
@@ -28,6 +28,7 @@ export const SETTING_KEYS = {
|
|
|
28
28
|
ENABLE_QUERY_STREAMING: 'enableQueryStreaming',
|
|
29
29
|
EXPAND_CLUSTER_DASHBOARD: 'expandClusterDashboard',
|
|
30
30
|
AUTOCOMPLETE_ON_ENTER: 'autocompleteOnEnter',
|
|
31
|
+
WORD_WRAP: 'wordWrap',
|
|
31
32
|
IS_HOTKEYS_HELP_HIDDEN: 'isHotKeysHelpHidden',
|
|
32
33
|
AUTO_REFRESH_INTERVAL: 'auto-refresh-interval',
|
|
33
34
|
CASE_SENSITIVE_JSON_SEARCH: 'caseSensitiveJsonSearch',
|
|
@@ -72,6 +73,7 @@ export const DEFAULT_USER_SETTINGS = {
|
|
|
72
73
|
[SETTING_KEYS.ENABLE_QUERY_STREAMING]: true,
|
|
73
74
|
[SETTING_KEYS.EXPAND_CLUSTER_DASHBOARD]: true,
|
|
74
75
|
[SETTING_KEYS.AUTOCOMPLETE_ON_ENTER]: true,
|
|
76
|
+
[SETTING_KEYS.WORD_WRAP]: 'on',
|
|
75
77
|
[SETTING_KEYS.IS_HOTKEYS_HELP_HIDDEN]: false,
|
|
76
78
|
[SETTING_KEYS.AUTO_REFRESH_INTERVAL]: 0,
|
|
77
79
|
[SETTING_KEYS.CASE_SENSITIVE_JSON_SEARCH]: false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {NodesRequestParams} from '../../../types/api/nodes';
|
|
2
2
|
import type {GroupsRequestParams} from '../../../types/api/storage';
|
|
3
|
+
import {getDatacenterQueryContext} from '../../datacenterQueryContext';
|
|
3
4
|
import {api} from '../api';
|
|
4
5
|
|
|
5
6
|
import {requestStorageData} from './requestStorageData';
|
|
@@ -8,13 +9,14 @@ import {prepareStorageNodesResponse} from './utils';
|
|
|
8
9
|
export const storageApi = api.injectEndpoints({
|
|
9
10
|
endpoints: (builder) => ({
|
|
10
11
|
getStorageNodesInfo: builder.query({
|
|
11
|
-
queryFn: async (params: Omit<NodesRequestParams, 'type'>, {signal}) => {
|
|
12
|
+
queryFn: async (params: Omit<NodesRequestParams, 'type'>, {signal, getState}) => {
|
|
13
|
+
const meta = getDatacenterQueryContext(getState);
|
|
12
14
|
try {
|
|
13
15
|
const result = await window.api.viewer.getNodes(
|
|
14
16
|
{storage: true, type: 'static', ...params},
|
|
15
17
|
{signal},
|
|
16
18
|
);
|
|
17
|
-
return {data: prepareStorageNodesResponse(result)};
|
|
19
|
+
return {data: prepareStorageNodesResponse(result), meta};
|
|
18
20
|
} catch (error) {
|
|
19
21
|
return {error};
|
|
20
22
|
}
|
|
@@ -2,7 +2,7 @@ import {z} from 'zod';
|
|
|
2
2
|
|
|
3
3
|
import type {ECapacityAlert, EFlag} from '../../../types/api/enums';
|
|
4
4
|
import type {NodesGroupByField, TNodeInfo} from '../../../types/api/nodes';
|
|
5
|
-
import type {Erasure, GroupsGroupByField} from '../../../types/api/storage';
|
|
5
|
+
import type {Erasure, GroupsGroupByField, TStorageGroupStateInfo} from '../../../types/api/storage';
|
|
6
6
|
import type {TTabletStateInfo} from '../../../types/api/tablet';
|
|
7
7
|
import type {PreparedPDisk, PreparedVDisk} from '../../../utils/disks/types';
|
|
8
8
|
import type {NodesUptimeFilterValues, PreparedNodeSystemState} from '../../../utils/nodes';
|
|
@@ -89,6 +89,7 @@ export interface PreparedStorageGroup {
|
|
|
89
89
|
AllocationUnits?: string | number;
|
|
90
90
|
GroupSizeInUnits?: number;
|
|
91
91
|
State?: string;
|
|
92
|
+
StateInfo?: TStorageGroupStateInfo;
|
|
92
93
|
MissingDisks?: string | number;
|
|
93
94
|
Available?: string;
|
|
94
95
|
|