ydb-embedded-ui 6.22.0 → 6.23.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. package/dist/components/PDiskPopup/PDiskPopup.d.ts +2 -4
  2. package/dist/components/PDiskPopup/PDiskPopup.js +10 -5
  3. package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
  4. package/dist/components/PaginatedTable/PaginatedTable.d.ts +2 -1
  5. package/dist/components/PaginatedTable/PaginatedTable.js +9 -7
  6. package/dist/components/PaginatedTable/PaginatedTable.js.map +1 -1
  7. package/dist/components/PaginatedTable/TableChunk.d.ts +2 -1
  8. package/dist/components/PaginatedTable/TableChunk.js +5 -2
  9. package/dist/components/PaginatedTable/TableChunk.js.map +1 -1
  10. package/dist/components/QueryResultTable/QueryResultTable.js +11 -16
  11. package/dist/components/QueryResultTable/QueryResultTable.js.map +1 -1
  12. package/dist/components/QueryResultTable/utils/getColumnWidth.d.ts +7 -0
  13. package/dist/components/QueryResultTable/utils/getColumnWidth.js +16 -0
  14. package/dist/components/QueryResultTable/utils/getColumnWidth.js.map +1 -0
  15. package/dist/components/QueryResultTable/utils/getColumnWidth.test.d.ts +1 -0
  16. package/dist/components/QueryResultTable/utils/getColumnWidth.test.js +32 -0
  17. package/dist/components/QueryResultTable/utils/getColumnWidth.test.js.map +1 -0
  18. package/dist/components/StorageGroupInfo/StorageGroupInfo.js +7 -7
  19. package/dist/components/StorageGroupInfo/StorageGroupInfo.js.map +1 -1
  20. package/dist/components/StorageGroupInfo/i18n/index.d.ts +1 -1
  21. package/dist/components/TableSkeleton/TableSkeleton.d.ts +2 -1
  22. package/dist/components/TableSkeleton/TableSkeleton.js +5 -1
  23. package/dist/components/TableSkeleton/TableSkeleton.js.map +1 -1
  24. package/dist/components/TableSkeleton/TableSkeleton.scss +7 -1
  25. package/dist/components/VDisk/VDisk.d.ts +1 -3
  26. package/dist/components/VDisk/VDisk.js +2 -2
  27. package/dist/components/VDisk/VDisk.js.map +1 -1
  28. package/dist/components/VDiskPopup/VDiskPopup.d.ts +1 -3
  29. package/dist/components/VDiskPopup/VDiskPopup.js +7 -2
  30. package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
  31. package/dist/containers/Cluster/Cluster.scss +2 -2
  32. package/dist/containers/Header/breadcrumbs.js +2 -3
  33. package/dist/containers/Header/breadcrumbs.js.map +1 -1
  34. package/dist/containers/Nodes/columns/columns.js +8 -0
  35. package/dist/containers/Nodes/columns/columns.js.map +1 -1
  36. package/dist/containers/Nodes/columns/constants.d.ts +2 -0
  37. package/dist/containers/Nodes/columns/constants.js +4 -0
  38. package/dist/containers/Nodes/columns/constants.js.map +1 -1
  39. package/dist/containers/Nodes/columns/i18n/en.json +1 -0
  40. package/dist/containers/Nodes/columns/i18n/index.d.ts +1 -1
  41. package/dist/containers/Storage/Disks/Disks.d.ts +3 -3
  42. package/dist/containers/Storage/Disks/Disks.js +6 -7
  43. package/dist/containers/Storage/Disks/Disks.js.map +1 -1
  44. package/dist/containers/Storage/PDisk/PDisk.d.ts +3 -2
  45. package/dist/containers/Storage/PDisk/PDisk.js +3 -2
  46. package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
  47. package/dist/containers/Storage/PDisk/PDisk.scss +1 -1
  48. package/dist/containers/Storage/PaginatedStorage.d.ts +5 -5
  49. package/dist/containers/Storage/PaginatedStorage.js +7 -73
  50. package/dist/containers/Storage/PaginatedStorage.js.map +1 -1
  51. package/dist/containers/Storage/PaginatedStorageGroups.d.ts +3 -0
  52. package/dist/containers/Storage/PaginatedStorageGroups.js +84 -0
  53. package/dist/containers/Storage/PaginatedStorageGroups.js.map +1 -0
  54. package/dist/containers/Storage/PaginatedStorageNodes.d.ts +3 -0
  55. package/dist/containers/Storage/PaginatedStorageNodes.js +98 -0
  56. package/dist/containers/Storage/PaginatedStorageNodes.js.map +1 -0
  57. package/dist/containers/Storage/Storage.js +15 -70
  58. package/dist/containers/Storage/Storage.js.map +1 -1
  59. package/dist/containers/Storage/Storage.scss +4 -0
  60. package/dist/containers/Storage/StorageControls/StorageControls.d.ts +3 -16
  61. package/dist/containers/Storage/StorageControls/StorageControls.js +18 -11
  62. package/dist/containers/Storage/StorageControls/StorageControls.js.map +1 -1
  63. package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.d.ts +22 -0
  64. package/dist/containers/Storage/StorageGroups/{PaginatedStorageGroups.js → PaginatedStorageGroupsTable.js} +23 -5
  65. package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.js.map +1 -0
  66. package/dist/containers/Storage/StorageGroups/{StorageGroups.d.ts → StorageGroupsTable.d.ts} +3 -4
  67. package/dist/containers/Storage/StorageGroups/{StorageGroups.js → StorageGroupsTable.js} +4 -3
  68. package/dist/containers/Storage/StorageGroups/StorageGroupsTable.js.map +1 -0
  69. package/dist/containers/Storage/StorageGroups/columns/columns.js +35 -10
  70. package/dist/containers/Storage/StorageGroups/columns/columns.js.map +1 -1
  71. package/dist/containers/Storage/StorageGroups/columns/constants.d.ts +17 -0
  72. package/dist/containers/Storage/StorageGroups/columns/constants.js +46 -1
  73. package/dist/containers/Storage/StorageGroups/columns/constants.js.map +1 -1
  74. package/dist/containers/Storage/StorageGroups/columns/hooks.d.ts +3 -3
  75. package/dist/containers/Storage/StorageGroups/columns/hooks.js +5 -8
  76. package/dist/containers/Storage/StorageGroups/columns/hooks.js.map +1 -1
  77. package/dist/containers/Storage/StorageGroups/columns/i18n/en.json +6 -0
  78. package/dist/containers/Storage/StorageGroups/columns/i18n/index.d.ts +1 -1
  79. package/dist/containers/Storage/StorageGroups/columns/types.d.ts +7 -5
  80. package/dist/containers/Storage/StorageGroups/getGroups.js +6 -5
  81. package/dist/containers/Storage/StorageGroups/getGroups.js.map +1 -1
  82. package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.d.ts +23 -0
  83. package/dist/containers/Storage/StorageNodes/{PaginatedStorageNodes.js → PaginatedStorageNodesTable.js} +23 -5
  84. package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.js.map +1 -0
  85. package/dist/containers/Storage/StorageNodes/{StorageNodes.d.ts → StorageNodesTable.d.ts} +3 -4
  86. package/dist/containers/Storage/StorageNodes/{StorageNodes.js → StorageNodesTable.js} +8 -6
  87. package/dist/containers/Storage/StorageNodes/StorageNodesTable.js.map +1 -0
  88. package/dist/containers/Storage/StorageNodes/columns/StorageNodesColumns.scss +1 -0
  89. package/dist/containers/Storage/StorageNodes/columns/columns.d.ts +1 -1
  90. package/dist/containers/Storage/StorageNodes/columns/columns.js +4 -5
  91. package/dist/containers/Storage/StorageNodes/columns/columns.js.map +1 -1
  92. package/dist/containers/Storage/StorageNodes/columns/constants.d.ts +9 -0
  93. package/dist/containers/Storage/StorageNodes/columns/constants.js +27 -0
  94. package/dist/containers/Storage/StorageNodes/columns/constants.js.map +1 -1
  95. package/dist/containers/Storage/StorageNodes/columns/i18n/en.json +2 -0
  96. package/dist/containers/Storage/StorageNodes/columns/i18n/index.d.ts +1 -1
  97. package/dist/containers/Storage/StorageNodes/getNodes.js +6 -5
  98. package/dist/containers/Storage/StorageNodes/getNodes.js.map +1 -1
  99. package/dist/containers/Storage/TableGroup/TableGroup.d.ts +12 -0
  100. package/dist/containers/Storage/TableGroup/TableGroup.js +21 -0
  101. package/dist/containers/Storage/TableGroup/TableGroup.js.map +1 -0
  102. package/dist/containers/Storage/TableGroup/TableGroup.scss +49 -0
  103. package/dist/containers/Storage/TableGroup/useExpandedTableGroups.d.ts +5 -0
  104. package/dist/containers/Storage/TableGroup/useExpandedTableGroups.js +28 -0
  105. package/dist/containers/Storage/TableGroup/useExpandedTableGroups.js.map +1 -0
  106. package/dist/containers/Storage/i18n/en.json +4 -1
  107. package/dist/containers/Storage/i18n/index.d.ts +1 -1
  108. package/dist/containers/Storage/i18n/index.js +1 -2
  109. package/dist/containers/Storage/i18n/index.js.map +1 -1
  110. package/dist/containers/Storage/shared.d.ts +2 -0
  111. package/dist/containers/Storage/shared.js +9 -0
  112. package/dist/containers/Storage/shared.js.map +1 -1
  113. package/dist/containers/Storage/useStorageQueryParams.d.ts +18 -0
  114. package/dist/containers/Storage/useStorageQueryParams.js +64 -0
  115. package/dist/containers/Storage/useStorageQueryParams.js.map +1 -0
  116. package/dist/containers/Storage/utils/index.d.ts +6 -2
  117. package/dist/containers/Storage/utils/index.js +11 -6
  118. package/dist/containers/Storage/utils/index.js.map +1 -1
  119. package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +17 -3
  120. package/dist/containers/Tenant/Diagnostics/Describe/Describe.js.map +1 -1
  121. package/dist/containers/Tenant/Diagnostics/Diagnostics.js +1 -1
  122. package/dist/containers/Tenant/Diagnostics/Diagnostics.js.map +1 -1
  123. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +0 -3
  124. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +2 -2
  125. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js.map +1 -1
  126. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +10 -3
  127. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js.map +1 -1
  128. package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +2 -3
  129. package/dist/containers/Tenant/Diagnostics/Overview/Overview.js.map +1 -1
  130. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +4 -4
  131. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js.map +1 -1
  132. package/dist/containers/Tenant/Diagnostics/Partitions/utils/index.d.ts +2 -2
  133. package/dist/containers/Tenant/Diagnostics/Partitions/utils/index.js +5 -5
  134. package/dist/containers/Tenant/Diagnostics/Partitions/utils/index.js.map +1 -1
  135. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +8 -2
  136. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js.map +1 -1
  137. package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.d.ts +5 -0
  138. package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.js +21 -0
  139. package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.js.map +1 -0
  140. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.d.ts +1 -3
  141. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +32 -37
  142. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js.map +1 -1
  143. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.d.ts +6 -0
  144. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.js +33 -0
  145. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.js.map +1 -0
  146. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.d.ts +2 -0
  147. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +26 -0
  148. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js.map +1 -1
  149. package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/en.json +7 -1
  150. package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/index.d.ts +1 -1
  151. package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/index.js +1 -2
  152. package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/index.js.map +1 -1
  153. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +27 -9
  154. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js.map +1 -1
  155. package/dist/containers/Tenant/ObjectSummary/__test__/transformPath.test.js +27 -3
  156. package/dist/containers/Tenant/ObjectSummary/__test__/transformPath.test.js.map +1 -1
  157. package/dist/containers/Tenant/ObjectSummary/transformPath.d.ts +2 -0
  158. package/dist/containers/Tenant/ObjectSummary/transformPath.js +10 -0
  159. package/dist/containers/Tenant/ObjectSummary/transformPath.js.map +1 -1
  160. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +3 -1
  161. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js.map +1 -1
  162. package/dist/containers/Tenant/Query/ExecuteResult/i18n/en.json +2 -1
  163. package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.d.ts +1 -1
  164. package/dist/containers/Tenant/Query/NewSQL/NewSQL.d.ts +1 -0
  165. package/dist/containers/Tenant/Query/NewSQL/NewSQL.js +135 -0
  166. package/dist/containers/Tenant/Query/NewSQL/NewSQL.js.map +1 -0
  167. package/dist/containers/Tenant/Query/NewSQL/i18n/en.json +32 -0
  168. package/dist/containers/Tenant/Query/NewSQL/i18n/index.d.ts +2 -0
  169. package/dist/containers/Tenant/Query/NewSQL/i18n/index.js +5 -0
  170. package/dist/containers/Tenant/Query/NewSQL/i18n/index.js.map +1 -0
  171. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +2 -1
  172. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js.map +1 -1
  173. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.scss +1 -0
  174. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +1 -1
  175. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js.map +1 -1
  176. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +10 -2
  177. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js.map +1 -1
  178. package/dist/containers/Tenant/Schema/SchemaViewer/prepareData.d.ts +2 -1
  179. package/dist/containers/Tenant/Schema/SchemaViewer/prepareData.js.map +1 -1
  180. package/dist/containers/Tenant/Tenant.js +7 -3
  181. package/dist/containers/Tenant/Tenant.js.map +1 -1
  182. package/dist/containers/Tenant/utils/newSQLQueryActions.d.ts +27 -0
  183. package/dist/containers/Tenant/utils/newSQLQueryActions.js +35 -0
  184. package/dist/containers/Tenant/utils/newSQLQueryActions.js.map +1 -0
  185. package/dist/containers/Tenant/utils/newSQLQueryTemplates.d.ts +24 -0
  186. package/dist/containers/Tenant/utils/newSQLQueryTemplates.js +228 -0
  187. package/dist/containers/Tenant/utils/newSQLQueryTemplates.js.map +1 -0
  188. package/dist/containers/Tenant/utils/schemaActions.d.ts +1 -1
  189. package/dist/containers/Tenant/utils/schemaActions.js +8 -6
  190. package/dist/containers/Tenant/utils/schemaActions.js.map +1 -1
  191. package/dist/containers/Tenant/utils/{queryTemplates.js → schemaQueryTemplates.js} +1 -1
  192. package/dist/containers/Tenant/utils/schemaQueryTemplates.js.map +1 -0
  193. package/dist/services/api.js +3 -3
  194. package/dist/services/api.js.map +1 -1
  195. package/dist/store/reducers/capabilities/hooks.d.ts +2 -0
  196. package/dist/store/reducers/capabilities/hooks.js +6 -0
  197. package/dist/store/reducers/capabilities/hooks.js.map +1 -1
  198. package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +4 -0
  199. package/dist/store/reducers/executeTopQueries/executeTopQueries.js +27 -1
  200. package/dist/store/reducers/executeTopQueries/executeTopQueries.js.map +1 -1
  201. package/dist/store/reducers/nodes/types.d.ts +1 -0
  202. package/dist/store/reducers/nodesList.d.ts +5 -5
  203. package/dist/store/reducers/nodesList.js +2 -2
  204. package/dist/store/reducers/nodesList.js.map +1 -1
  205. package/dist/store/reducers/overview/overview.js +5 -1
  206. package/dist/store/reducers/overview/overview.js.map +1 -1
  207. package/dist/store/reducers/storage/requestStorageData.d.ts +3 -3
  208. package/dist/store/reducers/storage/requestStorageData.js.map +1 -1
  209. package/dist/store/reducers/storage/selectors.d.ts +2 -3
  210. package/dist/store/reducers/storage/selectors.js +1 -27
  211. package/dist/store/reducers/storage/selectors.js.map +1 -1
  212. package/dist/store/reducers/storage/storage.d.ts +2 -2
  213. package/dist/store/reducers/storage/storage.js.map +1 -1
  214. package/dist/store/reducers/storage/types.d.ts +19 -10
  215. package/dist/store/reducers/storage/utils.js +27 -3
  216. package/dist/store/reducers/storage/utils.js.map +1 -1
  217. package/dist/store/reducers/tablet.js +5 -3
  218. package/dist/store/reducers/tablet.js.map +1 -1
  219. package/dist/store/reducers/tablets.d.ts +3 -3
  220. package/dist/store/reducers/tablets.js +4 -4
  221. package/dist/store/reducers/tablets.js.map +1 -1
  222. package/dist/types/api/capabilities.d.ts +1 -1
  223. package/dist/types/api/nodes.d.ts +3 -2
  224. package/dist/types/api/nodes.js.map +1 -1
  225. package/dist/types/api/storage.d.ts +22 -4
  226. package/dist/types/store/nodesList.d.ts +1 -1
  227. package/dist/utils/hooks/useSelectedColumns.js +7 -2
  228. package/dist/utils/hooks/useSelectedColumns.js.map +1 -1
  229. package/dist/utils/nodes.d.ts +2 -2
  230. package/dist/utils/nodes.js +4 -4
  231. package/dist/utils/nodes.js.map +1 -1
  232. package/dist/utils/storage.js +2 -0
  233. package/dist/utils/storage.js.map +1 -1
  234. package/dist/utils/utils.js +2 -1
  235. package/dist/utils/utils.js.map +1 -1
  236. package/package.json +1 -1
  237. package/dist/containers/Storage/StorageGroups/PaginatedStorageGroups.d.ts +0 -16
  238. package/dist/containers/Storage/StorageGroups/PaginatedStorageGroups.js.map +0 -1
  239. package/dist/containers/Storage/StorageGroups/StorageGroups.js.map +0 -1
  240. package/dist/containers/Storage/StorageNodes/PaginatedStorageNodes.d.ts +0 -17
  241. package/dist/containers/Storage/StorageNodes/PaginatedStorageNodes.js.map +0 -1
  242. package/dist/containers/Storage/StorageNodes/StorageNodes.js.map +0 -1
  243. package/dist/containers/Storage/UsageFilter/UsageFilter.d.ts +0 -14
  244. package/dist/containers/Storage/UsageFilter/UsageFilter.js +0 -39
  245. package/dist/containers/Storage/UsageFilter/UsageFilter.js.map +0 -1
  246. package/dist/containers/Storage/UsageFilter/UsageFilter.scss +0 -38
  247. package/dist/containers/Storage/UsageFilter/i18n/en.json +0 -5
  248. package/dist/containers/Storage/UsageFilter/i18n/index.d.ts +0 -2
  249. package/dist/containers/Storage/UsageFilter/i18n/index.js +0 -6
  250. package/dist/containers/Storage/UsageFilter/i18n/index.js.map +0 -1
  251. package/dist/containers/Storage/UsageFilter/i18n/ru.json +0 -5
  252. package/dist/containers/Storage/UsageFilter/index.d.ts +0 -1
  253. package/dist/containers/Storage/UsageFilter/index.js +0 -2
  254. package/dist/containers/Storage/UsageFilter/index.js.map +0 -1
  255. package/dist/containers/Storage/i18n/ru.json +0 -6
  256. package/dist/containers/Tenant/Diagnostics/TopQueries/i18n/ru.json +0 -4
  257. package/dist/containers/Tenant/utils/queryTemplates.js.map +0 -1
  258. package/dist/store/reducers/describe.d.ts +0 -7
  259. package/dist/store/reducers/describe.js +0 -25
  260. package/dist/store/reducers/describe.js.map +0 -1
  261. /package/dist/containers/Tenant/utils/{queryTemplates.d.ts → schemaQueryTemplates.d.ts} +0 -0
