ydb-embedded-ui 22.3.0 → 22.4.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 (302) hide show
  1. package/dist/components/DiskCapacityInfo/DiskCapacityInfo.d.ts +10 -1
  2. package/dist/components/DiskCapacityInfo/DiskCapacityInfo.js +75 -13
  3. package/dist/components/DiskCapacityInfo/DiskCapacityInfo.js.map +1 -1
  4. package/dist/components/DiskCapacityInfo/i18n/index.d.ts +1 -1
  5. package/dist/components/DiskPopup/DiskPopup.d.ts +25 -0
  6. package/dist/components/DiskPopup/DiskPopup.js +44 -0
  7. package/dist/components/DiskPopup/DiskPopup.js.map +1 -0
  8. package/dist/components/DiskPopup/DiskPopup.scss +203 -0
  9. package/dist/components/DiskPopup/i18n/en.json +3 -0
  10. package/dist/components/DiskPopup/i18n/index.d.ts +2 -0
  11. package/dist/components/DiskPopup/i18n/index.js +4 -0
  12. package/dist/components/DiskPopup/i18n/index.js.map +1 -0
  13. package/dist/components/DiskStatus/DiskStatus.d.ts +31 -0
  14. package/dist/components/DiskStatus/DiskStatus.js +61 -0
  15. package/dist/components/DiskStatus/DiskStatus.js.map +1 -0
  16. package/dist/components/DiskStatus/DiskStatus.scss +59 -0
  17. package/dist/components/DiskStatus/i18n/en.json +6 -0
  18. package/dist/components/DiskStatus/i18n/index.d.ts +2 -0
  19. package/dist/components/DiskStatus/i18n/index.js +4 -0
  20. package/dist/components/DiskStatus/i18n/index.js.map +1 -0
  21. package/dist/components/EntityStatus/EntityStatus.d.ts +1 -0
  22. package/dist/components/EntityStatus/EntityStatus.js +1 -1
  23. package/dist/components/EntityStatus/EntityStatus.js.map +1 -1
  24. package/dist/components/EvictVDiskButton/i18n/en.json +1 -1
  25. package/dist/components/FullNodeViewer/i18n/index.d.ts +1 -1
  26. package/dist/components/HoverPopup/HoverPopup.d.ts +2 -1
  27. package/dist/components/HoverPopup/HoverPopup.js +49 -17
  28. package/dist/components/HoverPopup/HoverPopup.js.map +1 -1
  29. package/dist/components/HoverPopup/usePopupPriority.d.ts +4 -0
  30. package/dist/components/HoverPopup/usePopupPriority.js +30 -0
  31. package/dist/components/HoverPopup/usePopupPriority.js.map +1 -0
  32. package/dist/components/PDiskInfo/PDiskLogSize.d.ts +5 -0
  33. package/dist/components/PDiskInfo/PDiskLogSize.js +20 -0
  34. package/dist/components/PDiskInfo/PDiskLogSize.js.map +1 -0
  35. package/dist/components/PDiskInfo/PDiskLogSize.scss +12 -0
  36. package/dist/components/PDiskInfo/getPDiskDetails.d.ts +4 -0
  37. package/dist/components/PDiskInfo/getPDiskDetails.js +33 -0
  38. package/dist/components/PDiskInfo/getPDiskDetails.js.map +1 -0
  39. package/dist/components/PDiskInfo/i18n/en.json +64 -2
  40. package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
  41. package/dist/components/PDiskInfo/statuses.d.ts +7 -0
  42. package/dist/components/PDiskInfo/statuses.js +185 -0
  43. package/dist/components/PDiskInfo/statuses.js.map +1 -0
  44. package/dist/components/PDiskPopup/PDiskPopup.d.ts +4 -7
  45. package/dist/components/PDiskPopup/PDiskPopup.js +28 -99
  46. package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
  47. package/dist/components/PDiskPopup/i18n/en.json +2 -12
  48. package/dist/components/PDiskPopup/i18n/index.d.ts +1 -1
  49. package/dist/components/StorageGroupInfo/StorageGroupInfo.d.ts +3 -3
  50. package/dist/components/StorageGroupInfo/StorageGroupInfo.js +78 -218
  51. package/dist/components/StorageGroupInfo/StorageGroupInfo.js.map +1 -1
  52. package/dist/components/StorageGroupInfo/StorageGroupInfo.scss +21 -0
  53. package/dist/components/StorageGroupInfo/i18n/en.json +1 -9
  54. package/dist/components/StorageGroupInfo/i18n/index.d.ts +1 -1
  55. package/dist/components/VDisk/VDisk.d.ts +2 -1
  56. package/dist/components/VDisk/VDisk.js +23 -32
  57. package/dist/components/VDisk/VDisk.js.map +1 -1
  58. package/dist/components/VDisk/VDiskWithDonorsStack.d.ts +1 -1
  59. package/dist/components/VDisk/VDiskWithDonorsStack.js +2 -1
  60. package/dist/components/VDisk/VDiskWithDonorsStack.js.map +1 -1
  61. package/dist/components/VDisk/getFlagStatusText.d.ts +2 -0
  62. package/dist/components/VDisk/getFlagStatusText.js +18 -0
  63. package/dist/components/VDisk/getFlagStatusText.js.map +1 -0
  64. package/dist/components/VDisk/i18n/en.json +1 -1
  65. package/dist/components/VDisk/i18n/index.d.ts +1 -1
  66. package/dist/components/VDiskInfo/getVDiskDetails.d.ts +5 -0
  67. package/dist/components/VDiskInfo/getVDiskDetails.js +29 -0
  68. package/dist/components/VDiskInfo/getVDiskDetails.js.map +1 -0
  69. package/dist/components/VDiskInfo/i18n/en.json +3 -1
  70. package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
  71. package/dist/components/VDiskPopup/VDiskPopup.d.ts +6 -8
  72. package/dist/components/VDiskPopup/VDiskPopup.js +106 -240
  73. package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
  74. package/dist/components/VDiskPopup/VDiskPopup.scss +3 -10
  75. package/dist/components/VDiskPopup/i18n/en.json +6 -22
  76. package/dist/components/VDiskPopup/i18n/index.d.ts +1 -1
  77. package/dist/components/VDiskStatus/VDiskReplicationStatus.d.ts +8 -0
  78. package/dist/components/VDiskStatus/VDiskReplicationStatus.js +32 -0
  79. package/dist/components/VDiskStatus/VDiskReplicationStatus.js.map +1 -0
  80. package/dist/components/VDiskStatus/VDiskStatus.d.ts +16 -0
  81. package/dist/components/VDiskStatus/VDiskStatus.js +20 -0
  82. package/dist/components/VDiskStatus/VDiskStatus.js.map +1 -0
  83. package/dist/components/VDiskStatus/VDiskStatus.scss +32 -0
  84. package/dist/components/VDiskStatus/i18n/en.json +33 -0
  85. package/dist/components/VDiskStatus/i18n/index.d.ts +1 -0
  86. package/dist/components/VDiskStatus/i18n/index.js +5 -0
  87. package/dist/components/VDiskStatus/i18n/index.js.map +1 -0
  88. package/dist/components/VDiskStatus/index.d.ts +2 -0
  89. package/dist/components/VDiskStatus/index.js +3 -0
  90. package/dist/components/VDiskStatus/index.js.map +1 -0
  91. package/dist/components/VDiskStatus/statuses.d.ts +4 -0
  92. package/dist/components/VDiskStatus/statuses.js +120 -0
  93. package/dist/components/VDiskStatus/statuses.js.map +1 -0
  94. package/dist/components/capacityMetricsColumns/i18n/en.json +4 -4
  95. package/dist/containers/Cluster/ClusterDrawerHealthcheck.js +6 -1
  96. package/dist/containers/Cluster/ClusterDrawerHealthcheck.js.map +1 -1
  97. package/dist/containers/Clusters/ClusterDrawerHealthcheck.js +1 -1
  98. package/dist/containers/Clusters/ClusterDrawerHealthcheck.js.map +1 -1
  99. package/dist/containers/Header/Header.js +8 -2
  100. package/dist/containers/Header/Header.js.map +1 -1
  101. package/dist/containers/Header/StorageGroupLeftControls.d.ts +1 -0
  102. package/dist/containers/Header/StorageGroupLeftControls.js +23 -0
  103. package/dist/containers/Header/StorageGroupLeftControls.js.map +1 -0
  104. package/dist/containers/Header/i18n/en.json +3 -1
  105. package/dist/containers/Header/i18n/index.d.ts +1 -1
  106. package/dist/containers/Operations/constants.d.ts +1 -1
  107. package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js +4 -4
  108. package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js.map +1 -1
  109. package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
  110. package/dist/containers/Storage/Disks/Disks.js +36 -9
  111. package/dist/containers/Storage/Disks/Disks.js.map +1 -1
  112. package/dist/containers/Storage/PDisk/PDisk.d.ts +2 -1
  113. package/dist/containers/Storage/PDisk/PDisk.js +2 -2
  114. package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
  115. package/dist/containers/Storage/PDisk/i18n/index.d.ts +1 -1
  116. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/columns.js +7 -2
  117. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/columns.js.map +1 -1
  118. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/i18n/index.d.ts +1 -1
  119. package/dist/containers/Storage/StorageExpertModePanel/components/SpaceLegend.scss +14 -82
  120. package/dist/containers/Storage/StorageExpertModePanel/i18n/index.d.ts +1 -1
  121. package/dist/containers/Storage/StorageGroupStateLabel.d.ts +4 -0
  122. package/dist/containers/Storage/StorageGroupStateLabel.js +9 -0
  123. package/dist/containers/Storage/StorageGroupStateLabel.js.map +1 -0
  124. package/dist/containers/Storage/utils/getStorageGroupStateLabel.d.ts +2 -0
  125. package/dist/containers/Storage/utils/getStorageGroupStateLabel.js +35 -0
  126. package/dist/containers/Storage/utils/getStorageGroupStateLabel.js.map +1 -0
  127. package/dist/containers/StorageGroupPage/StorageGroupPage.js +17 -12
  128. package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
  129. package/dist/containers/StorageGroupPage/StorageGroupPage.scss +9 -13
  130. package/dist/containers/StorageGroupPage/i18n/en.json +3 -1
  131. package/dist/containers/StorageGroupPage/i18n/index.d.ts +1 -1
  132. package/dist/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -1
  133. package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +4 -1
  134. package/dist/containers/Tenant/Diagnostics/Overview/Overview.js.map +1 -1
  135. package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/SchemaObjectInfo.d.ts +2 -1
  136. package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/SchemaObjectInfo.js +11 -2
  137. package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/SchemaObjectInfo.js.map +1 -1
  138. package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/prepareSchemaObjectInfo.d.ts +2 -1
  139. package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/prepareSchemaObjectInfo.js +9 -8
  140. package/dist/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/prepareSchemaObjectInfo.js.map +1 -1
  141. package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.d.ts +16 -1
  142. package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.js +56 -19
  143. package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.js.map +1 -1
  144. package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/i18n/en.json +5 -1
  145. package/dist/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/i18n/index.d.ts +1 -1
  146. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/i18n/index.d.ts +1 -1
  147. package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.d.ts +3 -1
  148. package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.js +3 -3
  149. package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.js.map +1 -1
  150. package/dist/containers/Tenant/TenantDrawerHealthcheck.js +8 -1
  151. package/dist/containers/Tenant/TenantDrawerHealthcheck.js.map +1 -1
  152. package/dist/containers/Tenants/DatabaseDrawerHealthcheck.js +8 -1
  153. package/dist/containers/Tenants/DatabaseDrawerHealthcheck.js.map +1 -1
  154. package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
  155. package/dist/lib.d.ts +1 -1
  156. package/dist/lib.js.map +1 -1
  157. package/dist/store/configureStore.d.ts +2 -2
  158. package/dist/store/defaultStore.d.ts +1 -1
  159. package/dist/store/reducers/header/types.d.ts +1 -1
  160. package/dist/store/reducers/index.d.ts +2 -2
  161. package/dist/store/reducers/pdisk/types.d.ts +1 -0
  162. package/dist/store/reducers/pdisk/utils.js +6 -1
  163. package/dist/store/reducers/pdisk/utils.js.map +1 -1
  164. package/dist/store/reducers/storage/prepareGroupsDisks.d.ts +1 -0
  165. package/dist/store/reducers/storage/prepareGroupsDisks.js +7 -18
  166. package/dist/store/reducers/storage/prepareGroupsDisks.js.map +1 -1
  167. package/dist/store/reducers/storage/utils.js +4 -0
  168. package/dist/store/reducers/storage/utils.js.map +1 -1
  169. package/dist/store/reducers/streamingQuery/streamingQuery.js +2 -4
  170. package/dist/store/reducers/streamingQuery/streamingQuery.js.map +1 -1
  171. package/dist/styles/mixins.scss +22 -0
  172. package/dist/types/api/pdisk.d.ts +4 -0
  173. package/dist/types/api/pdisk.js.map +1 -1
  174. package/dist/types/api/vdisk.d.ts +8 -0
  175. package/dist/types/api/vdisk.js +7 -0
  176. package/dist/types/api/vdisk.js.map +1 -1
  177. package/dist/types/store/nodesList.d.ts +4 -2
  178. package/dist/uiFactory/types.d.ts +5 -2
  179. package/dist/utils/bytesParsers/formatBytes.d.ts +3 -1
  180. package/dist/utils/bytesParsers/formatBytes.js +12 -3
  181. package/dist/utils/bytesParsers/formatBytes.js.map +1 -1
  182. package/dist/utils/disks/constants.d.ts +1 -0
  183. package/dist/utils/disks/constants.js +4 -0
  184. package/dist/utils/disks/constants.js.map +1 -1
  185. package/dist/utils/disks/diskInfo/getDiskLocationItems.d.ts +16 -0
  186. package/dist/utils/disks/diskInfo/getDiskLocationItems.js +30 -0
  187. package/dist/utils/disks/diskInfo/getDiskLocationItems.js.map +1 -0
  188. package/dist/utils/disks/diskInfo/i18n/en.json +9 -0
  189. package/dist/utils/disks/diskInfo/i18n/index.d.ts +2 -0
  190. package/dist/utils/disks/diskInfo/i18n/index.js +4 -0
  191. package/dist/utils/disks/diskInfo/i18n/index.js.map +1 -0
  192. package/dist/utils/disks/iconCalculators.d.ts +5 -0
  193. package/dist/utils/disks/iconCalculators.js +1 -1
  194. package/dist/utils/disks/iconCalculators.js.map +1 -1
  195. package/dist/utils/disks/prepareDisks.d.ts +6 -2
  196. package/dist/utils/disks/prepareDisks.js +22 -35
  197. package/dist/utils/disks/prepareDisks.js.map +1 -1
  198. package/dist/utils/disks/types.d.ts +9 -2
  199. package/dist/utils/hooks/useNodeMetadata.d.ts +2 -0
  200. package/dist/utils/hooks/useNodeMetadata.js +15 -0
  201. package/dist/utils/hooks/useNodeMetadata.js.map +1 -0
  202. package/dist/utils/nodes.js +6 -2
  203. package/dist/utils/nodes.js.map +1 -1
  204. package/dist/utils/storageMetrics.d.ts +2 -2
  205. package/dist/utils/storageMetrics.js +22 -10
  206. package/dist/utils/storageMetrics.js.map +1 -1
  207. package/dist/utils/timeParsers/formatDuration.d.ts +4 -1
  208. package/dist/utils/timeParsers/formatDuration.js +16 -1
  209. package/dist/utils/timeParsers/formatDuration.js.map +1 -1
  210. package/dist/utils/timeParsers/i18n/en.json +5 -1
  211. package/dist/utils/timeParsers/i18n/index.d.ts +1 -1
  212. package/dist/utils/timeParsers/i18n/ru.json +5 -1
  213. package/package.json +2 -2
  214. package/src/components/DiskCapacityInfo/DiskCapacityInfo.tsx +106 -15
  215. package/src/components/DiskPopup/DiskPopup.scss +203 -0
  216. package/src/components/DiskPopup/DiskPopup.tsx +123 -0
  217. package/src/components/DiskPopup/i18n/en.json +3 -0
  218. package/src/components/DiskPopup/i18n/index.ts +5 -0
  219. package/src/components/DiskStatus/DiskStatus.scss +59 -0
  220. package/src/components/DiskStatus/DiskStatus.tsx +149 -0
  221. package/src/components/DiskStatus/i18n/en.json +6 -0
  222. package/src/components/DiskStatus/i18n/index.ts +5 -0
  223. package/src/components/EntityStatus/EntityStatus.tsx +1 -1
  224. package/src/components/EvictVDiskButton/i18n/en.json +1 -1
  225. package/src/components/HoverPopup/HoverPopup.tsx +67 -20
  226. package/src/components/HoverPopup/usePopupPriority.ts +39 -0
  227. package/src/components/PDiskInfo/PDiskLogSize.scss +12 -0
  228. package/src/components/PDiskInfo/PDiskLogSize.tsx +37 -0
  229. package/src/components/PDiskInfo/getPDiskDetails.tsx +37 -0
  230. package/src/components/PDiskInfo/i18n/en.json +64 -8
  231. package/src/components/PDiskInfo/statuses.ts +209 -0
  232. package/src/components/PDiskPopup/PDiskPopup.tsx +62 -147
  233. package/src/components/PDiskPopup/i18n/en.json +2 -12
  234. package/src/components/StorageGroupInfo/StorageGroupInfo.scss +21 -0
  235. package/src/components/StorageGroupInfo/StorageGroupInfo.tsx +121 -260
  236. package/src/components/StorageGroupInfo/i18n/en.json +1 -9
  237. package/src/components/VDisk/VDisk.tsx +31 -34
  238. package/src/components/VDisk/VDiskWithDonorsStack.tsx +2 -0
  239. package/src/components/VDisk/getFlagStatusText.ts +19 -0
  240. package/src/components/VDisk/i18n/en.json +1 -1
  241. package/src/components/VDiskInfo/getVDiskDetails.tsx +41 -0
  242. package/src/components/VDiskInfo/i18n/en.json +3 -10
  243. package/src/components/VDiskPopup/VDiskPopup.scss +3 -10
  244. package/src/components/VDiskPopup/VDiskPopup.tsx +197 -421
  245. package/src/components/VDiskPopup/i18n/en.json +6 -22
  246. package/src/components/VDiskStatus/VDiskReplicationStatus.tsx +77 -0
  247. package/src/components/VDiskStatus/VDiskStatus.scss +32 -0
  248. package/src/components/VDiskStatus/VDiskStatus.tsx +38 -0
  249. package/src/components/VDiskStatus/i18n/en.json +33 -0
  250. package/src/components/VDiskStatus/i18n/index.ts +7 -0
  251. package/src/components/VDiskStatus/index.ts +7 -0
  252. package/src/components/VDiskStatus/statuses.ts +139 -0
  253. package/src/components/capacityMetricsColumns/i18n/en.json +4 -4
  254. package/src/containers/Cluster/ClusterDrawerHealthcheck.tsx +6 -0
  255. package/src/containers/Clusters/ClusterDrawerHealthcheck.tsx +1 -0
  256. package/src/containers/Header/Header.tsx +11 -3
  257. package/src/containers/Header/StorageGroupLeftControls.tsx +38 -0
  258. package/src/containers/Header/i18n/en.json +3 -1
  259. package/src/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.tsx +13 -2
  260. package/src/containers/Storage/Disks/Disks.tsx +66 -12
  261. package/src/containers/Storage/PDisk/PDisk.tsx +3 -0
  262. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/columns.tsx +24 -3
  263. package/src/containers/Storage/StorageExpertModePanel/components/SpaceLegend.scss +14 -82
  264. package/src/containers/Storage/StorageGroupStateLabel.tsx +22 -0
  265. package/src/containers/Storage/utils/getStorageGroupStateLabel.ts +49 -0
  266. package/src/containers/StorageGroupPage/StorageGroupPage.scss +9 -13
  267. package/src/containers/StorageGroupPage/StorageGroupPage.tsx +53 -25
  268. package/src/containers/StorageGroupPage/i18n/en.json +3 -1
  269. package/src/containers/Tenant/Diagnostics/Overview/Overview.tsx +5 -1
  270. package/src/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/SchemaObjectInfo.tsx +12 -1
  271. package/src/containers/Tenant/Diagnostics/Overview/SchemaObjectInfo/prepareSchemaObjectInfo.tsx +11 -10
  272. package/src/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/StreamingQueryInfo.tsx +83 -20
  273. package/src/containers/Tenant/Diagnostics/Overview/StreamingQueryInfo/i18n/en.json +5 -1
  274. package/src/containers/Tenant/Healthcheck/components/HealthcheckDrawer.tsx +5 -2
  275. package/src/containers/Tenant/TenantDrawerHealthcheck.tsx +10 -0
  276. package/src/containers/Tenants/DatabaseDrawerHealthcheck.tsx +10 -0
  277. package/src/lib.ts +1 -0
  278. package/src/store/reducers/header/types.ts +3 -1
  279. package/src/store/reducers/pdisk/types.ts +1 -0
  280. package/src/store/reducers/pdisk/utils.ts +6 -3
  281. package/src/store/reducers/storage/prepareGroupsDisks.ts +7 -22
  282. package/src/store/reducers/storage/utils.ts +4 -0
  283. package/src/store/reducers/streamingQuery/streamingQuery.ts +2 -4
  284. package/src/styles/mixins.scss +22 -0
  285. package/src/types/api/pdisk.ts +4 -0
  286. package/src/types/api/vdisk.ts +9 -0
  287. package/src/types/store/nodesList.ts +7 -7
  288. package/src/uiFactory/types.ts +9 -2
  289. package/src/utils/bytesParsers/formatBytes.ts +23 -4
  290. package/src/utils/disks/constants.ts +5 -0
  291. package/src/utils/disks/diskInfo/getDiskLocationItems.ts +50 -0
  292. package/src/utils/disks/diskInfo/i18n/en.json +9 -0
  293. package/src/utils/disks/diskInfo/i18n/index.ts +5 -0
  294. package/src/utils/disks/iconCalculators.ts +1 -1
  295. package/src/utils/disks/prepareDisks.ts +21 -47
  296. package/src/utils/disks/types.ts +10 -2
  297. package/src/utils/hooks/useNodeMetadata.ts +21 -0
  298. package/src/utils/nodes.ts +6 -1
  299. package/src/utils/storageMetrics.ts +27 -14
  300. package/src/utils/timeParsers/formatDuration.ts +22 -1
  301. package/src/utils/timeParsers/i18n/en.json +5 -1
  302. package/src/utils/timeParsers/i18n/ru.json +5 -1
