ydb-embedded-ui 6.23.1 → 6.25.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/CellWithPopover/CellWithPopover.js +2 -1
- package/dist/components/CellWithPopover/CellWithPopover.js.map +1 -1
- package/dist/components/NodeHostWrapper/NodeHostWrapper.d.ts +6 -2
- package/dist/components/NodeHostWrapper/NodeHostWrapper.js.map +1 -1
- package/dist/components/PDiskPopup/PDiskPopup.js +8 -1
- package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
- package/dist/components/PaginatedTable/PaginatedTable.d.ts +3 -2
- package/dist/components/PaginatedTable/PaginatedTable.js +15 -21
- package/dist/components/PaginatedTable/PaginatedTable.js.map +1 -1
- package/dist/components/PaginatedTable/TableChunk.d.ts +1 -2
- package/dist/components/PaginatedTable/TableChunk.js +5 -19
- package/dist/components/PaginatedTable/TableChunk.js.map +1 -1
- package/dist/components/PaginatedTable/useScrollBasedChunks.d.ts +9 -0
- package/dist/components/PaginatedTable/useScrollBasedChunks.js +35 -0
- package/dist/components/PaginatedTable/useScrollBasedChunks.js.map +1 -0
- package/dist/components/TabletsStatistic/TabletsStatistic.d.ts +2 -2
- package/dist/components/TabletsStatistic/TabletsStatistic.js +2 -2
- package/dist/components/TabletsStatistic/TabletsStatistic.js.map +1 -1
- package/dist/components/VDisk/VDisk.js +12 -26
- package/dist/components/VDisk/VDisk.js.map +1 -1
- package/dist/components/VDisk/VDisk.scss +2 -0
- package/dist/components/VDisk/VDiskWithDonorsStack.js +2 -2
- package/dist/components/VDisk/VDiskWithDonorsStack.js.map +1 -1
- package/dist/components/VDisk/utils.d.ts +2 -0
- package/dist/components/VDisk/utils.js +23 -0
- package/dist/components/VDisk/utils.js.map +1 -0
- package/dist/components/VDiskInfo/VDiskInfo.js +2 -2
- package/dist/components/VDiskInfo/VDiskInfo.js.map +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.d.ts +2 -3
- package/dist/components/VDiskPopup/VDiskPopup.js +29 -3
- package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
- package/dist/components/nodesColumns/columns.d.ts +55 -0
- package/dist/components/nodesColumns/columns.js +187 -0
- package/dist/components/nodesColumns/columns.js.map +1 -0
- package/dist/components/nodesColumns/constants.d.ts +39 -0
- package/dist/components/nodesColumns/constants.js +73 -0
- package/dist/components/nodesColumns/constants.js.map +1 -0
- package/dist/{containers/Nodes/columns → components/nodesColumns}/i18n/en.json +4 -3
- package/dist/components/nodesColumns/i18n/index.d.ts +2 -0
- package/dist/{containers/Nodes/columns → components/nodesColumns}/i18n/index.js +1 -1
- package/dist/components/nodesColumns/i18n/index.js.map +1 -0
- package/dist/components/nodesColumns/types.d.ts +8 -0
- package/dist/components/nodesColumns/types.js.map +1 -0
- package/dist/containers/AppWithClusters/ExtendedCluster/ExtendedCluster.js +8 -4
- package/dist/containers/AppWithClusters/ExtendedCluster/ExtendedCluster.js.map +1 -1
- package/dist/containers/Authentication/Authentication.js +12 -10
- package/dist/containers/Authentication/Authentication.js.map +1 -1
- package/dist/containers/Cluster/Cluster.js +3 -1
- package/dist/containers/Cluster/Cluster.js.map +1 -1
- package/dist/containers/Cluster/utils.d.ts +4 -0
- package/dist/containers/Cluster/utils.js +6 -1
- package/dist/containers/Cluster/utils.js.map +1 -1
- package/dist/containers/Node/Node.js +1 -1
- package/dist/containers/Node/Node.js.map +1 -1
- package/dist/containers/Nodes/Nodes.js +1 -1
- package/dist/containers/Nodes/Nodes.js.map +1 -1
- package/dist/containers/Nodes/NodesWrapper.d.ts +2 -2
- package/dist/containers/Nodes/NodesWrapper.js +2 -2
- package/dist/containers/Nodes/NodesWrapper.js.map +1 -1
- package/dist/containers/Nodes/PaginatedNodes.d.ts +3 -2
- package/dist/containers/Nodes/PaginatedNodes.js +3 -3
- package/dist/containers/Nodes/PaginatedNodes.js.map +1 -1
- package/dist/containers/Nodes/columns/columns.d.ts +2 -7
- package/dist/containers/Nodes/columns/columns.js +13 -187
- package/dist/containers/Nodes/columns/columns.js.map +1 -1
- package/dist/containers/Nodes/columns/constants.d.ts +1 -38
- package/dist/containers/Nodes/columns/constants.js +0 -68
- package/dist/containers/Nodes/columns/constants.js.map +1 -1
- package/dist/containers/Nodes/columns/hooks.d.ts +3 -3
- package/dist/containers/Nodes/columns/hooks.js +2 -1
- package/dist/containers/Nodes/columns/hooks.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskPage.js +2 -2
- package/dist/containers/PDiskPage/PDiskPage.js.map +1 -1
- package/dist/containers/Storage/Disks/Disks.d.ts +2 -2
- package/dist/containers/Storage/Disks/Disks.js +5 -6
- package/dist/containers/Storage/Disks/Disks.js.map +1 -1
- package/dist/containers/Storage/PDisk/PDisk.d.ts +2 -2
- package/dist/containers/Storage/PDisk/PDisk.js +13 -11
- package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorage.d.ts +4 -1
- package/dist/containers/Storage/PaginatedStorage.js +3 -2
- package/dist/containers/Storage/PaginatedStorage.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageGroups.js +7 -6
- package/dist/containers/Storage/PaginatedStorageGroups.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageNodes.js +9 -8
- package/dist/containers/Storage/PaginatedStorageNodes.js.map +1 -1
- package/dist/containers/Storage/Storage.d.ts +3 -1
- package/dist/containers/Storage/Storage.js +3 -3
- package/dist/containers/Storage/Storage.js.map +1 -1
- package/dist/containers/Storage/StorageControls/StorageControls.js +2 -2
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.d.ts +3 -2
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.js +2 -2
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/StorageGroupsColumns.scss +10 -1
- package/dist/containers/Storage/StorageGroups/columns/columns.js +21 -16
- package/dist/containers/Storage/StorageGroups/columns/columns.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/constants.js +1 -1
- package/dist/containers/Storage/StorageGroups/columns/constants.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/hooks.d.ts +3 -2
- package/dist/containers/Storage/StorageGroups/columns/hooks.js +5 -5
- package/dist/containers/Storage/StorageGroups/columns/hooks.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/i18n/en.json +1 -1
- package/dist/containers/Storage/StorageGroups/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageGroups/columns/types.d.ts +3 -2
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.d.ts +3 -2
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.js +2 -2
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/columns.d.ts +2 -38
- package/dist/containers/Storage/StorageNodes/columns/columns.js +34 -71
- package/dist/containers/Storage/StorageNodes/columns/columns.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/constants.d.ts +20 -4
- package/dist/containers/Storage/StorageNodes/columns/constants.js +4 -32
- package/dist/containers/Storage/StorageNodes/columns/constants.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/hooks.d.ts +2 -39
- package/dist/containers/Storage/StorageNodes/columns/hooks.js +4 -4
- package/dist/containers/Storage/StorageNodes/columns/hooks.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/i18n/en.json +0 -8
- package/dist/containers/Storage/StorageNodes/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageNodes/columns/types.d.ts +5 -5
- package/dist/containers/Storage/StorageWrapper.d.ts +6 -3
- package/dist/containers/Storage/StorageWrapper.js +10 -3
- package/dist/containers/Storage/StorageWrapper.js.map +1 -1
- package/dist/containers/Storage/types.d.ts +6 -0
- package/dist/containers/Storage/types.js +2 -0
- package/dist/containers/Storage/types.js.map +1 -0
- package/dist/containers/Storage/utils/index.d.ts +4 -6
- package/dist/containers/Storage/utils/index.js +35 -9
- package/dist/containers/Storage/utils/index.js.map +1 -1
- package/dist/containers/StorageGroupPage/StorageGroupPage.js +2 -2
- package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
- package/dist/containers/Tablet/components/TabletStorageInfo/TabletStorageInfo.scss +2 -9
- package/dist/containers/Tablets/Tablets.js +2 -123
- package/dist/containers/Tablets/Tablets.js.map +1 -1
- package/dist/containers/Tablets/TabletsTable.d.ts +10 -0
- package/dist/containers/Tablets/TabletsTable.js +129 -0
- package/dist/containers/Tablets/TabletsTable.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js +4 -4
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.d.ts +4 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +18 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +22 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +23 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +2 -6
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.js +4 -2
- package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js.map +1 -1
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +5 -7
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js.map +1 -1
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.scss +1 -1
- package/dist/containers/Tenant/Query/Preview/Preview.js +3 -2
- package/dist/containers/Tenant/Query/Preview/Preview.js.map +1 -1
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +1 -4
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js.map +1 -1
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.d.ts +4 -4
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js +1 -1
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js.map +1 -1
- package/dist/containers/Tenants/Tenants.js +10 -2
- package/dist/containers/Tenants/Tenants.js.map +1 -1
- package/dist/containers/UserSettings/i18n/en.json +0 -2
- package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
- package/dist/containers/UserSettings/settings.d.ts +0 -1
- package/dist/containers/UserSettings/settings.js +2 -7
- package/dist/containers/UserSettings/settings.js.map +1 -1
- package/dist/containers/VDiskPage/VDiskPage.js +3 -4
- package/dist/containers/VDiskPage/VDiskPage.js.map +1 -1
- package/dist/services/api.d.ts +3 -4
- package/dist/services/api.js +1 -3
- package/dist/services/api.js.map +1 -1
- package/dist/services/settings.d.ts +1 -2
- package/dist/services/settings.js +1 -2
- package/dist/services/settings.js.map +1 -1
- package/dist/store/reducers/cluster/__test__/parseGroupsStatsQueryResponse.test.js +62 -40
- package/dist/store/reducers/cluster/__test__/parseGroupsStatsQueryResponse.test.js.map +1 -1
- package/dist/store/reducers/cluster/cluster.js +0 -1
- package/dist/store/reducers/cluster/cluster.js.map +1 -1
- package/dist/store/reducers/cluster/utils.d.ts +1 -1
- package/dist/store/reducers/cluster/utils.js +2 -1
- package/dist/store/reducers/cluster/utils.js.map +1 -1
- package/dist/store/reducers/executeQuery.d.ts +0 -2
- package/dist/store/reducers/executeQuery.js +1 -2
- package/dist/store/reducers/executeQuery.js.map +1 -1
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +1 -1
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js +4 -4
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js.map +1 -1
- package/dist/store/reducers/nodes/types.d.ts +2 -7
- package/dist/store/reducers/nodes/utils.js +0 -6
- package/dist/store/reducers/nodes/utils.js.map +1 -1
- package/dist/store/reducers/preview.js +1 -1
- package/dist/store/reducers/preview.js.map +1 -1
- package/dist/store/reducers/shardsWorkload/shardsWorkload.js +0 -1
- package/dist/store/reducers/shardsWorkload/shardsWorkload.js.map +1 -1
- package/dist/store/reducers/storage/types.d.ts +6 -7
- package/dist/store/reducers/storage/utils.js +23 -9
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +0 -1
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js.map +1 -1
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +0 -1
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js.map +1 -1
- package/dist/store/reducers/tenants/types.d.ts +1 -0
- package/dist/store/reducers/tenants/utils.js +4 -2
- package/dist/store/reducers/tenants/utils.js.map +1 -1
- package/dist/store/reducers/viewSchema/viewSchema.js +2 -2
- package/dist/store/reducers/viewSchema/viewSchema.js.map +1 -1
- package/dist/types/additionalProps.d.ts +1 -1
- package/dist/types/api/cluster.d.ts +2 -0
- package/dist/types/api/cluster.js +3 -1
- package/dist/types/api/cluster.js.map +1 -1
- package/dist/types/api/nodes.d.ts +3 -0
- package/dist/types/api/nodes.js.map +1 -1
- package/dist/types/api/query.d.ts +16 -30
- package/dist/types/api/storage.d.ts +2 -2
- package/dist/types/store/query.d.ts +0 -1
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/constants.js +0 -2
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/disks/__test__/calculateVDiskSeverity.test.js +1 -2
- package/dist/utils/disks/__test__/calculateVDiskSeverity.test.js.map +1 -1
- package/dist/utils/disks/calculateVDiskSeverity.js +2 -3
- package/dist/utils/disks/calculateVDiskSeverity.js.map +1 -1
- package/dist/utils/disks/prepareDisks.js +3 -0
- package/dist/utils/disks/prepareDisks.js.map +1 -1
- package/dist/utils/disks/types.d.ts +1 -0
- package/dist/utils/nodes.d.ts +4 -2
- package/dist/utils/nodes.js +10 -1
- package/dist/utils/nodes.js.map +1 -1
- package/dist/utils/query.d.ts +5 -5
- package/dist/utils/query.js +7 -22
- package/dist/utils/query.js.map +1 -1
- package/dist/utils/query.test.js +221 -56
- package/dist/utils/query.test.js.map +1 -1
- package/dist/utils/storage.d.ts +1 -0
- package/dist/utils/storage.js +3 -0
- package/dist/utils/storage.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/PaginatedTable/useIntersectionObserver.d.ts +0 -9
- package/dist/components/PaginatedTable/useIntersectionObserver.js +0 -28
- package/dist/components/PaginatedTable/useIntersectionObserver.js.map +0 -1
- package/dist/containers/Nodes/columns/i18n/index.d.ts +0 -2
- package/dist/containers/Nodes/columns/i18n/index.js.map +0 -1
- package/dist/containers/Nodes/columns/types.d.ts +0 -9
- package/dist/containers/Nodes/columns/types.js.map +0 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.d.ts +0 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.js +0 -7
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.js.map +0 -1
- /package/dist/{containers/Nodes/columns → components/nodesColumns}/types.js +0 -0
@@ -3,7 +3,8 @@ import { Popover } from '@gravity-ui/uikit';
|
|
3
3
|
import { cn } from '../../utils/cn';
|
4
4
|
import './CellWithPopover.scss';
|
5
5
|
const b = cn('ydb-cell-with-popover');
|
6
|
+
const DELAY_TIMEOUT = 100;
|
6
7
|
export function CellWithPopover({ children, className, wrapperClassName, ...props }) {
|
7
|
-
return (_jsx("div", { className: b(null, wrapperClassName), children: _jsx(Popover, { className: b('popover', className), ...props, children: children }) }));
|
8
|
+
return (_jsx("div", { className: b(null, wrapperClassName), children: _jsx(Popover, { delayClosing: DELAY_TIMEOUT, delayOpening: DELAY_TIMEOUT, className: b('popover', className), ...props, children: children }) }));
|
8
9
|
}
|
9
10
|
//# sourceMappingURL=CellWithPopover.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CellWithPopover.js","sourceRoot":"","sources":["../../../src/components/CellWithPopover/CellWithPopover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAElC,OAAO,wBAAwB,CAAC;AAEhC,MAAM,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,CAAC;AAMtC,MAAM,UAAU,eAAe,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,GAAG,KAAK,EACW;IACnB,OAAO,CACH,cAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,gBAAgB,CAAC,YACrC,KAAC,OAAO,
|
1
|
+
{"version":3,"file":"CellWithPopover.js","sourceRoot":"","sources":["../../../src/components/CellWithPopover/CellWithPopover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAElC,OAAO,wBAAwB,CAAC;AAEhC,MAAM,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,CAAC;AAMtC,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,UAAU,eAAe,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,GAAG,KAAK,EACW;IACnB,OAAO,CACH,cAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,gBAAgB,CAAC,YACrC,KAAC,OAAO,IACJ,YAAY,EAAE,aAAa,EAC3B,YAAY,EAAE,aAAa,EAC3B,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,KAC9B,KAAK,YAER,QAAQ,GACH,GACR,CACT,CAAC;AACN,CAAC"}
|
@@ -1,7 +1,11 @@
|
|
1
|
-
import type { NodesPreparedEntity } from '../../store/reducers/nodes/types';
|
2
1
|
import type { NodeAddress } from '../../types/additionalProps';
|
2
|
+
import type { TSystemStateInfo } from '../../types/api/nodes';
|
3
|
+
export type NodeHostData = NodeAddress & Pick<TSystemStateInfo, 'SystemState'> & {
|
4
|
+
NodeId: string | number;
|
5
|
+
TenantName?: string;
|
6
|
+
};
|
3
7
|
interface NodeHostWrapperProps {
|
4
|
-
node:
|
8
|
+
node: NodeHostData;
|
5
9
|
getNodeRef?: (node?: NodeAddress) => string | null;
|
6
10
|
database?: string;
|
7
11
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NodeHostWrapper.js","sourceRoot":"","sources":["../../../src/components/NodeHostWrapper/NodeHostWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,eAAe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,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;IAC7C,CAAC;SAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACrB,QAAQ,GAAG,+BAA+B,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;IACzE,CAAC;IAED,MAAM,QAAQ,GAAG,eAAe;QAC5B,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE;YAC5B,UAAU,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,CAAC,UAAU;SAC1C,CAAC;QACJ,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,kBAAkB,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAC,qBAAqB,IAAC,IAAI,EAAE,QAAQ,GAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvF,OAAO,CACH,KAAC,eAAe,IACZ,QAAQ,EAAE,CAAC,eAAe,EAC1B,OAAO,EAAE,KAAC,2BAA2B,IAAC,IAAI,EAAE,IAAI,GAAI,EACpD,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,EAC5B,QAAQ,EAAE,eAAe,CAAC,SAAS,YAEnC,KAAC,YAAY,IACT,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,WAAW,EACxB,IAAI,EAAE,QAAQ,EACd,kBAAkB,QAClB,kBAAkB,EAAE,kBAAkB,GACxC,GACY,CACrB,CAAC;AACN,CAAC,CAAC"}
|
@@ -49,9 +49,16 @@ export const PDiskPopup = ({ data, ...props }) => {
|
|
49
49
|
const nodeHostsMap = useTypedSelector(selectNodeHostsMap);
|
50
50
|
const nodeHost = valueIsDefined(data.NodeId) ? nodeHostsMap === null || nodeHostsMap === void 0 ? void 0 : nodeHostsMap.get(data.NodeId) : undefined;
|
51
51
|
const info = React.useMemo(() => preparePDiskData(data, nodeHost), [data, nodeHost]);
|
52
|
+
const [isPopupContentHovered, setIsPopupContentHovered] = React.useState(false);
|
53
|
+
const onMouseLeave = React.useCallback(() => {
|
54
|
+
setIsPopupContentHovered(false);
|
55
|
+
}, []);
|
56
|
+
const onMouseEnter = React.useCallback(() => {
|
57
|
+
setIsPopupContentHovered(true);
|
58
|
+
}, []);
|
52
59
|
return (_jsx(Popup, { contentClassName: b(), placement: ['top', 'bottom'], hasArrow: true,
|
53
60
|
// bigger offset for easier switching to neighbour nodes
|
54
61
|
// matches the default offset for popup with arrow out of a sense of beauty
|
55
|
-
offset: [0, 12], ...props, children: _jsx(InfoViewer, { title: "PDisk", info: info, size: "s" }) }));
|
62
|
+
offset: [0, 12], onMouseLeave: onMouseLeave, onMouseEnter: onMouseEnter, ...props, open: isPopupContentHovered || props.open, children: _jsx(InfoViewer, { title: "PDisk", info: info, size: "s" }) }));
|
56
63
|
};
|
57
64
|
//# sourceMappingURL=PDiskPopup.js.map
|
@@ -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,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;AAErD,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,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AC,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1F,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAErF,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,KAAC,KAAK,IACF,gBAAgB,EAAE,CAAC,EAAE,EACrB,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,EAC5B,QAAQ;QACR,wDAAwD;QACxD,2EAA2E;QAC3E,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EACf,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,KACtB,KAAK,EACT,IAAI,EAAE,qBAAqB,IAAI,KAAK,CAAC,IAAI,YAEzC,KAAC,UAAU,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,GAAG,GAC7C,CACX,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import React from 'react';
|
1
2
|
import type { Column, FetchData, GetRowClassName, HandleTableColumnsResize, RenderControls, RenderEmptyDataMessage, RenderErrorMessage, SortParams } from './types';
|
2
3
|
import './PaginatedTable.scss';
|
3
4
|
export interface PaginatedTableProps<T, F> {
|
@@ -9,7 +10,7 @@ export interface PaginatedTableProps<T, F> {
|
|
9
10
|
columns: Column<T>[];
|
10
11
|
getRowClassName?: GetRowClassName<T>;
|
11
12
|
rowHeight?: number;
|
12
|
-
|
13
|
+
parentRef?: React.RefObject<HTMLElement>;
|
13
14
|
initialSortParams?: SortParams;
|
14
15
|
onColumnsResize?: HandleTableColumnsResize;
|
15
16
|
renderControls?: RenderControls;
|
@@ -17,4 +18,4 @@ export interface PaginatedTableProps<T, F> {
|
|
17
18
|
renderErrorMessage?: RenderErrorMessage;
|
18
19
|
containerClassName?: string;
|
19
20
|
}
|
20
|
-
export declare const PaginatedTable: <T, F>({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight,
|
21
|
+
export declare const PaginatedTable: <T, F>({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight, parentRef, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }: PaginatedTableProps<T, F>) => import("react/jsx-runtime").JSX.Element;
|
@@ -8,53 +8,47 @@ import { EmptyTableRow } from './TableRow';
|
|
8
8
|
import { DEFAULT_TABLE_ROW_HEIGHT } from './constants';
|
9
9
|
import i18n from './i18n';
|
10
10
|
import { b } from './shared';
|
11
|
-
import {
|
11
|
+
import { useScrollBasedChunks } from './useScrollBasedChunks';
|
12
12
|
import './PaginatedTable.scss';
|
13
|
-
export const PaginatedTable = ({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight = DEFAULT_TABLE_ROW_HEIGHT,
|
13
|
+
export const PaginatedTable = ({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, parentRef, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }) => {
|
14
14
|
const initialTotal = initialEntitiesCount || limit;
|
15
15
|
const initialFound = initialEntitiesCount || 0;
|
16
16
|
const [sortParams, setSortParams] = React.useState(initialSortParams);
|
17
17
|
const [totalEntities, setTotalEntities] = React.useState(initialTotal);
|
18
18
|
const [foundEntities, setFoundEntities] = React.useState(initialFound);
|
19
|
-
const [activeChunks, setActiveChunks] = React.useState([]);
|
20
19
|
const [isInitialLoad, setIsInitialLoad] = React.useState(true);
|
21
|
-
const
|
20
|
+
const tableRef = React.useRef(null);
|
21
|
+
const activeChunks = useScrollBasedChunks({
|
22
|
+
containerRef: parentRef !== null && parentRef !== void 0 ? parentRef : tableRef,
|
23
|
+
totalItems: foundEntities,
|
24
|
+
itemHeight: rowHeight,
|
25
|
+
chunkSize: limit,
|
26
|
+
});
|
22
27
|
const handleDataFetched = React.useCallback((total, found) => {
|
23
28
|
setTotalEntities(total);
|
24
29
|
setFoundEntities(found);
|
25
30
|
setIsInitialLoad(false);
|
26
31
|
}, []);
|
27
|
-
const onEntry = React.useCallback((id) => {
|
28
|
-
setActiveChunks((prev) => [...new Set([...prev, Number(id)])]);
|
29
|
-
}, []);
|
30
|
-
const onLeave = React.useCallback((id) => {
|
31
|
-
setActiveChunks((prev) => prev.filter((chunk) => chunk !== Number(id)));
|
32
|
-
}, []);
|
33
|
-
const observer = useIntersectionObserver({ onEntry, onLeave, parentContainer });
|
34
32
|
// reset table on filters change
|
35
33
|
React.useLayoutEffect(() => {
|
36
34
|
var _a;
|
37
35
|
setTotalEntities(initialTotal);
|
38
36
|
setFoundEntities(initialFound);
|
39
37
|
setIsInitialLoad(true);
|
40
|
-
if (
|
41
|
-
|
38
|
+
if (parentRef === null || parentRef === void 0 ? void 0 : parentRef.current) {
|
39
|
+
parentRef.current.scrollTo(0, 0);
|
42
40
|
}
|
43
41
|
else {
|
44
|
-
(_a =
|
42
|
+
(_a = tableRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
|
45
43
|
}
|
46
|
-
|
47
|
-
}, [filters, initialFound, initialTotal, limit, parentContainer]);
|
44
|
+
}, [filters, initialFound, initialTotal, limit, parentRef]);
|
48
45
|
const renderChunks = () => {
|
49
|
-
if (!observer) {
|
50
|
-
return null;
|
51
|
-
}
|
52
46
|
if (!isInitialLoad && foundEntities === 0) {
|
53
47
|
return (_jsx("tbody", { children: _jsx(EmptyTableRow, { columns: columns, children: renderEmptyDataMessage ? renderEmptyDataMessage() : i18n('empty') }) }));
|
54
48
|
}
|
55
49
|
const totalLength = foundEntities || limit;
|
56
50
|
const chunksCount = Math.ceil(totalLength / limit);
|
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)
|
51
|
+
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) }, value)));
|
58
52
|
};
|
59
53
|
const renderTable = () => (_jsxs("table", { className: b('table'), children: [_jsx(TableHead, { columns: columns, onSort: setSortParams, onColumnsResize: onColumnsResize }), renderChunks()] }));
|
60
54
|
const renderContent = () => {
|
@@ -63,6 +57,6 @@ export const PaginatedTable = ({ limit, initialEntitiesCount, fetchData, filters
|
|
63
57
|
}
|
64
58
|
return renderTable();
|
65
59
|
};
|
66
|
-
return (_jsx("div", { ref:
|
60
|
+
return (_jsx("div", { ref: tableRef, className: b(null, containerClassName), children: renderContent() }));
|
67
61
|
};
|
68
62
|
//# sourceMappingURL=PaginatedTable.js.map
|
@@ -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,
|
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,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D,OAAO,uBAAuB,CAAC;AAoB/B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAO,EACjC,KAAK,EACL,oBAAoB,EACpB,SAAS,EACT,OAAO,EACP,SAAS,EACT,OAAO,EACP,eAAe,EACf,SAAS,GAAG,wBAAwB,EACpC,SAAS,EACT,iBAAiB,EACjB,e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cZ,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,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,kBAAkB,CAAC,YACrD,aAAa,EAAE,GACd,CACT,CAAC;AACN,CAAC,CAAC"}
|
@@ -9,7 +9,6 @@ interface TableChunkProps<T, F> {
|
|
9
9
|
columns: Column<T>[];
|
10
10
|
filters?: F;
|
11
11
|
sortParams?: SortParams;
|
12
|
-
observer: IntersectionObserver;
|
13
12
|
isActive: boolean;
|
14
13
|
tableName: string;
|
15
14
|
fetchData: FetchData<T, F>;
|
@@ -17,5 +16,5 @@ interface TableChunkProps<T, F> {
|
|
17
16
|
renderErrorMessage?: (error: IResponseError) => React.ReactNode;
|
18
17
|
onDataFetched: (total: number, found: number) => void;
|
19
18
|
}
|
20
|
-
export declare const TableChunk: <T, F>({ id, limit, totalLength, rowHeight, columns, fetchData, tableName, filters, sortParams,
|
19
|
+
export declare const TableChunk: <T, F>({ id, limit, totalLength, rowHeight, columns, fetchData, tableName, filters, sortParams, getRowClassName, renderErrorMessage, onDataFetched, isActive, }: TableChunkProps<T, F>) => import("react/jsx-runtime").JSX.Element;
|
21
20
|
export {};
|
@@ -6,12 +6,9 @@ import { useAutoRefreshInterval } from '../../utils/hooks';
|
|
6
6
|
import { ResponseError } from '../Errors/ResponseError';
|
7
7
|
import { EmptyTableRow, LoadingTableRow, TableRow } from './TableRow';
|
8
8
|
const DEBOUNCE_TIMEOUT = 200;
|
9
|
-
// With original memo generic types are lost
|
10
|
-
const typedMemo = React.memo;
|
11
9
|
// Memoisation prevents chunks rerenders that could cause perfomance issues on big tables
|
12
|
-
export const TableChunk =
|
10
|
+
export const TableChunk = ({ id, limit, totalLength, rowHeight, columns, fetchData, tableName, filters, sortParams, getRowClassName, renderErrorMessage, onDataFetched, isActive, }) => {
|
13
11
|
var _a;
|
14
|
-
const ref = React.useRef(null);
|
15
12
|
const [isTimeoutActive, setIsTimeoutActive] = React.useState(true);
|
16
13
|
const [autoRefreshInterval] = useAutoRefreshInterval();
|
17
14
|
const queryParams = {
|
@@ -38,17 +35,6 @@ export const TableChunk = typedMemo(function TableChunk({ id, limit, totalLength
|
|
38
35
|
window.clearTimeout(timeout);
|
39
36
|
};
|
40
37
|
}, [isActive, isTimeoutActive]);
|
41
|
-
React.useEffect(() => {
|
42
|
-
const el = ref.current;
|
43
|
-
if (el) {
|
44
|
-
observer.observe(el);
|
45
|
-
}
|
46
|
-
return () => {
|
47
|
-
if (el) {
|
48
|
-
observer.unobserve(el);
|
49
|
-
}
|
50
|
-
};
|
51
|
-
}, [observer]);
|
52
38
|
React.useEffect(() => {
|
53
39
|
if (currentData && isActive) {
|
54
40
|
const { total = 0, found = 0 } = currentData;
|
@@ -56,8 +42,8 @@ export const TableChunk = typedMemo(function TableChunk({ id, limit, totalLength
|
|
56
42
|
}
|
57
43
|
}, [currentData, isActive, onDataFetched]);
|
58
44
|
const chunkOffset = id * limit;
|
59
|
-
const
|
60
|
-
const calculatedChunkLength =
|
45
|
+
const remainingLength = totalLength - chunkOffset;
|
46
|
+
const calculatedChunkLength = remainingLength < limit ? remainingLength : limit;
|
61
47
|
const dataLength = ((_a = currentData === null || currentData === void 0 ? void 0 : currentData.data) === null || _a === void 0 ? void 0 : _a.length) || calculatedChunkLength;
|
62
48
|
const renderContent = () => {
|
63
49
|
if (!isActive) {
|
@@ -75,12 +61,12 @@ export const TableChunk = typedMemo(function TableChunk({ id, limit, totalLength
|
|
75
61
|
return currentData.data.map((rowData, index) => (_jsx(TableRow, { index: index, row: rowData, columns: columns, height: rowHeight, getRowClassName: getRowClassName }, index)));
|
76
62
|
};
|
77
63
|
const chunkHeight = dataLength ? dataLength * rowHeight : limit * rowHeight;
|
78
|
-
return (_jsx("tbody", {
|
64
|
+
return (_jsx("tbody", { id: id.toString(), style: {
|
79
65
|
height: `${chunkHeight}px`,
|
80
66
|
// Default display: table-row-group doesn't work in Safari and breaks the table
|
81
67
|
// display: block works in Safari, but disconnects thead and tbody cell grids
|
82
68
|
// Hack to make it work in all cases
|
83
69
|
display: isActive ? 'table-row-group' : 'block',
|
84
70
|
}, children: renderContent() }));
|
85
|
-
}
|
71
|
+
};
|
86
72
|
//# sourceMappingURL=TableChunk.js.map
|
@@ -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;
|
1
|
+
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
3
|
+
containerRef: React.RefObject<HTMLElement>;
|
4
|
+
totalItems: number;
|
5
|
+
itemHeight: number;
|
6
|
+
chunkSize: number;
|
7
|
+
}
|
8
|
+
export declare const useScrollBasedChunks: ({ containerRef, totalItems, itemHeight, chunkSize, }: UseScrollBasedChunksProps) => number[];
|
9
|
+
export {};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { throttle } from 'lodash';
|
3
|
+
import { getArray } from '../../utils';
|
4
|
+
const THROTTLE_DELAY = 100;
|
5
|
+
const CHUNKS_AHEAD_COUNT = 1;
|
6
|
+
export const useScrollBasedChunks = ({ containerRef, totalItems, itemHeight, chunkSize, }) => {
|
7
|
+
const [activeChunks, setActiveChunks] = React.useState(getArray(1 + CHUNKS_AHEAD_COUNT).map((index) => index));
|
8
|
+
const calculateActiveChunks = React.useCallback(() => {
|
9
|
+
const container = containerRef.current;
|
10
|
+
if (!container) {
|
11
|
+
return;
|
12
|
+
}
|
13
|
+
const { scrollTop, clientHeight } = container;
|
14
|
+
const visibleStartIndex = Math.floor(scrollTop / itemHeight);
|
15
|
+
const visibleEndIndex = Math.min(Math.ceil((scrollTop + clientHeight) / itemHeight), totalItems - 1);
|
16
|
+
const startChunk = Math.floor(visibleStartIndex / chunkSize);
|
17
|
+
const endChunk = Math.floor(visibleEndIndex / chunkSize);
|
18
|
+
const newActiveChunks = getArray(endChunk - startChunk + 1 + CHUNKS_AHEAD_COUNT).map((index) => startChunk + index);
|
19
|
+
setActiveChunks(newActiveChunks);
|
20
|
+
}, [chunkSize, containerRef, itemHeight, totalItems]);
|
21
|
+
const throttledCalculateActiveChunks = React.useMemo(() => throttle(calculateActiveChunks, THROTTLE_DELAY), [calculateActiveChunks]);
|
22
|
+
React.useEffect(() => {
|
23
|
+
const container = containerRef.current;
|
24
|
+
if (!container) {
|
25
|
+
return undefined;
|
26
|
+
}
|
27
|
+
container.addEventListener('scroll', throttledCalculateActiveChunks);
|
28
|
+
return () => {
|
29
|
+
container.removeEventListener('scroll', throttledCalculateActiveChunks);
|
30
|
+
throttledCalculateActiveChunks.cancel();
|
31
|
+
};
|
32
|
+
}, [containerRef, throttledCalculateActiveChunks]);
|
33
|
+
return activeChunks;
|
34
|
+
};
|
35
|
+
//# sourceMappingURL=useScrollBasedChunks.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useScrollBasedChunks.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/useScrollBasedChunks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AASrC,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EACjC,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,GACe,EAAY,EAAE;IACtC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAClD,QAAQ,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CACzD,CAAC;IAEF,MAAM,qBAAqB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACjD,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,OAAO;QACX,CAAC;QAED,MAAM,EAAC,SAAS,EAAE,YAAY,EAAC,GAAG,SAAS,CAAC;QAC5C,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC;QAC7D,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAC5B,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,YAAY,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interface TabletsStatisticProps {
|
4
4
|
tablets: TTabletStateInfo[];
|
5
|
-
|
5
|
+
tenantName: string | undefined;
|
6
6
|
nodeId: string | number;
|
7
7
|
backend?: string;
|
8
8
|
}
|
9
|
-
export declare const TabletsStatistic: ({ tablets,
|
9
|
+
export declare const TabletsStatistic: ({ tablets, tenantName, nodeId, backend, }: TabletsStatisticProps) => import("react/jsx-runtime").JSX.Element;
|
10
10
|
export {};
|
@@ -18,11 +18,11 @@ const prepareTablets = (tablets) => {
|
|
18
18
|
});
|
19
19
|
return res.sort((x, y) => String(x.label).localeCompare(String(y.label)));
|
20
20
|
};
|
21
|
-
export const TabletsStatistic = ({ tablets = [],
|
21
|
+
export const TabletsStatistic = ({ tablets = [], tenantName, nodeId, backend, }) => {
|
22
22
|
const renderTabletInfo = (item, index) => {
|
23
23
|
var _a;
|
24
24
|
const tabletsPath = createHref(routes.node, { id: nodeId, activeTab: TABLETS }, {
|
25
|
-
tenantName
|
25
|
+
tenantName,
|
26
26
|
backend,
|
27
27
|
});
|
28
28
|
const label = `${item.label}: ${item.count}`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TabletsStatistic.js","sourceRoot":"","sources":["../../../src/components/TabletsStatistic/TabletsStatistic.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAC,OAAO,EAAC,MAAM,iCAAiC,CAAC;AACxD,OAAO,MAAM,EAAE,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,0BAA0B,EAAC,MAAM,oBAAoB,CAAC;AAE9D,OAAO,yBAAyB,CAAC;AAEjC,MAAM,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC;AAElC,MAAM,cAAc,GAAG,CAAC,OAA2B,EA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AAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAEhD,OAAO,cAAK,SAAS,EAAE,CAAC,EAAE,YAAG,eAAe,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAO,CAAC;AAC9E,CAAC,CAAC"}
|
@@ -1,43 +1,29 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
4
|
-
import routes, { createHref, getVDiskPagePath } from '../../routes';
|
5
|
-
import { useDiskPagesAvailable } from '../../store/reducers/capabilities/hooks';
|
6
|
-
import { valueIsDefined } from '../../utils';
|
3
|
+
import { debounce } from 'lodash';
|
7
4
|
import { cn } from '../../utils/cn';
|
8
|
-
import { stringifyVdiskId } from '../../utils/dataFormatters/dataFormatters';
|
9
|
-
import { isFullVDiskData } from '../../utils/disks/helpers';
|
10
5
|
import { DiskStateProgressBar } from '../DiskStateProgressBar/DiskStateProgressBar';
|
11
6
|
import { InternalLink } from '../InternalLink';
|
12
7
|
import { VDiskPopup } from '../VDiskPopup/VDiskPopup';
|
8
|
+
import { getVDiskLink } from './utils';
|
13
9
|
import './VDisk.scss';
|
14
10
|
const b = cn('ydb-vdisk-component');
|
11
|
+
const DEBOUNCE_TIMEOUT = 100;
|
15
12
|
export const VDisk = ({ data = {}, compact, inactive, showPopup, onShowPopup, onHidePopup, progressBarClassName, }) => {
|
16
|
-
const isFullData = isFullVDiskData(data);
|
17
|
-
const diskPagesAvailable = useDiskPagesAvailable();
|
18
13
|
const [isPopupVisible, setIsPopupVisible] = React.useState(false);
|
19
14
|
const anchor = React.useRef(null);
|
20
|
-
const
|
15
|
+
const debouncedHandleShowPopup = debounce(() => {
|
21
16
|
setIsPopupVisible(true);
|
22
17
|
onShowPopup === null || onShowPopup === void 0 ? void 0 : onShowPopup();
|
23
|
-
};
|
24
|
-
const
|
18
|
+
}, DEBOUNCE_TIMEOUT);
|
19
|
+
const debouncedHandleHidePopup = debounce(() => {
|
25
20
|
setIsPopupVisible(false);
|
26
21
|
onHidePopup === null || onHidePopup === void 0 ? void 0 : onHidePopup();
|
27
|
-
};
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
vDiskPath = getVDiskPagePath(data.VDiskSlotId, data.PDiskId, data.NodeId);
|
34
|
-
}
|
35
|
-
else if (valueIsDefined(data.NodeId) && isFullData) {
|
36
|
-
vDiskPath = createHref(routes.node, { id: data.NodeId, activeTab: STRUCTURE }, {
|
37
|
-
pdiskId: data.PDiskId,
|
38
|
-
vdiskId: stringifyVdiskId(data.VDiskId),
|
39
|
-
});
|
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, anchorRef: anchor, open: isPopupVisible || showPopup })] }));
|
22
|
+
}, DEBOUNCE_TIMEOUT);
|
23
|
+
const vDiskPath = getVDiskLink(data);
|
24
|
+
return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b(), ref: anchor, onMouseEnter: debouncedHandleShowPopup, onMouseLeave: () => {
|
25
|
+
debouncedHandleShowPopup.cancel();
|
26
|
+
debouncedHandleHidePopup();
|
27
|
+
}, 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
28
|
};
|
43
29
|
//# sourceMappingURL=VDisk.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VDisk.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDisk.tsx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AAX,WAAW,EAAI,CAAC;IACpB,CAAC,EAAE,gBAAgB,CAAC,CAAC;IAErB,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAErC,OAAO,CACH,MAAC,KAAK,CAAC,QAAQ,eACX,cACI,SAAS,EAAE,CAAC,EAAE,EACd,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,wBAAwB,EACtC,YAAY,EAAE,GAAG,EAAE;oBACf,wBAAwB,CAAC,MAAM,EAAE,CAAC;oBAClC,wBAAwB,EAAE,CAAC;gBAC/B,CAAC,YAED,KAAC,YAAY,IAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YAChD,KAAC,oBAAoB,IACjB,oBAAoB,EAAE,IAAI,CAAC,gBAAgB,EAC3C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,oBAAoB,GACjC,GACS,GACb,EACN,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,IAAI,SAAS,GAAI,IACnE,CACpB,CAAC;AACN,CAAC,CAAC"}
|
@@ -4,8 +4,8 @@ import { isFullVDiskData } from '../../utils/disks/helpers';
|
|
4
4
|
import { Stack } from '../Stack/Stack';
|
5
5
|
import { VDisk } from './VDisk';
|
6
6
|
export function VDiskWithDonorsStack({ data, className, stackClassName, ...restProps }) {
|
7
|
-
const
|
8
|
-
const content = donors && donors.length > 0 ? (_jsxs(Stack, { className: stackClassName, children: [_jsx(VDisk, { data:
|
7
|
+
const { Donors: donors, ...restData } = data || {};
|
8
|
+
const content = donors && donors.length > 0 ? (_jsxs(Stack, { className: stackClassName, children: [_jsx(VDisk, { data: restData, ...restProps }), donors.map((donor) => {
|
9
9
|
const isFullData = isFullVDiskData(donor);
|
10
10
|
// donor and acceptor are always in the same group
|
11
11
|
return (_jsx(VDisk, { data: donor, ...restProps }, stringifyVdiskId(isFullData ? donor.VDiskId : donor)));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VDiskWithDonorsStack.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDiskWithDonorsStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAQ9B,MAAM,UAAU,oBAAoB,CAAC,EACjC,IAAI,EACJ,SAAS,EACT,cAAc,EACd,GAAG,SAAS,EACY;IACxB,MAAM,MAAM,GAAG,
|
1
|
+
{"version":3,"file":"VDiskWithDonorsStack.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDiskWithDonorsStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAQ9B,MAAM,UAAU,oBAAoB,CAAC,EACjC,IAAI,EACJ,SAAS,EACT,cAAc,EACd,GAAG,SAAS,EACY;IACxB,MAAM,EAAC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAC,GAAG,IAAI,IAAI,EAAE,CAAC;IAEjD,MAAM,OAAO,GACT,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC1B,MAAC,KAAK,IAAC,SAAS,EAAE,cAAc,aAC5B,KAAC,KAAK,IAAC,IAAI,EAAE,QAAQ,KAAM,SAAS,GAAI,EACvC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBAClB,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;gBAE1C,kDAAkD;gBAClD,OAAO,CACH,KAAC,KAAK,IAEF,IAAI,EAAE,KAAK,KACP,SAAS,IAFR,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAG3D,CACL,CAAC;YACN,CAAC,CAAC,IACE,CACX,CAAC,CAAC,CAAC,CACA,KAAC,KAAK,IAAC,IAAI,EAAE,IAAI,KAAM,SAAS,GAAI,CACvC,CAAC;IAEN,OAAO,cAAK,SAAS,EAAE,SAAS,YAAG,OAAO,GAAO,CAAC;AACtD,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { STRUCTURE } from '../../containers/Node/NodePages';
|
2
|
+
import routes, { createHref, getVDiskPagePath } from '../../routes';
|
3
|
+
import { valueIsDefined } from '../../utils';
|
4
|
+
import { stringifyVdiskId } from '../../utils/dataFormatters/dataFormatters';
|
5
|
+
import { isFullVDiskData } from '../../utils/disks/helpers';
|
6
|
+
export function getVDiskLink(data) {
|
7
|
+
let vDiskPath;
|
8
|
+
const isFullData = isFullVDiskData(data);
|
9
|
+
const VDiskSlotId = isFullData ? data.VDiskSlotId : data.VSlotId;
|
10
|
+
if (valueIsDefined(VDiskSlotId) &&
|
11
|
+
valueIsDefined(data.PDiskId) &&
|
12
|
+
valueIsDefined(data.NodeId)) {
|
13
|
+
vDiskPath = getVDiskPagePath(VDiskSlotId, data.PDiskId, data.NodeId);
|
14
|
+
}
|
15
|
+
else if (valueIsDefined(data.NodeId) && isFullVDiskData(data)) {
|
16
|
+
vDiskPath = createHref(routes.node, { id: data.NodeId, activeTab: STRUCTURE }, {
|
17
|
+
pdiskId: data.PDiskId,
|
18
|
+
vdiskId: stringifyVdiskId(data.VDiskId),
|
19
|
+
});
|
20
|
+
}
|
21
|
+
return vDiskPath;
|
22
|
+
}
|
23
|
+
//# sourceMapp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,CAAC"}
|
@@ -3,7 +3,7 @@ import { getVDiskPagePath } from '../../routes';
|
|
3
3
|
import { selectIsUserAllowedToMakeChanges } from '../../store/reducers/authentication/authentication';
|
4
4
|
import { valueIsDefined } from '../../utils';
|
5
5
|
import { cn } from '../../utils/cn';
|
6
|
-
import { formatStorageValuesToGb
|
6
|
+
import { formatStorageValuesToGb } from '../../utils/dataFormatters/dataFormatters';
|
7
7
|
import { createVDiskDeveloperUILink } from '../../utils/developerUI/developerUI';
|
8
8
|
import { getSeverityColor } from '../../utils/disks/helpers';
|
9
9
|
import { useTypedSelector } from '../../utils/hooks';
|
@@ -125,6 +125,6 @@ export function VDiskInfo({ data, withVDiskPageLink, withTitle, ...infoViewerPro
|
|
125
125
|
return _jsx(InfoViewer, { info: vdiskInfo, title: title, ...infoViewerProps });
|
126
126
|
}
|
127
127
|
function VDiskTitle({ data }) {
|
128
|
-
return (_jsxs("div", { className: b('title'), children: [vDiskInfoKeyset('vdiks-title'), _jsx(EntityStatus, { status: getSeverityColor(data.Severity), name:
|
128
|
+
return (_jsxs("div", { className: b('title'), children: [vDiskInfoKeyset('vdiks-title'), _jsx(EntityStatus, { status: getSeverityColor(data.Severity), name: data.StringifiedId })] }));
|
129
129
|
}
|
130
130
|
//# sourceMappingURL=VDiskInfo.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VDiskInfo.js","sourceRoot":"","sources":["../../../src/components/VDiskInfo/VDiskInfo.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,gCAAgC,EAAC,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,uBAAuB,
|
1
|
+
{"version":3,"file":"VDiskInfo.js","sourceRoot":"","sources":["../../../src/components/VDiskInfo/VDiskInfo.ts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I,CAAC;AAC9E,CAAC;AAMD,SAAS,UAAU,CAA0B,EAAC,IAAI,EAAqB;IACnE,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,aACrB,eAAe,CAAC,aAAa,CAAC,EAC/B,KAAC,YAAY,IAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,GAAI,IACjF,CACT,CAAC;AACN,CAAC"}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import type { PopupProps } from '@gravity-ui/uikit';
|
2
|
-
import type {
|
3
|
-
import type { UnavailableDonor } from '../../utils/disks/types';
|
2
|
+
import type { PreparedVDisk, UnavailableDonor } from '../../utils/disks/types';
|
4
3
|
import './VDiskPopup.scss';
|
5
4
|
interface VDiskPopupProps extends PopupProps {
|
6
|
-
data:
|
5
|
+
data: PreparedVDisk | UnavailableDonor;
|
7
6
|
}
|
8
7
|
export declare const VDiskPopup: ({ data, ...props }: VDiskPopupProps) => import("react/jsx-runtime").JSX.Element;
|
9
8
|
export {};
|