ydb-embedded-ui 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (285) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +28 -0
  3. package/dist/HOCS/WithSearch/WithSearch.js +26 -0
  4. package/dist/HOCS/index.js +1 -0
  5. package/dist/assets/icons/bug.svg +1 -0
  6. package/dist/assets/icons/close.svg +1 -0
  7. package/dist/assets/icons/control-menu-button.svg +1 -0
  8. package/dist/assets/icons/databases.svg +3 -0
  9. package/dist/assets/icons/dots.svg +1 -0
  10. package/dist/assets/icons/server.svg +1 -0
  11. package/dist/assets/icons/settings-with-dot.svg +1 -0
  12. package/dist/assets/icons/settings.svg +1 -0
  13. package/dist/assets/icons/signIn.svg +1 -0
  14. package/dist/assets/icons/signOut.svg +1 -0
  15. package/dist/assets/icons/star.svg +1 -0
  16. package/dist/assets/icons/storage.svg +1 -0
  17. package/dist/assets/icons/support.svg +1 -0
  18. package/dist/assets/icons/user-check.svg +1 -0
  19. package/dist/assets/icons/user-secret.svg +1 -0
  20. package/dist/assets/icons/ydb.svg +4 -0
  21. package/dist/components/AsideNavigation/AsideHeader.scss +148 -0
  22. package/dist/components/AsideNavigation/AsideHeader.tsx +388 -0
  23. package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.scss +82 -0
  24. package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.tsx +138 -0
  25. package/dist/components/AsideNavigation/AsideHeaderFooterSlot/AsideHeaderFooterSlot.tsx +33 -0
  26. package/dist/components/AsideNavigation/AsideHeaderFooterSlot/SlotsContext.tsx +49 -0
  27. package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.scss +16 -0
  28. package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.tsx +37 -0
  29. package/dist/components/AsideNavigation/CompositeBar/CompositeBar.scss +108 -0
  30. package/dist/components/AsideNavigation/CompositeBar/CompositeBar.tsx +282 -0
  31. package/dist/components/AsideNavigation/Content/Content.tsx +35 -0
  32. package/dist/components/AsideNavigation/Drawer/Drawer.scss +76 -0
  33. package/dist/components/AsideNavigation/Drawer/Drawer.tsx +134 -0
  34. package/dist/components/AsideNavigation/Drawer/index.ts +1 -0
  35. package/dist/components/AsideNavigation/Logo/Logo.scss +44 -0
  36. package/dist/components/AsideNavigation/Logo/Logo.tsx +82 -0
  37. package/dist/components/AsideNavigation/Settings/README.md +92 -0
  38. package/dist/components/AsideNavigation/Settings/Settings.scss +113 -0
  39. package/dist/components/AsideNavigation/Settings/Settings.tsx +270 -0
  40. package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.scss +70 -0
  41. package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.tsx +141 -0
  42. package/dist/components/AsideNavigation/Settings/SettingsSearch/SettingsSearch.tsx +57 -0
  43. package/dist/components/AsideNavigation/Settings/collect-settings.ts +156 -0
  44. package/dist/components/AsideNavigation/Settings/filter-settings.ts +38 -0
  45. package/dist/components/AsideNavigation/Settings/helpers.ts +39 -0
  46. package/dist/components/AsideNavigation/Settings/i18n/en.json +5 -0
  47. package/dist/components/AsideNavigation/Settings/i18n/index.ts +11 -0
  48. package/dist/components/AsideNavigation/Settings/i18n/ru.json +5 -0
  49. package/dist/components/AsideNavigation/Settings/index.ts +1 -0
  50. package/dist/components/AsideNavigation/constants.ts +28 -0
  51. package/dist/components/AsideNavigation/helpers.ts +34 -0
  52. package/dist/components/AsideNavigation/i18n/en.json +4 -0
  53. package/dist/components/AsideNavigation/i18n/index.ts +11 -0
  54. package/dist/components/AsideNavigation/i18n/ru.json +4 -0
  55. package/dist/components/AsideNavigation/icons.ts +32 -0
  56. package/dist/components/AsideNavigation/types.ts +23 -0
  57. package/dist/components/Breadcrumbs/Breadcrumbs.js +25 -0
  58. package/dist/components/Breadcrumbs/Breadcrumbs.scss +4 -0
  59. package/dist/components/ClusterInfo/ClusterInfo.scss +65 -0
  60. package/dist/components/ClusterInfo/ClusterInfo.tsx +157 -0
  61. package/dist/components/Collapse/Collapse.js +84 -0
  62. package/dist/components/Collapse/Collapse.scss +70 -0
  63. package/dist/components/CriticalActionDialog/CriticalActionDialog.js +53 -0
  64. package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +31 -0
  65. package/dist/components/EmptyState/EmptyState.js +48 -0
  66. package/dist/components/EmptyState/EmptyState.scss +70 -0
  67. package/dist/components/EntityStatus/EntityStatus.js +96 -0
  68. package/dist/components/EntityStatus/EntityStatus.scss +81 -0
  69. package/dist/components/FullGroupViewer/FullGroupViewer.js +149 -0
  70. package/dist/components/FullGroupViewer/FullGroupViewer.scss +32 -0
  71. package/dist/components/FullNodeViewer/FullNodeViewer.js +108 -0
  72. package/dist/components/FullNodeViewer/FullNodeViewer.scss +78 -0
  73. package/dist/components/GroupTreeViewer/GroupTreeViewer.js +86 -0
  74. package/dist/components/GroupTreeViewer/GroupTreeViewer.scss +17 -0
  75. package/dist/components/GroupViewer/GroupViewer.js +100 -0
  76. package/dist/components/GroupViewer/GroupViewer.scss +41 -0
  77. package/dist/components/Hotkey/Hotkey.js +102 -0
  78. package/dist/components/Icon/Icon.js +26 -0
  79. package/dist/components/InfoViewer/InfoViewer.js +47 -0
  80. package/dist/components/InfoViewer/InfoViewer.scss +48 -0
  81. package/dist/components/InternalLink/InternalLink.js +15 -0
  82. package/dist/components/NodesViewer/NodesViewer.js +183 -0
  83. package/dist/components/NodesViewer/NodesViewer.scss +66 -0
  84. package/dist/components/PDiskViewer/PDiskViewer.js +80 -0
  85. package/dist/components/PDiskViewer/PDiskViewer.scss +40 -0
  86. package/dist/components/Pagination/Pagination.js +63 -0
  87. package/dist/components/Pagination/Pagination.scss +25 -0
  88. package/dist/components/PoolBar/PoolBar.js +52 -0
  89. package/dist/components/PoolBar/PoolBar.scss +40 -0
  90. package/dist/components/PoolUsage/PoolUsage.js +54 -0
  91. package/dist/components/PoolUsage/PoolUsage.scss +65 -0
  92. package/dist/components/PoolsGraph/PoolsGraph.js +33 -0
  93. package/dist/components/PoolsGraph/PoolsGraph.scss +3 -0
  94. package/dist/components/ProblemFilter/ProblemFilter.js +24 -0
  95. package/dist/components/ProgressViewer/ProgressViewer.js +92 -0
  96. package/dist/components/ProgressViewer/ProgressViewer.scss +84 -0
  97. package/dist/components/SplitPane/SplitPane.js +368 -0
  98. package/dist/components/SplitPane/SplitPane.scss +107 -0
  99. package/dist/components/SplitPane/index.js +3 -0
  100. package/dist/components/Tablet/Tablet.js +61 -0
  101. package/dist/components/Tablet/Tablet.scss +49 -0
  102. package/dist/components/TabletsStatistic/TabletsStatistic.js +58 -0
  103. package/dist/components/TabletsStatistic/TabletsStatistic.scss +41 -0
  104. package/dist/components/TabletsViewer/TabletsViewer.js +44 -0
  105. package/dist/components/TabletsViewer/TabletsViewer.scss +37 -0
  106. package/dist/components/Tag/Tag.js +14 -0
  107. package/dist/components/Tag/Tag.scss +17 -0
  108. package/dist/components/Tags/Tags.js +36 -0
  109. package/dist/components/Tags/Tags.scss +5 -0
  110. package/dist/components/TenantOverview/TenantOverview.js +148 -0
  111. package/dist/components/TenantOverview/TenantOverview.scss +75 -0
  112. package/dist/components/TreeView/TreeView.js +60 -0
  113. package/dist/components/TreeView/TreeView.scss +30 -0
  114. package/dist/components/TruncatedQuery/TruncatedQuery.js +26 -0
  115. package/dist/components/TruncatedQuery/TruncatedQuery.scss +12 -0
  116. package/dist/containers/App/App.js +67 -0
  117. package/dist/containers/App/App.scss +154 -0
  118. package/dist/containers/App/Content.js +109 -0
  119. package/dist/containers/App/TipPopup/TipPopup.js +66 -0
  120. package/dist/containers/App/TipPopup/TipPopup.scss +42 -0
  121. package/dist/containers/AppIcons/AppIcons.js +477 -0
  122. package/dist/containers/AsideNavigation/AsideNavigation.scss +43 -0
  123. package/dist/containers/AsideNavigation/AsideNavigation.tsx +228 -0
  124. package/dist/containers/Authentication/Authentication.scss +37 -0
  125. package/dist/containers/Authentication/Authentication.tsx +89 -0
  126. package/dist/containers/Cluster/Cluster.js +168 -0
  127. package/dist/containers/Cluster/Cluster.scss +52 -0
  128. package/dist/containers/Group/Group.js +97 -0
  129. package/dist/containers/Group/Group.scss +6 -0
  130. package/dist/containers/Header/Header.js +88 -0
  131. package/dist/containers/Header/Header.scss +72 -0
  132. package/dist/containers/Header/Host/Host.js +66 -0
  133. package/dist/containers/Header/Host/Host.scss +43 -0
  134. package/dist/containers/Heatmap/Heatmap.js +246 -0
  135. package/dist/containers/Heatmap/Heatmap.scss +94 -0
  136. package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +167 -0
  137. package/dist/containers/Heatmap/Histogram/Histogram.js +108 -0
  138. package/dist/containers/Heatmap/Histogram/Histogram.scss +49 -0
  139. package/dist/containers/Heatmap/util.js +110 -0
  140. package/dist/containers/Node/Node.js +184 -0
  141. package/dist/containers/Node/Node.scss +34 -0
  142. package/dist/containers/Node/NodePages.js +13 -0
  143. package/dist/containers/Nodes/Nodes.js +193 -0
  144. package/dist/containers/Nodes/Nodes.scss +50 -0
  145. package/dist/containers/Pdisk/Pdisk.js +159 -0
  146. package/dist/containers/Pdisk/Pdisk.scss +40 -0
  147. package/dist/containers/Pool/Pool.js +169 -0
  148. package/dist/containers/Pool/Pool.scss +32 -0
  149. package/dist/containers/ReduxTooltip/ReduxTooltip.js +108 -0
  150. package/dist/containers/ReduxTooltip/ReduxTooltip.scss +67 -0
  151. package/dist/containers/StorageV2/DiskStateProgressBar/DiskStateProgressBar.scss +81 -0
  152. package/dist/containers/StorageV2/DiskStateProgressBar/DiskStateProgressBar.tsx +56 -0
  153. package/dist/containers/StorageV2/Pdisk/Pdisk.scss +32 -0
  154. package/dist/containers/StorageV2/Pdisk/Pdisk.tsx +167 -0
  155. package/dist/containers/StorageV2/Storage.js +249 -0
  156. package/dist/containers/StorageV2/Storage.scss +57 -0
  157. package/dist/containers/StorageV2/StorageFilter/StorageFilter.js +39 -0
  158. package/dist/containers/StorageV2/StorageGroups/StorageGroups.scss +26 -0
  159. package/dist/containers/StorageV2/StorageGroups/StorageGroups.tsx +234 -0
  160. package/dist/containers/StorageV2/StorageNodes/StorageNodes.scss +30 -0
  161. package/dist/containers/StorageV2/StorageNodes/StorageNodes.tsx +135 -0
  162. package/dist/containers/StorageV2/Vdisk/Vdisk.js +250 -0
  163. package/dist/containers/StorageV2/Vdisk/Vdisk.scss +32 -0
  164. package/dist/containers/Tablet/Tablet.js +453 -0
  165. package/dist/containers/Tablet/Tablet.scss +88 -0
  166. package/dist/containers/Tablets/Tablets.js +306 -0
  167. package/dist/containers/Tablets/Tablets.scss +77 -0
  168. package/dist/containers/TabletsFilters/TabletsFilters.js +412 -0
  169. package/dist/containers/TabletsFilters/TabletsFilters.scss +104 -0
  170. package/dist/containers/Tenant/Acl/Acl.js +149 -0
  171. package/dist/containers/Tenant/Acl/Acl.scss +34 -0
  172. package/dist/containers/Tenant/Compute/Compute.js +110 -0
  173. package/dist/containers/Tenant/Compute/Compute.scss +6 -0
  174. package/dist/containers/Tenant/Describe/Describe.js +81 -0
  175. package/dist/containers/Tenant/Describe/Describe.scss +25 -0
  176. package/dist/containers/Tenant/Healthcheck/Healthcheck.js +116 -0
  177. package/dist/containers/Tenant/Healthcheck/Healthcheck.scss +64 -0
  178. package/dist/containers/Tenant/Healthcheck/IssuesViewer/IssueViewer.scss +164 -0
  179. package/dist/containers/Tenant/Healthcheck/IssuesViewer/IssuesViewer.js +185 -0
  180. package/dist/containers/Tenant/Network/Network.js +341 -0
  181. package/dist/containers/Tenant/Network/Network.scss +145 -0
  182. package/dist/containers/Tenant/Network/NodeNetwork/NodeNetwork.js +71 -0
  183. package/dist/containers/Tenant/Network/NodeNetwork/NodeNetwork.scss +52 -0
  184. package/dist/containers/Tenant/Preview/Preview.js +169 -0
  185. package/dist/containers/Tenant/Preview/Preview.scss +20 -0
  186. package/dist/containers/Tenant/QueryEditor/QueryEditor.js +649 -0
  187. package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +71 -0
  188. package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +168 -0
  189. package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.scss +42 -0
  190. package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +58 -0
  191. package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss +24 -0
  192. package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.js +171 -0
  193. package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.scss +51 -0
  194. package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +156 -0
  195. package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.scss +82 -0
  196. package/dist/containers/Tenant/Schema/HotKeys/HotKeys.js +149 -0
  197. package/dist/containers/Tenant/Schema/HotKeys/HotKeys.scss +48 -0
  198. package/dist/containers/Tenant/Schema/Info/Info.js +84 -0
  199. package/dist/containers/Tenant/Schema/Info/Info.scss +3 -0
  200. package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.js +67 -0
  201. package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.scss +21 -0
  202. package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.js +439 -0
  203. package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.scss +90 -0
  204. package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.js +150 -0
  205. package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.scss +41 -0
  206. package/dist/containers/Tenant/Schema/SchemaPages.js +56 -0
  207. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +115 -0
  208. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.scss +13 -0
  209. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +63 -0
  210. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.scss +28 -0
  211. package/dist/containers/Tenant/Tenant.js +199 -0
  212. package/dist/containers/Tenant/Tenant.scss +94 -0
  213. package/dist/containers/Tenant/TenantPages.js +35 -0
  214. package/dist/containers/Tenant/TopQueries/TopQueries.js +184 -0
  215. package/dist/containers/Tenant/TopQueries/TopQueries.scss +53 -0
  216. package/dist/containers/Tenant/TopShards/TopShards.js +171 -0
  217. package/dist/containers/Tenant/TopShards/TopShards.scss +23 -0
  218. package/dist/containers/Tenants/Tenants.js +375 -0
  219. package/dist/containers/Tenants/Tenants.scss +73 -0
  220. package/dist/containers/UserSettings/UserSettings.tsx +57 -0
  221. package/dist/containers/Vdisk/Vdisk.js +160 -0
  222. package/dist/containers/Vdisk/Vdisk.scss +40 -0
  223. package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +528 -0
  224. package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.scss +60 -0
  225. package/dist/contexts/HistoryContext.ts +6 -0
  226. package/dist/index.css +11 -0
  227. package/dist/index.js +28 -0
  228. package/dist/index.test.js +5 -0
  229. package/dist/react-app-env.d.ts +1 -0
  230. package/dist/reportWebVitals.js +13 -0
  231. package/dist/routes.js +40 -0
  232. package/dist/services/api.js +224 -0
  233. package/dist/setupTests.js +5 -0
  234. package/dist/store/index.js +61 -0
  235. package/dist/store/reducers/authentication.js +77 -0
  236. package/dist/store/reducers/cluster.js +52 -0
  237. package/dist/store/reducers/clusterInfo.js +48 -0
  238. package/dist/store/reducers/clusterNodes.js +70 -0
  239. package/dist/store/reducers/describe.js +45 -0
  240. package/dist/store/reducers/executeQuery.js +158 -0
  241. package/dist/store/reducers/executeTopQueries.js +69 -0
  242. package/dist/store/reducers/explainQuery.js +174 -0
  243. package/dist/store/reducers/group.js +49 -0
  244. package/dist/store/reducers/healthcheckInfo.js +45 -0
  245. package/dist/store/reducers/heatmap.js +105 -0
  246. package/dist/store/reducers/host.js +44 -0
  247. package/dist/store/reducers/hotKeys.js +57 -0
  248. package/dist/store/reducers/index.js +78 -0
  249. package/dist/store/reducers/network.js +45 -0
  250. package/dist/store/reducers/node.js +42 -0
  251. package/dist/store/reducers/nodes.js +58 -0
  252. package/dist/store/reducers/olapStats.js +74 -0
  253. package/dist/store/reducers/pdisk.js +51 -0
  254. package/dist/store/reducers/pool.js +42 -0
  255. package/dist/store/reducers/preview.js +73 -0
  256. package/dist/store/reducers/schema.js +95 -0
  257. package/dist/store/reducers/schemaAcl.js +44 -0
  258. package/dist/store/reducers/settings.js +76 -0
  259. package/dist/store/reducers/shardsWorkload.js +75 -0
  260. package/dist/store/reducers/storage.js +280 -0
  261. package/dist/store/reducers/tablet.js +94 -0
  262. package/dist/store/reducers/tablets.js +90 -0
  263. package/dist/store/reducers/tabletsFilters.js +126 -0
  264. package/dist/store/reducers/tenant.js +76 -0
  265. package/dist/store/reducers/tenants.js +61 -0
  266. package/dist/store/reducers/tooltip.js +64 -0
  267. package/dist/store/reducers/vdisk.js +49 -0
  268. package/dist/store/state-url-mapping.js +133 -0
  269. package/dist/store/utils.js +55 -0
  270. package/dist/styles/mixins.scss +254 -0
  271. package/dist/styles/react-treeview.scss +45 -0
  272. package/dist/types/assets.d.ts +12 -0
  273. package/dist/types/react-list.d.ts +4 -0
  274. package/dist/types/window.d.ts +33 -0
  275. package/dist/utils/actionsConstants.js +4 -0
  276. package/dist/utils/constants.js +126 -0
  277. package/dist/utils/getNodesColumns.js +156 -0
  278. package/dist/utils/i18n/i18n.ts +7 -0
  279. package/dist/utils/i18n/index.ts +1 -0
  280. package/dist/utils/index.js +136 -0
  281. package/dist/utils/monaco.js +69 -0
  282. package/dist/utils/prepareQueryExplain.ts +101 -0
  283. package/dist/utils/tooltip.js +197 -0
  284. package/dist/utils/utils.js +75 -0
  285. package/package.json +89 -0