@@ -40,6 +40,7 @@ interface PrepareSchemaObjectInfoItemsParams {
40
40
  itemsAfterType?: YDBDefinitionListItem[];
41
41
  additionalItems?: YDBDefinitionListItem[];
42
42
  showAdministrativeFields?: boolean;
43
+ createdContent?: YDBDefinitionListItem['content'];
43
44
  }
44
45
 
45
46
  function isPresent(value: string | number | undefined): value is string | number {
@@ -83,6 +84,7 @@ export function prepareSchemaObjectInfoItems({
83
84
  itemsAfterType = [],
84
85
  additionalItems = [],
85
86
  showAdministrativeFields = false,
87
+ createdContent,
86
88
  }: PrepareSchemaObjectInfoItemsParams): YDBDefinitionListItem[] {
87
89
  const self = data?.PathDescription?.Self;
88
90
  let pathId = self?.PathId;
@@ -116,21 +118,20 @@ export function prepareSchemaObjectInfoItems({
116
118
  );
117
119
  }
118
120
 
119
- if (Number(createStep)) {
121
+ items.push({
122
+ name: schemaObjectInfoKeyset('field_full-path'),
123
+ content: isPresent(fullPath) ? fullPath : EMPTY_DATA_PLACEHOLDER,
124
+ copyText: isPresent(fullPath) ? fullPath : undefined,
125
+ });
126
+
127
+ if (createdContent || Number(createStep)) {
120
128
  items.push({
121
129
  name: tenantKeyset('field_created'),
122
- content: formatDateTime(createStep),
130
+ content: createdContent || formatDateTime(createStep),
123
131
  });
124
132
  }
125
133
 
126
- items.push(
127
- {
128
- name: schemaObjectInfoKeyset('field_full-path'),
129
- content: isPresent(fullPath) ? fullPath : EMPTY_DATA_PLACEHOLDER,
130
- copyText: isPresent(fullPath) ? fullPath : undefined,
131
- },
132
- ...additionalItems,
133
- );
134
+ items.push(...additionalItems);
134
135
 
135
136
  return items.filter(({content}) => content !== undefined && content !== null && content !== '');
136
137
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
+ import {dateTimeParse} from '@gravity-ui/date-utils';
3
4
  import {Label} from '@gravity-ui/uikit';
4
5
 
5
6
  import {Loader} from '../../../../../components/Loader';
@@ -7,8 +8,11 @@ import type {YDBDefinitionListItem} from '../../../../../components/YDBDefinitio
7
8
  import {YDBDefinitionList} from '../../../../../components/YDBDefinitionList/YDBDefinitionList';
8
9
  import {YQLCodePreview} from '../../../../../components/YQLCodePreview/YQLCodePreview';
9
10
  import {streamingQueriesApi} from '../../../../../store/reducers/streamingQuery/streamingQuery';
11
+ import type {TEvDescribeSchemeResult} from '../../../../../types/api/schema';
12
+ import {EPathType} from '../../../../../types/api/schema';
10
13
  import type {IQueryResult} from '../../../../../types/store/query';
11
14
  import {cn} from '../../../../../utils/cn';
15
+ import {EMPTY_DATA_PLACEHOLDER} from '../../../../../utils/constants';
12
16
  import {
13
17
  getStringifiedData,
14
18
  stripIndentByFirstLine,
@@ -16,6 +20,7 @@ import {
16
20
  } from '../../../../../utils/dataFormatters/dataFormatters';
17
21
  import {parseIssuesData} from '../../../../../utils/query';
18
22
  import {ResultIssuesModal} from '../../../Query/Issues/Issues';
23
+ import {SchemaObjectInfo} from '../SchemaObjectInfo/SchemaObjectInfo';
19
24
 
20
25
  import i18n from './i18n';
21
26
 
@@ -24,26 +29,37 @@ import './StreamingQueryInfo.scss';
24
29
  interface StreamingQueryProps {
25
30
  database: string;
26
31
  path: string;
32
+ data?: TEvDescribeSchemeResult;
27
33
  }
28
34
 
29
35
  const b = cn('ydb-streaming-query-info');
30
36
 
31
- export function StreamingQueryInfo({database, path}: StreamingQueryProps) {
32
- const {data: sysData, isFetching} = streamingQueriesApi.useGetStreamingQueryInfoQuery(
37
+ export function StreamingQueryInfo({database, path, data}: StreamingQueryProps) {
38
+ const {currentData: sysData, isFetching} = streamingQueriesApi.useGetStreamingQueryInfoQuery(
33
39
  {database, path},
34
40
  {skip: !database || !path},
35
41
  );
36
42
  const loading = isFetching && sysData === undefined;
37
43
 
38
- if (loading) {
39
- return <Loader size="s" className={b('loader')} />;
40
- }
41
-
42
- const {items, queryText} = prepareStreamingQueryItems(sysData);
44
+ const {items, queryText, createdContent, stateItems} = prepareStreamingQueryInfo(
45
+ sysData,
46
+ data?.PathDescription?.Self?.CreateStep,
47
+ );
43
48
 
44
49
  return (
45
50
  <React.Fragment>
46
- <YDBDefinitionList items={items} />
51
+ <SchemaObjectInfo
52
+ data={data}
53
+ fallbackType={EPathType.EPathTypeStreamingQuery}
54
+ path={path}
55
+ createdContent={createdContent}
56
+ itemsAfterType={stateItems}
57
+ />
58
+ {loading ? (
59
+ <Loader size="s" className={b('loader')} />
60
+ ) : items.length ? (
61
+ <YDBDefinitionList items={items} />
62
+ ) : null}
47
63
  {queryText ? (
48
64
  <YQLCodePreview title={i18n('field_query-text')} text={queryText} />
49
65
  ) : null}
@@ -73,27 +89,40 @@ function StateLabel({state}: {state?: string}) {
73
89
  return <Label theme={theme}>{state}</Label>;
74
90
  }
75
91
 
76
- function prepareStreamingQueryItems(sysData?: IQueryResult) {
92
+ export function prepareStreamingQueryInfo(sysData?: IQueryResult, createStep?: string | number) {
77
93
  if (!sysData) {
78
- return {items: [], queryText: undefined};
94
+ return {items: [], queryText: undefined, createdContent: undefined, stateItems: []};
79
95
  }
80
96
 
81
- const info: YDBDefinitionListItem[] = [];
82
- const state = getStringifiedData(sysData.resultSets?.[0]?.result?.[0]?.State);
83
-
84
- const queryText = getStringifiedData(sysData.resultSets?.[0]?.result?.[0]?.Text);
97
+ const row = sysData.resultSets?.[0]?.result?.[0];
98
+ const createdContent =
99
+ formatLifecycleValue(row?.CreatedAt, row?.CreatedBy, createStep) ??
100
+ (row && 'CreatedAt' in row ? EMPTY_DATA_PLACEHOLDER : undefined);
101
+ const lifecycleFields = [
102
+ {name: i18n('field_started'), timestamp: 'StartedAt', user: 'StartedBy'},
103
+ {name: i18n('field_modified'), timestamp: 'ModifiedAt', user: 'ModifiedBy'},
104
+ {name: i18n('field_stopped'), timestamp: 'FinishedAt', user: 'StoppedBy'},
105
+ ];
106
+ const info: YDBDefinitionListItem[] = lifecycleFields
107
+ .filter(({timestamp}) => row && timestamp in row)
108
+ .map(({name, timestamp, user}) => ({
109
+ name,
110
+ content: formatLifecycleValue(row?.[timestamp], row?.[user]) ?? EMPTY_DATA_PLACEHOLDER,
111
+ }));
112
+ const state = getStringifiedData(row?.Status);
113
+
114
+ const queryText = getStringifiedData(row?.Text);
85
115
  let normalizedQueryText = trimOuterEmptyLines(queryText);
86
116
  normalizedQueryText = stripIndentByFirstLine(normalizedQueryText);
87
117
 
88
- const errorRaw = sysData.resultSets?.[0]?.result?.[0]?.Error;
118
+ const errorRaw = row?.Issues;
89
119
 
90
120
  // We use custom error check, because error type can be non-standard
91
121
  const errorData = parseIssuesData(errorRaw);
92
122
 
93
- info.push({
94
- name: i18n('field_query-state'),
95
- content: <StateLabel state={state} />,
96
- });
123
+ const stateItems: YDBDefinitionListItem[] = [
124
+ {name: i18n('field_query-state'), content: <StateLabel state={state} />},
125
+ ];
97
126
 
98
127
  if (errorData) {
99
128
  info.push({
@@ -102,5 +131,39 @@ function prepareStreamingQueryItems(sysData?: IQueryResult) {
102
131
  });
103
132
  }
104
133
 
105
- return {items: info, queryText: normalizedQueryText};
134
+ return {items: info, queryText: normalizedQueryText, createdContent, stateItems};
135
+ }
136
+
137
+ function formatLifecycleValue(
138
+ timestamp: string | number | null | undefined,
139
+ user: string | number | null | undefined,
140
+ fallback?: string | number,
141
+ ) {
142
+ let milliseconds = NaN;
143
+ if (typeof timestamp === 'number') {
144
+ milliseconds = timestamp;
145
+ } else if (typeof timestamp === 'string') {
146
+ milliseconds = Date.parse(timestamp);
147
+ }
148
+ const dateMilliseconds =
149
+ Number.isFinite(milliseconds) && milliseconds > 0 ? milliseconds : Number(fallback);
150
+ const date =
151
+ Number.isFinite(dateMilliseconds) && dateMilliseconds > 0
152
+ ? dateTimeParse(dateMilliseconds)?.format('YYYY-MM-DD HH:mm:ss')
153
+ : undefined;
154
+
155
+ if (!date && !user) {
156
+ return undefined;
157
+ }
158
+
159
+ if (!user) {
160
+ return date;
161
+ }
162
+
163
+ return (
164
+ <React.Fragment>
165
+ {i18n('value_date-by-user', {date: date || EMPTY_DATA_PLACEHOLDER})}{' '}
166
+ <Label theme="normal">{String(user)}</Label>
167
+ </React.Fragment>
168
+ );
106
169
  }
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "field_query-state": "State",
3
3
  "field_query-error": "Error",
4
- "field_query-text": "Text"
4
+ "field_query-text": "Text",
5
+ "field_started": "Started",
6
+ "field_modified": "Modified",
7
+ "field_stopped": "Stopped",
8
+ "value_date-by-user": "{{date}} by"
5
9
  }
@@ -9,10 +9,12 @@ import {EnableFullscreenButton} from '../../../../components/EnableFullscreenBut
9
9
  import type {SelfCheckResult} from '../../../../types/api/healthcheck';
10
10
  import {uiFactory} from '../../../../uiFactory/uiFactory';
11
11
  import {createAndDownloadJsonFile} from '../../../../utils/downloadFile';
12
+ import type {HealthcheckAssistantTarget} from '../types';
12
13
 
13
14
  import {HealthcheckDrawerTitle} from './HealthcheckDrawerTitle';
14
15
 
15
16
  interface HealthcheckDrawerProps {
17
+ target?: HealthcheckAssistantTarget;
16
18
  children: React.ReactNode;
17
19
  isDrawerVisible: boolean;
18
20
  onCloseDrawer: () => void;
@@ -29,6 +31,7 @@ interface HealthcheckDrawerProps {
29
31
  }
30
32
 
31
33
  export function HealthcheckDrawer({
34
+ target,
32
35
  children,
33
36
  isDrawerVisible,
34
37
  onCloseDrawer,
@@ -51,11 +54,11 @@ export function HealthcheckDrawer({
51
54
 
52
55
  return (
53
56
  <React.Fragment>
54
- {renderDrawerExtension()}
57
+ {renderDrawerExtension({target})}
55
58
  {renderDrawerContent()}
56
59
  </React.Fragment>
57
60
  );
58
- }, [renderDrawerContent, renderDrawerExtension]);
61
+ }, [renderDrawerContent, renderDrawerExtension, target]);
59
62
 
60
63
  const handleDownload = React.useCallback(
61
64
  (event: React.MouseEvent<HTMLButtonElement>) => {
@@ -8,6 +8,7 @@ import {useTypedSelector} from '../../utils/hooks';
8
8
 
9
9
  import {Healthcheck} from './Healthcheck/Healthcheck';
10
10
  import {HealthcheckDrawer} from './Healthcheck/components/HealthcheckDrawer';
11
+ import {getDatabaseHealthcheckAssistantTarget} from './Healthcheck/utils';
11
12
  import {useCurrentSchema} from './TenantContext';
12
13
  import i18n from './i18n';
13
14
  import {useTenantQueryParams} from './useTenantQueryParams';
@@ -46,6 +47,15 @@ export function TenantDrawerHealthcheck({children, clusterName}: TenantDrawerHea
46
47
 
47
48
  return (
48
49
  <HealthcheckDrawer
50
+ target={
51
+ database
52
+ ? getDatabaseHealthcheckAssistantTarget({
53
+ database,
54
+ clusterName,
55
+ scope: 'database',
56
+ })
57
+ : undefined
58
+ }
49
59
  isDrawerVisible={Boolean(showHealthcheck)}
50
60
  onCloseDrawer={handleCloseDrawer}
51
61
  renderDrawerContent={renderDrawerContent}
@@ -8,6 +8,7 @@ import type {PreparedTenant} from '../../store/reducers/tenants/types';
8
8
  import {useTypedSelector} from '../../utils/hooks';
9
9
  import {Healthcheck} from '../Tenant/Healthcheck/Healthcheck';
10
10
  import {HealthcheckDrawer} from '../Tenant/Healthcheck/components/HealthcheckDrawer';
11
+ import {getDatabaseHealthcheckAssistantTarget} from '../Tenant/Healthcheck/utils';
11
12
  import tenantI18n from '../Tenant/i18n';
12
13
  import {useTenantQueryParams} from '../Tenant/useTenantQueryParams';
13
14
 
@@ -78,6 +79,15 @@ export function DatabaseDrawerHealthcheck({children, clusterName}: DatabaseDrawe
78
79
 
79
80
  return (
80
81
  <HealthcheckDrawer
82
+ target={
83
+ database
84
+ ? getDatabaseHealthcheckAssistantTarget({
85
+ database,
86
+ clusterName: selectedClusterName,
87
+ scope: 'database',
88
+ })
89
+ : undefined
90
+ }
81
91
  isDrawerVisible={Boolean(database)}
82
92
  onCloseDrawer={handleCloseDrawer}
83
93
  renderDrawerContent={renderDrawerContent}
package/src/lib.ts CHANGED
@@ -46,6 +46,7 @@ export type {
46
46
  IllustrationComponent,
47
47
  IllustrationName,
48
48
  RenderHealthcheckAssistantAction,
49
+ HealthcheckDrawerExtensionProps,
49
50
  } from './uiFactory/types';
50
51
  export type {
51
52
  HealthcheckAssistantActionProps,
@@ -76,7 +76,9 @@ export type PageBreadcrumbsOptions<T extends Page = undefined> = T extends 'home
76
76
  ? NodeBreadcrumbsOptions
77
77
  : T extends 'tablet'
78
78
  ? TabletBreadcrumbsOptions
79
- : {};
79
+ : T extends 'storageGroup'
80
+ ? StorageGroupBreadcrumbsOptions
81
+ : {};
80
82
 
81
83
  export interface HeaderState {
82
84
  page?: Page;
@@ -5,6 +5,7 @@ export interface PDiskData extends PreparedPDisk {
5
5
  NodeHost?: string;
6
6
  NodeType?: string;
7
7
  NodeDC?: string;
8
+ NodeRack?: string;
8
9
  SlotItems?: (SlotItem<'vDisk'> | SlotItem<'log'> | SlotItem<'empty'>)[];
9
10
  }
10
11
 
@@ -62,9 +62,11 @@ export function preparePDiskDataResponse([pdiskResponse = {}, nodeResponse]: [
62
62
  };
63
63
  }
64
64
 
65
- const preparedVDisks = WhiteboardVDisksData.map((disk) =>
66
- prepareWhiteboardVDiskData({...disk, NodeId}),
67
- );
65
+ const preparedVDisks = WhiteboardVDisksData.map((disk) => ({
66
+ ...prepareWhiteboardVDiskData({...disk, NodeId}),
67
+ PDiskType: preparedPDisk.Type,
68
+ PDiskPath: preparedPDisk.Path,
69
+ }));
68
70
 
69
71
  setDonorRecipientReferences((cb) => {
70
72
  for (const vDisk of preparedVDisks) {
@@ -145,6 +147,7 @@ export function preparePDiskDataResponse([pdiskResponse = {}, nodeResponse]: [
145
147
  NodeHost: preparedNode.Host,
146
148
  NodeType: preparedNode.Roles?.[0],
147
149
  NodeDC: preparedNode.DC,
150
+ NodeRack: preparedNode.Rack,
148
151
  SlotItems: diskSlots,
149
152
  };
150
153
  }
@@ -32,31 +32,14 @@ export function prepareGroupsVDisk(data: TStorageVDisk = {}): PreparedVDisk {
32
32
  SlotSize: PDisk?.SlotSize,
33
33
  });
34
34
 
35
- const whiteboardAllocatedSize = parseOptionalNonNegativeNumber(whiteboardVDisk.AllocatedSize);
36
- const whiteboardAvailableSize = parseOptionalNonNegativeNumber(whiteboardVDisk.AvailableSize);
37
- const whiteboardSlotSize = parseOptionalNonNegativeNumber(
38
- PDisk?.Whiteboard?.EnforcedDynamicSlotSize,
39
- );
40
- const whiteboardSizeFields =
35
+ const WhiteboardSize =
41
36
  hasWhiteboardData && data.Whiteboard
42
37
  ? prepareVDiskSizeFields({
43
- AvailableSize: whiteboardAvailableSize,
44
- AllocatedSize: whiteboardAllocatedSize,
45
- SlotSize: whiteboardSlotSize,
46
- })
38
+ AvailableSize: whiteboardVDisk.AvailableSize,
39
+ AllocatedSize: whiteboardVDisk.AllocatedSize,
40
+ SlotSize: PDisk?.Whiteboard?.EnforcedDynamicSlotSize,
41
+ }).DisplaySize
47
42
  : undefined;
48
- const WhiteboardSize = whiteboardSizeFields
49
- ? {
50
- AllocatedSize:
51
- whiteboardAllocatedSize === undefined
52
- ? undefined
53
- : whiteboardSizeFields.AllocatedSize,
54
- SizeLimit:
55
- whiteboardAvailableSize === undefined && whiteboardSlotSize === undefined
56
- ? undefined
57
- : whiteboardSizeFields.SizeLimit,
58
- }
59
- : undefined;
60
43
 
61
44
  const preparedDonors = bscVDisk.Donors?.map((donor) => {
62
45
  const preparedDonor = prepareGroupsVDisk(donor);
@@ -77,6 +60,8 @@ export function prepareGroupsVDisk(data: TStorageVDisk = {}): PreparedVDisk {
77
60
  HasWhiteboardData: hasWhiteboardData,
78
61
  ...(WhiteboardSize ? {WhiteboardSize} : {}),
79
62
  PDisk: preparedPDisk,
63
+ PDiskType: preparedPDisk.Type,
64
+ PDiskPath: preparedPDisk.Path,
80
65
  Donors: preparedDonors,
81
66
  PDiskId,
82
67
  StringifiedId,
@@ -88,10 +88,14 @@ const prepareStorageNodeData = (
88
88
  pDisk.Realtime !== undefined);
89
89
  return prepareWhiteboardPDiskData({...pDisk, NodeId}, hasWhiteboardData ? pDisk : null);
90
90
  });
91
+ const pDisksById = new Map(pDisks?.map((pDisk) => [pDisk.PDiskId, pDisk]));
91
92
  const vDisks = VDisks?.map((vDisk) => {
93
+ const pDisk = vDisk.PDiskId === undefined ? undefined : pDisksById.get(vDisk.PDiskId);
92
94
  return {
93
95
  ...prepareWhiteboardVDiskData({...vDisk, VDiskId: vDisk.VDiskId}),
94
96
  NodeId,
97
+ PDiskType: pDisk?.Type,
98
+ PDiskPath: pDisk?.Path,
95
99
  };
96
100
  });
97
101
 
@@ -3,12 +3,10 @@ import {isQueryErrorResponse, parseQueryAPIResponse} from '../../../utils/query'
3
3
  import {api} from '../api';
4
4
 
5
5
  function getStreamingQueryInfoSQL(path: string) {
6
+ // Select available columns so older backends without lifecycle fields remain supported.
6
7
  const safePath = path.replace(/'/g, "''");
7
8
  return `${QUERY_TECHNICAL_MARK}
8
- SELECT
9
- Status AS State,
10
- Issues AS Error,
11
- Text
9
+ SELECT * WITHOUT Plan, Ast
12
10
  FROM \`.sys/streaming_queries\`
13
11
  WHERE Path = '${safePath}'
14
12
  LIMIT 1`;
@@ -9,6 +9,28 @@
9
9
  }
10
10
  }
11
11
 
12
+ @mixin capacity-alert-label-colors($color) {
13
+ background-color: var(--ydb-capacity-alert-label-background);
14
+
15
+ @if $color == 'green' {
16
+ --ydb-capacity-alert-label-background: var(--g-color-base-positive-light);
17
+
18
+ color: var(--g-color-text-positive-heavy);
19
+ } @else if $color == 'yellow' {
20
+ --ydb-capacity-alert-label-background: var(--g-color-base-warning-light);
21
+
22
+ color: var(--g-color-text-warning-heavy);
23
+ } @else if $color == 'red' {
24
+ --ydb-capacity-alert-label-background: var(--g-color-base-danger-light);
25
+
26
+ color: var(--g-color-base-danger-heavy);
27
+ } @else {
28
+ --ydb-capacity-alert-label-background: var(--ydb-space-#{$color}-bg);
29
+
30
+ color: var(--ydb-space-#{$color}-text);
31
+ }
32
+ }
33
+
12
34
  @mixin container() {
13
35
  max-width: 1170px;
14
36
  margin: 0 auto;
@@ -56,6 +56,10 @@ export interface TPDiskStateInfo {
56
56
  /** float; percent in the 0..100 scale. */
57
57
  PDiskUsage?: number;
58
58
  PDiskCapacityAlert?: ECapacityAlert | string;
59
+ /** Added by viewer from the BlobStorage controller system view. */
60
+ Status?: EDriveStatus;
61
+ DecommitStatus?: EDecommitStatus;
62
+ MaintenanceStatus?: EMaintenanceStatus;
59
63
  }
60
64
 
61
65
  export enum TPDiskState {
@@ -41,6 +41,8 @@ export interface TVDiskStateInfo {
41
41
  SatisfactionRank?: TVDiskSatisfactionRank;
42
42
  /** Is VDisk replicated? (i.e. contains all blobs it must have) */
43
43
  Replicated?: boolean;
44
+ /** Detailed Whiteboard replication status. May be absent on older nodes. */
45
+ DetailedReplicationStatus?: EVDiskDetailedReplicationStatus;
44
46
  /** Does this VDisk has any yet unreplicated phantom-like blobs? */
45
47
  UnreplicatedPhantoms?: boolean;
46
48
  /** The same for the non-phantom-like blobs. */
@@ -138,6 +140,13 @@ export enum EVDiskState {
138
140
  PDiskError = 'PDiskError',
139
141
  }
140
142
 
143
+ export enum EVDiskDetailedReplicationStatus {
144
+ Replicated = 'Replicated',
145
+ WaitingForToken = 'WaitingForToken',
146
+ InProgress = 'InProgress',
147
+ PhantomsOnly = 'PhantomsOnly',
148
+ }
149
+
141
150
  /**
142
151
  * BSC VDisk data
143
152
  *
@@ -1,7 +1,7 @@
1
- export type NodesMap = Map<
2
- number,
3
- {
4
- Host?: string;
5
- DC?: string;
6
- }
7
- >;
1
+ export interface NodeMetadata {
2
+ Host?: string;
3
+ DC?: string;
4
+ Rack?: string;
5
+ }
6
+
7
+ export type NodesMap = Map<number, NodeMetadata>;
@@ -7,7 +7,10 @@ import type {
7
7
  GetHealthcheckViewTitles,
8
8
  GetHealthcheckViewsOrder,
9
9
  } from '../containers/Tenant/Healthcheck/shared';
10
- import type {HealthcheckAssistantActionProps} from '../containers/Tenant/Healthcheck/types';
10
+ import type {
11
+ HealthcheckAssistantActionProps,
12
+ HealthcheckAssistantTarget,
13
+ } from '../containers/Tenant/Healthcheck/types';
11
14
  import type {ClusterInfo} from '../store/reducers/cluster/cluster';
12
15
  import type {PreparedStorageNode} from '../store/reducers/storage/types';
13
16
  import type {PreparedTenant} from '../store/reducers/tenants/types';
@@ -70,7 +73,7 @@ export interface UIFactory<H extends string = CommonIssueCategory, T extends str
70
73
  * Renders after the drawer header and before Healthcheck content.
71
74
  * Stays mounted while the drawer is open, independent of loading, error or issue state.
72
75
  */
73
- renderDrawerExtension?: () => React.ReactNode;
76
+ renderDrawerExtension?: (props: HealthcheckDrawerExtensionProps) => React.ReactNode;
74
77
  };
75
78
  hasAccess: HasAccess;
76
79
  hideGrantAccess?: boolean;
@@ -211,6 +214,10 @@ export type RenderNodeTooltipActions = (props: {data?: PreparedStorageNode}) =>
211
214
 
212
215
  export type RenderChatPanel = () => React.ReactNode;
213
216
 
217
+ export interface HealthcheckDrawerExtensionProps {
218
+ target?: HealthcheckAssistantTarget;
219
+ }
220
+
214
221
  export type RenderHealthcheckAssistantAction = (
215
222
  props: HealthcheckAssistantActionProps,
216
223
  ) => React.ReactNode;
@@ -1,6 +1,11 @@
1
1
  import {GIGABYTE, KILOBYTE, MEGABYTE, PETABYTE, TERABYTE, UNBREAKABLE_GAP} from '../constants';
2
2
  import type {FormatToSizeArgs, FormatValuesArgs} from '../dataFormatters/common';
3
- import {formatNumber, roundToPrecision} from '../dataFormatters/dataFormatters';
3
+ import {
4
+ formatNumber,
5
+ roundToDecimalPlaces,
6
+ roundToPrecision,
7
+ } from '../dataFormatters/dataFormatters';
8
+ import {configuredNumeral} from '../numeral';
4
9
  import {isNumeric} from '../utils';
5
10
 
6
11
  import i18n from './i18n';
@@ -57,8 +62,22 @@ export const getBytesSizeUnit = (value: number) => {
57
62
  return size;
58
63
  };
59
64
 
60
- const formatToSize = ({value, size = 'mb', precision = 0}: FormatToSizeArgs<BytesSizes>) => {
61
- const result = roundToPrecision(Number(value) / sizes[size].value, precision);
65
+ const formatToSize = ({
66
+ value,
67
+ size = 'mb',
68
+ precision = 0,
69
+ fixedDecimalPlaces,
70
+ }: FormatToSizeArgs<BytesSizes> & {fixedDecimalPlaces?: number}) => {
71
+ const convertedValue = Number(value) / sizes[size].value;
72
+ if (fixedDecimalPlaces !== undefined) {
73
+ const roundedValue = roundToDecimalPlaces(convertedValue, fixedDecimalPlaces);
74
+ const pattern =
75
+ roundedValue !== 0 && fixedDecimalPlaces > 0
76
+ ? `0,0.${'0'.repeat(fixedDecimalPlaces)}`
77
+ : '0,0';
78
+ return configuredNumeral(roundedValue).format(pattern);
79
+ }
80
+ const result = roundToPrecision(convertedValue, precision);
62
81
 
63
82
  return formatNumber(result);
64
83
  };
@@ -78,7 +97,7 @@ export const formatBytes = ({
78
97
  withSizeLabel = true,
79
98
  delimiter,
80
99
  ...params
81
- }: FormatValuesArgs<BytesSizes>) => {
100
+ }: FormatValuesArgs<BytesSizes> & {fixedDecimalPlaces?: number}) => {
82
101
  if (!isNumeric(value)) {
83
102
  return '';
84
103
  }
@@ -142,6 +142,7 @@ export const PDISK_STATE_SEVERITY = {
142
142
  export interface LabelVisualConfig {
143
143
  theme: LabelProps['theme'];
144
144
  icon?: IconData;
145
+ dangerHeavy?: boolean;
145
146
  }
146
147
 
147
148
  export const NUMERIC_SEVERITY_TO_LABEL_VIEW: Record<number, LabelVisualConfig> = {
@@ -157,6 +158,10 @@ export const NUMERIC_SEVERITY_TO_LABEL_VIEW: Record<number, LabelVisualConfig> =
157
158
  theme: 'danger',
158
159
  icon: CircleExclamation,
159
160
  },
161
+ [SOLID_RED_SEVERITY]: {
162
+ theme: 'danger',
163
+ dangerHeavy: true,
164
+ },
160
165
  [DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Blue]: {
161
166
  theme: 'info',
162
167
  icon: ArrowsRotateLeft,