@@ -1,12 +1,10 @@
1
1
  import type { PopupProps } from '@gravity-ui/uikit';
2
- import type { NodesMap } from '../../types/store/nodesList';
3
2
  import type { PreparedPDisk } from '../../utils/disks/types';
4
3
  import type { InfoViewerItem } from '../InfoViewer';
5
4
  import './PDiskPopup.scss';
6
- export declare const preparePDiskData: (data: PreparedPDisk, nodes?: NodesMap) => InfoViewerItem[];
5
+ export declare const preparePDiskData: (data: PreparedPDisk, nodeHost?: string) => InfoViewerItem[];
7
6
  interface PDiskPopupProps extends PopupProps {
8
7
  data: PreparedPDisk;
9
- nodes?: NodesMap;
10
8
  }
11
- export declare const PDiskPopup: ({ data, nodes, ...props }: PDiskPopupProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const PDiskPopup: ({ data, ...props }: PDiskPopupProps) => import("react/jsx-runtime").JSX.Element;
12
10
  export {};
@@ -1,16 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { Popup } from '@gravity-ui/uikit';
4
+ import { selectNodeHostsMap } from '../../store/reducers/nodesList';
4
5
  import { EFlag } from '../../types/api/enums';
6
+ import { valueIsDefined } from '../../utils';
5
7
  import { cn } from '../../utils/cn';
6
8
  import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants';
7
9
  import { getPDiskId } from '../../utils/disks/helpers';
10
+ import { useTypedSelector } from '../../utils/hooks';
8
11
  import { bytesToGB } from '../../utils/utils';
9
12
  import { InfoViewer } from '../InfoViewer';
10
13
  import './PDiskPopup.scss';
11
14
  const b = cn('pdisk-storage-popup');
12
15
  const errorColors = [EFlag.Orange, EFlag.Red, EFlag.Yellow];
13
- export const preparePDiskData = (data, nodes) => {
16
+ export const preparePDiskData = (data, nodeHost) => {
14
17
  var _a;
15
18
  const { AvailableSize, TotalSize, State, PDiskId, NodeId, Path, Realtime, Type, Device } = data;
16
19
  const pdiskData = [
@@ -24,8 +27,8 @@ export const preparePDiskData = (data, nodes) => {
24
27
  if (NodeId) {
25
28
  pdiskData.push({ label: 'Node Id', value: NodeId });
26
29
  }
27
- if (nodes && NodeId && nodes.get(NodeId)) {
28
- pdiskData.push({ label: 'Host', value: nodes.get(NodeId) });
30
+ if (nodeHost) {
31
+ pdiskData.push({ label: 'Host', value: nodeHost });
29
32
  }
30
33
  if (Path) {
31
34
  pdiskData.push({ label: 'Path', value: Path });
@@ -42,8 +45,10 @@ export const preparePDiskData = (data, nodes) => {
42
45
  }
43
46
  return pdiskData;
44
47
  };
45
- export const PDiskPopup = ({ data, nodes, ...props }) => {
46
- const info = React.useMemo(() => preparePDiskData(data, nodes), [data, nodes]);
48
+ export const PDiskPopup = ({ data, ...props }) => {
49
+ const nodeHostsMap = useTypedSelector(selectNodeHostsMap);
50
+ const nodeHost = valueIsDefined(data.NodeId) ? nodeHostsMap === null || nodeHostsMap === void 0 ? void 0 : nodeHostsMap.get(data.NodeId) : undefined;
51
+ const info = React.useMemo(() => preparePDiskData(data, nodeHost), [data, nodeHost]);
47
52
  return (_jsx(Popup, { contentClassName: b(), placement: ['top', 'bottom'], hasArrow: true,
48
53
  // bigger offset for easier switching to neighbour nodes
49
54
  // matches the default offset for popup with arrow out of a sense of beauty
@@ -1 +1 @@
1
- {"version":3,"file":"PDiskPopup.js","sourceRoot":"","sources":["../../../src/components/PDiskPopup/PDiskPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC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EAAE,MAAM,EAAC,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAC,IAAI,EAAE,GAAG,KAAK,EAAkB,EAAE,EAAE;IAC5D,MAAM,YAAY,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,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,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,KACX,KAAK,YAET,KAAC,UAAU,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,GAAG,GAC7C,CACX,CAAC;AACN,CAAC,CAAC"}
@@ -2,6 +2,7 @@ import type { Column, FetchData, GetRowClassName, HandleTableColumnsResize, Rend
2
2
  import './PaginatedTable.scss';
3
3
  export interface PaginatedTableProps<T, F> {
4
4
  limit: number;
5
+ initialEntitiesCount?: number;
5
6
  fetchData: FetchData<T, F>;
6
7
  filters?: F;
7
8
  tableName: string;
@@ -16,4 +17,4 @@ export interface PaginatedTableProps<T, F> {
16
17
  renderErrorMessage?: RenderErrorMessage;
17
18
  containerClassName?: string;
18
19
  }
19
- export declare const PaginatedTable: <T, F>({ limit, fetchData, filters, tableName, columns, getRowClassName, rowHeight, parentContainer, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }: PaginatedTableProps<T, F>) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const PaginatedTable: <T, F>({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight, parentContainer, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }: PaginatedTableProps<T, F>) => import("react/jsx-runtime").JSX.Element;
@@ -10,10 +10,12 @@ import i18n from './i18n';
10
10
  import { b } from './shared';
11
11
  import { useIntersectionObserver } from './useIntersectionObserver';
12
12
  import './PaginatedTable.scss';
13
- export const PaginatedTable = ({ limit, fetchData, filters, tableName, columns, getRowClassName, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, parentContainer, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }) => {
13
+ export const PaginatedTable = ({ limit, initialEntitiesCount, fetchData, filters, tableName, columns, getRowClassName, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, parentContainer, initialSortParams, onColumnsResize, renderControls, renderErrorMessage, renderEmptyDataMessage, containerClassName, }) => {
14
+ const initialTotal = initialEntitiesCount || limit;
15
+ const initialFound = initialEntitiesCount || 0;
14
16
  const [sortParams, setSortParams] = React.useState(initialSortParams);
15
- const [totalEntities, setTotalEntities] = React.useState(limit);
16
- const [foundEntities, setFoundEntities] = React.useState(0);
17
+ const [totalEntities, setTotalEntities] = React.useState(initialTotal);
18
+ const [foundEntities, setFoundEntities] = React.useState(initialFound);
17
19
  const [activeChunks, setActiveChunks] = React.useState([]);
18
20
  const [isInitialLoad, setIsInitialLoad] = React.useState(true);
19
21
  const tableContainer = React.useRef(null);
@@ -32,8 +34,8 @@ export const PaginatedTable = ({ limit, fetchData, filters, tableName, columns,
32
34
  // reset table on filters change
33
35
  React.useLayoutEffect(() => {
34
36
  var _a;
35
- setTotalEntities(limit);
36
- setFoundEntities(0);
37
+ setTotalEntities(initialTotal);
38
+ setFoundEntities(initialFound);
37
39
  setIsInitialLoad(true);
38
40
  if (parentContainer) {
39
41
  parentContainer.scrollTo(0, 0);
@@ -42,7 +44,7 @@ export const PaginatedTable = ({ limit, fetchData, filters, tableName, columns,
42
44
  (_a = tableContainer.current) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
43
45
  }
44
46
  setActiveChunks([0]);
45
- }, [filters, limit, parentContainer]);
47
+ }, [filters, initialFound, initialTotal, limit, parentContainer]);
46
48
  const renderChunks = () => {
47
49
  if (!observer) {
48
50
  return null;
@@ -52,7 +54,7 @@ export const PaginatedTable = ({ limit, fetchData, filters, tableName, columns,
52
54
  }
53
55
  const totalLength = foundEntities || limit;
54
56
  const chunksCount = Math.ceil(totalLength / limit);
55
- return getArray(chunksCount).map((value) => (_jsx(TableChunk, { id: value, limit: limit, rowHeight: rowHeight, columns: columns, fetchData: fetchData, filters: filters, tableName: tableName, sortParams: sortParams, getRowClassName: getRowClassName, renderErrorMessage: renderErrorMessage, onDataFetched: handleDataFetched, isActive: activeChunks.includes(value), observer: observer }, value)));
57
+ return getArray(chunksCount).map((value) => (_jsx(TableChunk, { id: value, limit: limit, totalLength: totalLength, rowHeight: rowHeight, columns: columns, fetchData: fetchData, filters: filters, tableName: tableName, sortParams: sortParams, getRowClassName: getRowClassName, renderErrorMessage: renderErrorMessage, onDataFetched: handleDataFetched, isActive: activeChunks.includes(value), observer: observer }, value)));
56
58
  };
57
59
  const renderTable = () => (_jsxs("table", { className: b('table'), children: [_jsx(TableHead, { columns: columns, onSort: setSortParams, onColumnsResize: onColumnsResize }), renderChunks()] }));
58
60
  const renderContent = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"PaginatedTable.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/PaginatedTable.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO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AC,aAAa,EAAE,aAAa,EAAE,aAAa,EAAC,CAAC,GACxC,EACnC,KAAC,uBAAuB,CAAC,KAAK,cAAE,WAAW,EAAE,GAAiC,IACxD,CAC7B,CAAC;QACN,CAAC;QAED,OAAO,WAAW,EAAE,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,CACH,cAAK,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,kBAAkB,CAAC,YAC3D,aAAa,EAAE,GACd,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -4,6 +4,7 @@ import type { Column, FetchData, GetRowClassName, SortParams } from './types';
4
4
  interface TableChunkProps<T, F> {
5
5
  id: number;
6
6
  limit: number;
7
+ totalLength: number;
7
8
  rowHeight: number;
8
9
  columns: Column<T>[];
9
10
  filters?: F;
@@ -16,5 +17,5 @@ interface TableChunkProps<T, F> {
16
17
  renderErrorMessage?: (error: IResponseError) => React.ReactNode;
17
18
  onDataFetched: (total: number, found: number) => void;
18
19
  }
19
- export declare const TableChunk: <T, F>({ id, limit, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }: TableChunkProps<T, F>) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const TableChunk: <T, F>({ id, limit, totalLength, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }: TableChunkProps<T, F>) => import("react/jsx-runtime").JSX.Element;
20
21
  export {};
@@ -9,7 +9,7 @@ const DEBOUNCE_TIMEOUT = 200;
9
9
  // With original memo generic types are lost
10
10
  const typedMemo = React.memo;
11
11
  // Memoisation prevents chunks rerenders that could cause perfomance issues on big tables
12
- export const TableChunk = typedMemo(function TableChunk({ id, limit, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }) {
12
+ export const TableChunk = typedMemo(function TableChunk({ id, limit, totalLength, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }) {
13
13
  var _a;
14
14
  const ref = React.useRef(null);
15
15
  const [isTimeoutActive, setIsTimeoutActive] = React.useState(true);
@@ -55,7 +55,10 @@ export const TableChunk = typedMemo(function TableChunk({ id, limit, rowHeight,
55
55
  onDataFetched(total, found);
56
56
  }
57
57
  }, [currentData, isActive, onDataFetched]);
58
- const dataLength = ((_a = currentData === null || currentData === void 0 ? void 0 : currentData.data) === null || _a === void 0 ? void 0 : _a.length) || limit;
58
+ const chunkOffset = id * limit;
59
+ const remainingLenght = totalLength - chunkOffset;
60
+ const calculatedChunkLength = remainingLenght < limit ? remainingLenght : limit;
61
+ const dataLength = ((_a = currentData === null || currentData === void 0 ? void 0 : currentData.data) === null || _a === void 0 ? void 0 : _a.length) || calculatedChunkLength;
59
62
  const renderContent = () => {
60
63
  if (!isActive) {
61
64
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"TableChunk.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableChunk.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpE,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,4CAA4C;AAC5C,MAAM,SAAS,GAA2B,KAAK,CAAC,IAAI,CAAC;AAmBrD,yFAAyF;AACzF,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC,SAAS,UAAU,CAAO,EAC1D,EAAE,EACF,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,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AAC,CAAC,OAAO;SAClD,YAEA,aAAa,EAAE,GACZ,CACX,CAAC;AACN,CAAC,CAAC,CAAC"}
@@ -8,30 +8,28 @@ import { isNumeric } from '../../utils/utils';
8
8
  import { ResizeableDataTable } from '../ResizeableDataTable/ResizeableDataTable';
9
9
  import { Cell } from './Cell';
10
10
  import i18n from './i18n';
11
+ import { getColumnWidth } from './utils/getColumnWidth';
11
12
  import './QueryResultTable.scss';
12
13
  const TABLE_SETTINGS = {
13
14
  ...DEFAULT_TABLE_SETTINGS,
14
15
  stripedRows: true,
15
16
  dynamicRenderType: 'variable',
16
17
  dynamicItemSizeGetter: () => 40,
18
+ sortable: false,
17
19
  };
18
20
  export const b = cn('ydb-query-result-table');
19
- const prepareTypedColumns = (columns) => {
21
+ const WIDTH_PREDICTION_ROWS_COUNT = 100;
22
+ const prepareTypedColumns = (columns, data) => {
20
23
  if (!columns.length) {
21
24
  return [];
22
25
  }
26
+ const dataSlice = data === null || data === void 0 ? void 0 : data.slice(0, WIDTH_PREDICTION_ROWS_COUNT);
23
27
  return columns.map(({ name, type }) => {
24
28
  const columnType = getColumnType(type);
25
29
  const column = {
26
30
  name,
31
+ width: getColumnWidth({ data: dataSlice, name }),
27
32
  align: columnType === 'number' ? DataTable.RIGHT : DataTable.LEFT,
28
- sortAccessor: (row) => {
29
- const value = row[name];
30
- if (value === undefined || value === null) {
31
- return null;
32
- }
33
- return columnType === 'number' ? BigInt(value) : value;
34
- },
35
33
  render: ({ row }) => _jsx(Cell, { value: String(row[name]) }),
36
34
  };
37
35
  return column;
@@ -41,11 +39,12 @@ const prepareGenericColumns = (data) => {
41
39
  if (!data.length) {
42
40
  return [];
43
41
  }
42
+ const dataSlice = data === null || data === void 0 ? void 0 : data.slice(0, WIDTH_PREDICTION_ROWS_COUNT);
44
43
  return Object.keys(data[0]).map((name) => {
45
44
  const column = {
46
45
  name,
46
+ width: getColumnWidth({ data: dataSlice, name }),
47
47
  align: isNumeric(data[0][name]) ? DataTable.RIGHT : DataTable.LEFT,
48
- sortAccessor: (row) => (isNumeric(row[name]) ? Number(row[name]) : row[name]),
49
48
  render: ({ row }) => _jsx(Cell, { value: String(row[name]) }),
50
49
  };
51
50
  return column;
@@ -53,15 +52,11 @@ const prepareGenericColumns = (data) => {
53
52
  };
54
53
  const getRowIndex = (_, index) => index;
55
54
  export const QueryResultTable = (props) => {
56
- const { columns: rawColumns, data: rawData, settings: settingsMix, ...restProps } = props;
55
+ const { columns: rawColumns, data: rawData, ...restProps } = props;
57
56
  const data = React.useMemo(() => prepareQueryResponse(rawData), [rawData]);
58
57
  const columns = React.useMemo(() => {
59
- return rawColumns ? prepareTypedColumns(rawColumns) : prepareGenericColumns(data);
58
+ return rawColumns ? prepareTypedColumns(rawColumns, data) : prepareGenericColumns(data);
60
59
  }, [data, rawColumns]);
61
- const settings = React.useMemo(() => ({
62
- ...TABLE_SETTINGS,
63
- ...settingsMix,
64
- }), [settingsMix]);
65
60
  // empty data is expected to be be an empty array
66
61
  // undefined data is not rendered at all
67
62
  if (!Array.isArray(rawData)) {
@@ -70,7 +65,7 @@ export const QueryResultTable = (props) => {
70
65
  if (!columns.length) {
71
66
  return _jsx("div", { className: b('message'), children: i18n('empty') });
72
67
  }
73
- return (_jsx(ResizeableDataTable, { data: data, columns: columns, settings: settings,
68
+ return (_jsx(ResizeableDataTable, { data: data, columns: columns, settings: TABLE_SETTINGS,
74
69
  // prevent accessing row.id in case it is present but is not the PK (i.e. may repeat)
75
70
  rowKey: getRowIndex, ...restProps }));
76
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"QueryResultTable.js","sourceRoot":"","sources":["../../../src/components/QueryResultTable/QueryResultTable.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAIrD,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,sBAAsB,EAAC,MAAM,uBAAuB,CAAC;AA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MAAM,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,SAAS,EAAC,GAAG,KAAK,CAAC;IAExF,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC/B,OAAO,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACtF,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;IACvB,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACH,GAAG,cAAc;QACjB,GAAG,WAAW;KACjB,CAAC,EACF,CAAC,WAAW,CAAC,CAChB,CAAC;IAEF,iDAAiD;IACjD,wCAAwC;IACxC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YAAG,IAAI,CAAC,OAAO,CAAC,GAAO,CAAC;IAC/D,CAAC;IAED,OAAO,CACH,KAAC,mBAAmB,IAChB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ;QAClB,qFAAqF;QACrF,MAAM,EAAE,WAAW,KACf,SAAS,GACf,CACL,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"QueryResultTable.js","sourceRoot":"","sources":["../../../src/components/QueryResultTable/QueryResultTable.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAA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MAAM,WAAW,GAAG,CAAC,CAAU,EAAE,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC;AAQzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;IAC7D,MAAM,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS,EAAC,GAAG,KAAK,CAAC;IAEjE,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC/B,OAAO,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC5F,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;IAEvB,iDAAiD;IACjD,wCAAwC;IACxC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YAAG,IAAI,CAAC,OAAO,CAAC,GAAO,CAAC;IAC/D,CAAC;IAED,OAAO,CACH,KAAC,mBAAmB,IAChB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc;QACxB,qFAAqF;QACrF,MAAM,EAAE,WAAW,KACf,SAAS,GACf,CACL,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { KeyValueRow } from '../../../types/api/query';
2
+ export declare const MAX_COLUMN_WIDTH = 600;
3
+ export declare const HEADER_PADDING = 20;
4
+ export declare const getColumnWidth: ({ data, name }: {
5
+ data?: KeyValueRow[];
6
+ name: string;
7
+ }) => number;
@@ -0,0 +1,16 @@
1
+ export const MAX_COLUMN_WIDTH = 600;
2
+ export const HEADER_PADDING = 20;
3
+ export const getColumnWidth = ({ data, name }) => {
4
+ let maxColumnContentLength = name.length;
5
+ if (data) {
6
+ for (const row of data) {
7
+ const cellLength = row[name] ? String(row[name]).length : 0;
8
+ maxColumnContentLength = Math.max(maxColumnContentLength, cellLength);
9
+ if (maxColumnContentLength * 10 + HEADER_PADDING >= MAX_COLUMN_WIDTH) {
10
+ return MAX_COLUMN_WIDTH;
11
+ }
12
+ }
13
+ }
14
+ return maxColumnContentLength * 10 + HEADER_PADDING;
15
+ };
16
+ //# sourceMappingURL=getColumnWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getColumnWidth.js","sourceRoot":"","sources":["../../../../src/components/QueryResultTable/utils/getColumnWidth.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,EAAuC,EAAE,EAAE;IACjF,IAAI,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAAC;IAEzC,IAAI,IAAI,EAAE,CAAC;QACP,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,sBAAsB,GAAG,IAAI,CAAC,GAAG,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;YAEtE,IAAI,sBAAsB,GAAG,EAAE,GAAG,cAAc,IAAI,gBAAgB,EAAE,CAAC;gBACnE,OAAO,gBAAgB,CAAC;YAC5B,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,sBAAsB,GAAG,EAAE,GAAG,cAAc,CAAC;AACxD,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { HEADER_PADDING, MAX_COLUMN_WIDTH, getColumnWidth } from './getColumnWidth';
2
+ describe('getColumnWidth', () => {
3
+ it('returns minimum width for empty data', () => {
4
+ const result = getColumnWidth({ data: [], name: 'test' });
5
+ expect(result).toBe(HEADER_PADDING + 'test'.length * 10);
6
+ });
7
+ it('calculates correct width for string columns', () => {
8
+ const data = [{ test: 'short' }, { test: 'medium length' }, { test: 'this is a longer string' }];
9
+ const result = getColumnWidth({ data, name: 'test' });
10
+ expect(result).toBe(HEADER_PADDING + 'this is a longer string'.length * 10);
11
+ });
12
+ it('returns MAX_COLUMN_WIDTH when calculated width exceeds it', () => {
13
+ const data = [{ test: 'a'.repeat(100) }];
14
+ const result = getColumnWidth({ data, name: 'test' });
15
+ expect(result).toBe(MAX_COLUMN_WIDTH);
16
+ });
17
+ it('handles undefined data correctly', () => {
18
+ const result = getColumnWidth({ name: 'test' });
19
+ expect(result).toBe(HEADER_PADDING + 'test'.length * 10);
20
+ });
21
+ it('handles missing values in data correctly', () => {
22
+ const data = [{ test: 'short' }, {}, { test: 'longer string' }];
23
+ const result = getColumnWidth({ data, name: 'test' });
24
+ expect(result).toBe(HEADER_PADDING + 'longer string'.length * 10);
25
+ });
26
+ it('uses column name length when all values are shorter', () => {
27
+ const data = [{ longColumnName: 'a' }, { longColumnName: 'bb' }];
28
+ const result = getColumnWidth({ data, name: 'longColumnName' });
29
+ expect(result).toBe(HEADER_PADDING + 'longColumnName'.length * 10);
30
+ });
31
+ });
32
+ //# sourceMappingURL=getColumnWidth.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getColumnWidth.test.js","sourceRoot":"","sources":["../../../../src/components/QueryResultTable/utils/getColumnWidth.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,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,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAChD,MAAM,IAAI,GAAG,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,EAAE,EAAE,EAAE,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,cAAc,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,eAAe,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC3D,MAAM,IAAI,GAAG,CAAC,EAAC,cAAc,EAAE,GAAG,EAAC,EAAE,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,cAAc,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAC,CAAC,CAAC;QAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,gBAAgB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -10,7 +10,7 @@ import { ProgressViewer } from '../ProgressViewer/ProgressViewer';
10
10
  import { storageGroupInfoKeyset } from './i18n';
11
11
  // eslint-disable-next-line complexity
12
12
  export function StorageGroupInfo({ data, className, ...infoViewerProps }) {
13
- const { Encryption, Overall, DiskSpace, MediaType, ErasureSpecies, Used, Limit, Usage, Read, Write, GroupGeneration, Latency, AllocationUnits, State, MissingDisks, Available, LatencyPutTabletLog, LatencyPutUserData, LatencyGetFast, } = data || {};
13
+ const { Encryption, Overall, DiskSpace, MediaType, ErasureSpecies, Used, Limit, Usage, Read, Write, GroupGeneration, Latency, AllocationUnits, State, MissingDisks, Available, LatencyPutTabletLogMs, LatencyPutUserDataMs, LatencyGetFastMs, } = data || {};
14
14
  const storageGroupInfoFirstColumn = [];
15
15
  if (valueIsDefined(GroupGeneration)) {
16
16
  storageGroupInfoFirstColumn.push({
@@ -82,22 +82,22 @@ export function StorageGroupInfo({ data, className, ...infoViewerProps }) {
82
82
  value: _jsx(EntityStatus, { status: Latency }),
83
83
  });
84
84
  }
85
- if (valueIsDefined(LatencyPutTabletLog)) {
85
+ if (valueIsDefined(LatencyPutTabletLogMs)) {
86
86
  storageGroupInfoSecondColumn.push({
87
87
  label: storageGroupInfoKeyset('latency-put-tablet-log'),
88
- value: formatToMs(LatencyPutTabletLog),
88
+ value: formatToMs(LatencyPutTabletLogMs),
89
89
  });
90
90
  }
91
- if (valueIsDefined(LatencyPutUserData)) {
91
+ if (valueIsDefined(LatencyPutUserDataMs)) {
92
92
  storageGroupInfoSecondColumn.push({
93
93
  label: storageGroupInfoKeyset('latency-put-user-data'),
94
- value: formatToMs(LatencyPutUserData),
94
+ value: formatToMs(LatencyPutUserDataMs),
95
95
  });
96
96
  }
97
- if (valueIsDefined(LatencyGetFast)) {
97
+ if (valueIsDefined(LatencyGetFastMs)) {
98
98
  storageGroupInfoSecondColumn.push({
99
99
  label: storageGroupInfoKeyset('latency-get-fast'),
100
- value: formatToMs(LatencyGetFast),
100
+ value: formatToMs(LatencyGetFastMs),
101
101
  });
102
102
  }
103
103
  if (valueIsDefined(AllocationUnits)) {
@@ -1 +1 @@
1
- {"version":3,"file":"StorageGroupInfo.js","sourceRoot":"","sources":["../../../src/components/StorageGroupInfo/StorageGroupInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,uBAAuB,EAAC,MAAM,2CAA2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UAAU,IAAC,IAAI,EAAE,2BAA2B,KAAM,eAAe,GAAI,EACtE,KAAC,UAAU,IAAC,IAAI,EAAE,4BAA4B,KAAM,eAAe,GAAI,IACpE,CACV,CAAC;AACN,CAAC"}
@@ -1 +1 @@
1
- export declare const storageGroupInfoKeyset: (key: "state" | "yes" | "no" | "usage" | "media-type" | "available" | "read-throughput" | "write-throughput" | "encryption" | "overall" | "disk-space" | "erasure-species" | "used-space" | "group-generation" | "latency" | "allocation-units" | "missing-disks" | "latency-put-tablet-log" | "latency-put-user-data" | "latency-get-fast", params?: import("@gravity-ui/i18n").Params) => string;
1
+ export declare const storageGroupInfoKeyset: (key: "state" | "yes" | "no" | "encryption" | "missing-disks" | "usage" | "latency" | "allocation-units" | "media-type" | "available" | "read-throughput" | "write-throughput" | "overall" | "disk-space" | "erasure-species" | "used-space" | "group-generation" | "latency-put-tablet-log" | "latency-put-user-data" | "latency-get-fast", params?: import("@gravity-ui/i18n").Params) => string;
@@ -2,6 +2,7 @@ import './TableSkeleton.scss';
2
2
  interface TableSkeletonProps {
3
3
  className?: string;
4
4
  rows?: number;
5
+ delay?: number;
5
6
  }
6
- export declare const TableSkeleton: ({ rows, className }: TableSkeletonProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const TableSkeleton: ({ rows, delay, className }: TableSkeletonProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -1,7 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Skeleton } from '@gravity-ui/uikit';
3
3
  import { cn } from '../../utils/cn';
4
+ import { useDelayed } from '../../utils/hooks/useDelayed';
4
5
  import './TableSkeleton.scss';
5
6
  const b = cn('table-skeleton');
6
- export const TableSkeleton = ({ rows = 2, className }) => (_jsxs("div", { className: b(null, className), children: [_jsxs("div", { className: b('row'), children: [_jsx(Skeleton, { className: b('col-1') }), _jsx(Skeleton, { className: b('col-2') }), _jsx(Skeleton, { className: b('col-3') }), _jsx(Skeleton, { className: b('col-4') }), _jsx(Skeleton, { className: b('col-5') })] }), [...new Array(rows)].map((_, index) => (_jsx("div", { className: b('row'), children: _jsx(Skeleton, { className: b('col-full') }) }, `skeleton-row-${index}`)))] }));
7
+ export const TableSkeleton = ({ rows = 2, delay = 600, className }) => {
8
+ const [show] = useDelayed(delay);
9
+ return (_jsxs("div", { className: b('wrapper', { hidden: !show }, className), children: [_jsxs("div", { className: b('row'), children: [_jsx(Skeleton, { className: b('col-1') }), _jsx(Skeleton, { className: b('col-2') }), _jsx(Skeleton, { className: b('col-3') }), _jsx(Skeleton, { className: b('col-4') }), _jsx(Skeleton, { className: b('col-5') })] }), [...new Array(rows)].map((_, index) => (_jsx("div", { className: b('row'), children: _jsx(Skeleton, { className: b('col-full') }) }, `skeleton-row-${index}`)))] }));
10
+ };
7
11
  //# sourceMappingURL=TableSkeleton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableSkeleton.js","sourceRoot":"","sources":["../../../src/components/TableSkeleton/TableSkeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAElC,OAAO,sBAAsB,CAAC;AAE9B,MAAM,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC;AAO/B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,SAAS,EAAqB,EAAE,EAAE,CAAC,CACxE,eAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,aAC9B,eAAK,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,aACpB,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,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AE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,EACnC,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,IACjC,EACL,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,cAAK,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,YACpB,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,GAAI,IADX,gBAAgB,KAAK,EAAE,CAEhD,CACT,CAAC,IACA,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -1,5 +1,11 @@
1
1
  .table-skeleton {
2
- width: 100%;
2
+ &__wrapper {
3
+ width: 100%;
4
+
5
+ &_hidden {
6
+ visibility: hidden;
7
+ }
8
+ }
3
9
 
4
10
  &__row {
5
11
  display: flex;
@@ -1,9 +1,7 @@
1
- import type { NodesMap } from '../../types/store/nodesList';
2
1
  import type { PreparedVDisk } from '../../utils/disks/types';
3
2
  import './VDisk.scss';
4
3
  export interface VDiskProps {
5
4
  data?: PreparedVDisk;
6
- nodes?: NodesMap;
7
5
  compact?: boolean;
8
6
  inactive?: boolean;
9
7
  showPopup?: boolean;
@@ -11,4 +9,4 @@ export interface VDiskProps {
11
9
  onHidePopup?: VoidFunction;
12
10
  progressBarClassName?: string;
13
11
  }
14
- export declare const VDisk: ({ data, nodes, compact, inactive, showPopup, onShowPopup, onHidePopup, progressBarClassName, }: VDiskProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const VDisk: ({ data, compact, inactive, showPopup, onShowPopup, onHidePopup, progressBarClassName, }: VDiskProps) => import("react/jsx-runtime").JSX.Element;
@@ -12,7 +12,7 @@ import { InternalLink } from '../InternalLink';
12
12
  import { VDiskPopup } from '../VDiskPopup/VDiskPopup';
13
13
  import './VDisk.scss';
14
14
  const b = cn('ydb-vdisk-component');
15
- export const VDisk = ({ data = {}, nodes, compact, inactive, showPopup, onShowPopup, onHidePopup, progressBarClassName, }) => {
15
+ export const VDisk = ({ data = {}, compact, inactive, showPopup, onShowPopup, onHidePopup, progressBarClassName, }) => {
16
16
  const isFullData = isFullVDiskData(data);
17
17
  const diskPagesAvailable = useDiskPagesAvailable();
18
18
  const [isPopupVisible, setIsPopupVisible] = React.useState(false);
@@ -38,6 +38,6 @@ export const VDisk = ({ data = {}, nodes, compact, inactive, showPopup, onShowPo
38
38
  vdiskId: stringifyVdiskId(data.VDiskId),
39
39
  });
40
40
  }
41
- return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b(), ref: anchor, onMouseEnter: handleShowPopup, onMouseLeave: handleHidePopup, children: _jsx(InternalLink, { to: vDiskPath, className: b('content'), children: _jsx(DiskStateProgressBar, { diskAllocatedPercent: data.AllocatedPercent, severity: data.Severity, compact: compact, inactive: inactive, className: progressBarClassName }) }) }), _jsx(VDiskPopup, { data: data, nodes: nodes, anchorRef: anchor, open: isPopupVisible || showPopup })] }));
41
+ return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b(), ref: anchor, onMouseEnter: handleShowPopup, onMouseLeave: handleHidePopup, children: _jsx(InternalLink, { to: vDiskPath, className: b('content'), children: _jsx(DiskStateProgressBar, { diskAllocatedPercent: data.AllocatedPercent, severity: data.Severity, compact: compact, inactive: inactive, className: progressBarClassName }) }) }), _jsx(VDiskPopup, { data: data, anchorRef: anchor, open: isPopupVisible || showPopup })] }));
42
42
  };
43
43
  //# sourceMappingURL=VDisk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VDisk.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDisk.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,E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B,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"}
@@ -1,11 +1,9 @@
1
1
  import type { PopupProps } from '@gravity-ui/uikit';
2
2
  import type { TVDiskStateInfo } from '../../types/api/vdisk';
3
- import type { NodesMap } from '../../types/store/nodesList';
4
3
  import type { UnavailableDonor } from '../../utils/disks/types';
5
4
  import './VDiskPopup.scss';
6
5
  interface VDiskPopupProps extends PopupProps {
7
6
  data: TVDiskStateInfo | UnavailableDonor;
8
- nodes?: NodesMap;
9
7
  }
10
- export declare const VDiskPopup: ({ data, nodes, ...props }: VDiskPopupProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const VDiskPopup: ({ data, ...props }: VDiskPopupProps) => import("react/jsx-runtime").JSX.Element;
11
9
  export {};
@@ -1,11 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { Label, Popup } from '@gravity-ui/uikit';
4
+ import { selectNodeHostsMap } from '../../store/reducers/nodesList';
4
5
  import { EFlag } from '../../types/api/enums';
6
+ import { valueIsDefined } from '../../utils';
5
7
  import { cn } from '../../utils/cn';
6
8
  import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants';
7
9
  import { stringifyVdiskId } from '../../utils/dataFormatters/dataFormatters';
8
10
  import { isFullVDiskData } from '../../utils/disks/helpers';
11
+ import { useTypedSelector } from '../../utils/hooks';
9
12
  import { bytesToGB, bytesToSpeed } from '../../utils/utils';
10
13
  import { InfoViewer } from '../InfoViewer';
11
14
  import { preparePDiskData } from '../PDiskPopup/PDiskPopup';
@@ -83,10 +86,12 @@ const prepareVDiskData = (data) => {
83
86
  }
84
87
  return vdiskData;
85
88
  };
86
- export const VDiskPopup = ({ data, nodes, ...props }) => {
89
+ export const VDiskPopup = ({ data, ...props }) => {
87
90
  const isFullData = isFullVDiskData(data);
88
91
  const vdiskInfo = React.useMemo(() => (isFullData ? prepareVDiskData(data) : prepareUnavailableVDiskData(data)), [data, isFullData]);
89
- const pdiskInfo = React.useMemo(() => isFullData && data.PDisk && preparePDiskData(data.PDisk, nodes), [data, nodes, isFullData]);
92
+ const nodeHostsMap = useTypedSelector(selectNodeHostsMap);
93
+ const nodeHost = valueIsDefined(data.NodeId) ? nodeHostsMap === null || nodeHostsMap === void 0 ? void 0 : nodeHostsMap.get(data.NodeId) : undefined;
94
+ const pdiskInfo = React.useMemo(() => isFullData && data.PDisk && preparePDiskData(data.PDisk, nodeHost), [data, nodeHost, isFullData]);
90
95
  return (_jsxs(Popup, { contentClassName: b(), placement: ['top', 'bottom'], hasArrow: true,
91
96
  // bigger offset for easier switching to neighbour nodes
92
97
  // matches the default offset for popup with arrow out of a sense of beauty