ydb-embedded-ui 22.4.0 → 22.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +3 -2
  2. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +19 -4
  3. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js.map +1 -1
  4. package/dist/components/CopyableValue/CopyableValue.d.ts +10 -0
  5. package/dist/components/CopyableValue/CopyableValue.js +10 -0
  6. package/dist/components/CopyableValue/CopyableValue.js.map +1 -0
  7. package/dist/components/CopyableValue/CopyableValue.scss +16 -0
  8. package/dist/components/CopyableValue/i18n/en.json +3 -0
  9. package/dist/components/CopyableValue/i18n/index.d.ts +2 -0
  10. package/dist/components/CopyableValue/i18n/index.js +6 -0
  11. package/dist/components/CopyableValue/i18n/index.js.map +1 -0
  12. package/dist/components/CriticalActionDialog/CriticalActionDialog.d.ts +2 -1
  13. package/dist/components/CriticalActionDialog/CriticalActionDialog.js +2 -1
  14. package/dist/components/CriticalActionDialog/CriticalActionDialog.js.map +1 -1
  15. package/dist/components/DiskCapacityInfo/DiskCapacityInfo.d.ts +1 -21
  16. package/dist/components/DiskCapacityInfo/DiskCapacityInfo.js +40 -126
  17. package/dist/components/DiskCapacityInfo/DiskCapacityInfo.js.map +1 -1
  18. package/dist/components/DiskCapacityInfo/i18n/en.json +0 -1
  19. package/dist/components/DiskCapacityInfo/i18n/index.d.ts +1 -1
  20. package/dist/components/EntityStatus/EntityStatus.d.ts +18 -6
  21. package/dist/components/EntityStatus/EntityStatus.js +5 -1
  22. package/dist/components/EntityStatus/EntityStatus.js.map +1 -1
  23. package/dist/components/EntityStatus/EntityStatus.scss +5 -0
  24. package/dist/components/EvictVDiskButton/EvictVDiskButton.d.ts +5 -2
  25. package/dist/components/EvictVDiskButton/EvictVDiskButton.js +3 -2
  26. package/dist/components/EvictVDiskButton/EvictVDiskButton.js.map +1 -1
  27. package/dist/components/EvictVDiskButton/i18n/en.json +2 -2
  28. package/dist/components/FullNodeViewer/FullNodeViewer.js +4 -7
  29. package/dist/components/FullNodeViewer/FullNodeViewer.js.map +1 -1
  30. package/dist/components/FullNodeViewer/i18n/index.d.ts +1 -1
  31. package/dist/components/HoverPopup/HoverPopup.d.ts +1 -0
  32. package/dist/components/HoverPopup/HoverPopup.js +87 -16
  33. package/dist/components/HoverPopup/HoverPopup.js.map +1 -1
  34. package/dist/components/MemoryViewer/MemoryViewer.d.ts +3 -1
  35. package/dist/components/MemoryViewer/MemoryViewer.js +25 -16
  36. package/dist/components/MemoryViewer/MemoryViewer.js.map +1 -1
  37. package/dist/components/MemoryViewer/i18n/en.json +4 -3
  38. package/dist/components/MemoryViewer/i18n/index.d.ts +1 -1
  39. package/dist/components/MemoryViewer/utils.d.ts +4 -2
  40. package/dist/components/MemoryViewer/utils.js +11 -11
  41. package/dist/components/MemoryViewer/utils.js.map +1 -1
  42. package/dist/components/PDiskInfo/PDiskInfo.d.ts +4 -9
  43. package/dist/components/PDiskInfo/PDiskInfo.js +32 -144
  44. package/dist/components/PDiskInfo/PDiskInfo.js.map +1 -1
  45. package/dist/components/PDiskInfo/PDiskInfo.scss +15 -0
  46. package/dist/components/PDiskInfo/PDiskLogSize.js +1 -1
  47. package/dist/components/PDiskInfo/PDiskLogSize.js.map +1 -1
  48. package/dist/components/PDiskInfo/i18n/en.json +6 -3
  49. package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
  50. package/dist/components/PDiskInfo/statuses.js +12 -3
  51. package/dist/components/PDiskInfo/statuses.js.map +1 -1
  52. package/dist/components/Search/Search.js +3 -1
  53. package/dist/components/Search/Search.js.map +1 -1
  54. package/dist/components/StorageGroupInfo/StorageGroupInfo.js +4 -9
  55. package/dist/components/StorageGroupInfo/StorageGroupInfo.js.map +1 -1
  56. package/dist/components/StorageGroupInfo/i18n/index.d.ts +1 -1
  57. package/dist/components/TenantNameWrapper/i18n/index.d.ts +1 -1
  58. package/dist/components/VDisk/VDisk.js +2 -2
  59. package/dist/components/VDisk/VDisk.js.map +1 -1
  60. package/dist/components/VDiskInfo/VDiskInfo.d.ts +3 -7
  61. package/dist/components/VDiskInfo/VDiskInfo.js +57 -235
  62. package/dist/components/VDiskInfo/VDiskInfo.js.map +1 -1
  63. package/dist/components/VDiskInfo/VDiskInfo.scss +19 -3
  64. package/dist/components/VDiskInfo/getVDiskDetails.d.ts +7 -1
  65. package/dist/components/VDiskInfo/getVDiskDetails.js +14 -1
  66. package/dist/components/VDiskInfo/getVDiskDetails.js.map +1 -1
  67. package/dist/components/VDiskInfo/i18n/en.json +4 -13
  68. package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
  69. package/dist/components/VDiskPopup/VDiskPopup.d.ts +2 -1
  70. package/dist/components/VDiskPopup/VDiskPopup.js +10 -26
  71. package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
  72. package/dist/components/VDiskPopup/i18n/en.json +0 -2
  73. package/dist/components/VDiskPopup/i18n/index.d.ts +1 -1
  74. package/dist/components/VDiskStatus/VDiskReplicationStatus.js +1 -1
  75. package/dist/components/VDiskStatus/VDiskReplicationStatus.js.map +1 -1
  76. package/dist/components/VDiskStatus/VDiskStatus.js +2 -2
  77. package/dist/components/VDiskStatus/VDiskStatus.js.map +1 -1
  78. package/dist/components/VDiskStatus/VDiskStatus.scss +4 -0
  79. package/dist/components/VDiskStatus/statuses.js +2 -2
  80. package/dist/components/VDiskStatus/statuses.js.map +1 -1
  81. package/dist/components/nodesColumns/columns.d.ts +1 -0
  82. package/dist/components/nodesColumns/columns.js +13 -6
  83. package/dist/components/nodesColumns/columns.js.map +1 -1
  84. package/dist/containers/Clusters/Clusters.js +35 -6
  85. package/dist/containers/Clusters/Clusters.js.map +1 -1
  86. package/dist/containers/Clusters/Clusters.scss +24 -6
  87. package/dist/containers/Clusters/columns.js +9 -4
  88. package/dist/containers/Clusters/columns.js.map +1 -1
  89. package/dist/containers/Clusters/i18n/en.json +6 -0
  90. package/dist/containers/Clusters/i18n/index.d.ts +1 -1
  91. package/dist/containers/Header/Header.js +8 -0
  92. package/dist/containers/Header/Header.js.map +1 -1
  93. package/dist/containers/Header/HeaderLeftControls.js +3 -1
  94. package/dist/containers/Header/HeaderLeftControls.js.map +1 -1
  95. package/dist/containers/Header/PDiskLeftControls.d.ts +1 -0
  96. package/dist/containers/Header/PDiskLeftControls.js +24 -0
  97. package/dist/containers/Header/PDiskLeftControls.js.map +1 -0
  98. package/dist/containers/Header/VDiskLeftControls.d.ts +1 -0
  99. package/dist/containers/Header/VDiskLeftControls.js +23 -0
  100. package/dist/containers/Header/VDiskLeftControls.js.map +1 -0
  101. package/dist/containers/Header/breadcrumbs.js +5 -2
  102. package/dist/containers/Header/breadcrumbs.js.map +1 -1
  103. package/dist/containers/Header/i18n/en.json +4 -1
  104. package/dist/containers/Header/i18n/index.d.ts +1 -1
  105. package/dist/containers/Nodes/NodesControls/NodesControls.js +1 -1
  106. package/dist/containers/Nodes/NodesControls/NodesControls.js.map +1 -1
  107. package/dist/containers/Nodes/PaginatedNodes/GroupedNodesComponent.js +5 -3
  108. package/dist/containers/Nodes/PaginatedNodes/GroupedNodesComponent.js.map +1 -1
  109. package/dist/containers/Nodes/PaginatedNodes/NodesComponent.js +4 -2
  110. package/dist/containers/Nodes/PaginatedNodes/NodesComponent.js.map +1 -1
  111. package/dist/containers/Nodes/useDebouncedSearch.d.ts +2 -0
  112. package/dist/containers/Nodes/useDebouncedSearch.js +11 -0
  113. package/dist/containers/Nodes/useDebouncedSearch.js.map +1 -0
  114. package/dist/containers/PDiskPage/PDiskPage.js +30 -31
  115. package/dist/containers/PDiskPage/PDiskPage.js.map +1 -1
  116. package/dist/containers/PDiskPage/PDiskPage.scss +22 -11
  117. package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js +3 -3
  118. package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js.map +1 -1
  119. package/dist/containers/PDiskPage/PDiskStorageDetails.d.ts +6 -0
  120. package/dist/containers/PDiskPage/PDiskStorageDetails.js +28 -0
  121. package/dist/containers/PDiskPage/PDiskStorageDetails.js.map +1 -0
  122. package/dist/containers/PDiskPage/PDiskStorageDetails.scss +51 -0
  123. package/dist/containers/PDiskPage/i18n/en.json +2 -0
  124. package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
  125. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/i18n/index.d.ts +1 -1
  126. package/dist/containers/Storage/StorageExpertModePanel/constants.d.ts +1 -1
  127. package/dist/containers/Storage/StorageExpertModePanel/i18n/index.d.ts +1 -1
  128. package/dist/containers/Storage/useStorageQueryParams.d.ts +4 -4
  129. package/dist/containers/StorageGroupPage/StorageGroupPage.js +7 -5
  130. package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
  131. package/dist/containers/StorageGroupPage/StorageGroupPage.scss +10 -0
  132. package/dist/containers/StorageGroupPage/i18n/en.json +0 -1
  133. package/dist/containers/StorageGroupPage/i18n/index.d.ts +1 -1
  134. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/i18n/index.d.ts +1 -1
  135. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +5 -12
  136. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js.map +1 -1
  137. package/dist/containers/Tenant/Diagnostics/TopQueries/columns/i18n/index.d.ts +1 -1
  138. package/dist/containers/Tenant/Healthcheck/Healthcheck.scss +6 -1
  139. package/dist/containers/Tenant/Healthcheck/components/HealthcheckIssue.js +2 -2
  140. package/dist/containers/Tenant/Healthcheck/components/HealthcheckIssue.js.map +1 -1
  141. package/dist/containers/Tenant/TenantDrawerHealthcheck.js +10 -2
  142. package/dist/containers/Tenant/TenantDrawerHealthcheck.js.map +1 -1
  143. package/dist/containers/VDiskPage/VDiskPage.js +33 -33
  144. package/dist/containers/VDiskPage/VDiskPage.js.map +1 -1
  145. package/dist/containers/VDiskPage/VDiskPage.scss +21 -8
  146. package/dist/containers/VDiskPage/VDiskStorageDetails.js +27 -29
  147. package/dist/containers/VDiskPage/VDiskStorageDetails.js.map +1 -1
  148. package/dist/containers/VDiskPage/VDiskStorageDetails.scss +24 -93
  149. package/dist/containers/VDiskPage/i18n/en.json +3 -12
  150. package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
  151. package/dist/store/reducers/cluster/parseFields.js +1 -0
  152. package/dist/store/reducers/cluster/parseFields.js.map +1 -1
  153. package/dist/store/reducers/clusters/clusters.js +1 -0
  154. package/dist/store/reducers/clusters/clusters.js.map +1 -1
  155. package/dist/store/reducers/clusters/selectors.d.ts +1 -0
  156. package/dist/store/reducers/clusters/selectors.js +4 -1
  157. package/dist/store/reducers/clusters/selectors.js.map +1 -1
  158. package/dist/store/reducers/clusters/types.d.ts +2 -0
  159. package/dist/store/reducers/storage/prepareGroupsDisks.d.ts +1 -1
  160. package/dist/store/reducers/storage/prepareGroupsDisks.js +2 -1
  161. package/dist/store/reducers/storage/prepareGroupsDisks.js.map +1 -1
  162. package/dist/store/reducers/storage/utils.js +10 -3
  163. package/dist/store/reducers/storage/utils.js.map +1 -1
  164. package/dist/store/reducers/vdisk/types.d.ts +1 -1
  165. package/dist/store/reducers/vdisk/utils.js +5 -5
  166. package/dist/store/reducers/vdisk/utils.js.map +1 -1
  167. package/dist/types/api/meta.d.ts +1 -0
  168. package/dist/types/api/nodesList.d.ts +2 -0
  169. package/dist/utils/hooks/useDatabaseHealthcheckAvailable.d.ts +2 -0
  170. package/dist/utils/hooks/useDatabaseHealthcheckAvailable.js +6 -0
  171. package/dist/utils/hooks/useDatabaseHealthcheckAvailable.js.map +1 -0
  172. package/dist/utils/memory.d.ts +5 -0
  173. package/dist/utils/memory.js +9 -0
  174. package/dist/utils/memory.js.map +1 -0
  175. package/dist/utils/nodes.js +3 -3
  176. package/dist/utils/nodes.js.map +1 -1
  177. package/dist/utils/storageMetrics.d.ts +1 -0
  178. package/dist/utils/storageMetrics.js +8 -0
  179. package/dist/utils/storageMetrics.js.map +1 -1
  180. package/package.json +1 -1
  181. package/src/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.tsx +22 -3
  182. package/src/components/CopyableValue/CopyableValue.scss +16 -0
  183. package/src/components/CopyableValue/CopyableValue.tsx +40 -0
  184. package/src/components/CopyableValue/i18n/en.json +3 -0
  185. package/src/components/CopyableValue/i18n/index.ts +8 -0
  186. package/src/components/CriticalActionDialog/CriticalActionDialog.tsx +3 -0
  187. package/src/components/DiskCapacityInfo/DiskCapacityInfo.tsx +40 -185
  188. package/src/components/DiskCapacityInfo/i18n/en.json +0 -1
  189. package/src/components/EntityStatus/EntityStatus.scss +5 -0
  190. package/src/components/EntityStatus/EntityStatus.tsx +38 -5
  191. package/src/components/EvictVDiskButton/EvictVDiskButton.tsx +10 -2
  192. package/src/components/EvictVDiskButton/i18n/en.json +2 -2
  193. package/src/components/FullNodeViewer/FullNodeViewer.tsx +4 -9
  194. package/src/components/HoverPopup/HoverPopup.tsx +95 -19
  195. package/src/components/MemoryViewer/MemoryViewer.tsx +30 -17
  196. package/src/components/MemoryViewer/i18n/en.json +4 -3
  197. package/src/components/MemoryViewer/utils.ts +19 -12
  198. package/src/components/PDiskInfo/PDiskInfo.scss +15 -0
  199. package/src/components/PDiskInfo/PDiskInfo.tsx +51 -243
  200. package/src/components/PDiskInfo/PDiskLogSize.tsx +12 -8
  201. package/src/components/PDiskInfo/i18n/en.json +6 -3
  202. package/src/components/PDiskInfo/statuses.ts +16 -3
  203. package/src/components/Search/Search.tsx +5 -2
  204. package/src/components/StorageGroupInfo/StorageGroupInfo.tsx +8 -13
  205. package/src/components/VDisk/VDisk.tsx +3 -2
  206. package/src/components/VDiskInfo/VDiskInfo.scss +19 -3
  207. package/src/components/VDiskInfo/VDiskInfo.tsx +119 -341
  208. package/src/components/VDiskInfo/getVDiskDetails.tsx +24 -2
  209. package/src/components/VDiskInfo/i18n/en.json +4 -13
  210. package/src/components/VDiskPopup/VDiskPopup.tsx +16 -24
  211. package/src/components/VDiskPopup/i18n/en.json +0 -2
  212. package/src/components/VDiskStatus/VDiskReplicationStatus.tsx +1 -1
  213. package/src/components/VDiskStatus/VDiskStatus.scss +4 -0
  214. package/src/components/VDiskStatus/VDiskStatus.tsx +13 -2
  215. package/src/components/VDiskStatus/statuses.ts +2 -2
  216. package/src/components/nodesColumns/columns.tsx +26 -12
  217. package/src/containers/Clusters/Clusters.scss +24 -6
  218. package/src/containers/Clusters/Clusters.tsx +74 -5
  219. package/src/containers/Clusters/columns.tsx +36 -6
  220. package/src/containers/Clusters/i18n/en.json +6 -0
  221. package/src/containers/Header/Header.tsx +8 -0
  222. package/src/containers/Header/HeaderLeftControls.tsx +3 -1
  223. package/src/containers/Header/PDiskLeftControls.tsx +41 -0
  224. package/src/containers/Header/VDiskLeftControls.tsx +40 -0
  225. package/src/containers/Header/breadcrumbs.tsx +4 -2
  226. package/src/containers/Header/i18n/en.json +4 -1
  227. package/src/containers/Nodes/NodesControls/NodesControls.tsx +1 -0
  228. package/src/containers/Nodes/PaginatedNodes/GroupedNodesComponent.tsx +5 -3
  229. package/src/containers/Nodes/PaginatedNodes/NodesComponent.tsx +4 -2
  230. package/src/containers/Nodes/useDebouncedSearch.ts +13 -0
  231. package/src/containers/PDiskPage/PDiskPage.scss +22 -11
  232. package/src/containers/PDiskPage/PDiskPage.tsx +88 -56
  233. package/src/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.tsx +3 -9
  234. package/src/containers/PDiskPage/PDiskStorageDetails.scss +51 -0
  235. package/src/containers/PDiskPage/PDiskStorageDetails.tsx +64 -0
  236. package/src/containers/PDiskPage/i18n/en.json +2 -0
  237. package/src/containers/StorageGroupPage/StorageGroupPage.scss +10 -0
  238. package/src/containers/StorageGroupPage/StorageGroupPage.tsx +37 -28
  239. package/src/containers/StorageGroupPage/i18n/en.json +0 -1
  240. package/src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +5 -32
  241. package/src/containers/Tenant/Healthcheck/Healthcheck.scss +6 -1
  242. package/src/containers/Tenant/Healthcheck/components/HealthcheckIssue.tsx +18 -8
  243. package/src/containers/Tenant/TenantDrawerHealthcheck.tsx +14 -1
  244. package/src/containers/VDiskPage/VDiskPage.scss +21 -8
  245. package/src/containers/VDiskPage/VDiskPage.tsx +103 -64
  246. package/src/containers/VDiskPage/VDiskStorageDetails.scss +24 -93
  247. package/src/containers/VDiskPage/VDiskStorageDetails.tsx +50 -158
  248. package/src/containers/VDiskPage/i18n/en.json +3 -14
  249. package/src/store/reducers/cluster/parseFields.ts +1 -0
  250. package/src/store/reducers/clusters/clusters.ts +1 -0
  251. package/src/store/reducers/clusters/selectors.ts +4 -0
  252. package/src/store/reducers/clusters/types.ts +3 -0
  253. package/src/store/reducers/storage/prepareGroupsDisks.ts +2 -0
  254. package/src/store/reducers/storage/utils.ts +13 -3
  255. package/src/store/reducers/vdisk/types.ts +2 -1
  256. package/src/store/reducers/vdisk/utils.ts +4 -5
  257. package/src/types/api/meta.ts +1 -0
  258. package/src/types/api/nodesList.ts +3 -0
  259. package/src/utils/hooks/useDatabaseHealthcheckAvailable.ts +9 -0
  260. package/src/utils/memory.ts +16 -0
  261. package/src/utils/nodes.ts +3 -2
  262. package/src/utils/storageMetrics.ts +11 -0
  263. package/dist/components/VDiskInfo/getVDiskCapacityColumns.d.ts +0 -11
  264. package/dist/components/VDiskInfo/getVDiskCapacityColumns.js +0 -52
  265. package/dist/components/VDiskInfo/getVDiskCapacityColumns.js.map +0 -1
  266. package/src/components/VDiskInfo/getVDiskCapacityColumns.tsx +0 -83
