ydb-embedded-ui 6.29.2 → 6.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. package/dist/components/NodeHostWrapper/NodeHostWrapper.js +1 -1
  2. package/dist/components/NodeHostWrapper/NodeHostWrapper.js.map +1 -1
  3. package/dist/components/PaginatedTable/PaginatedTable.d.ts +2 -2
  4. package/dist/components/PaginatedTable/PaginatedTable.js +10 -15
  5. package/dist/components/PaginatedTable/PaginatedTable.js.map +1 -1
  6. package/dist/components/PaginatedTable/PaginatedTable.scss +5 -1
  7. package/dist/components/PaginatedTable/TableChunk.d.ts +3 -3
  8. package/dist/components/PaginatedTable/TableChunk.js +7 -10
  9. package/dist/components/PaginatedTable/TableChunk.js.map +1 -1
  10. package/dist/components/PaginatedTable/constants.d.ts +1 -1
  11. package/dist/components/PaginatedTable/constants.js +1 -1
  12. package/dist/components/PaginatedTable/useScrollBasedChunks.d.ts +5 -3
  13. package/dist/components/PaginatedTable/useScrollBasedChunks.js +43 -23
  14. package/dist/components/PaginatedTable/useScrollBasedChunks.js.map +1 -1
  15. package/dist/components/PaginatedTable/utils.d.ts +18 -0
  16. package/dist/components/PaginatedTable/utils.js +27 -0
  17. package/dist/components/PaginatedTable/utils.js.map +1 -1
  18. package/dist/components/Tablet/Tablet.d.ts +2 -2
  19. package/dist/components/Tablet/Tablet.js +3 -3
  20. package/dist/components/Tablet/Tablet.js.map +1 -1
  21. package/dist/components/TabletNameWrapper/TabletNameWrapper.js +1 -3
  22. package/dist/components/TabletNameWrapper/TabletNameWrapper.js.map +1 -1
  23. package/dist/components/TabletsStatistic/TabletsStatistic.d.ts +2 -3
  24. package/dist/components/TabletsStatistic/TabletsStatistic.js +4 -8
  25. package/dist/components/TabletsStatistic/TabletsStatistic.js.map +1 -1
  26. package/dist/components/TenantNameWrapper/TenantNameWrapper.js +1 -1
  27. package/dist/components/TenantNameWrapper/TenantNameWrapper.js.map +1 -1
  28. package/dist/components/nodesColumns/columns.js +1 -1
  29. package/dist/components/nodesColumns/columns.js.map +1 -1
  30. package/dist/containers/App/Content.js +2 -2
  31. package/dist/containers/App/Content.js.map +1 -1
  32. package/dist/containers/Cluster/Cluster.js +3 -1
  33. package/dist/containers/Cluster/Cluster.js.map +1 -1
  34. package/dist/containers/Cluster/ClusterDashboard/ClusterDashboard.d.ts +4 -5
  35. package/dist/containers/Cluster/ClusterDashboard/ClusterDashboard.js +7 -14
  36. package/dist/containers/Cluster/ClusterDashboard/ClusterDashboard.js.map +1 -1
  37. package/dist/containers/Header/breadcrumbs.js +2 -2
  38. package/dist/containers/Header/breadcrumbs.js.map +1 -1
  39. package/dist/containers/Node/Node.js +10 -8
  40. package/dist/containers/Node/Node.js.map +1 -1
  41. package/dist/containers/Node/NodePages.d.ts +7 -2
  42. package/dist/containers/Node/NodePages.js +4 -0
  43. package/dist/containers/Node/NodePages.js.map +1 -1
  44. package/dist/containers/Nodes/NodesWrapper.d.ts +1 -1
  45. package/dist/containers/Nodes/PaginatedNodes.d.ts +1 -1
  46. package/dist/containers/PDiskPage/PDiskPage.js +3 -2
  47. package/dist/containers/PDiskPage/PDiskPage.js.map +1 -1
  48. package/dist/containers/Storage/PaginatedStorage.d.ts +1 -1
  49. package/dist/containers/Storage/PaginatedStorageGroups.js +2 -2
  50. package/dist/containers/Storage/PaginatedStorageGroups.js.map +1 -1
  51. package/dist/containers/Storage/PaginatedStorageNodes.js +2 -2
  52. package/dist/containers/Storage/PaginatedStorageNodes.js.map +1 -1
  53. package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.d.ts +1 -1
  54. package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.d.ts +1 -1
  55. package/dist/containers/Storage/StorageWrapper.d.ts +1 -1
  56. package/dist/containers/StorageGroupPage/StorageGroupPage.js +3 -2
  57. package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
  58. package/dist/containers/Tablet/Tablet.js +4 -9
  59. package/dist/containers/Tablet/Tablet.js.map +1 -1
  60. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.js +2 -3
  61. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.js.map +1 -1
  62. package/dist/containers/Tenant/Diagnostics/Diagnostics.js +3 -4
  63. package/dist/containers/Tenant/Diagnostics/Diagnostics.js.map +1 -1
  64. package/dist/containers/Tenant/ObjectSummary/CreateDirectoryDialog/CreateDirectoryDialog.js.map +1 -0
  65. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +7 -6
  66. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js.map +1 -1
  67. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +4 -2
  68. package/dist/containers/Tenant/ObjectSummary/ObjectTree.js +1 -1
  69. package/dist/containers/Tenant/ObjectSummary/ObjectTree.js.map +1 -1
  70. package/dist/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.d.ts +1 -0
  71. package/dist/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.js +12 -0
  72. package/dist/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.js.map +1 -0
  73. package/dist/containers/Tenant/{Schema → ObjectSummary}/SchemaTree/SchemaTree.js +3 -1
  74. package/dist/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.js.map +1 -0
  75. package/dist/containers/Tenant/ObjectSummary/UpdateTreeContext.d.ts +8 -0
  76. package/dist/containers/Tenant/ObjectSummary/UpdateTreeContext.js +23 -0
  77. package/dist/containers/Tenant/ObjectSummary/UpdateTreeContext.js.map +1 -0
  78. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +1 -1
  79. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js.map +1 -1
  80. package/dist/containers/Tenant/Query/ExecuteResult/TraceButton.d.ts +2 -1
  81. package/dist/containers/Tenant/Query/ExecuteResult/TraceButton.js +10 -12
  82. package/dist/containers/Tenant/Query/ExecuteResult/TraceButton.js.map +1 -1
  83. package/dist/containers/Tenant/Tenant.js +13 -1
  84. package/dist/containers/Tenant/Tenant.js.map +1 -1
  85. package/dist/containers/Tenant/TenantPages.d.ts +1 -0
  86. package/dist/containers/Tenant/TenantPages.js.map +1 -1
  87. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.js +6 -6
  88. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.js.map +1 -1
  89. package/dist/containers/VDiskPage/VDiskPage.js +3 -2
  90. package/dist/containers/VDiskPage/VDiskPage.js.map +1 -1
  91. package/dist/routes.d.ts +11 -1
  92. package/dist/routes.js +6 -0
  93. package/dist/routes.js.map +1 -1
  94. package/dist/services/api.d.ts +3 -1
  95. package/dist/services/api.js +7 -6
  96. package/dist/services/api.js.map +1 -1
  97. package/dist/services/settings.d.ts +1 -1
  98. package/dist/services/settings.js +1 -1
  99. package/dist/services/settings.js.map +1 -1
  100. package/dist/store/reducers/capabilities/capabilities.d.ts +387 -9
  101. package/dist/store/reducers/capabilities/capabilities.js +7 -6
  102. package/dist/store/reducers/capabilities/capabilities.js.map +1 -1
  103. package/dist/store/reducers/capabilities/hooks.d.ts +2 -0
  104. package/dist/store/reducers/capabilities/hooks.js +18 -3
  105. package/dist/store/reducers/capabilities/hooks.js.map +1 -1
  106. package/dist/store/reducers/executeQuery.d.ts +3 -0
  107. package/dist/store/reducers/executeQuery.js +18 -0
  108. package/dist/store/reducers/executeQuery.js.map +1 -1
  109. package/dist/store/reducers/pdisk/pdisk.js +1 -1
  110. package/dist/store/reducers/pdisk/pdisk.js.map +1 -1
  111. package/dist/store/reducers/trace.d.ts +1 -1
  112. package/dist/store/reducers/trace.js +4 -2
  113. package/dist/store/reducers/trace.js.map +1 -1
  114. package/dist/types/api/capabilities.d.ts +1 -1
  115. package/dist/types/store/executeQuery.d.ts +3 -2
  116. package/dist/types/store/executeQuery.js.map +1 -1
  117. package/package.json +1 -1
  118. package/dist/containers/Tenant/Schema/CreateDirectoryDialog/CreateDirectoryDialog.js.map +0 -1
  119. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js.map +0 -1
  120. /package/dist/containers/Tenant/{Schema → ObjectSummary}/CreateDirectoryDialog/CreateDirectoryDialog.d.ts +0 -0
  121. /package/dist/containers/Tenant/{Schema → ObjectSummary}/CreateDirectoryDialog/CreateDirectoryDialog.js +0 -0
  122. /package/dist/containers/Tenant/{Schema → ObjectSummary}/CreateDirectoryDialog/CreateDirectoryDialog.scss +0 -0
  123. /package/dist/containers/Tenant/{Schema → ObjectSummary}/SchemaTree/SchemaTree.d.ts +0 -0
