ydb-embedded-ui 6.22.0 → 6.23.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/PDiskPopup/PDiskPopup.d.ts +2 -4
- package/dist/components/PDiskPopup/PDiskPopup.js +10 -5
- package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
- package/dist/components/PaginatedTable/PaginatedTable.d.ts +2 -1
- package/dist/components/PaginatedTable/PaginatedTable.js +9 -7
- package/dist/components/PaginatedTable/PaginatedTable.js.map +1 -1
- package/dist/components/PaginatedTable/TableChunk.d.ts +2 -1
- package/dist/components/PaginatedTable/TableChunk.js +5 -2
- package/dist/components/PaginatedTable/TableChunk.js.map +1 -1
- package/dist/components/QueryResultTable/QueryResultTable.js +11 -16
- package/dist/components/QueryResultTable/QueryResultTable.js.map +1 -1
- package/dist/components/QueryResultTable/utils/getColumnWidth.d.ts +7 -0
- package/dist/components/QueryResultTable/utils/getColumnWidth.js +16 -0
- package/dist/components/QueryResultTable/utils/getColumnWidth.js.map +1 -0
- package/dist/components/QueryResultTable/utils/getColumnWidth.test.d.ts +1 -0
- package/dist/components/QueryResultTable/utils/getColumnWidth.test.js +32 -0
- package/dist/components/QueryResultTable/utils/getColumnWidth.test.js.map +1 -0
- package/dist/components/StorageGroupInfo/StorageGroupInfo.js +7 -7
- package/dist/components/StorageGroupInfo/StorageGroupInfo.js.map +1 -1
- package/dist/components/StorageGroupInfo/i18n/index.d.ts +1 -1
- package/dist/components/TableSkeleton/TableSkeleton.d.ts +2 -1
- package/dist/components/TableSkeleton/TableSkeleton.js +5 -1
- package/dist/components/TableSkeleton/TableSkeleton.js.map +1 -1
- package/dist/components/TableSkeleton/TableSkeleton.scss +7 -1
- package/dist/components/VDisk/VDisk.d.ts +1 -3
- package/dist/components/VDisk/VDisk.js +2 -2
- package/dist/components/VDisk/VDisk.js.map +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.d.ts +1 -3
- package/dist/components/VDiskPopup/VDiskPopup.js +7 -2
- package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
- package/dist/containers/Cluster/Cluster.scss +2 -2
- package/dist/containers/Header/breadcrumbs.js +2 -3
- package/dist/containers/Header/breadcrumbs.js.map +1 -1
- package/dist/containers/Nodes/columns/columns.js +8 -0
- package/dist/containers/Nodes/columns/columns.js.map +1 -1
- package/dist/containers/Nodes/columns/constants.d.ts +2 -0
- package/dist/containers/Nodes/columns/constants.js +4 -0
- package/dist/containers/Nodes/columns/constants.js.map +1 -1
- package/dist/containers/Nodes/columns/i18n/en.json +1 -0
- package/dist/containers/Nodes/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/Disks/Disks.d.ts +3 -3
- package/dist/containers/Storage/Disks/Disks.js +6 -7
- package/dist/containers/Storage/Disks/Disks.js.map +1 -1
- package/dist/containers/Storage/PDisk/PDisk.d.ts +3 -2
- package/dist/containers/Storage/PDisk/PDisk.js +3 -2
- package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
- package/dist/containers/Storage/PDisk/PDisk.scss +1 -1
- package/dist/containers/Storage/PaginatedStorage.d.ts +5 -5
- package/dist/containers/Storage/PaginatedStorage.js +7 -73
- package/dist/containers/Storage/PaginatedStorage.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageGroups.d.ts +3 -0
- package/dist/containers/Storage/PaginatedStorageGroups.js +84 -0
- package/dist/containers/Storage/PaginatedStorageGroups.js.map +1 -0
- package/dist/containers/Storage/PaginatedStorageNodes.d.ts +3 -0
- package/dist/containers/Storage/PaginatedStorageNodes.js +98 -0
- package/dist/containers/Storage/PaginatedStorageNodes.js.map +1 -0
- package/dist/containers/Storage/Storage.js +15 -70
- package/dist/containers/Storage/Storage.js.map +1 -1
- package/dist/containers/Storage/Storage.scss +4 -0
- package/dist/containers/Storage/StorageControls/StorageControls.d.ts +3 -16
- package/dist/containers/Storage/StorageControls/StorageControls.js +18 -11
- package/dist/containers/Storage/StorageControls/StorageControls.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.d.ts +22 -0
- package/dist/containers/Storage/StorageGroups/{PaginatedStorageGroups.js → PaginatedStorageGroupsTable.js} +23 -5
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.js.map +1 -0
- package/dist/containers/Storage/StorageGroups/{StorageGroups.d.ts → StorageGroupsTable.d.ts} +3 -4
- package/dist/containers/Storage/StorageGroups/{StorageGroups.js → StorageGroupsTable.js} +4 -3
- package/dist/containers/Storage/StorageGroups/StorageGroupsTable.js.map +1 -0
- package/dist/containers/Storage/StorageGroups/columns/columns.js +35 -10
- package/dist/containers/Storage/StorageGroups/columns/columns.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/constants.d.ts +17 -0
- package/dist/containers/Storage/StorageGroups/columns/constants.js +46 -1
- package/dist/containers/Storage/StorageGroups/columns/constants.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/hooks.d.ts +3 -3
- package/dist/containers/Storage/StorageGroups/columns/hooks.js +5 -8
- package/dist/containers/Storage/StorageGroups/columns/hooks.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/i18n/en.json +6 -0
- package/dist/containers/Storage/StorageGroups/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageGroups/columns/types.d.ts +7 -5
- package/dist/containers/Storage/StorageGroups/getGroups.js +6 -5
- package/dist/containers/Storage/StorageGroups/getGroups.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.d.ts +23 -0
- package/dist/containers/Storage/StorageNodes/{PaginatedStorageNodes.js → PaginatedStorageNodesTable.js} +23 -5
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.js.map +1 -0
- package/dist/containers/Storage/StorageNodes/{StorageNodes.d.ts → StorageNodesTable.d.ts} +3 -4
- package/dist/containers/Storage/StorageNodes/{StorageNodes.js → StorageNodesTable.js} +8 -6
- package/dist/containers/Storage/StorageNodes/StorageNodesTable.js.map +1 -0
- package/dist/containers/Storage/StorageNodes/columns/StorageNodesColumns.scss +1 -0
- package/dist/containers/Storage/StorageNodes/columns/columns.d.ts +1 -1
- package/dist/containers/Storage/StorageNodes/columns/columns.js +4 -5
- package/dist/containers/Storage/StorageNodes/columns/columns.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/constants.d.ts +9 -0
- package/dist/containers/Storage/StorageNodes/columns/constants.js +27 -0
- package/dist/containers/Storage/StorageNodes/columns/constants.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/i18n/en.json +2 -0
- package/dist/containers/Storage/StorageNodes/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageNodes/getNodes.js +6 -5
- package/dist/containers/Storage/StorageNodes/getNodes.js.map +1 -1
- package/dist/containers/Storage/TableGroup/TableGroup.d.ts +12 -0
- package/dist/containers/Storage/TableGroup/TableGroup.js +21 -0
- package/dist/containers/Storage/TableGroup/TableGroup.js.map +1 -0
- package/dist/containers/Storage/TableGroup/TableGroup.scss +49 -0
- package/dist/containers/Storage/TableGroup/useExpandedTableGroups.d.ts +5 -0
- package/dist/containers/Storage/TableGroup/useExpandedTableGroups.js +28 -0
- package/dist/containers/Storage/TableGroup/useExpandedTableGroups.js.map +1 -0
- package/dist/containers/Storage/i18n/en.json +4 -1
- package/dist/containers/Storage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/i18n/index.js +1 -2
- package/dist/containers/Storage/i18n/index.js.map +1 -1
- package/dist/containers/Storage/shared.d.ts +2 -0
- package/dist/containers/Storage/shared.js +9 -0
- package/dist/containers/Storage/shared.js.map +1 -1
- package/dist/containers/Storage/useStorageQueryParams.d.ts +18 -0
- package/dist/containers/Storage/useStorageQueryParams.js +64 -0
- package/dist/containers/Storage/useStorageQueryParams.js.map +1 -0
- package/dist/containers/Storage/utils/index.d.ts +6 -2
- package/dist/containers/Storage/utils/index.js +11 -6
- package/dist/containers/Storage/utils/index.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +17 -3
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +0 -3
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +2 -2
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +10 -3
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +2 -3
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +4 -4
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Partitions/utils/index.d.ts +2 -2
- package/dist/containers/Tenant/Diagnostics/Partitions/utils/index.js +5 -5
- package/dist/containers/Tenant/Diagnostics/Partitions/utils/index.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +8 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.d.ts +5 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.js +21 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.d.ts +1 -3
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +32 -37
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.d.ts +6 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.js +33 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.d.ts +2 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +26 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/en.json +7 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/index.js +1 -2
- package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/index.js.map +1 -1
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +27 -9
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js.map +1 -1
- package/dist/containers/Tenant/ObjectSummary/__test__/transformPath.test.js +27 -3
- package/dist/containers/Tenant/ObjectSummary/__test__/transformPath.test.js.map +1 -1
- package/dist/containers/Tenant/ObjectSummary/transformPath.d.ts +2 -0
- package/dist/containers/Tenant/ObjectSummary/transformPath.js +10 -0
- package/dist/containers/Tenant/ObjectSummary/transformPath.js.map +1 -1
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +3 -1
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js.map +1 -1
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/en.json +2 -1
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Query/NewSQL/NewSQL.d.ts +1 -0
- package/dist/containers/Tenant/Query/NewSQL/NewSQL.js +135 -0
- package/dist/containers/Tenant/Query/NewSQL/NewSQL.js.map +1 -0
- package/dist/containers/Tenant/Query/NewSQL/i18n/en.json +32 -0
- package/dist/containers/Tenant/Query/NewSQL/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Query/NewSQL/i18n/index.js +5 -0
- package/dist/containers/Tenant/Query/NewSQL/i18n/index.js.map +1 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +2 -1
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js.map +1 -1
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.scss +1 -0
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +1 -1
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js.map +1 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +10 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js.map +1 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/prepareData.d.ts +2 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/prepareData.js.map +1 -1
- package/dist/containers/Tenant/Tenant.js +7 -3
- package/dist/containers/Tenant/Tenant.js.map +1 -1
- package/dist/containers/Tenant/utils/newSQLQueryActions.d.ts +27 -0
- package/dist/containers/Tenant/utils/newSQLQueryActions.js +35 -0
- package/dist/containers/Tenant/utils/newSQLQueryActions.js.map +1 -0
- package/dist/containers/Tenant/utils/newSQLQueryTemplates.d.ts +24 -0
- package/dist/containers/Tenant/utils/newSQLQueryTemplates.js +228 -0
- package/dist/containers/Tenant/utils/newSQLQueryTemplates.js.map +1 -0
- package/dist/containers/Tenant/utils/schemaActions.d.ts +1 -1
- package/dist/containers/Tenant/utils/schemaActions.js +8 -6
- package/dist/containers/Tenant/utils/schemaActions.js.map +1 -1
- package/dist/containers/Tenant/utils/{queryTemplates.js → schemaQueryTemplates.js} +1 -1
- package/dist/containers/Tenant/utils/schemaQueryTemplates.js.map +1 -0
- package/dist/services/api.js +3 -3
- package/dist/services/api.js.map +1 -1
- package/dist/store/reducers/capabilities/hooks.d.ts +2 -0
- package/dist/store/reducers/capabilities/hooks.js +6 -0
- package/dist/store/reducers/capabilities/hooks.js.map +1 -1
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +4 -0
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js +27 -1
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js.map +1 -1
- package/dist/store/reducers/nodes/types.d.ts +1 -0
- package/dist/store/reducers/nodesList.d.ts +5 -5
- package/dist/store/reducers/nodesList.js +2 -2
- package/dist/store/reducers/nodesList.js.map +1 -1
- package/dist/store/reducers/overview/overview.js +5 -1
- package/dist/store/reducers/overview/overview.js.map +1 -1
- package/dist/store/reducers/storage/requestStorageData.d.ts +3 -3
- package/dist/store/reducers/storage/requestStorageData.js.map +1 -1
- package/dist/store/reducers/storage/selectors.d.ts +2 -3
- package/dist/store/reducers/storage/selectors.js +1 -27
- package/dist/store/reducers/storage/selectors.js.map +1 -1
- package/dist/store/reducers/storage/storage.d.ts +2 -2
- package/dist/store/reducers/storage/storage.js.map +1 -1
- package/dist/store/reducers/storage/types.d.ts +19 -10
- package/dist/store/reducers/storage/utils.js +27 -3
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/store/reducers/tablet.js +5 -3
- package/dist/store/reducers/tablet.js.map +1 -1
- package/dist/store/reducers/tablets.d.ts +3 -3
- package/dist/store/reducers/tablets.js +4 -4
- package/dist/store/reducers/tablets.js.map +1 -1
- package/dist/types/api/capabilities.d.ts +1 -1
- package/dist/types/api/nodes.d.ts +3 -2
- package/dist/types/api/nodes.js.map +1 -1
- package/dist/types/api/storage.d.ts +22 -4
- package/dist/types/store/nodesList.d.ts +1 -1
- package/dist/utils/hooks/useSelectedColumns.js +7 -2
- package/dist/utils/hooks/useSelectedColumns.js.map +1 -1
- package/dist/utils/nodes.d.ts +2 -2
- package/dist/utils/nodes.js +4 -4
- package/dist/utils/nodes.js.map +1 -1
- package/dist/utils/storage.js +2 -0
- package/dist/utils/storage.js.map +1 -1
- package/dist/utils/utils.js +2 -1
- package/dist/utils/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroups.d.ts +0 -16
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroups.js.map +0 -1
- package/dist/containers/Storage/StorageGroups/StorageGroups.js.map +0 -1
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodes.d.ts +0 -17
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodes.js.map +0 -1
- package/dist/containers/Storage/StorageNodes/StorageNodes.js.map +0 -1
- package/dist/containers/Storage/UsageFilter/UsageFilter.d.ts +0 -14
- package/dist/containers/Storage/UsageFilter/UsageFilter.js +0 -39
- package/dist/containers/Storage/UsageFilter/UsageFilter.js.map +0 -1
- package/dist/containers/Storage/UsageFilter/UsageFilter.scss +0 -38
- package/dist/containers/Storage/UsageFilter/i18n/en.json +0 -5
- package/dist/containers/Storage/UsageFilter/i18n/index.d.ts +0 -2
- package/dist/containers/Storage/UsageFilter/i18n/index.js +0 -6
- package/dist/containers/Storage/UsageFilter/i18n/index.js.map +0 -1
- package/dist/containers/Storage/UsageFilter/i18n/ru.json +0 -5
- package/dist/containers/Storage/UsageFilter/index.d.ts +0 -1
- package/dist/containers/Storage/UsageFilter/index.js +0 -2
- package/dist/containers/Storage/UsageFilter/index.js.map +0 -1
- package/dist/containers/Storage/i18n/ru.json +0 -6
- package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/ru.json +0 -4
- package/dist/containers/Tenant/utils/queryTemplates.js.map +0 -1
- package/dist/store/reducers/describe.d.ts +0 -7
- package/dist/store/reducers/describe.js +0 -25
- package/dist/store/reducers/describe.js.map +0 -1
- /package/dist/containers/Tenant/utils/{queryTemplates.d.ts → schemaQueryTemplates.d.ts} +0 -0
@@ -1,12 +1,10 @@
|
|
1
1
|
import type { PopupProps } from '@gravity-ui/uikit';
|
2
|
-
import type { NodesMap } from '../../types/store/nodesList';
|
3
2
|
import type { PreparedPDisk } from '../../utils/disks/types';
|
4
3
|
import type { InfoViewerItem } from '../InfoViewer';
|
5
4
|
import './PDiskPopup.scss';
|
6
|
-
export declare const preparePDiskData: (data: PreparedPDisk,
|
5
|
+
export declare const preparePDiskData: (data: PreparedPDisk, nodeHost?: string) => InfoViewerItem[];
|
7
6
|
interface PDiskPopupProps extends PopupProps {
|
8
7
|
data: PreparedPDisk;
|
9
|
-
nodes?: NodesMap;
|
10
8
|
}
|
11
|
-
export declare const PDiskPopup: ({ data,
|
9
|
+
export declare const PDiskPopup: ({ data, ...props }: PDiskPopupProps) => import("react/jsx-runtime").JSX.Element;
|
12
10
|
export {};
|
@@ -1,16 +1,19 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
3
|
import { Popup } from '@gravity-ui/uikit';
|
4
|
+
import { selectNodeHostsMap } from '../../store/reducers/nodesList';
|
4
5
|
import { EFlag } from '../../types/api/enums';
|
6
|
+
import { valueIsDefined } from '../../utils';
|
5
7
|
import { cn } from '../../utils/cn';
|
6
8
|
import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants';
|
7
9
|
import { getPDiskId } from '../../utils/disks/helpers';
|
10
|
+
import { useTypedSelector } from '../../utils/hooks';
|
8
11
|
import { bytesToGB } from '../../utils/utils';
|
9
12
|
import { InfoViewer } from '../InfoViewer';
|
10
13
|
import './PDiskPopup.scss';
|
11
14
|
const b = cn('pdisk-storage-popup');
|
12
15
|
const errorColors = [EFlag.Orange, EFlag.Red, EFlag.Yellow];
|
13
|
-
export const preparePDiskData = (data,
|
16
|
+
export const preparePDiskData = (data, nodeHost) => {
|
14
17
|
var _a;
|
15
18
|
const { AvailableSize, TotalSize, State, PDiskId, NodeId, Path, Realtime, Type, Device } = data;
|
16
19
|
const pdiskData = [
|
@@ -24,8 +27,8 @@ export const preparePDiskData = (data, nodes) => {
|
|
24
27
|
if (NodeId) {
|
25
28
|
pdiskData.push({ label: 'Node Id', value: NodeId });
|
26
29
|
}
|
27
|
-
if (
|
28
|
-
pdiskData.push({ label: 'Host', value:
|
30
|
+
if (nodeHost) {
|
31
|
+
pdiskData.push({ label: 'Host', value: nodeHost });
|
29
32
|
}
|
30
33
|
if (Path) {
|
31
34
|
pdiskData.push({ label: 'Path', value: Path });
|
@@ -42,8 +45,10 @@ export const preparePDiskData = (data, nodes) => {
|
|
42
45
|
}
|
43
46
|
return pdiskData;
|
44
47
|
};
|
45
|
-
export const PDiskPopup = ({ data,
|
46
|
-
const
|
48
|
+
export const PDiskPopup = ({ data, ...props }) => {
|
49
|
+
const nodeHostsMap = useTypedSelector(selectNodeHostsMap);
|
50
|
+
const nodeHost = valueIsDefined(data.NodeId) ? nodeHostsMap === null || nodeHostsMap === void 0 ? void 0 : nodeHostsMap.get(data.NodeId) : undefined;
|
51
|
+
const info = React.useMemo(() => preparePDiskData(data, nodeHost), [data, nodeHost]);
|
47
52
|
return (_jsx(Popup, { contentClassName: b(), placement: ['top', 'bottom'], hasArrow: true,
|
48
53
|
// bigger offset for easier switching to neighbour nodes
|
49
54
|
// matches the default offset for popup with arrow out of a sense of beauty
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PDiskPopup.js","sourceRoot":"","sources":["../../../src/components/PDiskPopup/PDiskPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"PDiskPopup.js","sourceRoot":"","sources":["../../../src/components/PDiskPopup/PDiskPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,sBAAsB,EAAC,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAEr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AwD;QACxD,2EAA2E;QAC3E,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KACX,KAAK,YAET,KAAC,UAAU,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,GAAG,GAC7C,CACX,CAAC;AACN,CAAC,CAAC"}
|
@@ -2,6 +2,7 @@ import type { Column, FetchData, GetRowClassName, HandleTableColumnsResize, Rend
|
|
2
2
|
import './PaginatedTable.scss';
|
3
3
|
export interface PaginatedTableProps<T, F> {
|
4
4
|
limit: number;
|
5
|
+
initialEntitiesCount?: number;
|
5
6
|
fetchData: FetchData<T, F>;
|
6
7
|
filters?: F;
|
7
8
|
tableName: string;
|
@@ -16,4 +17,4 @@ export interface PaginatedTableProps<T, F> {
|
|
16
17
|
renderErrorMessage?: RenderErrorMessage;
|
17
18
|
containerClassName?: string;
|
18
19
|
}
|
19
|
-
export declare const PaginatedTable: <T, F>({ limit, fetchData, filters, tableName, columns, getRowClassName, rowHeight, parentContainer, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }: PaginatedTableProps<T, F>) => import("react/jsx-runtime").JSX.Element;
|
20
|
+
export declare const PaginatedTable: <T, F>({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight, parentContainer, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }: PaginatedTableProps<T, F>) => import("react/jsx-runtime").JSX.Element;
|
@@ -10,10 +10,12 @@ import i18n from './i18n';
|
|
10
10
|
import { b } from './shared';
|
11
11
|
import { useIntersectionObserver } from './useIntersectionObserver';
|
12
12
|
import './PaginatedTable.scss';
|
13
|
-
export const PaginatedTable = ({ limit, fetchData, filters, tableName, columns, getRowClassName, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, parentContainer, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }) => {
|
13
|
+
export const PaginatedTable = ({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, parentContainer, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }) => {
|
14
|
+
const initialTotal = initialEntitiesCount || limit;
|
15
|
+
const initialFound = initialEntitiesCount || 0;
|
14
16
|
const [sortParams, setSortParams] = React.useState(initialSortParams);
|
15
|
-
const [totalEntities, setTotalEntities] = React.useState(
|
16
|
-
const [foundEntities, setFoundEntities] = React.useState(
|
17
|
+
const [totalEntities, setTotalEntities] = React.useState(initialTotal);
|
18
|
+
const [foundEntities, setFoundEntities] = React.useState(initialFound);
|
17
19
|
const [activeChunks, setActiveChunks] = React.useState([]);
|
18
20
|
const [isInitialLoad, setIsInitialLoad] = React.useState(true);
|
19
21
|
const tableContainer = React.useRef(null);
|
@@ -32,8 +34,8 @@ export const PaginatedTable = ({ limit, fetchData, filters, tableName, columns,
|
|
32
34
|
// reset table on filters change
|
33
35
|
React.useLayoutEffect(() => {
|
34
36
|
var _a;
|
35
|
-
setTotalEntities(
|
36
|
-
setFoundEntities(
|
37
|
+
setTotalEntities(initialTotal);
|
38
|
+
setFoundEntities(initialFound);
|
37
39
|
setIsInitialLoad(true);
|
38
40
|
if (parentContainer) {
|
39
41
|
parentContainer.scrollTo(0, 0);
|
@@ -42,7 +44,7 @@ export const PaginatedTable = ({ limit, fetchData, filters, tableName, columns,
|
|
42
44
|
(_a = tableContainer.current) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
|
43
45
|
}
|
44
46
|
setActiveChunks([0]);
|
45
|
-
}, [filters, limit, parentContainer]);
|
47
|
+
}, [filters, initialFound, initialTotal, limit, parentContainer]);
|
46
48
|
const renderChunks = () => {
|
47
49
|
if (!observer) {
|
48
50
|
return null;
|
@@ -52,7 +54,7 @@ export const PaginatedTable = ({ limit, fetchData, filters, tableName, columns,
|
|
52
54
|
}
|
53
55
|
const totalLength = foundEntities || limit;
|
54
56
|
const chunksCount = Math.ceil(totalLength / limit);
|
55
|
-
return getArray(chunksCount).map((value) => (_jsx(TableChunk, { id: value, limit: limit, rowHeight: rowHeight, columns: columns, fetchData: fetchData, filters: filters, tableName: tableName, sortParams: sortParams, getRowClassName: getRowClassName, renderErrorMessage: renderErrorMessage, onDataFetched: handleDataFetched, isActive: activeChunks.includes(value), observer: observer }, value)));
|
57
|
+
return getArray(chunksCount).map((value) => (_jsx(TableChunk, { id: value, limit: limit, totalLength: totalLength, rowHeight: rowHeight, columns: columns, fetchData: fetchData, filters: filters, tableName: tableName, sortParams: sortParams, getRowClassName: getRowClassName, renderErrorMessage: renderErrorMessage, onDataFetched: handleDataFetched, isActive: activeChunks.includes(value), observer: observer }, value)));
|
56
58
|
};
|
57
59
|
const renderTable = () => (_jsxs("table", { className: b('table'), children: [_jsx(TableHead, { columns: columns, onSort: setSortParams, onColumnsResize: onColumnsResize }), renderChunks()] }));
|
58
60
|
const renderContent = () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PaginatedTable.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/PaginatedTable.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,uBAAuB,EAAC,MAAM,oDAAoD,CAAC;AAE3F,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,wBAAwB,EAAC,MAAM,aAAa,CAAC;AACrD,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAC,CAAC,EAAC,MAAM,UAAU,CAAC;AAW3B,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAElE,OAAO,uBAAuB,CAAC;
|
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eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,iBAAiB,EAChC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,EACtC,QAAQ,EAAE,QAAQ,IAdb,KAAK,CAeZ,CACL,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACtB,iBAAO,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,aACxB,KAAC,SAAS,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,GAAI,EACvF,YAAY,EAAE,IACX,CACX,CAAC;IAEF,MAAM,aAAa,GAAG,GAAG,EAAE;QACvB,IAAI,cAAc,EAAE,CAAC;YACjB,OAAO,CACH,MAAC,uBAAuB,eACpB,KAAC,uBAAuB,CAAC,QAAQ,cAC5B,cAAc,CAAC,EAAC,MAAM,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,EAAC,CAAC,GACxC,EACnC,KAAC,uBAAuB,CAAC,KAAK,cAAE,WAAW,EAAE,GAAiC,IACxD,CAC7B,CAAC;QACN,CAAC;QAED,OAAO,WAAW,EAAE,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,CACH,cAAK,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,kBAAkB,CAAC,YAC3D,aAAa,EAAE,GACd,CACT,CAAC;AACN,CAAC,CAAC"}
|
@@ -4,6 +4,7 @@ import type { Column, FetchData, GetRowClassName, SortParams } from './types';
|
|
4
4
|
interface TableChunkProps<T, F> {
|
5
5
|
id: number;
|
6
6
|
limit: number;
|
7
|
+
totalLength: number;
|
7
8
|
rowHeight: number;
|
8
9
|
columns: Column<T>[];
|
9
10
|
filters?: F;
|
@@ -16,5 +17,5 @@ interface TableChunkProps<T, F> {
|
|
16
17
|
renderErrorMessage?: (error: IResponseError) => React.ReactNode;
|
17
18
|
onDataFetched: (total: number, found: number) => void;
|
18
19
|
}
|
19
|
-
export declare const TableChunk: <T, F>({ id, limit, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }: TableChunkProps<T, F>) => import("react/jsx-runtime").JSX.Element;
|
20
|
+
export declare const TableChunk: <T, F>({ id, limit, totalLength, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }: TableChunkProps<T, F>) => import("react/jsx-runtime").JSX.Element;
|
20
21
|
export {};
|
@@ -9,7 +9,7 @@ const DEBOUNCE_TIMEOUT = 200;
|
|
9
9
|
// With original memo generic types are lost
|
10
10
|
const typedMemo = React.memo;
|
11
11
|
// Memoisation prevents chunks rerenders that could cause perfomance issues on big tables
|
12
|
-
export const TableChunk = typedMemo(function TableChunk({ id, limit, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }) {
|
12
|
+
export const TableChunk = typedMemo(function TableChunk({ id, limit, totalLength, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }) {
|
13
13
|
var _a;
|
14
14
|
const ref = React.useRef(null);
|
15
15
|
const [isTimeoutActive, setIsTimeoutActive] = React.useState(true);
|
@@ -55,7 +55,10 @@ export const TableChunk = typedMemo(function TableChunk({ id, limit, rowHeight,
|
|
55
55
|
onDataFetched(total, found);
|
56
56
|
}
|
57
57
|
}, [currentData, isActive, onDataFetched]);
|
58
|
-
const
|
58
|
+
const chunkOffset = id * limit;
|
59
|
+
const remainingLenght = totalLength - chunkOffset;
|
60
|
+
const calculatedChunkLength = remainingLenght < limit ? remainingLenght : limit;
|
61
|
+
const dataLength = ((_a = currentData === null || currentData === void 0 ? void 0 : currentData.data) === null || _a === void 0 ? void 0 : _a.length) || calculatedChunkLength;
|
59
62
|
const renderContent = () => {
|
60
63
|
if (!isActive) {
|
61
64
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TableChunk.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableChunk.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpE,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,4CAA4C;AAC5C,MAAM,SAAS,GAA2B,KAAK,CAAC,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"TableChunk.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableChunk.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpE,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,4CAA4C;AAC5C,MAAM,SAAS,GAA2B,KAAK,CAAC,IAAI,CAAC;AAoBrD,yFAAyF;AACzF,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC,SAAS,UAAU,CAAO,EAC1D,EAAE,EACF,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,EACT,OAAO,EACP,UAA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EAAE,SAAS,GAAI,CACtC,GACW,CACnB,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACvC,KAAC,eAAe,IAEZ,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,KAAK,IAHP,KAAK,CAIZ,CACL,CAAC,CAAC;YACP,CAAC;QACL,CAAC;QAED,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,QAAQ,IAEL,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,OAAY,EACjB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,eAAe,IAL3B,KAAK,CAMZ,CACL,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;IAE5E,OAAO,CACH,gBACI,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,EACjB,KAAK,EAAE;YACH,MAAM,EAAE,GAAG,WAAW,IAAI;YAC1B,+EAA+E;YAC/E,6EAA6E;YAC7E,oCAAoC;YACpC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO;SAClD,YAEA,aAAa,EAAE,GACZ,CACX,CAAC;AACN,CAAC,CAAC,CAAC"}
|
@@ -8,30 +8,28 @@ import { isNumeric } from '../../utils/utils';
|
|
8
8
|
import { ResizeableDataTable } from '../ResizeableDataTable/ResizeableDataTable';
|
9
9
|
import { Cell } from './Cell';
|
10
10
|
import i18n from './i18n';
|
11
|
+
import { getColumnWidth } from './utils/getColumnWidth';
|
11
12
|
import './QueryResultTable.scss';
|
12
13
|
const TABLE_SETTINGS = {
|
13
14
|
...DEFAULT_TABLE_SETTINGS,
|
14
15
|
stripedRows: true,
|
15
16
|
dynamicRenderType: 'variable',
|
16
17
|
dynamicItemSizeGetter: () => 40,
|
18
|
+
sortable: false,
|
17
19
|
};
|
18
20
|
export const b = cn('ydb-query-result-table');
|
19
|
-
const
|
21
|
+
const WIDTH_PREDICTION_ROWS_COUNT = 100;
|
22
|
+
const prepareTypedColumns = (columns, data) => {
|
20
23
|
if (!columns.length) {
|
21
24
|
return [];
|
22
25
|
}
|
26
|
+
const dataSlice = data === null || data === void 0 ? void 0 : data.slice(0, WIDTH_PREDICTION_ROWS_COUNT);
|
23
27
|
return columns.map(({ name, type }) => {
|
24
28
|
const columnType = getColumnType(type);
|
25
29
|
const column = {
|
26
30
|
name,
|
31
|
+
width: getColumnWidth({ data: dataSlice, name }),
|
27
32
|
align: columnType === 'number' ? DataTable.RIGHT : DataTable.LEFT,
|
28
|
-
sortAccessor: (row) => {
|
29
|
-
const value = row[name];
|
30
|
-
if (value === undefined || value === null) {
|
31
|
-
return null;
|
32
|
-
}
|
33
|
-
return columnType === 'number' ? BigInt(value) : value;
|
34
|
-
},
|
35
33
|
render: ({ row }) => _jsx(Cell, { value: String(row[name]) }),
|
36
34
|
};
|
37
35
|
return column;
|
@@ -41,11 +39,12 @@ const prepareGenericColumns = (data) => {
|
|
41
39
|
if (!data.length) {
|
42
40
|
return [];
|
43
41
|
}
|
42
|
+
const dataSlice = data === null || data === void 0 ? void 0 : data.slice(0, WIDTH_PREDICTION_ROWS_COUNT);
|
44
43
|
return Object.keys(data[0]).map((name) => {
|
45
44
|
const column = {
|
46
45
|
name,
|
46
|
+
width: getColumnWidth({ data: dataSlice, name }),
|
47
47
|
align: isNumeric(data[0][name]) ? DataTable.RIGHT : DataTable.LEFT,
|
48
|
-
sortAccessor: (row) => (isNumeric(row[name]) ? Number(row[name]) : row[name]),
|
49
48
|
render: ({ row }) => _jsx(Cell, { value: String(row[name]) }),
|
50
49
|
};
|
51
50
|
return column;
|
@@ -53,15 +52,11 @@ const prepareGenericColumns = (data) => {
|
|
53
52
|
};
|
54
53
|
const getRowIndex = (_, index) => index;
|
55
54
|
export const QueryResultTable = (props) => {
|
56
|
-
const { columns: rawColumns, data: rawData,
|
55
|
+
const { columns: rawColumns, data: rawData, ...restProps } = props;
|
57
56
|
const data = React.useMemo(() => prepareQueryResponse(rawData), [rawData]);
|
58
57
|
const columns = React.useMemo(() => {
|
59
|
-
return rawColumns ? prepareTypedColumns(rawColumns) : prepareGenericColumns(data);
|
58
|
+
return rawColumns ? prepareTypedColumns(rawColumns, data) : prepareGenericColumns(data);
|
60
59
|
}, [data, rawColumns]);
|
61
|
-
const settings = React.useMemo(() => ({
|
62
|
-
...TABLE_SETTINGS,
|
63
|
-
...settingsMix,
|
64
|
-
}), [settingsMix]);
|
65
60
|
// empty data is expected to be be an empty array
|
66
61
|
// undefined data is not rendered at all
|
67
62
|
if (!Array.isArray(rawData)) {
|
@@ -70,7 +65,7 @@ export const QueryResultTable = (props) => {
|
|
70
65
|
if (!columns.length) {
|
71
66
|
return _jsx("div", { className: b('message'), children: i18n('empty') });
|
72
67
|
}
|
73
|
-
return (_jsx(ResizeableDataTable, { data: data, columns: columns, settings:
|
68
|
+
return (_jsx(ResizeableDataTable, { data: data, columns: columns, settings: TABLE_SETTINGS,
|
74
69
|
// prevent accessing row.id in case it is present but is not the PK (i.e. may repeat)
|
75
70
|
rowKey: getRowIndex, ...restProps }));
|
76
71
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryResultTable.js","sourceRoot":"","sources":["../../../src/components/QueryResultTable/QueryResultTable.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAIrD,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,sBAAsB,EAAC,MAAM,uBAAuB,CAA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AC,YAAG,IAAI,CAAC,OAAO,CAAC,GAAO,CAAC;IAC/D,CAAC;IAED,OAAO,CACH,KAAC,mBAAmB,IAChB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc;QACxB,qFAAqF;QACrF,MAAM,EAAE,WAAW,KACf,SAAS,GACf,CACL,CAAC;AACN,CAAC,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export const MAX_COLUMN_WIDTH = 600;
|
2
|
+
export const HEADER_PADDING = 20;
|
3
|
+
export const getColumnWidth = ({ data, name }) => {
|
4
|
+
let maxColumnContentLength = name.length;
|
5
|
+
if (data) {
|
6
|
+
for (const row of data) {
|
7
|
+
const cellLength = row[name] ? String(row[name]).length : 0;
|
8
|
+
maxColumnContentLength = Math.max(maxColumnContentLength, cellLength);
|
9
|
+
if (maxColumnContentLength * 10 + HEADER_PADDING >= MAX_COLUMN_WIDTH) {
|
10
|
+
return MAX_COLUMN_WIDTH;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
14
|
+
return maxColumnContentLength * 10 + HEADER_PADDING;
|
15
|
+
};
|
16
|
+
//# sourceMappingURL=getColumnWidth.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getColumnWidth.js","sourceRoot":"","sources":["../../../../src/components/QueryResultTable/utils/getColumnWidth.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,EAAuC,EAAE,EAAE;IACjF,IAAI,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAAC;IAEzC,IAAI,IAAI,EAAE,CAAC;QACP,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,sBAAsB,GAAG,IAAI,CAAC,GAAG,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;YAEtE,IAAI,sBAAsB,GAAG,EAAE,GAAG,cAAc,IAAI,gBAAgB,EAAE,CAAC;gBACnE,OAAO,gBAAgB,CAAC;YAC5B,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,sBAAsB,GAAG,EAAE,GAAG,cAAc,CAAC;AACxD,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { HEADER_PADDING, MAX_COLUMN_WIDTH, getColumnWidth } from './getColumnWidth';
|
2
|
+
describe('getColumnWidth', () => {
|
3
|
+
it('returns minimum width for empty data', () => {
|
4
|
+
const result = getColumnWidth({ data: [], name: 'test' });
|
5
|
+
expect(result).toBe(HEADER_PADDING + 'test'.length * 10);
|
6
|
+
});
|
7
|
+
it('calculates correct width for string columns', () => {
|
8
|
+
const data = [{ test: 'short' }, { test: 'medium length' }, { test: 'this is a longer string' }];
|
9
|
+
const result = getColumnWidth({ data, name: 'test' });
|
10
|
+
expect(result).toBe(HEADER_PADDING + 'this is a longer string'.length * 10);
|
11
|
+
});
|
12
|
+
it('returns MAX_COLUMN_WIDTH when calculated width exceeds it', () => {
|
13
|
+
const data = [{ test: 'a'.repeat(100) }];
|
14
|
+
const result = getColumnWidth({ data, name: 'test' });
|
15
|
+
expect(result).toBe(MAX_COLUMN_WIDTH);
|
16
|
+
});
|
17
|
+
it('handles undefined data correctly', () => {
|
18
|
+
const result = getColumnWidth({ name: 'test' });
|
19
|
+
expect(result).toBe(HEADER_PADDING + 'test'.length * 10);
|
20
|
+
});
|
21
|
+
it('handles missing values in data correctly', () => {
|
22
|
+
const data = [{ test: 'short' }, {}, { test: 'longer string' }];
|
23
|
+
const result = getColumnWidth({ data, name: 'test' });
|
24
|
+
expect(result).toBe(HEADER_PADDING + 'longer string'.length * 10);
|
25
|
+
});
|
26
|
+
it('uses column name length when all values are shorter', () => {
|
27
|
+
const data = [{ longColumnName: 'a' }, { longColumnName: 'bb' }];
|
28
|
+
const result = getColumnWidth({ data, name: 'longColumnName' });
|
29
|
+
expect(result).toBe(HEADER_PADDING + 'longColumnName'.length * 10);
|
30
|
+
});
|
31
|
+
});
|
32
|
+
//# sourceMappingURL=getColumnWidth.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getColumnWidth.test.js","sourceRoot":"","sources":["../../../../src/components/QueryResultTable/utils/getColumnWidth.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAElF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,MAAM,GAAG,cAAc,CAAC,EAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACnD,MAAM,IAAI,GAAG,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,EAAE,EAAC,IAAI,EAAE,eAAe,EAAC,EAAE,EAAC,IAAI,EAAE,yBAAyB,EAAC,CAAC,CAAC;QAC3F,MAAM,MAAM,GAAG,cAAc,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,yBAAyB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC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CAAC;QAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,gBAAgB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
@@ -10,7 +10,7 @@ import { ProgressViewer } from '../ProgressViewer/ProgressViewer';
|
|
10
10
|
import { storageGroupInfoKeyset } from './i18n';
|
11
11
|
// eslint-disable-next-line complexity
|
12
12
|
export function StorageGroupInfo({ data, className, ...infoViewerProps }) {
|
13
|
-
const { Encryption, Overall, DiskSpace, MediaType, ErasureSpecies, Used, Limit, Usage, Read, Write, GroupGeneration, Latency, AllocationUnits, State, MissingDisks, Available,
|
13
|
+
const { Encryption, Overall, DiskSpace, MediaType, ErasureSpecies, Used, Limit, Usage, Read, Write, GroupGeneration, Latency, AllocationUnits, State, MissingDisks, Available, LatencyPutTabletLogMs, LatencyPutUserDataMs, LatencyGetFastMs, } = data || {};
|
14
14
|
const storageGroupInfoFirstColumn = [];
|
15
15
|
if (valueIsDefined(GroupGeneration)) {
|
16
16
|
storageGroupInfoFirstColumn.push({
|
@@ -82,22 +82,22 @@ export function StorageGroupInfo({ data, className, ...infoViewerProps }) {
|
|
82
82
|
value: _jsx(EntityStatus, { status: Latency }),
|
83
83
|
});
|
84
84
|
}
|
85
|
-
if (valueIsDefined(
|
85
|
+
if (valueIsDefined(LatencyPutTabletLogMs)) {
|
86
86
|
storageGroupInfoSecondColumn.push({
|
87
87
|
label: storageGroupInfoKeyset('latency-put-tablet-log'),
|
88
|
-
value: formatToMs(
|
88
|
+
value: formatToMs(LatencyPutTabletLogMs),
|
89
89
|
});
|
90
90
|
}
|
91
|
-
if (valueIsDefined(
|
91
|
+
if (valueIsDefined(LatencyPutUserDataMs)) {
|
92
92
|
storageGroupInfoSecondColumn.push({
|
93
93
|
label: storageGroupInfoKeyset('latency-put-user-data'),
|
94
|
-
value: formatToMs(
|
94
|
+
value: formatToMs(LatencyPutUserDataMs),
|
95
95
|
});
|
96
96
|
}
|
97
|
-
if (valueIsDefined(
|
97
|
+
if (valueIsDefined(LatencyGetFastMs)) {
|
98
98
|
storageGroupInfoSecondColumn.push({
|
99
99
|
label: storageGroupInfoKeyset('latency-get-fast'),
|
100
|
-
value: formatToMs(
|
100
|
+
value: formatToMs(LatencyGetFastMs),
|
101
101
|
});
|
102
102
|
}
|
103
103
|
if (valueIsDefined(AllocationUnits)) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"StorageGroupInfo.js","sourceRoot":"","sources":["../../../src/components/StorageGroupInfo/StorageGroupInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,uBAAuB,EAAC,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EAAC,sBAAsB,EAAC,MAAM,QAAQ,CAAC;AAO9C,sCAAsC;AACtC,MAAM,UAAU,gBAAgB,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,GAAG,eAAe,EAAwB;IACzF,MAAM,EACF,UAAU,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,eAAe,EACf,OAAO,EACP,eAAe,EACf,KAAK,EACL,YAAY,EACZ,SAAS,EACT,
|
1
|
+
{"version":3,"file":"StorageGroupInfo.js","sourceRoot":"","sources":["../../../src/components/StorageGroupInfo/StorageGroupInfo.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2BAA2B,KAAM,eAAe,GAAI,EACtE,KAAC,UAAU,IAAC,IAAI,EAAE,4BAA4B,KAAM,eAAe,GAAI,IACpE,CACV,CAAC;AACN,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
export declare const storageGroupInfoKeyset: (key: "state" | "yes" | "no" | "
|
1
|
+
export declare const storageGroupInfoKeyset: (key: "state" | "yes" | "no" | "encryption" | "missing-disks" | "usage" | "latency" | "allocation-units" | "media-type" | "available" | "read-throughput" | "write-throughput" | "overall" | "disk-space" | "erasure-species" | "used-space" | "group-generation" | "latency-put-tablet-log" | "latency-put-user-data" | "latency-get-fast", params?: import("@gravity-ui/i18n").Params) => string;
|
@@ -2,6 +2,7 @@ import './TableSkeleton.scss';
|
|
2
2
|
interface TableSkeletonProps {
|
3
3
|
className?: string;
|
4
4
|
rows?: number;
|
5
|
+
delay?: number;
|
5
6
|
}
|
6
|
-
export declare const TableSkeleton: ({ rows, className }: TableSkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
7
|
+
export declare const TableSkeleton: ({ rows, delay, className }: TableSkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
7
8
|
export {};
|
@@ -1,7 +1,11 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { Skeleton } from '@gravity-ui/uikit';
|
3
3
|
import { cn } from '../../utils/cn';
|
4
|
+
import { useDelayed } from '../../utils/hooks/useDelayed';
|
4
5
|
import './TableSkeleton.scss';
|
5
6
|
const b = cn('table-skeleton');
|
6
|
-
export const TableSkeleton = ({ rows = 2,
|
7
|
+
export const TableSkeleton = ({ rows = 2, delay = 600, className }) => {
|
8
|
+
const [show] = useDelayed(delay);
|
9
|
+
return (_jsxs("div", { className: b('wrapper', { hidden: !show }, className), children: [_jsxs("div", { className: b('row'), children: [_jsx(Skeleton, { className: b('col-1') }), _jsx(Skeleton, { className: b('col-2') }), _jsx(Skeleton, { className: b('col-3') }), _jsx(Skeleton, { className: b('col-4') }), _jsx(Skeleton, { className: b('col-5') })] }), [...new Array(rows)].map((_, index) => (_jsx("div", { className: b('row'), children: _jsx(Skeleton, { className: b('col-full') }) }, `skeleton-row-${index}`)))] }));
|
10
|
+
};
|
7
11
|
//# sourceMappingURL=TableSkeleton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TableSkeleton.js","sourceRoot":"","sources":["../../../src/components/TableSkeleton/TableSkeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"TableSkeleton.js","sourceRoot":"","sources":["../../../src/components/TableSkeleton/TableSkeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAExD,OAAO,sBAAsB,CAAC;AAE9B,MAAM,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC;AAQ/B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,GAAG,EAAE,SAAS,EAAqB,EAAE,EAAE;IACpF,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAEjC,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,MAAM,EAAE,CAAC,IAAI,EAAC,EAAE,SAAS,CAAC,aACpD,eAAK,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,aACpB,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,IACjC,EACL,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,cAAK,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,YACpB,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,GAAI,IADX,gBAAgB,KAAK,EAAE,CAEhD,CACT,CAAC,IACA,CACT,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import type { NodesMap } from '../../types/store/nodesList';
|
2
1
|
import type { PreparedVDisk } from '../../utils/disks/types';
|
3
2
|
import './VDisk.scss';
|
4
3
|
export interface VDiskProps {
|
5
4
|
data?: PreparedVDisk;
|
6
|
-
nodes?: NodesMap;
|
7
5
|
compact?: boolean;
|
8
6
|
inactive?: boolean;
|
9
7
|
showPopup?: boolean;
|
@@ -11,4 +9,4 @@ export interface VDiskProps {
|
|
11
9
|
onHidePopup?: VoidFunction;
|
12
10
|
progressBarClassName?: string;
|
13
11
|
}
|
14
|
-
export declare const VDisk: ({ data,
|
12
|
+
export declare const VDisk: ({ data, compact, inactive, showPopup, onShowPopup, onHidePopup, progressBarClassName, }: VDiskProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -12,7 +12,7 @@ import { InternalLink } from '../InternalLink';
|
|
12
12
|
import { VDiskPopup } from '../VDiskPopup/VDiskPopup';
|
13
13
|
import './VDisk.scss';
|
14
14
|
const b = cn('ydb-vdisk-component');
|
15
|
-
export const VDisk = ({ data = {},
|
15
|
+
export const VDisk = ({ data = {}, compact, inactive, showPopup, onShowPopup, onHidePopup, progressBarClassName, }) => {
|
16
16
|
const isFullData = isFullVDiskData(data);
|
17
17
|
const diskPagesAvailable = useDiskPagesAvailable();
|
18
18
|
const [isPopupVisible, setIsPopupVisible] = React.useState(false);
|
@@ -38,6 +38,6 @@ export const VDisk = ({ data = {}, nodes, compact, inactive, showPopup, onShowPo
|
|
38
38
|
vdiskId: stringifyVdiskId(data.VDiskId),
|
39
39
|
});
|
40
40
|
}
|
41
|
-
return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b(), ref: anchor, onMouseEnter: handleShowPopup, onMouseLeave: handleHidePopup, children: _jsx(InternalLink, { to: vDiskPath, className: b('content'), children: _jsx(DiskStateProgressBar, { diskAllocatedPercent: data.AllocatedPercent, severity: data.Severity, compact: compact, inactive: inactive, className: progressBarClassName }) }) }), _jsx(VDiskPopup, { data: data,
|
41
|
+
return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b(), ref: anchor, onMouseEnter: handleShowPopup, onMouseLeave: handleHidePopup, children: _jsx(InternalLink, { to: vDiskPath, className: b('content'), children: _jsx(DiskStateProgressBar, { diskAllocatedPercent: data.AllocatedPercent, severity: data.Severity, compact: compact, inactive: inactive, className: progressBarClassName }) }) }), _jsx(VDiskPopup, { data: data, anchorRef: anchor, open: isPopupVisible || showPopup })] }));
|
42
42
|
};
|
43
43
|
//# sourceMappingURL=VDisk.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VDisk.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDisk.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,iCAAiC,CAAC;AAC1D,OAAO,MAAM,EAAE,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAClE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;
|
1
|
+
{"version":3,"file":"VDisk.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDisk.tsx"],"names":[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AE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,IAAI,SAAS,GAAI,IACnE,CACpB,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,11 +1,9 @@
|
|
1
1
|
import type { PopupProps } from '@gravity-ui/uikit';
|
2
2
|
import type { TVDiskStateInfo } from '../../types/api/vdisk';
|
3
|
-
import type { NodesMap } from '../../types/store/nodesList';
|
4
3
|
import type { UnavailableDonor } from '../../utils/disks/types';
|
5
4
|
import './VDiskPopup.scss';
|
6
5
|
interface VDiskPopupProps extends PopupProps {
|
7
6
|
data: TVDiskStateInfo | UnavailableDonor;
|
8
|
-
nodes?: NodesMap;
|
9
7
|
}
|
10
|
-
export declare const VDiskPopup: ({ data,
|
8
|
+
export declare const VDiskPopup: ({ data, ...props }: VDiskPopupProps) => import("react/jsx-runtime").JSX.Element;
|
11
9
|
export {};
|
@@ -1,11 +1,14 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
3
|
import { Label, Popup } from '@gravity-ui/uikit';
|
4
|
+
import { selectNodeHostsMap } from '../../store/reducers/nodesList';
|
4
5
|
import { EFlag } from '../../types/api/enums';
|
6
|
+
import { valueIsDefined } from '../../utils';
|
5
7
|
import { cn } from '../../utils/cn';
|
6
8
|
import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants';
|
7
9
|
import { stringifyVdiskId } from '../../utils/dataFormatters/dataFormatters';
|
8
10
|
import { isFullVDiskData } from '../../utils/disks/helpers';
|
11
|
+
import { useTypedSelector } from '../../utils/hooks';
|
9
12
|
import { bytesToGB, bytesToSpeed } from '../../utils/utils';
|
10
13
|
import { InfoViewer } from '../InfoViewer';
|
11
14
|
import { preparePDiskData } from '../PDiskPopup/PDiskPopup';
|
@@ -83,10 +86,12 @@ const prepareVDiskData = (data) => {
|
|
83
86
|
}
|
84
87
|
return vdiskData;
|
85
88
|
};
|
86
|
-
export const VDiskPopup = ({ data,
|
89
|
+
export const VDiskPopup = ({ data, ...props }) => {
|
87
90
|
const isFullData = isFullVDiskData(data);
|
88
91
|
const vdiskInfo = React.useMemo(() => (isFullData ? prepareVDiskData(data) : prepareUnavailableVDiskData(data)), [data, isFullData]);
|
89
|
-
const
|
92
|
+
const nodeHostsMap = useTypedSelector(selectNodeHostsMap);
|
93
|
+
const nodeHost = valueIsDefined(data.NodeId) ? nodeHostsMap === null || nodeHostsMap === void 0 ? void 0 : nodeHostsMap.get(data.NodeId) : undefined;
|
94
|
+
const pdiskInfo = React.useMemo(() => isFullData && data.PDisk && preparePDiskData(data.PDisk, nodeHost), [data, nodeHost, isFullData]);
|
90
95
|
return (_jsxs(Popup, { contentClassName: b(), placement: ['top', 'bottom'], hasArrow: true,
|
91
96
|
// bigger offset for easier switching to neighbour nodes
|
92
97
|
// matches the default offset for popup with arrow out of a sense of beauty
|