@@ -3,14 +3,15 @@ import {DefinitionList, Flex, useTheme} from '@gravity-ui/uikit';
3
3
  import type {TMemoryStats} from '../../types/api/nodes';
4
4
  import {formatBytes} from '../../utils/bytesParsers';
5
5
  import {cn} from '../../utils/cn';
6
- import {GIGABYTE} from '../../utils/constants';
6
+ import {EMPTY_DATA_PLACEHOLDER, GIGABYTE} from '../../utils/constants';
7
+ import {getNodeMemory} from '../../utils/memory';
7
8
  import type {FormatProgressViewerValues} from '../../utils/progress';
8
9
  import {calculateProgressStatus} from '../../utils/progress';
9
- import {isNumeric} from '../../utils/utils';
10
+ import {isNumeric, parseOptionalNonNegativeNumber} from '../../utils/utils';
10
11
  import {HoverPopup} from '../HoverPopup/HoverPopup';
11
12
  import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
12
13
 
13
- import {calculateAllocatedMemory, getMemorySegments} from './utils';
14
+ import {getMemorySegments} from './utils';
14
15
 
15
16
  import './MemoryViewer.scss';
16
17
 
@@ -38,6 +39,8 @@ const formatDetailedValues: FormatProgressViewerValues = (value, total) => {
38
39
 
39
40
  export interface MemoryProgressViewerProps {
40
41
  stats: TMemoryStats;
42
+ memoryUsed?: string;
43
+ memoryLimit?: string;
41
44
  className?: string;
42
45
  warningThreshold?: number;
43
46
  dangerThreshold?: number;
@@ -47,29 +50,35 @@ export interface MemoryProgressViewerProps {
47
50
 
48
51
  export function MemoryViewer({
49
52
  stats,
53
+ memoryUsed,
54
+ memoryLimit,
50
55
  percents,
51
56
  formatValues,
52
57
  className,
53
58
  warningThreshold,
54
59
  dangerThreshold,
55
60
  }: MemoryProgressViewerProps) {
56
- const memoryUsage = stats.AnonRss ?? calculateAllocatedMemory(stats);
57
-
58
- const capacity = stats.HardLimit;
59
-
61
+ const {memoryUsed: memoryUsage, memoryLimit: capacity} = getNodeMemory({
62
+ MemoryStats: stats,
63
+ MemoryUsed: memoryUsed,
64
+ MemoryLimit: memoryLimit,
65
+ });
60
66
  const theme = useTheme();
61
- let fillWidth =
62
- Math.floor((parseFloat(String(memoryUsage)) / parseFloat(String(capacity))) * 100) || 0;
63
- fillWidth = fillWidth > 100 ? 100 : fillWidth;
67
+
68
+ if (memoryUsage === undefined) {
69
+ return EMPTY_DATA_PLACEHOLDER;
70
+ }
71
+ const fillWidth =
72
+ capacity === undefined ? 0 : Math.min(100, Math.floor((memoryUsage / capacity) * 100));
64
73
  let valueText: number | string | undefined = memoryUsage,
65
74
  capacityText: number | string | undefined = capacity,
66
75
  divider = '/';
67
- if (percents) {
76
+ if (percents && capacity !== undefined) {
68
77
  valueText = fillWidth + '%';
69
78
  capacityText = '';
70
79
  divider = '';
71
80
  } else if (formatValues) {
72
- [valueText, capacityText] = formatValues(Number(memoryUsage), Number(capacity));
81
+ [valueText, capacityText] = formatValues(memoryUsage, capacity);
73
82
  }
74
83
 
75
84
  const renderContent = () => {
@@ -81,13 +90,17 @@ export function MemoryViewer({
81
90
  };
82
91
 
83
92
  const calculateMemoryShare = (segmentSize: number) => {
84
- if (!memoryUsage) {
93
+ if (!memoryUsage || capacity === undefined) {
85
94
  return 0;
86
95
  }
87
- return (segmentSize / parseFloat(String(capacity))) * 100;
96
+ return (segmentSize / capacity) * 100;
88
97
  };
89
98
 
90
- const memorySegments = getMemorySegments(stats, Number(memoryUsage));
99
+ // Without anonymous RSS, the backend's MemoryUsed excludes allocator caches.
100
+ const memorySegments = getMemorySegments(stats, memoryUsage, {
101
+ allocatorCachesIncludedInUsage: parseOptionalNonNegativeNumber(stats.AnonRss) !== undefined,
102
+ memoryLimit: capacity,
103
+ });
91
104
 
92
105
  const status = calculateProgressStatus({
93
106
  fillWidth,
@@ -135,9 +148,9 @@ export function MemoryViewer({
135
148
  )}
136
149
  >
137
150
  <div className={b({theme, status}, className)}>
138
- <div className={b('progress-container')}>
151
+ <div className={capacity === undefined ? undefined : b('progress-container')}>
139
152
  {memorySegments
140
- .filter(({isInfo}) => !isInfo)
153
+ .filter(({isInfo}) => !isInfo && capacity !== undefined)
141
154
  .map((segment) => {
142
155
  if (segment.value < MIN_VISIBLE_MEMORY_VALUE) {
143
156
  return null;
@@ -5,8 +5,9 @@
5
5
  "text_memtable": "MemTable",
6
6
  "text_query-execution": "Query Execution",
7
7
  "text_usage": "Usage",
8
- "text_soft-limit": "Soft Limit",
9
- "text_hard-limit": "Hard Limit",
8
+ "text_soft-limit": "Memory Controller Soft Limit",
9
+ "text_hard-limit": "Memory Controller Hard Limit",
10
10
  "text_other": "Other",
11
- "text_memory-details": "Memory Details"
11
+ "text_memory-details": "Memory Details",
12
+ "text_memory-limit": "Memory Limit"
12
13
  }
@@ -1,14 +1,8 @@
1
1
  import type {TMemoryStats} from '../../types/api/nodes';
2
- import {isNumeric} from '../../utils/utils';
2
+ import {isNumeric, parseOptionalNonNegativeNumber} from '../../utils/utils';
3
3
 
4
4
  import i18n from './i18n';
5
5
 
6
- export function calculateAllocatedMemory(stats: TMemoryStats) {
7
- const allocatedMemory = getMaybeNumber(stats.AllocatedMemory) || 0;
8
- const allocatorCaches = getMaybeNumber(stats.AllocatorCachesMemory) || 0;
9
- return String(allocatedMemory + allocatorCaches);
10
- }
11
-
12
6
  function getMaybeNumber(value: string | number | undefined): number | undefined {
13
7
  return isNumeric(value) ? parseFloat(String(value)) : undefined;
14
8
  }
@@ -34,7 +28,14 @@ export function getMemorySegmentColor(key: string): string {
34
28
  return MEMORY_SEGMENT_COLORS[key] || MEMORY_SEGMENT_COLORS['Other'];
35
29
  }
36
30
 
37
- export function getMemorySegments(stats: TMemoryStats, memoryUsage: number): MemorySegment[] {
31
+ export function getMemorySegments(
32
+ stats: TMemoryStats,
33
+ memoryUsage: number,
34
+ {
35
+ allocatorCachesIncludedInUsage = true,
36
+ memoryLimit,
37
+ }: {allocatorCachesIncludedInUsage?: boolean; memoryLimit?: number} = {},
38
+ ): MemorySegment[] {
38
39
  const segments = [
39
40
  {
40
41
  label: i18n('text_shared-cache'),
@@ -61,12 +62,12 @@ export function getMemorySegments(stats: TMemoryStats, memoryUsage: number): Mem
61
62
  label: i18n('text_allocator-caches'),
62
63
  key: 'AllocatorCachesMemory',
63
64
  value: getMaybeNumber(stats.AllocatorCachesMemory),
64
- isInfo: false,
65
+ isInfo: !allocatorCachesIncludedInUsage,
65
66
  },
66
67
  ];
67
68
 
68
69
  const nonInfoSegments = segments.filter(
69
- (segment) => segment.value !== undefined,
70
+ (segment) => !segment.isInfo && segment.value !== undefined,
70
71
  ) as MemorySegment[];
71
72
  const sumNonInfoSegments = nonInfoSegments.reduce((acc, segment) => acc + segment.value, 0);
72
73
 
@@ -92,16 +93,22 @@ export function getMemorySegments(stats: TMemoryStats, memoryUsage: number): Mem
92
93
  value: memoryUsage,
93
94
  isInfo: true,
94
95
  },
96
+ {
97
+ label: i18n('text_memory-limit'),
98
+ key: 'MemoryLimit',
99
+ value: memoryLimit,
100
+ isInfo: true,
101
+ },
95
102
  {
96
103
  label: i18n('text_soft-limit'),
97
104
  key: 'SoftLimit',
98
- value: getMaybeNumber(stats.SoftLimit),
105
+ value: parseOptionalNonNegativeNumber(stats.SoftLimit) || undefined,
99
106
  isInfo: true,
100
107
  },
101
108
  {
102
109
  label: i18n('text_hard-limit'),
103
110
  key: 'HardLimit',
104
- value: getMaybeNumber(stats.HardLimit),
111
+ value: parseOptionalNonNegativeNumber(stats.HardLimit) || undefined,
105
112
  isInfo: true,
106
113
  },
107
114
  );
@@ -0,0 +1,15 @@
1
+ .ydb-pdisk-info {
2
+ --g-definition-list-item-gap: var(--g-spacing-3);
3
+
4
+ &__column {
5
+ flex: 1 1 400px;
6
+
7
+ min-width: 0;
8
+ max-width: 500px;
9
+ }
10
+
11
+ &__identity-value {
12
+ min-width: 0;
13
+ overflow-wrap: anywhere;
14
+ }
15
+ }
@@ -1,263 +1,71 @@
1
1
  import {Flex} from '@gravity-ui/uikit';
2
2
 
3
3
  import {useBlobStorageCapacityMetricsEnabled} from '../../store/reducers/capabilities/hooks';
4
- import {valueIsDefined} from '../../utils';
5
- import {formatBytes} from '../../utils/bytesParsers';
6
- import {formatStorageValuesToGb} from '../../utils/dataFormatters/dataFormatters';
7
- import {createPDiskDeveloperUILink, useHasDeveloperUi} from '../../utils/developerUI/developerUI';
8
- import {formatPDiskType} from '../../utils/disks/getPDiskType';
4
+ import {cn} from '../../utils/cn';
5
+ import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
9
6
  import type {PreparedPDisk} from '../../utils/disks/types';
10
- import {getPDiskCapacityInfoItems, toInfoViewerItems} from '../DiskCapacityInfo/DiskCapacityInfo';
11
- import type {InfoViewerItem} from '../InfoViewer';
12
- import {InfoViewer} from '../InfoViewer/InfoViewer';
13
- import {LinkWithIcon} from '../LinkWithIcon/LinkWithIcon';
14
- import {PDiskPageLink} from '../PDiskPageLink/PDiskPageLink';
15
- import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
16
- import {StatusIcon} from '../StatusIcon/StatusIcon';
7
+ import {formatMetricPercent} from '../../utils/storageMetrics';
8
+ import {CopyableValue} from '../CopyableValue/CopyableValue';
9
+ import {getPDiskCapacityItems} from '../DiskCapacityInfo/DiskCapacityInfo';
10
+ import type {YDBDefinitionListItem} from '../YDBDefinitionList/YDBDefinitionList';
11
+ import {YDBDefinitionList} from '../YDBDefinitionList/YDBDefinitionList';
17
12
 
13
+ import {getPDiskLogItems, getPDiskRuntimeItems} from './getPDiskDetails';
18
14
  import {pDiskInfoKeyset} from './i18n';
19
15
 
20
- interface GetPDiskInfoOptions<T extends PreparedPDisk> {
21
- pDisk?: T;
22
- nodeId?: number | string | null;
23
- withPDiskPageLink?: boolean;
24
- hasDeveloperUi?: boolean;
25
- capacityMetricsEnabled?: boolean;
26
- }
27
-
28
- // eslint-disable-next-line complexity
29
- function getPDiskInfo<T extends PreparedPDisk>({
30
- pDisk,
31
- nodeId,
32
- withPDiskPageLink,
33
- hasDeveloperUi,
34
- capacityMetricsEnabled,
35
- }: GetPDiskInfoOptions<T>) {
36
- const {
37
- PDiskId,
38
- Path,
39
- Guid,
40
- Category,
41
- Type,
42
- Device,
43
- Realtime,
44
- State,
45
- SerialNumber,
46
- TotalSize,
47
- AllocatedSize,
48
- AllocatedPercent,
49
- StatusV2,
50
- NumActiveSlots,
51
- ExpectedSlotCount,
52
- LogUsedSize,
53
- LogTotalSize,
54
- SystemSize,
55
- SharedWithOs,
56
- } = pDisk || {};
16
+ import './PDiskInfo.scss';
57
17
 
58
- const generalInfo: InfoViewerItem[] = [];
59
-
60
- if (valueIsDefined(Category)) {
61
- generalInfo.push({label: pDiskInfoKeyset('type'), value: formatPDiskType(Type)});
62
- }
63
- if (valueIsDefined(Path)) {
64
- generalInfo.push({label: pDiskInfoKeyset('path'), value: Path});
65
- }
66
- if (valueIsDefined(Guid)) {
67
- generalInfo.push({label: pDiskInfoKeyset('guid'), value: Guid});
68
- }
69
- // SerialNumber could be an empty string ""
70
- if (SerialNumber) {
71
- generalInfo.push({
72
- label: pDiskInfoKeyset('serial-number'),
73
- value: SerialNumber,
74
- });
75
- }
76
- if (SharedWithOs) {
77
- generalInfo.push({
78
- label: pDiskInfoKeyset('shared-with-os'),
79
- value: pDiskInfoKeyset('yes'),
80
- });
81
- }
82
-
83
- const statusInfo: InfoViewerItem[] = [];
84
-
85
- if (valueIsDefined(StatusV2)) {
86
- statusInfo.push({label: pDiskInfoKeyset('drive-status'), value: StatusV2});
87
- }
88
- if (valueIsDefined(State)) {
89
- statusInfo.push({label: pDiskInfoKeyset('state'), value: State});
90
- }
91
- if (valueIsDefined(Device)) {
92
- statusInfo.push({
93
- label: pDiskInfoKeyset('device'),
94
- value: <StatusIcon status={Device} />,
95
- });
96
- }
97
- if (valueIsDefined(Realtime)) {
98
- statusInfo.push({
99
- label: pDiskInfoKeyset('realtime'),
100
- value: <StatusIcon status={Realtime} />,
101
- });
102
- }
103
-
104
- const additionalInfo: InfoViewerItem[] = [];
105
-
106
- const shouldDisplayLinks =
107
- (withPDiskPageLink || hasDeveloperUi) && valueIsDefined(PDiskId) && valueIsDefined(nodeId);
108
-
109
- if (shouldDisplayLinks) {
110
- const pDiskInternalViewerPath = createPDiskDeveloperUILink({
111
- nodeId,
112
- pDiskId: PDiskId,
113
- });
114
-
115
- additionalInfo.push({
116
- label: pDiskInfoKeyset('links'),
117
- value: (
118
- <Flex wrap="wrap" gap={2}>
119
- {withPDiskPageLink && <PDiskPageLink pDiskId={PDiskId} nodeId={nodeId} />}
120
- {hasDeveloperUi && (
121
- <LinkWithIcon
122
- title={pDiskInfoKeyset('developer-ui')}
123
- url={pDiskInternalViewerPath}
124
- />
125
- )}
126
- </Flex>
127
- ),
128
- });
129
- }
18
+ const b = cn('ydb-pdisk-info');
130
19
 
131
- if (capacityMetricsEnabled) {
132
- const configurationInfo = [...generalInfo];
133
- const runtimeInfo = [...statusInfo];
134
- const capacityItems = getPDiskCapacityInfoItems(pDisk, {
135
- withUsage: true,
136
- withCapacityAlert: false,
137
- });
138
- const slotSizeItem = capacityItems.find(({id}) => id === 'slot-size-in-units');
139
- const runtimeCapacityItems = capacityItems.filter(({id}) => id !== 'slot-size-in-units');
140
-
141
- if (slotSizeItem) {
142
- configurationInfo.push(...toInfoViewerItems([slotSizeItem]));
143
- }
144
- configurationInfo.push(...additionalInfo);
145
- runtimeInfo.push(...toInfoViewerItems(runtimeCapacityItems));
146
-
147
- if (valueIsDefined(LogUsedSize) && valueIsDefined(LogTotalSize)) {
148
- runtimeInfo.push({
149
- label: pDiskInfoKeyset('log-size'),
150
- value: (
151
- <ProgressViewer
152
- value={LogUsedSize}
153
- capacity={LogTotalSize}
154
- formatValues={formatStorageValuesToGb}
155
- />
156
- ),
157
- });
158
- }
159
- if (valueIsDefined(SystemSize)) {
160
- runtimeInfo.push({
161
- label: pDiskInfoKeyset('system-size'),
162
- value: formatBytes({value: SystemSize}),
163
- });
164
- }
165
-
166
- return [configurationInfo, runtimeInfo];
167
- }
168
-
169
- const spaceInfo: InfoViewerItem[] = [];
20
+ interface PDiskInfoProps {
21
+ pDisk?: PreparedPDisk;
22
+ className?: string;
23
+ }
170
24
 
171
- const hasSpaceData =
172
- Number.isFinite(Number(AllocatedSize)) && Number.isFinite(Number(TotalSize));
173
- spaceInfo.push({
174
- label: pDiskInfoKeyset('space'),
175
- value: hasSpaceData
176
- ? formatStorageValuesToGb(Number(AllocatedSize), Number(TotalSize)).join(' / ')
177
- : pDiskInfoKeyset('value_no-data'),
178
- });
179
- if (!isNaN(Number(AllocatedPercent))) {
180
- spaceInfo.push({
181
- label: pDiskInfoKeyset('usage'),
182
- value: `${AllocatedPercent}%`,
183
- });
184
- }
185
- if (valueIsDefined(NumActiveSlots) && valueIsDefined(ExpectedSlotCount)) {
186
- spaceInfo.push({
187
- label: pDiskInfoKeyset('slots'),
188
- value: <ProgressViewer value={NumActiveSlots} capacity={ExpectedSlotCount} />,
189
- });
190
- }
191
- if (valueIsDefined(LogUsedSize) && valueIsDefined(LogTotalSize)) {
192
- spaceInfo.push({
193
- label: pDiskInfoKeyset('log-size'),
194
- value: (
195
- <ProgressViewer
196
- value={LogUsedSize}
197
- capacity={LogTotalSize}
198
- formatValues={formatStorageValuesToGb}
199
- />
200
- ),
201
- });
202
- }
203
- if (valueIsDefined(SystemSize)) {
204
- spaceInfo.push({
205
- label: pDiskInfoKeyset('system-size'),
206
- value: formatBytes({value: SystemSize}),
25
+ function getPageCapacityItems(data: PreparedPDisk, capacityMetricsEnabled: boolean) {
26
+ const items = getPDiskCapacityItems(data, {useWhiteboardSize: capacityMetricsEnabled}).filter(
27
+ ({id}) => capacityMetricsEnabled || id === 'space' || id === 'slots',
28
+ );
29
+ if (!capacityMetricsEnabled) {
30
+ items.splice(1, 0, {
31
+ id: 'usage',
32
+ name: pDiskInfoKeyset('usage'),
33
+ content: formatMetricPercent(data.AllocatedPercent, 2),
207
34
  });
208
35
  }
209
-
210
- return [generalInfo, statusInfo, spaceInfo, additionalInfo];
211
- }
212
-
213
- interface PDiskInfoProps<T extends PreparedPDisk> extends GetPDiskInfoOptions<T> {
214
- className?: string;
36
+ return [...items, ...getPDiskLogItems(data)];
215
37
  }
216
38
 
217
- export function PDiskInfo<T extends PreparedPDisk>({
218
- pDisk,
219
- nodeId,
220
- withPDiskPageLink,
221
- className,
222
- }: PDiskInfoProps<T>) {
223
- const hasDeveloperUi = useHasDeveloperUi();
39
+ export function PDiskInfo({pDisk = {}, className}: PDiskInfoProps) {
224
40
  const capacityMetricsEnabled = useBlobStorageCapacityMetricsEnabled();
225
-
226
- const infoGroups = getPDiskInfo({
227
- pDisk,
228
- nodeId,
229
- withPDiskPageLink,
230
- hasDeveloperUi,
231
- capacityMetricsEnabled,
232
- });
233
-
234
- if (capacityMetricsEnabled) {
235
- const [configurationInfo, runtimeInfo] = infoGroups;
236
-
237
- return (
238
- <Flex className={className} gap={2} direction="row" wrap>
239
- <Flex direction="column" gap={2} width={500}>
240
- <InfoViewer info={configurationInfo} renderEmptyState={() => null} />
241
- </Flex>
242
- <Flex direction="column" gap={2} width={500}>
243
- <InfoViewer info={runtimeInfo} renderEmptyState={() => null} />
244
- </Flex>
245
- </Flex>
246
- );
247
- }
248
-
249
- const [generalInfo, statusInfo, spaceInfo, additionalInfo] = infoGroups;
41
+ const identityItems = [
42
+ {name: pDiskInfoKeyset('guid'), value: pDisk.Guid},
43
+ {name: pDiskInfoKeyset('serial-number'), value: pDisk.SerialNumber},
44
+ ].map(({name, value}) => ({
45
+ name,
46
+ content: (
47
+ <CopyableValue copyText={value || undefined} fieldName={name}>
48
+ <span className={b('identity-value')}>{value || EMPTY_DATA_PLACEHOLDER}</span>
49
+ </CopyableValue>
50
+ ),
51
+ }));
52
+ const runtimeItems: YDBDefinitionListItem[] = [
53
+ ...getPDiskRuntimeItems(pDisk),
54
+ ...identityItems,
55
+ ];
250
56
 
251
57
  return (
252
- <Flex className={className} gap={2} direction="row" wrap>
253
- <Flex direction="column" gap={2} width={500}>
254
- <InfoViewer info={generalInfo} renderEmptyState={() => null} />
255
- <InfoViewer info={spaceInfo} renderEmptyState={() => null} />
256
- </Flex>
257
- <Flex direction="column" gap={2} width={500}>
258
- <InfoViewer info={statusInfo} renderEmptyState={() => null} />
259
- <InfoViewer info={additionalInfo} renderEmptyState={() => null} />
260
- </Flex>
58
+ <Flex className={b(null, className)} gap={6} gapRow={3} wrap="wrap" qa="pdisk-page-info">
59
+ <YDBDefinitionList
60
+ items={runtimeItems}
61
+ nameMaxWidth={200}
62
+ wrapperClassName={b('column')}
63
+ />
64
+ <YDBDefinitionList
65
+ items={getPageCapacityItems(pDisk, capacityMetricsEnabled)}
66
+ nameMaxWidth={200}
67
+ wrapperClassName={b('column')}
68
+ />
261
69
  </Flex>
262
70
  );
263
71
  }
@@ -23,14 +23,18 @@ export function PDiskLogSize({used, total}: {used?: string; total?: string}) {
23
23
  }
24
24
 
25
25
  return (
26
- <Flex gap={1} alignItems="center" className={b()}>
27
- <Progress
28
- className={b('progress')}
29
- value={percentage}
30
- theme="success"
31
- size="s"
32
- aria-label={i18n('log-size')}
33
- />
26
+ <Flex
27
+ gap={1}
28
+ alignItems="center"
29
+ className={b()}
30
+ role="meter"
31
+ aria-label={i18n('log-size')}
32
+ aria-valuemin={0}
33
+ aria-valuemax={100}
34
+ aria-valuenow={percentage}
35
+ aria-valuetext={formatStorageMetricPair(usedSize, totalSize, 2)}
36
+ >
37
+ <Progress className={b('progress')} value={percentage} theme="success" size="s" />
34
38
  <span>{formatStorageMetricPair(usedSize, totalSize, 2)}</span>
35
39
  </Flex>
36
40
  );
@@ -3,7 +3,6 @@
3
3
  "path": "Path",
4
4
  "guid": "GUID",
5
5
  "serial-number": "Serial Number",
6
- "shared-with-os": "SharedWithOs",
7
6
  "drive-status": "Drive Status",
8
7
  "state": "State",
9
8
  "device": "Device",
@@ -14,12 +13,16 @@
14
13
  "slots": "Slots",
15
14
  "log-size": "Log Size",
16
15
  "system-size": "System Size",
17
- "links": "Links",
18
16
  "developer-ui": "Developer UI",
19
- "yes": "Yes",
20
17
  "context_slots": "The number of VDisks residing on this PDisk",
21
18
  "context_log-size": "The size of the Common Log shared by the residing VDisks",
22
19
  "context_system-size": "The size reserved for the PDisk system components. Includes SysLog",
20
+ "field_drive": "Drive status",
21
+ "field_decommit": "Decommission",
22
+ "value_not-available": "N/A",
23
+ "context_drive-not-available": "Drive is not available",
24
+ "context_decommit-not-available": "Decommission status is not available",
25
+ "context_maintenance-not-available": "Maintenance status is not available",
23
26
  "value_unknown": "Unknown",
24
27
  "value_ok": "Ok",
25
28
  "value_initial": "Initial",
@@ -24,6 +24,16 @@ function unknownLabel(): DiskStatusLabelData {
24
24
  };
25
25
  }
26
26
 
27
+ function unavailableLabel(title: string, tooltip: string): DiskStatusLabelData {
28
+ return {
29
+ title,
30
+ value: i18n('value_not-available'),
31
+ tooltip,
32
+ theme: 'unknown',
33
+ icon: CircleQuestionFill,
34
+ };
35
+ }
36
+
27
37
  function getLabelView({
28
38
  severity,
29
39
  icon,
@@ -112,7 +122,7 @@ export function getPDiskStateLabel(state?: TPDiskState): DiskStatusLabelData {
112
122
 
113
123
  export function getPDiskDriveLabel(status?: EDriveStatus): DiskStatusLabelData | undefined {
114
124
  if (!status || status === 'UNKNOWN') {
115
- return undefined;
125
+ return unavailableLabel(i18n('field_drive'), i18n('context_drive-not-available'));
116
126
  }
117
127
  const labels: Record<Exclude<EDriveStatus, 'UNKNOWN'>, StatusText> = {
118
128
  ACTIVE: {value: i18n('value_active'), tooltip: i18n('context_active')},
@@ -141,7 +151,7 @@ export function getPDiskDriveLabel(status?: EDriveStatus): DiskStatusLabelData |
141
151
 
142
152
  export function getPDiskDecommitLabel(status?: EDecommitStatus): DiskStatusLabelData | undefined {
143
153
  if (!status || status === 'DECOMMIT_UNSET') {
144
- return undefined;
154
+ return unavailableLabel(i18n('field_decommit'), i18n('context_decommit-not-available'));
145
155
  }
146
156
  const labels: Record<Exclude<EDecommitStatus, 'DECOMMIT_UNSET'>, StatusText> = {
147
157
  DECOMMIT_NONE: {value: i18n('value_decommit-none'), tooltip: i18n('context_decommit-none')},
@@ -174,7 +184,10 @@ export function getPDiskMaintenanceLabel(
174
184
  status?: EMaintenanceStatus,
175
185
  ): DiskStatusLabelData | undefined {
176
186
  if (!status) {
177
- return undefined;
187
+ return unavailableLabel(
188
+ i18n('label_maintenance'),
189
+ i18n('context_maintenance-not-available'),
190
+ );
178
191
  }
179
192
  const labels: Record<EMaintenanceStatus, StatusText> = {
180
193
  NO_REQUEST: {
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
3
  import type {TextInputProps} from '@gravity-ui/uikit';
4
+ import {TextInput} from '@gravity-ui/uikit';
4
5
 
5
6
  import {cn} from '../../utils/cn';
6
7
  import {DebouncedTextInput} from '../DebouncedInput/DebouncedTextInput';
@@ -40,9 +41,11 @@ export const Search = ({
40
41
  [onChange],
41
42
  );
42
43
 
44
+ const Input = debounce === 0 ? TextInput : DebouncedTextInput;
45
+
43
46
  return (
44
- <DebouncedTextInput
45
- debounce={debounce}
47
+ <Input
48
+ {...(debounce === 0 ? {} : {debounce})}
46
49
  hasClear
47
50
  autoFocus
48
51
  controlRef={controlRef}