@@ -0,0 +1,81 @@
1
+ .entity-status {
2
+ display: inline-flex;
3
+ max-width: 100%;
4
+ align-items: center;
5
+ font-size: var(--yc-text-body2-font-size);
6
+ line-height: var(--yc-text-body2-line-height);
7
+
8
+ &__clipboard-button {
9
+ visibility: hidden;
10
+ margin-left: 5px;
11
+ color: var(--yc-color-text-secondary);
12
+
13
+ &_visible {
14
+ visibility: visible;
15
+ }
16
+ }
17
+
18
+ a {
19
+ color: var(--yc-color-text-link);
20
+ text-decoration: none;
21
+ text-overflow: ellipsis;
22
+ overflow: hidden;
23
+ white-space: nowrap;
24
+ }
25
+
26
+ a:hover {
27
+ color: var(--yc-color-text-link-hover);
28
+ }
29
+
30
+ &__label {
31
+ margin-right: 2px;
32
+ color: var(--yc-color-text-complementary);
33
+ font-size: var(--yc-text-body2-font-size);
34
+ line-height: var(--yc-text-body2-line-height);
35
+ }
36
+
37
+ &__name {
38
+ white-space: nowrap;
39
+ }
40
+
41
+ &__status-icon {
42
+ border-radius: 3px;
43
+ margin-right: 8px;
44
+
45
+ &_size_xs {
46
+ min-width: 16px;
47
+ height: 16px;
48
+ }
49
+ &_size_m {
50
+ min-width: 18px;
51
+ height: 18px;
52
+ }
53
+
54
+ &_state_running,
55
+ &_state_green {
56
+ background-color: var(--yc-color-base-positive-heavy);
57
+ }
58
+ &_state_yellow {
59
+ background-color: var(--yc-color-base-warning-heavy);
60
+ }
61
+ &_state_blue {
62
+ background-color: var(--yc-color-base-info-heavy);
63
+ }
64
+
65
+ &_state_red {
66
+ background: var(--yc-color-base-danger-heavy);
67
+ }
68
+ &_state_gray,
69
+ &_state_grey {
70
+ background: var(--yc-color-text-complementary);
71
+ }
72
+ &_state_orange {
73
+ background: var(--yc-color-text-warning-heavy);
74
+ }
75
+ }
76
+
77
+ &_size_m {
78
+ font-size: var(--yc-text-body2-font-size);
79
+ line-height: var(--yc-text-body2-line-height);
80
+ }
81
+ }
@@ -0,0 +1,149 @@
1
+ import React from 'react';
2
+ import cn from 'bem-cn-lite';
3
+ import PropTypes from 'prop-types';
4
+
5
+ import DataTable from '@yandex-cloud/react-data-table';
6
+
7
+ import InfoViewer from '../InfoViewer/InfoViewer';
8
+ import EntityStatus from '../EntityStatus/EntityStatus';
9
+ import ProgressViewer from '../ProgressViewer/ProgressViewer';
10
+ import Breadcrumbs from '../Breadcrumbs/Breadcrumbs';
11
+
12
+ import {stringifyVdiskId, formatStorageValues} from '../../utils';
13
+ import {PDISK_CATEGORIES} from '../../utils/constants';
14
+ import routes, {createHref} from '../../routes';
15
+
16
+ import './FullGroupViewer.scss';
17
+
18
+ const b = cn('full-group-viewer');
19
+
20
+ const tableSettings = {
21
+ displayIndices: false,
22
+ stickyHead: DataTable.FIXED,
23
+ syncHeadOnResize: true,
24
+ dynamicRender: true,
25
+ };
26
+
27
+ class FullGroupViewer extends React.Component {
28
+ static propTypes = {
29
+ className: PropTypes.string,
30
+ group: PropTypes.object.isRequired,
31
+ };
32
+
33
+ static defaultProps = {
34
+ className: '',
35
+ };
36
+
37
+ renderContent = () => {
38
+ const {group} = this.props;
39
+ const data = group.VDisks;
40
+ const columns = [
41
+ {
42
+ name: 'VDiskId',
43
+ header: 'VDisk',
44
+ render: ({value, row}) => (
45
+ <EntityStatus
46
+ status={row.Overall}
47
+ name={stringifyVdiskId(value)}
48
+ path={createHref(routes.vdisk, null, {
49
+ vdiskId: stringifyVdiskId(value),
50
+ })}
51
+ />
52
+ ),
53
+ },
54
+ {
55
+ name: 'pdisk',
56
+ header: 'PDisk',
57
+ // eslint-disable-next-line no-confusing-arrow
58
+ render: ({row}) =>
59
+ row.PDisk ? (
60
+ <EntityStatus
61
+ path={createHref(
62
+ routes.pdisk,
63
+ {id: row.PDisk.PDiskId},
64
+ {node_id: row.PDisk.NodeId},
65
+ )}
66
+ status={row.PDisk.Overall}
67
+ name={`${row.NodeId}-${row.PDisk.PDiskId}`}
68
+ />
69
+ ) : (
70
+ <div className="error">—</div>
71
+ ),
72
+ },
73
+ {
74
+ name: 'space',
75
+ header: 'Space',
76
+ width: '150px',
77
+ // eslint-disable-next-line no-confusing-arrow
78
+ render: ({row}) =>
79
+ row.PDisk ? (
80
+ <ProgressViewer
81
+ capacity={row.PDisk.TotalSize}
82
+ value={row.PDisk.TotalSize - row.PDisk.AvailableSize}
83
+ formatValues={formatStorageValues}
84
+ />
85
+ ) : (
86
+ <div className="error">—</div>
87
+ ),
88
+ },
89
+ {
90
+ name: 'category',
91
+ header: 'Category',
92
+ // eslint-disable-next-line no-confusing-arrow
93
+ render: ({row}) =>
94
+ row.PDisk ? (
95
+ PDISK_CATEGORIES[row.PDisk.Category]
96
+ ) : (
97
+ <div className="error">—</div>
98
+ ),
99
+ align: DataTable.RIGHT,
100
+ },
101
+ {
102
+ name: 'path',
103
+ header: 'Path',
104
+ // eslint-disable-next-line no-confusing-arrow
105
+ render: ({row}) => (row.PDisk ? row.PDisk.Path : <div className="error">—</div>),
106
+ },
107
+ {
108
+ name: 'guid',
109
+ header: 'Guid',
110
+ // eslint-disable-next-line no-confusing-arrow
111
+ render: ({row}) => (row.PDisk ? row.PDisk.Guid : <div className="error">—</div>),
112
+ align: DataTable.RIGHT,
113
+ },
114
+ ];
115
+
116
+ const groupInfo = [
117
+ {label: 'Generation', value: group.GroupGeneration},
118
+ {label: 'Latency', value: <EntityStatus status={group.Latency} />},
119
+ {label: 'Erasure', value: group.ErasureSpecies},
120
+ ];
121
+
122
+ const breadcrumbsItems = [{text: 'Database'}, {text: 'Storage Pool'}, {text: 'BS Group'}];
123
+
124
+ return (
125
+ <React.Fragment>
126
+ <Breadcrumbs items={breadcrumbsItems} />
127
+ <InfoViewer className={b('section')} info={groupInfo} title={'Info'} />
128
+ <DataTable
129
+ cls={b('disks')}
130
+ columns={columns}
131
+ data={data}
132
+ settings={tableSettings}
133
+ />
134
+ </React.Fragment>
135
+ );
136
+ };
137
+
138
+ render() {
139
+ const {className, group} = this.props;
140
+
141
+ return (
142
+ <div className={`${b()} ${className}`}>
143
+ {group ? this.renderContent() : <div className="error">no group data</div>}
144
+ </div>
145
+ );
146
+ }
147
+ }
148
+
149
+ export default FullGroupViewer;
@@ -0,0 +1,32 @@
1
+ @import '../../styles/mixins';
2
+
3
+ .full-group-viewer {
4
+ @include container-fluid();
5
+ @include flex-container();
6
+ overflow: auto;
7
+
8
+ &__section {
9
+ min-width: 315px;
10
+ display: inline-block;
11
+ margin-right: 40px;
12
+ border-radius: 5px;
13
+
14
+ .info-viewer__label {
15
+ min-width: 75px;
16
+ }
17
+ }
18
+
19
+ .info-viewer__items {
20
+ grid-template-columns: max-content;
21
+ }
22
+
23
+ .data-table {
24
+ margin-top: 50px;
25
+ @include flex-container();
26
+ overflow: auto;
27
+ }
28
+
29
+ .data-table__table {
30
+ width: 100%;
31
+ }
32
+ }
@@ -0,0 +1,108 @@
1
+ import React from 'react';
2
+ import cn from 'bem-cn-lite';
3
+ import PropTypes from 'prop-types';
4
+
5
+ import InfoViewer from '../InfoViewer/InfoViewer';
6
+ import EntityStatus from '../EntityStatus/EntityStatus';
7
+ import ProgressViewer from '../ProgressViewer/ProgressViewer';
8
+ import PoolUsage from '../PoolUsage/PoolUsage';
9
+ import Tags from '../Tags/Tags';
10
+ import Icon from '../Icon/Icon';
11
+
12
+ import {LOAD_AVERAGE_TIME_INTERVALS} from '../../utils/constants';
13
+ import {calcUptime} from '../../utils';
14
+
15
+ import './FullNodeViewer.scss';
16
+
17
+ const b = cn('full-node-viewer');
18
+
19
+ class FullNodeViewer extends React.Component {
20
+ static propTypes = {
21
+ className: PropTypes.string,
22
+ node: PropTypes.object.isRequired,
23
+ backend: PropTypes.string,
24
+ singleClusterMode: PropTypes.bool,
25
+ additionalNodesInfo: PropTypes.object,
26
+ };
27
+
28
+ static defaultProps = {
29
+ className: '',
30
+ };
31
+
32
+ render() {
33
+ const {node, className, additionalNodesInfo={}} = this.props;
34
+ const nodeHref = additionalNodesInfo.getNodeRef
35
+ ? additionalNodesInfo.getNodeRef(node)
36
+ : undefined;
37
+
38
+ const commonInfo = [
39
+ {label: 'Version', value: node.Version},
40
+ {label: 'Uptime', value: calcUptime(node.StartTime)},
41
+ {label: 'DC', value: node.DataCenterDescription},
42
+ {label: 'Rack', value: node.Rack},
43
+ ];
44
+
45
+ const averageInfo = node.LoadAverage.map((load, loadIndex) => ({
46
+ label: LOAD_AVERAGE_TIME_INTERVALS[`${loadIndex}`],
47
+ value: <ProgressViewer value={load} percents={true} colorizeProgress={true} />,
48
+ }));
49
+
50
+ return (
51
+ <div className={`${b()} ${className}`}>
52
+ {node ? (
53
+ <div>
54
+ <div className={b('row')}>
55
+ <div className={b('title')}>Node</div>
56
+ <EntityStatus status={node.SystemState} name={node.Host} />
57
+ {nodeHref && (
58
+ <a
59
+ rel="noopener noreferrer"
60
+ className={b('link', {external: true})}
61
+ href={nodeHref}
62
+ target="_blank"
63
+ >
64
+ <Icon name="external" />
65
+ </a>
66
+ )}
67
+
68
+ <div className={b('row', {id: true})}>
69
+ <label className={b('label', {id: true})}>NodeID</label>
70
+ <label>{node.NodeId}</label>
71
+ </div>
72
+
73
+ <Tags tags={[node.DataCenter]} />
74
+ <Tags tags={node.Roles} tagsType="blue" />
75
+ </div>
76
+
77
+ <div className={b('common-info')}>
78
+ <div>
79
+ <div className={b('section-title')}>Pools</div>
80
+ <div className={b('section', {pools: true})}>
81
+ {node.PoolStats.map((pool, poolIndex) => (
82
+ <PoolUsage key={poolIndex} data={pool} />
83
+ ))}
84
+ </div>
85
+ </div>
86
+
87
+ <InfoViewer
88
+ title="Common info"
89
+ className={b('section')}
90
+ info={commonInfo}
91
+ />
92
+
93
+ <InfoViewer
94
+ title="Load average"
95
+ className={b('section', {average: true})}
96
+ info={averageInfo}
97
+ />
98
+ </div>
99
+ </div>
100
+ ) : (
101
+ <div className="error">no data</div>
102
+ )}
103
+ </div>
104
+ );
105
+ }
106
+ }
107
+
108
+ export default FullNodeViewer;
@@ -0,0 +1,78 @@
1
+ @import '../../styles/mixins.scss';
2
+
3
+ .full-node-viewer {
4
+ @include container-fluid();
5
+ font-size: var(--yc-text-body2-font-size);
6
+ line-height: var(--yc-text-body2-line-height);
7
+
8
+ &__title {
9
+ font-size: var(--yc-text-body2-font-size);
10
+ line-height: var(--yc-text-body2-line-height);
11
+ margin: 0 20px 0 0;
12
+ font-weight: 500;
13
+ text-transform: uppercase;
14
+ }
15
+
16
+ &__row {
17
+ display: flex;
18
+ align-items: center;
19
+ margin: 15px 0;
20
+
21
+ &_id {
22
+ margin: 0 15px 0 24px;
23
+ }
24
+ }
25
+
26
+ &__common-info {
27
+ display: flex;
28
+ align-items: stretch;
29
+ justify-content: flex-start;
30
+ }
31
+
32
+ &__section {
33
+ padding: 15px;
34
+ margin-right: 20px;
35
+ border-radius: 10px;
36
+
37
+ &_pools {
38
+ padding: 15px 15px 15px 0;
39
+ display: grid;
40
+ grid-template-columns: 110px 110px;
41
+ grid-gap: 7px 20px;
42
+ }
43
+ }
44
+
45
+ .info-viewer__label {
46
+ min-width: 60px;
47
+ }
48
+
49
+ &__label {
50
+ color: var(--yc-color-text-hint);
51
+ font-size: var(--yc-text-body2-font-size);
52
+ min-width: 100px;
53
+ margin-right: 25px;
54
+ line-height: 18px;
55
+ white-space: nowrap;
56
+
57
+ .yc-root_theme_dark & {
58
+ color: var(--yc-color-text-hint);
59
+ }
60
+
61
+ &_id {
62
+ min-width: auto;
63
+ margin-right: 10px;
64
+ }
65
+ }
66
+
67
+ &__section-title {
68
+ font-size: var(--yc-text-body2-font-size);
69
+ line-height: var(--yc-text-body2-line-height);
70
+ margin: 15px 0 0 0;
71
+ font-weight: 500;
72
+ }
73
+
74
+ &__link {
75
+ margin-left: 5px;
76
+ @extend .link;
77
+ }
78
+ }
@@ -0,0 +1,86 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import cn from 'bem-cn-lite';
4
+ import {withRouter} from 'react-router';
5
+
6
+ import GroupViewer from '../GroupViewer/GroupViewer';
7
+ import PDiskViewer from '../PDiskViewer/PDiskViewer';
8
+ import EntityStatus from '../EntityStatus/EntityStatus';
9
+ import TreeView from '../TreeView/TreeView';
10
+ import {stringifyVdiskId} from '../../utils';
11
+ import routes, {createHref} from '../../routes';
12
+ import {backend} from '../../store';
13
+
14
+ import './GroupTreeViewer.scss';
15
+
16
+ const b = cn('group-tree-viewer');
17
+
18
+ class GroupTreeViewer extends React.Component {
19
+ static propTypes = {
20
+ group: PropTypes.object.isRequired,
21
+ collapsed: PropTypes.bool,
22
+ onClick: PropTypes.func,
23
+ };
24
+
25
+ static ITEM_HEIGHT_COLLAPSED = 38;
26
+ static GROUP_ITEM_HEIGHT = 34;
27
+
28
+ static makeGetHeight = (groups, extendedGroups) => (index) => {
29
+ const {VDisks} = groups[index];
30
+ const countVDisks = VDisks?.length;
31
+ const parentHeight = GroupTreeViewer.ITEM_HEIGHT_COLLAPSED;
32
+ const childHeight = GroupTreeViewer.GROUP_ITEM_HEIGHT;
33
+
34
+ if (extendedGroups.has(index)) {
35
+ return parentHeight + countVDisks * childHeight;
36
+ }
37
+
38
+ return parentHeight;
39
+ };
40
+
41
+ render() {
42
+ const {group, collapsed, onClick} = this.props;
43
+ const label2 = (
44
+ <div>
45
+ <GroupViewer key={group.GroupID} group={group} />
46
+ </div>
47
+ );
48
+ if (group && Object.keys(group).length) {
49
+ return (
50
+ <div className={b()}>
51
+ <TreeView
52
+ key={group.GroupID}
53
+ nodeLabel={label2}
54
+ collapsed={collapsed}
55
+ onClick={onClick}
56
+ >
57
+ {group.VDisks?.map((disk, diskIndex) => (
58
+ <div key={diskIndex} className={b('row')}>
59
+ <EntityStatus
60
+ className={b('disk')}
61
+ status={disk.Overall}
62
+ name={stringifyVdiskId(disk.VDiskId)}
63
+ label="VDiskID"
64
+ path={createHref(routes.vdisk, null, {
65
+ vdiskId: stringifyVdiskId(disk.VDiskId),
66
+ })}
67
+ />
68
+
69
+ <PDiskViewer
70
+ className={b('disk')}
71
+ disk={disk.PDisk}
72
+ key={disk.Guid}
73
+ backend={backend}
74
+ />
75
+ </div>
76
+ ))}
77
+ </TreeView>
78
+ </div>
79
+ );
80
+ } else {
81
+ return <div className={b()}>No data</div>;
82
+ }
83
+ }
84
+ }
85
+
86
+ export default withRouter(GroupTreeViewer);
@@ -0,0 +1,17 @@
1
+ @import '../../styles/react-treeview';
2
+
3
+ .group-tree-viewer {
4
+ &__row {
5
+ display: flex;
6
+ align-items: center;
7
+ height: 34px;
8
+ }
9
+
10
+ &__disk {
11
+ margin: 8px 10px 8px 20px;
12
+ }
13
+
14
+ &__vdisk {
15
+ margin-right: 25px;
16
+ }
17
+ }
@@ -0,0 +1,100 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import cn from 'bem-cn-lite';
4
+
5
+ import EntityStatus from '../EntityStatus/EntityStatus';
6
+ import ProgressViewer from '../ProgressViewer/ProgressViewer';
7
+
8
+ import routes, {createHref} from '../../routes';
9
+ import {formatStorageValues, formatThroughput, formatIOPS} from '../../utils';
10
+
11
+ import './GroupViewer.scss';
12
+
13
+ const b = cn('group-viewer');
14
+
15
+ class GroupViewer extends React.Component {
16
+ static propTypes = {
17
+ group: PropTypes.object.isRequired,
18
+ className: PropTypes.string,
19
+ };
20
+
21
+ static defaultProps = {
22
+ className: '',
23
+ };
24
+
25
+ render() {
26
+ const {group, className} = this.props;
27
+ const {
28
+ GroupID = 'no id',
29
+ Overall = 'gray',
30
+ VDisks,
31
+ ErasureSpecies,
32
+ Latency = 'gray',
33
+ AcquiredIOPS,
34
+ AcquiredSize,
35
+ AcquiredThroughput,
36
+ MaximumIOPS,
37
+ MaximumSize,
38
+ MaximumThroughput,
39
+ } = group;
40
+ if (group && Object.keys(group).length) {
41
+ return (
42
+ <div className={`${b()} ${className}`}>
43
+ <div className={b('group')}>
44
+ <EntityStatus
45
+ name={GroupID}
46
+ status={Overall}
47
+ path={createHref(routes.group, {id: GroupID})}
48
+ className={b('name')}
49
+ />
50
+ </div>
51
+
52
+ <div className={b('latency')}>
53
+ <EntityStatus name="Latency" status={Latency} />
54
+ </div>
55
+
56
+ <div className={b('label')}>{(VDisks && VDisks.length) || 0} Vdisks</div>
57
+ <div className={b('label')}>{ErasureSpecies || 'no ErasureSpecies info'}</div>
58
+ <div className={b('vdisks')}>
59
+ {VDisks?.map((disk) => (
60
+ <div key={disk.Guid} className={b('disk-overall')}>
61
+ <EntityStatus status={disk.Overall} />
62
+ </div>
63
+ ))}
64
+ </div>
65
+
66
+ <div className={b('progress')}>
67
+ <ProgressViewer
68
+ value={AcquiredSize}
69
+ capacity={MaximumSize}
70
+ colorizeProgress={true}
71
+ formatValues={formatStorageValues}
72
+ />
73
+ </div>
74
+
75
+ <div className={b('progress')}>
76
+ <ProgressViewer
77
+ value={AcquiredIOPS}
78
+ capacity={MaximumIOPS}
79
+ colorizeProgress={true}
80
+ formatValues={formatIOPS}
81
+ />
82
+ </div>
83
+
84
+ <div className={b('progress')}>
85
+ <ProgressViewer
86
+ value={AcquiredThroughput}
87
+ capacity={MaximumThroughput}
88
+ colorizeProgress={true}
89
+ formatValues={formatThroughput}
90
+ />
91
+ </div>
92
+ </div>
93
+ );
94
+ } else {
95
+ return <div className={b()}>No data</div>;
96
+ }
97
+ }
98
+ }
99
+
100
+ export default GroupViewer;
@@ -0,0 +1,41 @@
1
+ .group-viewer {
2
+ display: flex;
3
+ align-items: center;
4
+ &__group {
5
+ margin-right: 20px;
6
+ }
7
+
8
+ &__label {
9
+ color: var(--yc-color-text-complementary);
10
+ font-size: var(--yc-text-body-font-size);
11
+ margin-right: 20px;
12
+ }
13
+
14
+ &__name {
15
+ color: var(--yc-color-base-special);
16
+ text-decoration: none;
17
+ display: inline-block;
18
+
19
+ &:before {
20
+ transform: translateY(3px);
21
+ }
22
+ }
23
+
24
+ &__latency {
25
+ margin-right: 20px;
26
+ }
27
+
28
+ &__vdisks {
29
+ display: flex;
30
+ }
31
+
32
+ &__disk-overall {
33
+ .entity-status:before {
34
+ margin-right: 5px;
35
+ }
36
+ }
37
+
38
+ &__progress {
39
+ margin-right: 10px;
40
+ }
41
+ }