@@ -20,7 +20,7 @@ export const NodeHostWrapper = ({ node, getNodeRef, database }) => {
20
20
  }
21
21
  const nodePath = isNodeAvailable
22
22
  ? getDefaultNodePath(node.NodeId, {
23
- tenantName: database !== null && database !== void 0 ? database : node.TenantName,
23
+ database: database !== null && database !== void 0 ? database : node.TenantName,
24
24
  })
25
25
  : undefined;
26
26
  return (_jsx(CellWithPopover, { disabled: !isNodeAvailable, content: _jsx(NodeEndpointsTooltipContent, { data: node, nodeHref: nodeHref }), placement: ['top', 'bottom'], behavior: PopoverBehavior.Immediate, children: _jsx(EntityStatus, { name: node.Host, status: node.SystemState, path: nodePath, hasClipboardButton: true }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"NodeHostWrapper.js","sourceRoot":"","sources":["../../../src/components/NodeHostWrapper/NodeHostWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EAAC,+BAA+B,EAAC,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,2BAA2B,EAAC,MAAM,oBAAoB,CAAC;AAc/D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAA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B,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,SACpB,GACY,CACrB,CAAC;AACN,CAAC,CAAC"}
@@ -10,7 +10,7 @@ export interface PaginatedTableProps<T, F> {
10
10
  columns: Column<T>[];
11
11
  getRowClassName?: GetRowClassName<T>;
12
12
  rowHeight?: number;
13
- parentRef?: React.RefObject<HTMLElement>;
13
+ parentRef: React.RefObject<HTMLElement>;
14
14
  initialSortParams?: SortParams;
15
15
  onColumnsResize?: HandleTableColumnsResize;
16
16
  renderControls?: RenderControls;
@@ -18,4 +18,4 @@ export interface PaginatedTableProps<T, F> {
18
18
  renderErrorMessage?: RenderErrorMessage;
19
19
  containerClassName?: string;
20
20
  }
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;
21
+ export declare const PaginatedTable: <T, F>({ limit: chunkSize, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight, parentRef, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }: PaginatedTableProps<T, F>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { getArray } from '../../utils';
4
3
  import { TableWithControlsLayout } from '../TableWithControlsLayout/TableWithControlsLayout';
5
4
  import { TableChunk } from './TableChunk';
6
5
  import { TableHead } from './TableHead';
@@ -10,20 +9,22 @@ import i18n from './i18n';
10
9
  import { b } from './shared';
11
10
  import { useScrollBasedChunks } from './useScrollBasedChunks';
12
11
  import './PaginatedTable.scss';
13
- export const PaginatedTable = ({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, parentRef, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }) => {
14
- const initialTotal = initialEntitiesCount || limit;
15
- const initialFound = initialEntitiesCount || 0;
12
+ export const PaginatedTable = ({ limit: chunkSize, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, parentRef, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }) => {
13
+ const initialTotal = initialEntitiesCount || 0;
14
+ const initialFound = initialEntitiesCount || 1;
16
15
  const [sortParams, setSortParams] = React.useState(initialSortParams);
17
16
  const [totalEntities, setTotalEntities] = React.useState(initialTotal);
18
17
  const [foundEntities, setFoundEntities] = React.useState(initialFound);
19
18
  const [isInitialLoad, setIsInitialLoad] = React.useState(true);
20
19
  const tableRef = React.useRef(null);
21
20
  const activeChunks = useScrollBasedChunks({
22
- containerRef: parentRef !== null && parentRef !== void 0 ? parentRef : tableRef,
21
+ parentRef,
22
+ tableRef,
23
23
  totalItems: foundEntities,
24
- itemHeight: rowHeight,
25
- chunkSize: limit,
24
+ rowHeight,
25
+ chunkSize,
26
26
  });
27
+ const lastChunkSize = React.useMemo(() => foundEntities % chunkSize || chunkSize, [foundEntities, chunkSize]);
27
28
  const handleDataFetched = React.useCallback((total, found) => {
28
29
  setTotalEntities(total);
29
30
  setFoundEntities(found);
@@ -31,24 +32,18 @@ export const PaginatedTable = ({ limit, initialEntitiesCount, fetchData, filters
31
32
  }, []);
32
33
  // reset table on filters change
33
34
  React.useLayoutEffect(() => {
34
- var _a;
35
35
  setTotalEntities(initialTotal);
36
36
  setFoundEntities(initialFound);
37
37
  setIsInitialLoad(true);
38
38
  if (parentRef === null || parentRef === void 0 ? void 0 : parentRef.current) {
39
39
  parentRef.current.scrollTo(0, 0);
40
40
  }
41
- else {
42
- (_a = tableRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
43
- }
44
- }, [filters, initialFound, initialTotal, limit, parentRef]);
41
+ }, [filters, initialFound, initialTotal, parentRef]);
45
42
  const renderChunks = () => {
46
43
  if (!isInitialLoad && foundEntities === 0) {
47
44
  return (_jsx("tbody", { children: _jsx(EmptyTableRow, { columns: columns, children: renderEmptyDataMessage ? renderEmptyDataMessage() : i18n('empty') }) }));
48
45
  }
49
- const totalLength = foundEntities || limit;
50
- const chunksCount = Math.ceil(totalLength / limit);
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)));
46
+ return activeChunks.map((isActive, index) => (_jsx(TableChunk, { id: index, calculatedCount: index === activeChunks.length - 1 ? lastChunkSize : chunkSize, chunkSize: chunkSize, rowHeight: rowHeight, columns: columns, fetchData: fetchData, filters: filters, tableName: tableName, sortParams: sortParams, getRowClassName: getRowClassName, renderErrorMessage: renderErrorMessage, onDataFetched: handleDataFetched, isActive: isActive }, index)));
52
47
  };
53
48
  const renderTable = () => (_jsxs("table", { className: b('table'), children: [_jsx(TableHead, { columns: columns, onSort: setSortParams, onColumnsResize: onColumnsResize }), renderChunks()] }));
54
49
  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,cAA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N,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"}
@@ -29,6 +29,10 @@
29
29
  position: relative;
30
30
  z-index: 1;
31
31
 
32
+ // Performance optimization for row hovering.
33
+ // it actually works.
34
+ transform: translateZ(0);
35
+
32
36
  &:hover {
33
37
  background: var(--paginated-table-hover-color);
34
38
  }
@@ -177,6 +181,6 @@
177
181
  }
178
182
 
179
183
  &__row-skeleton::after {
180
- animation-delay: 200ms;
184
+ animation: none !important;
181
185
  }
182
186
  }
@@ -3,9 +3,9 @@ import type { IResponseError } from '../../types/api/error';
3
3
  import type { Column, FetchData, GetRowClassName, SortParams } from './types';
4
4
  interface TableChunkProps<T, F> {
5
5
  id: number;
6
- limit: number;
7
- totalLength: number;
6
+ chunkSize: number;
8
7
  rowHeight: number;
8
+ calculatedCount: number;
9
9
  columns: Column<T>[];
10
10
  filters?: F;
11
11
  sortParams?: SortParams;
@@ -16,5 +16,5 @@ interface TableChunkProps<T, F> {
16
16
  renderErrorMessage?: (error: IResponseError) => React.ReactNode;
17
17
  onDataFetched: (total: number, found: number) => void;
18
18
  }
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;
19
+ export declare const TableChunk: <T, F>({ id, chunkSize, calculatedCount, rowHeight, columns, fetchData, tableName, filters, sortParams, getRowClassName, renderErrorMessage, onDataFetched, isActive, }: TableChunkProps<T, F>) => import("react/jsx-runtime").JSX.Element;
20
20
  export {};
@@ -5,16 +5,17 @@ import { getArray } from '../../utils';
5
5
  import { useAutoRefreshInterval } from '../../utils/hooks';
6
6
  import { ResponseError } from '../Errors/ResponseError';
7
7
  import { EmptyTableRow, LoadingTableRow, TableRow } from './TableRow';
8
+ import { typedMemo } from './utils';
8
9
  const DEBOUNCE_TIMEOUT = 200;
9
10
  // Memoisation prevents chunks rerenders that could cause perfomance issues on big tables
10
- export const TableChunk = ({ id, limit, totalLength, rowHeight, columns, fetchData, tableName, filters, sortParams, getRowClassName, renderErrorMessage, onDataFetched, isActive, }) => {
11
+ export const TableChunk = typedMemo(function TableChunk({ id, chunkSize, calculatedCount, rowHeight, columns, fetchData, tableName, filters, sortParams, getRowClassName, renderErrorMessage, onDataFetched, isActive, }) {
11
12
  var _a;
12
13
  const [isTimeoutActive, setIsTimeoutActive] = React.useState(true);
13
14
  const [autoRefreshInterval] = useAutoRefreshInterval();
14
15
  const columnsIds = columns.map((column) => column.name);
15
16
  const queryParams = {
16
- offset: id * limit,
17
- limit,
17
+ offset: id * chunkSize,
18
+ limit: chunkSize,
18
19
  fetchData: fetchData,
19
20
  filters,
20
21
  sortParams,
@@ -43,10 +44,7 @@ export const TableChunk = ({ id, limit, totalLength, rowHeight, columns, fetchDa
43
44
  onDataFetched(total, found);
44
45
  }
45
46
  }, [currentData, isActive, onDataFetched]);
46
- const chunkOffset = id * limit;
47
- const remainingLength = totalLength - chunkOffset;
48
- const calculatedChunkLength = remainingLength < limit ? remainingLength : limit;
49
- const dataLength = ((_a = currentData === null || currentData === void 0 ? void 0 : currentData.data) === null || _a === void 0 ? void 0 : _a.length) || calculatedChunkLength;
47
+ const dataLength = ((_a = currentData === null || currentData === void 0 ? void 0 : currentData.data) === null || _a === void 0 ? void 0 : _a.length) || calculatedCount;
50
48
  const renderContent = () => {
51
49
  if (!isActive) {
52
50
  return null;
@@ -62,13 +60,12 @@ export const TableChunk = ({ id, limit, totalLength, rowHeight, columns, fetchDa
62
60
  }
63
61
  return currentData.data.map((rowData, index) => (_jsx(TableRow, { index: index, row: rowData, columns: columns, height: rowHeight, getRowClassName: getRowClassName }, index)));
64
62
  };
65
- const chunkHeight = dataLength ? dataLength * rowHeight : limit * rowHeight;
66
63
  return (_jsx("tbody", { id: id.toString(), style: {
67
- height: `${chunkHeight}px`,
64
+ height: `${dataLength * rowHeight}px`,
68
65
  // Default display: table-row-group doesn't work in Safari and breaks the table
69
66
  // display: block works in Safari, but disconnects thead and tbody cell grids
70
67
  // Hack to make it work in all cases
71
68
  display: isActive ? 'table-row-group' : 'block',
72
69
  }, children: renderContent() }));
73
- };
70
+ });
74
71
  //# 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;AAmB7B,yFAAyF;AACzF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAO,EAC7B,EAAE,EACF,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,EACT,OAAO,EACP,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,QAAQ,GACY,EAAE,EAAE;;IACxB,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,mBAAmB,CAAC,GAAG,sBAAsB,EAAE,CAAC;IAEvD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM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,GAAG,SAAS,IAAI;YACrC,+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"}
@@ -7,5 +7,5 @@ export declare const ASCENDING = 1;
7
7
  export declare const DESCENDING = -1;
8
8
  export declare const DEFAULT_SORT_ORDER = -1;
9
9
  export declare const DEFAULT_REQUEST_TIMEOUT = 200;
10
- export declare const DEFAULT_TABLE_ROW_HEIGHT = 40;
10
+ export declare const DEFAULT_TABLE_ROW_HEIGHT = 41;
11
11
  export declare const DEFAULT_INTERSECTION_OBSERVER_MARGIN = "100%";
@@ -8,6 +8,6 @@ export const DESCENDING = -1;
8
8
  export const DEFAULT_SORT_ORDER = DESCENDING;
9
9
  // Time in ms after which request will be sent
10
10
  export const DEFAULT_REQUEST_TIMEOUT = 200;
11
- export const DEFAULT_TABLE_ROW_HEIGHT = 40;
11
+ export const DEFAULT_TABLE_ROW_HEIGHT = 41;
12
12
  export const DEFAULT_INTERSECTION_OBSERVER_MARGIN = '100%';
13
13
  //# sourceMappingURL=constants.js.map
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  interface UseScrollBasedChunksProps {
3
- containerRef: React.RefObject<HTMLElement>;
3
+ parentRef: React.RefObject<HTMLElement>;
4
+ tableRef: React.RefObject<HTMLElement>;
4
5
  totalItems: number;
5
- itemHeight: number;
6
+ rowHeight: number;
6
7
  chunkSize: number;
8
+ overscanCount?: number;
7
9
  }
8
- export declare const useScrollBasedChunks: ({ containerRef, totalItems, itemHeight, chunkSize, }: UseScrollBasedChunksProps) => number[];
10
+ export declare const useScrollBasedChunks: ({ parentRef, tableRef, totalItems, rowHeight, chunkSize, overscanCount, }: UseScrollBasedChunksProps) => boolean[];
9
11
  export {};
@@ -1,35 +1,55 @@
1
1
  import React from 'react';
2
2
  import { throttle } from 'lodash';
3
- import { getArray } from '../../utils';
3
+ import { calculateElementOffsetTop } from './utils';
4
+ const DEFAULT_OVERSCAN_COUNT = 1;
4
5
  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;
6
+ export const useScrollBasedChunks = ({ parentRef, tableRef, totalItems, rowHeight, chunkSize, overscanCount = DEFAULT_OVERSCAN_COUNT, }) => {
7
+ const chunksCount = React.useMemo(() => Math.ceil(totalItems / chunkSize), [chunkSize, totalItems]);
8
+ const [startChunk, setStartChunk] = React.useState(0);
9
+ const [endChunk, setEndChunk] = React.useState(Math.min(overscanCount, Math.max(chunksCount - 1, 0)));
10
+ const calculateVisibleRange = React.useCallback(() => {
11
+ const container = parentRef === null || parentRef === void 0 ? void 0 : parentRef.current;
12
+ const table = tableRef.current;
13
+ if (!container || !table) {
14
+ return null;
15
+ }
16
+ const tableOffset = calculateElementOffsetTop(table, container);
17
+ const containerScroll = container.scrollTop;
18
+ const visibleStart = Math.max(containerScroll - tableOffset, 0);
19
+ const visibleEnd = visibleStart + container.clientHeight;
20
+ const start = Math.max(Math.floor(visibleStart / rowHeight / chunkSize) - overscanCount, 0);
21
+ const end = Math.min(Math.floor(visibleEnd / rowHeight / chunkSize) + overscanCount, Math.max(chunksCount - 1, 0));
22
+ return { start, end };
23
+ }, [parentRef, tableRef, rowHeight, chunkSize, overscanCount, chunksCount]);
24
+ const handleScroll = React.useCallback(() => {
25
+ const newRange = calculateVisibleRange();
26
+ if (newRange) {
27
+ setStartChunk(newRange.start);
28
+ setEndChunk(newRange.end);
12
29
  }
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]);
30
+ }, [calculateVisibleRange]);
22
31
  React.useEffect(() => {
23
- const container = containerRef.current;
32
+ const container = parentRef === null || parentRef === void 0 ? void 0 : parentRef.current;
24
33
  if (!container) {
25
34
  return undefined;
26
35
  }
27
- container.addEventListener('scroll', throttledCalculateActiveChunks);
36
+ const throttledHandleScroll = throttle(handleScroll, THROTTLE_DELAY, {
37
+ leading: true,
38
+ trailing: true,
39
+ });
40
+ container.addEventListener('scroll', throttledHandleScroll);
28
41
  return () => {
29
- container.removeEventListener('scroll', throttledCalculateActiveChunks);
30
- throttledCalculateActiveChunks.cancel();
42
+ container.removeEventListener('scroll', throttledHandleScroll);
43
+ throttledHandleScroll.cancel();
31
44
  };
32
- }, [containerRef, throttledCalculateActiveChunks]);
33
- return activeChunks;
45
+ }, [handleScroll, parentRef]);
46
+ return React.useMemo(() => {
47
+ // boolean array that represents active chunks
48
+ const activeChunks = Array(chunksCount).fill(false);
49
+ for (let i = startChunk; i <= endChunk; i++) {
50
+ activeChunks[i] = true;
51
+ }
52
+ return activeChunks;
53
+ }, [chunksCount, startChunk, endChunk]);
34
54
  };
35
55
  //# sourceMappingURL=useScrollBasedChunks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useScrollBasedChunks.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/useScrollBasedChunks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,E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,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpD,KAAK,IAAI,CAAC,GAAG,UAAU,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,OAAO,YAAY,CAAC;IACxB,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC"}
@@ -1,2 +1,20 @@
1
1
  export declare function rafThrottle<Fn extends (...args: any[]) => any>(fn: Fn): (...args: Parameters<Fn>) => void;
2
2
  export declare function calculateColumnWidth(newWidth: number, minWidth?: number, maxWidth?: number): number;
3
+ export declare const typedMemo: <T>(Component: T) => T;
4
+ /**
5
+ * Calculates the total vertical offset (distance from top) of an element relative to its container
6
+ * or the document body if no container is specified.
7
+ *
8
+ * This function traverses up through the DOM tree, accumulating offsetTop values
9
+ * from each parent element until it reaches either the specified container or
10
+ * the top of the document.
11
+ *
12
+ * @param element - The HTML element to calculate the offset for
13
+ * @param container - Optional container element to stop the calculation at
14
+ * @returns The total vertical offset in pixels
15
+ *
16
+ * Example:
17
+ * const offset = calculateElementOffsetTop(myElement, myContainer);
18
+ * // Returns the distance in pixels from myElement to the top of myContainer
19
+ */
20
+ export declare function calculateElementOffsetTop(element: HTMLElement, container?: HTMLElement): number;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  // invoke passed function at most once per animation frame
2
3
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
4
  export function rafThrottle(fn) {
@@ -19,4 +20,30 @@ export function rafThrottle(fn) {
19
20
  export function calculateColumnWidth(newWidth, minWidth = 40, maxWidth = Infinity) {
20
21
  return Math.max(minWidth, Math.min(newWidth, maxWidth));
21
22
  }
23
+ export const typedMemo = React.memo;
24
+ /**
25
+ * Calculates the total vertical offset (distance from top) of an element relative to its container
26
+ * or the document body if no container is specified.
27
+ *
28
+ * This function traverses up through the DOM tree, accumulating offsetTop values
29
+ * from each parent element until it reaches either the specified container or
30
+ * the top of the document.
31
+ *
32
+ * @param element - The HTML element to calculate the offset for
33
+ * @param container - Optional container element to stop the calculation at
34
+ * @returns The total vertical offset in pixels
35
+ *
36
+ * Example:
37
+ * const offset = calculateElementOffsetTop(myElement, myContainer);
38
+ * // Returns the distance in pixels from myElement to the top of myContainer
39
+ */
40
+ export function calculateElementOffsetTop(element, container) {
41
+ let currentElement = element;
42
+ let offsetTop = 0;
43
+ while (currentElement && currentElement !== container) {
44
+ offsetTop += currentElement.offsetTop;
45
+ currentElement = currentElement.offsetParent;
46
+ }
47
+ return offsetTop;
48
+ }
22
49
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/utils.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,8DAA8D;AAC9D,MAAM,UAAU,WAAW,CAAqC,EAAM;IAClE,IAAI,KAAK,GAAkB,IAAI,CAAC;IAChC,IAAI,UAA0B,CAAC;IAE/B,OAAO,SAAS,SAAS,CAAC,GAAG,IAAoB;QAC7C,2CAA2C;QAC3C,UAAU,GAAG,IAAI,CAAC;QAElB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO;QACX,CAAC;QAED,KAAK,GAAG,qBAAqB,CAAC,GAAG,EAAE;YAC/B,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC;YAClB,KAAK,GAAG,IAAI,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,oBAAoB,CAAC,QAAgB,EAAE,QAAQ,GAAG,EAAE,EAAE,QAAQ,GAAG,QAAQ;IACrF,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ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AC;AACrB,CAAC"}
@@ -2,7 +2,7 @@ import type { TTabletStateInfo } from '../../types/api/tablet';
2
2
  import './Tablet.scss';
3
3
  interface TabletProps {
4
4
  tablet?: TTabletStateInfo;
5
- tenantName?: string;
5
+ database?: string;
6
6
  }
7
- export declare const Tablet: ({ tablet, tenantName }: TabletProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const Tablet: ({ tablet, database }: TabletProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -8,11 +8,11 @@ import { TabletIcon } from '../TabletIcon/TabletIcon';
8
8
  import { TabletTooltipContent } from '../TooltipsContent';
9
9
  import './Tablet.scss';
10
10
  const b = cn('tablet');
11
- export const Tablet = ({ tablet = {}, tenantName }) => {
11
+ export const Tablet = ({ tablet = {}, database }) => {
12
12
  var _a;
13
- const { TabletId: id, NodeId, Type } = tablet;
13
+ const { TabletId: id } = tablet;
14
14
  const status = (_a = tablet.Overall) === null || _a === void 0 ? void 0 : _a.toLowerCase();
15
- const tabletPath = id && getTabletPagePath(id, { nodeId: NodeId, tenantName, type: Type });
15
+ const tabletPath = id && getTabletPagePath(id, { database });
16
16
  return (_jsx(ContentWithPopup, { className: b('wrapper'), content: _jsx(TabletTooltipContent, { data: tablet, className: b('popup-content') }), children: _jsx(InternalLink, { to: tabletPath, children: _jsx(TabletIcon, { className: b({ status }), text: getTabletLabel(tablet.Type) }) }) }));
17
17
  };
18
18
  //# sourceMappingURL=Tablet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tablet.js","sourceRoot":"","sources":["../../../src/components/Tablet/Tablet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAC,YAAY,EAA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B,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAExD,OAAO,eAAe,CAAC;AAEvB,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;AAOvB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAC,MAAM,GAAG,EAAE,EAAE,QAAQ,EAAc,EAAE,EAAE;;IAC3D,MAAM,EAAC,QAAQ,EAAE,EAAE,EAAC,GAAG,MAAM,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAA,MAAM,CAAC,OAAO,0CAAE,WAAW,EAAE,CAAC;IAE7C,MAAM,UAAU,GAAG,EAAE,IAAI,iBAAiB,CAAC,EAAE,EAAE,EAAC,QAAQ,EAAC,CAAC,CAAC;IAE3D,OAAO,CACH,KAAC,gBAAgB,IACb,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EACvB,OAAO,EAAE,KAAC,oBAAoB,IAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,GAAI,YAE9E,KAAC,YAAY,IAAC,EAAE,EAAE,UAAU,YACxB,KAAC,UAAU,IAAC,SAAS,EAAE,CAAC,CAAC,EAAC,MAAM,EAAC,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,GAAI,GAC9D,GACA,CACtB,CAAC;AACN,CAAC,CAAC"}
@@ -10,9 +10,7 @@ import { LinkWithIcon } from '../LinkWithIcon/LinkWithIcon';
10
10
  import i18n from './i18n';
11
11
  export function TabletNameWrapper({ tabletId, database }) {
12
12
  const isUserAllowedToMakeChanges = useTypedSelector(selectIsUserAllowedToMakeChanges);
13
- const tabletPath = getTabletPagePath(tabletId, {
14
- tenantName: database,
15
- });
13
+ const tabletPath = getTabletPagePath(tabletId, { database });
16
14
  return (_jsx(CellWithPopover, { disabled: !isUserAllowedToMakeChanges, content: _jsx(DefinitionList, { responsive: true, children: _jsx(DefinitionList.Item, { name: i18n('field_links'), children: _jsx(LinkWithIcon, { title: i18n('context_developer-ui'), url: createTabletDeveloperUIHref(tabletId) }) }) }), placement: ['top', 'bottom'], behavior: PopoverBehavior.Immediate, children: _jsx(EntityStatus, { name: tabletId.toString(), path: tabletPath, hasClipboardButton: true, showStatus: false }) }));
17
15
  }
18
16
  //# sourceMappingURL=TabletNameWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabletNameWrapper.js","sourceRoot":"","sources":["../../../src/components/TabletNameWrapper/TabletNameWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,gCAAgC,EAAC,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAC,2BAA2B,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAE1D,OAAO,IAAI,MAAM,QAAQ,CAAC;AAO1B,MAAM,UAAU,iBAAiB,CAAC,EAAC,QAAQ,EAAE,QAAQ,EAAyB;IAC1E,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;IAEtF,MAAM,UAAU,GAAG,iBAAiB,CAAC,QAAQ,EAAE;QAC3C,UAAU,EAAE,QAAQ;KACvB,CAAC,CAAC;IAEH,OAAO,CACH,KAAC,eAAe,IACZ,QAAQ,EAAE,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AAC,QAAQ,EAAE,EAAC,QAAQ,EAAC,CAAC,CAAC;IAE3D,OAAO,CACH,KAAC,eAAe,IACZ,QAAQ,EAAE,CAAC,0BAA0B,EACrC,OAAO,EACH,KAAC,cAAc,IAAC,UAAU,kBACtB,KAAC,cAAc,CAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,YAC1C,KAAC,YAAY,IACT,KAAK,EAAE,IAAI,CAAC,sBAAsB,CAAC,EACnC,GAAG,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAC5C,GACgB,GACT,EAErB,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,EAC5B,QAAQ,EAAE,eAAe,CAAC,SAAS,YAEnC,KAAC,YAAY,IACT,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,EACzB,IAAI,EAAE,UAAU,EAChB,kBAAkB,QAClB,UAAU,EAAE,KAAK,GACnB,GACY,CACrB,CAAC;AACN,CAAC"}
@@ -2,9 +2,8 @@ import type { TTabletStateInfo } from '../../types/api/tablet';
2
2
  import './TabletsStatistic.scss';
3
3
  interface TabletsStatisticProps {
4
4
  tablets: TTabletStateInfo[];
5
- tenantName: string | undefined;
5
+ database: string | undefined;
6
6
  nodeId: string | number;
7
- backend?: string;
8
7
  }
9
- export declare const TabletsStatistic: ({ tablets, tenantName, nodeId, backend, }: TabletsStatisticProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const TabletsStatistic: ({ tablets, database, nodeId }: TabletsStatisticProps) => import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Link } from 'react-router-dom';
3
- import { TABLETS } from '../../containers/Node/NodePages';
4
- import routes, { createHref } from '../../routes';
3
+ import { TABLETS, getDefaultNodePath } from '../../containers/Node/NodePages';
5
4
  import { cn } from '../../utils/cn';
6
5
  import { getTabletLabel } from '../../utils/constants';
7
6
  import { mapTabletStateToColorState } from '../../utils/tablet';
@@ -18,16 +17,13 @@ const prepareTablets = (tablets) => {
18
17
  });
19
18
  return res.sort((x, y) => String(x.label).localeCompare(String(y.label)));
20
19
  };
21
- export const TabletsStatistic = ({ tablets = [], tenantName, nodeId, backend, }) => {
20
+ export const TabletsStatistic = ({ tablets = [], database, nodeId }) => {
22
21
  const renderTabletInfo = (item, index) => {
23
22
  var _a;
24
- const tabletsPath = createHref(routes.node, { id: nodeId, activeTab: TABLETS }, {
25
- tenantName,
26
- backend,
27
- });
23
+ const tabletsPath = getDefaultNodePath(nodeId, { database }, TABLETS);
28
24
  const label = `${item.label}: ${item.count}`;
29
25
  const className = b('tablet', { state: (_a = item.state) === null || _a === void 0 ? void 0 : _a.toLowerCase() });
30
- return backend ? (_jsx("a", { href: tabletsPath, className: className, children: label }, index)) : (_jsx(Link, { to: tabletsPath, className: className, children: label }, index));
26
+ return (_jsx(Link, { to: tabletsPath, className: className, children: label }, index));
31
27
  };
32
28
  const preparedTablets = prepareTablets(tablets);
33
29
  return _jsx("div", { className: b(), children: preparedTablets.map(renderTabletInfo) });
@@ -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,EAAE,EAA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AAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAC,OAAO,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAwB,EAAE,EAAE;IACxF,MAAM,gBAAgB,GAAG,CAAC,IAA+C,EAAE,KAAa,EAAE,EAAE;;QACxF,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAC,EAAE,OAAO,CAAC,CAAC;QAEpE,MAAM,KAAK,GAAG,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;QAC7C,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAC,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,EAAE,EAAC,CAAC,CAAC;QAElE,OAAO,CACH,KAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAc,SAAS,EAAE,SAAS,YAClD,KAAK,IADkB,KAAK,CAE1B,CACV,CAAC;IACN,CAAC,CAAC;IACF,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAEhD,OAAO,cAAK,SAAS,EAAE,CAAC,EAAE,YAAG,eAAe,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAO,CAAC;AAC9E,CAAC,CAAC"}
@@ -27,7 +27,7 @@ export function TenantNameWrapper({ tenant, additionalTenantsProps }) {
27
27
  const isExternalLink = Boolean(backend);
28
28
  const monitoringLink = (_a = additionalTenantsProps === null || additionalTenantsProps === void 0 ? void 0 : additionalTenantsProps.getMonitoringLink) === null || _a === void 0 ? void 0 : _a.call(additionalTenantsProps, tenant.Name, tenant.Type);
29
29
  return (_jsx(CellWithPopover, { disabled: !isUserAllowedToMakeChanges || !monitoringLink, content: monitoringLink ? (_jsx(DefinitionList, { responsive: true, children: _jsx(DefinitionList.Item, { name: i18n('field_links'), children: _jsx(LinkWithIcon, { title: i18n('field_monitoring-link'), url: monitoringLink }) }) })) : null, placement: ['top', 'bottom'], behavior: PopoverBehavior.Immediate, children: _jsx(EntityStatus, { externalLink: isExternalLink, name: tenant.Name || i18n('context_unknown'), withLeftTrim: true, status: tenant.Overall, hasClipboardButton: true, path: getTenantPath({
30
- name: tenant.Name,
30
+ database: tenant.Name,
31
31
  backend,
32
32
  }) }) }));
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TenantNameWrapper.js","sourceRoot":"","sources":["../../../src/components/TenantNameWrapper/TenantNameWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAC,aAAa,EAAC,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAC,gCAAgC,EAAC,MAAM,oDAAoD,CAAC;AAGpG,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAE1D,OAAO,IAAI,MAAM,QAAQ,CAAC;AAO1B,MAAM,gBAAgB,GAAG,CACrB,MAAsB,EACtB,sBAA+C,EACjD,EAAE;;IACA,IAAI,OAAO,CAAA,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,oBAAoB,CAAA,KAAK,UAAU,EAAE,CAAC;QACrE,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,OAAO,GAAqC,MAAA,MAAM,CAAC,kBAAkB,mCAAI,MAAM,CAAC,OAAO,CAAC;IAC5F,MAAM,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,MAAM,CAAC,aAAa,CAAC;IACvD,IAAI,CAAC,OAAO,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,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AAY,EAAE,IAAI,EAClB,MAAM,EAAE,MAAM,CAAC,OAAO,EACtB,kBAAkB,QAClB,IAAI,EAAE,aAAa,CAAC;gBAChB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,OAAO;aACV,CAAC,GACJ,GACY,CACrB,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"TenantNameWrapper.js","sourceRoot":"","sources":["../../../src/components/TenantNameWrapper/TenantNameWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAC,aAAa,EAAC,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAC,gCAAgC,EAAC,MAAM,oDAAoD,CAAC;AAGpG,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAE1D,OAAO,IAAI,MAAM,QAAQ,CAAC;AAO1B,MAAM,gBAAgB,GAAG,CACrB,MAAsB,EACtB,sBAA+C,EACjD,EAAE;;IACA,IAAI,OAAO,CAAA,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,oBAAoB,CAAA,KAAK,UAAU,EAAE,CAAC;QACrE,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,OAAO,GAAqC,MAAA,MAAM,CAAC,kBAAkB,mCAAI,MAAM,CAAC,OAAO,CAAC;IAC5F,MAAM,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,MAAM,CAAC,aAAa,CAAC;IACvD,IAAI,CAAC,OAAO,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,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BAAkB,QAClB,IAAI,EAAE,aAAa,CAAC;gBAChB,QAAQ,EAAE,MAAM,CAAC,IAAI;gBACrB,OAAO;aACV,CAAC,GACJ,GACY,CACrB,CAAC;AACN,CAAC"}
@@ -169,7 +169,7 @@ export function getTabletsColumn({ database }) {
169
169
  width: 500,
170
170
  resizeMinWidth: 500,
171
171
  render: ({ row }) => {
172
- return row.Tablets ? (_jsx(TabletsStatistic, { tenantName: database !== null && database !== void 0 ? database : row.TenantName, nodeId: row.NodeId, tablets: row.Tablets })) : (EMPTY_DATA_PLACEHOLDER);
172
+ return row.Tablets ? (_jsx(TabletsStatistic, { database: database !== null && database !== void 0 ? database : row.TenantName, nodeId: row.NodeId, tablets: row.Tablets })) : (EMPTY_DATA_PLACEHOLDER);
173
173
  },
174
174
  align: DataTable.LEFT,
175
175
  sortable: false,