ydb-embedded-ui 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +2 -2
  4. package/dist/assets/icons/cluster.svg +1 -0
  5. package/dist/assets/icons/hide.svg +1 -0
  6. package/dist/assets/icons/show.svg +1 -0
  7. package/dist/assets/icons/user-check.svg +1 -1
  8. package/dist/assets/icons/user-secret.svg +1 -1
  9. package/dist/components/AsideNavigation/AsideHeader.scss +1 -2
  10. package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.scss +7 -7
  11. package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.scss +2 -2
  12. package/dist/components/AsideNavigation/CompositeBar/CompositeBar.scss +6 -6
  13. package/dist/components/AsideNavigation/Drawer/Drawer.scss +5 -5
  14. package/dist/components/AsideNavigation/Logo/Logo.scss +3 -4
  15. package/dist/components/AsideNavigation/Settings/Settings.scss +27 -12
  16. package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.scss +14 -6
  17. package/dist/components/Breadcrumbs/Breadcrumbs.scss +2 -1
  18. package/dist/components/ClusterInfo/ClusterInfo.scss +19 -12
  19. package/dist/components/ClusterInfo/ClusterInfo.tsx +110 -10
  20. package/dist/components/CopyToClipboard/CopyToClipboard.tsx +39 -0
  21. package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +5 -4
  22. package/dist/components/Divider/Divider.scss +7 -0
  23. package/dist/components/Divider/Divider.tsx +11 -0
  24. package/dist/components/EmptyState/EmptyState.scss +14 -10
  25. package/dist/components/EnableFullscreenButton/EnableFullscreenButton.tsx +22 -0
  26. package/dist/components/EntityStatus/EntityStatus.js +5 -3
  27. package/dist/components/EntityStatus/EntityStatus.scss +35 -13
  28. package/dist/components/FullGroupViewer/FullGroupViewer.js +2 -4
  29. package/dist/components/FullGroupViewer/FullGroupViewer.scss +6 -3
  30. package/dist/components/FullNodeViewer/FullNodeViewer.scss +19 -11
  31. package/dist/components/Fullscreen/Fullscreen.scss +28 -0
  32. package/dist/components/Fullscreen/Fullscreen.tsx +81 -0
  33. package/dist/components/GroupTreeViewer/GroupTreeViewer.scss +1 -0
  34. package/dist/components/GroupViewer/GroupViewer.scss +8 -4
  35. package/dist/components/Icon/Icon.js +2 -0
  36. package/dist/components/InfoViewer/InfoViewer.scss +22 -16
  37. package/dist/components/NodesViewer/NodesViewer.js +25 -35
  38. package/dist/components/NodesViewer/NodesViewer.scss +15 -11
  39. package/dist/components/PDiskViewer/PDiskViewer.scss +10 -4
  40. package/dist/components/Pagination/Pagination.scss +6 -3
  41. package/dist/components/PoolBar/PoolBar.scss +14 -10
  42. package/dist/components/PoolUsage/PoolUsage.scss +17 -9
  43. package/dist/components/ProgressViewer/ProgressViewer.js +1 -1
  44. package/dist/components/ProgressViewer/ProgressViewer.scss +28 -18
  45. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.scss +14 -0
  46. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.tsx +29 -0
  47. package/dist/components/SplitPane/SplitPane.scss +33 -40
  48. package/dist/components/SplitPane/SplitPane.tsx +94 -0
  49. package/dist/components/Tablet/Tablet.scss +9 -6
  50. package/dist/components/TabletsOverall/TabletsOverall.scss +19 -0
  51. package/dist/components/TabletsOverall/TabletsOverall.tsx +105 -0
  52. package/dist/components/TabletsStatistic/TabletsStatistic.scss +24 -18
  53. package/dist/components/TabletsViewer/TabletsViewer.scss +12 -9
  54. package/dist/components/Tag/Tag.scss +6 -4
  55. package/dist/components/Tags/Tags.scss +1 -1
  56. package/dist/components/TreeView/TreeView.js +1 -1
  57. package/dist/components/TreeView/TreeView.scss +9 -0
  58. package/dist/components/TruncatedQuery/TruncatedQuery.scss +4 -3
  59. package/dist/containers/App/App.js +1 -0
  60. package/dist/containers/App/App.scss +50 -31
  61. package/dist/containers/App/Content.js +2 -2
  62. package/dist/containers/App/NodesTable.scss +25 -0
  63. package/dist/containers/App/TipPopup/TipPopup.scss +10 -6
  64. package/dist/containers/AppIcons/AppIcons.js +46 -22
  65. package/dist/containers/AsideNavigation/AsideNavigation.scss +1 -1
  66. package/dist/containers/AsideNavigation/AsideNavigation.tsx +12 -5
  67. package/dist/containers/Authentication/Authentication.scss +63 -14
  68. package/dist/containers/Authentication/Authentication.tsx +42 -9
  69. package/dist/containers/Cluster/Cluster.scss +5 -3
  70. package/dist/containers/Cluster/Cluster.tsx +49 -0
  71. package/dist/containers/Group/Group.scss +1 -1
  72. package/dist/containers/Header/Header.scss +15 -59
  73. package/dist/containers/Header/Header.tsx +75 -0
  74. package/dist/containers/Header/Host/Host.scss +10 -3
  75. package/dist/containers/Heatmap/Heatmap.js +1 -1
  76. package/dist/containers/Heatmap/Heatmap.scss +16 -7
  77. package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +3 -3
  78. package/dist/containers/Heatmap/Histogram/Histogram.scss +21 -9
  79. package/dist/containers/Node/Node.js +1 -1
  80. package/dist/containers/Node/Node.scss +6 -4
  81. package/dist/containers/Nodes/Nodes.js +28 -27
  82. package/dist/containers/Nodes/Nodes.scss +5 -17
  83. package/dist/containers/Pdisk/Pdisk.scss +6 -4
  84. package/dist/containers/Pool/Pool.scss +7 -4
  85. package/dist/containers/ReduxTooltip/ReduxTooltip.scss +5 -1
  86. package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.scss +77 -0
  87. package/dist/containers/{StorageV2 → Storage}/DiskStateProgressBar/DiskStateProgressBar.tsx +1 -1
  88. package/dist/containers/{StorageV2 → Storage}/Pdisk/Pdisk.scss +6 -4
  89. package/dist/containers/{StorageV2 → Storage}/Pdisk/Pdisk.tsx +1 -2
  90. package/dist/containers/{StorageV2 → Storage}/Storage.js +72 -34
  91. package/dist/containers/{StorageV2 → Storage}/Storage.scss +12 -14
  92. package/dist/containers/{StorageV2 → Storage}/StorageFilter/StorageFilter.js +1 -9
  93. package/dist/containers/{StorageV2 → Storage}/StorageGroups/StorageGroups.scss +2 -0
  94. package/dist/containers/{StorageV2 → Storage}/StorageGroups/StorageGroups.tsx +1 -1
  95. package/dist/containers/{StorageV2 → Storage}/StorageNodes/StorageNodes.scss +2 -0
  96. package/dist/containers/{StorageV2 → Storage}/StorageNodes/StorageNodes.tsx +1 -1
  97. package/dist/containers/{StorageV2 → Storage}/Vdisk/Vdisk.js +0 -0
  98. package/dist/containers/{StorageV2 → Storage}/Vdisk/Vdisk.scss +6 -4
  99. package/dist/containers/Tablet/Tablet.scss +13 -9
  100. package/dist/containers/Tablets/Tablets.js +21 -90
  101. package/dist/containers/Tablets/Tablets.scss +9 -35
  102. package/dist/containers/TabletsFilters/TabletsFilters.js +2 -75
  103. package/dist/containers/TabletsFilters/TabletsFilters.scss +15 -35
  104. package/dist/containers/Tenant/Acl/Acl.js +54 -47
  105. package/dist/containers/Tenant/Acl/Acl.scss +15 -4
  106. package/dist/containers/Tenant/{Compute → Diagnostics/Compute}/Compute.js +35 -12
  107. package/dist/containers/Tenant/Diagnostics/Compute/Compute.scss +14 -0
  108. package/dist/containers/Tenant/{Describe → Diagnostics/Describe}/Describe.js +50 -1
  109. package/dist/containers/Tenant/{Describe → Diagnostics/Describe}/Describe.scss +5 -3
  110. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +27 -0
  111. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +88 -0
  112. package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +50 -0
  113. package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +208 -0
  114. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +75 -0
  115. package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.js +191 -0
  116. package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss +79 -0
  117. package/dist/containers/Tenant/{Healthcheck → Diagnostics/Healthcheck}/IssuesViewer/IssueViewer.scss +25 -13
  118. package/dist/containers/Tenant/{Healthcheck → Diagnostics/Healthcheck}/IssuesViewer/IssuesViewer.js +2 -2
  119. package/dist/containers/Tenant/{Schema → Diagnostics}/HotKeys/HotKeys.js +14 -8
  120. package/dist/containers/Tenant/{Schema → Diagnostics}/HotKeys/HotKeys.scss +7 -5
  121. package/dist/containers/Tenant/{Network → Diagnostics/Network}/Network.js +39 -9
  122. package/dist/containers/Tenant/{Network → Diagnostics/Network}/Network.scss +35 -36
  123. package/dist/containers/Tenant/{Network → Diagnostics/Network}/NodeNetwork/NodeNetwork.js +0 -0
  124. package/dist/containers/Tenant/{Network → Diagnostics/Network}/NodeNetwork/NodeNetwork.scss +11 -9
  125. package/dist/containers/Tenant/Diagnostics/Overview/Overview.scss +13 -0
  126. package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +123 -0
  127. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +200 -0
  128. package/dist/{components → containers/Tenant/Diagnostics}/TenantOverview/TenantOverview.scss +24 -17
  129. package/dist/containers/Tenant/{TopQueries → Diagnostics/TopQueries}/TopQueries.js +32 -30
  130. package/dist/containers/Tenant/{TopQueries → Diagnostics/TopQueries}/TopQueries.scss +10 -9
  131. package/dist/containers/Tenant/{TopShards → Diagnostics/TopShards}/TopShards.js +25 -29
  132. package/dist/containers/Tenant/{TopShards → Diagnostics/TopShards}/TopShards.scss +1 -13
  133. package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.scss +38 -0
  134. package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +104 -0
  135. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +165 -0
  136. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +310 -0
  137. package/dist/containers/Tenant/Preview/Preview.js +50 -12
  138. package/dist/containers/Tenant/Preview/Preview.scss +45 -3
  139. package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.scss +85 -0
  140. package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.tsx +94 -0
  141. package/dist/containers/Tenant/QueryEditor/QueryEditor.js +291 -264
  142. package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +47 -18
  143. package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +132 -32
  144. package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.scss +47 -11
  145. package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +89 -20
  146. package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss +60 -6
  147. package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.js +10 -23
  148. package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.scss +15 -7
  149. package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +7 -3
  150. package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.scss +28 -17
  151. package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.js +7 -7
  152. package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.scss +1 -11
  153. package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.js +37 -17
  154. package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.scss +33 -12
  155. package/dist/containers/Tenant/Schema/SchemaNodeActions/SchemaNodeActions.scss +17 -0
  156. package/dist/containers/Tenant/Schema/SchemaNodeActions/SchemaNodeActions.tsx +125 -0
  157. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +5 -4
  158. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.scss +6 -2
  159. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +53 -34
  160. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.scss +1 -22
  161. package/dist/containers/Tenant/Tenant.scss +3 -32
  162. package/dist/containers/Tenant/Tenant.tsx +161 -0
  163. package/dist/containers/Tenant/TenantPages.tsx +48 -0
  164. package/dist/containers/Tenant/utils/ToggleButton.scss +26 -0
  165. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx +126 -0
  166. package/dist/containers/Tenants/Tenants.js +41 -55
  167. package/dist/containers/Tenants/Tenants.scss +4 -17
  168. package/dist/containers/UserSettings/UserSettings.tsx +0 -2
  169. package/dist/containers/Vdisk/Vdisk.scss +6 -4
  170. package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +1 -1
  171. package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.scss +5 -5
  172. package/dist/{routes.js → routes.ts} +14 -4
  173. package/dist/store/reducers/clusterNodes.js +1 -1
  174. package/dist/store/reducers/fullscreen.ts +31 -0
  175. package/dist/store/reducers/header.ts +23 -0
  176. package/dist/store/reducers/hotKeys.js +1 -1
  177. package/dist/store/reducers/index.js +6 -0
  178. package/dist/store/reducers/saveQuery.ts +33 -0
  179. package/dist/store/reducers/schema.js +14 -0
  180. package/dist/store/reducers/shardsWorkload.js +1 -1
  181. package/dist/store/state-url-mapping.js +1 -1
  182. package/dist/store/utils.js +2 -6
  183. package/dist/styles/mixins.scss +49 -34
  184. package/dist/utils/autofetcher.ts +51 -0
  185. package/dist/utils/constants.js +25 -7
  186. package/dist/utils/createToast.tsx +23 -0
  187. package/dist/utils/getNodesColumns.js +25 -28
  188. package/dist/utils/index.js +6 -2
  189. package/package.json +8 -4
  190. package/dist/components/SplitPane/SplitPane.js +0 -368
  191. package/dist/components/TenantOverview/TenantOverview.js +0 -148
  192. package/dist/containers/Cluster/Cluster.js +0 -168
  193. package/dist/containers/Header/Header.js +0 -88
  194. package/dist/containers/StorageV2/DiskStateProgressBar/DiskStateProgressBar.scss +0 -81
  195. package/dist/containers/Tenant/Compute/Compute.scss +0 -6
  196. package/dist/containers/Tenant/Healthcheck/Healthcheck.js +0 -116
  197. package/dist/containers/Tenant/Healthcheck/Healthcheck.scss +0 -64
  198. package/dist/containers/Tenant/Schema/Info/Info.js +0 -84
  199. package/dist/containers/Tenant/Schema/Info/Info.scss +0 -3
  200. package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.js +0 -439
  201. package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.scss +0 -90
  202. package/dist/containers/Tenant/Schema/SchemaPages.js +0 -56
  203. package/dist/containers/Tenant/Tenant.js +0 -199
  204. package/dist/containers/Tenant/TenantPages.js +0 -35
@@ -1,88 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import {connect} from 'react-redux';
4
- import cn from 'bem-cn-lite';
5
- import {withRouter} from 'react-router-dom';
6
-
7
- import Host from '../../containers/Header/Host/Host';
8
-
9
- import {backend, clusterName as clusterNameLocation} from '../../store';
10
- import {getHostInfo} from '../../store/reducers/host';
11
- import {getClusterInfo} from '../../store/reducers/cluster';
12
- import {setSettingValue, getSettingValue} from '../../store/reducers/settings';
13
- import {THEME_KEY} from '../../utils/constants';
14
-
15
- import './Header.scss';
16
-
17
- const b = cn('header');
18
-
19
- const ClusterName = ({name}) => (
20
- <div className={b('cluster-info')}>
21
- <div className={b('cluster-info-title')}>cluster</div>
22
- <div className={b('cluster-info-name')}>{name}</div>
23
- </div>
24
- );
25
- ClusterName.propTypes = {
26
- name: PropTypes.string,
27
- };
28
-
29
- class Header extends React.Component {
30
- static propTypes = {
31
- getHostInfo: PropTypes.func,
32
- host: PropTypes.object,
33
- pathname: PropTypes.string,
34
- clusterName: PropTypes.string,
35
- theme: PropTypes.string,
36
- setSettingValue: PropTypes.func,
37
- getSettingValue: PropTypes.func,
38
- getClusterInfo: PropTypes.func,
39
- singleClusterMode: PropTypes.bool,
40
- };
41
- componentDidMount() {
42
- const {pathname, clusterName, singleClusterMode} = this.props;
43
- const isClustersPage = pathname.includes('/clusters');
44
-
45
- if (!isClustersPage && !clusterName && !singleClusterMode) {
46
- this.props.getClusterInfo(clusterNameLocation);
47
- }
48
- this.props.getHostInfo();
49
- }
50
- render() {
51
- const {host, clusterName: clusterNameWeb, singleClusterMode} = this.props;
52
- const clusterName = singleClusterMode ? host.ClusterName : clusterNameWeb;
53
-
54
- return (
55
- <header className={b()}>
56
- <div className={b('content')}>
57
- {clusterName && <ClusterName name={clusterName} />}
58
- </div>
59
- {host.Host && (
60
- <Host host={host} backend={backend} singleClusterMode={singleClusterMode} />
61
- )}
62
- </header>
63
- );
64
- }
65
- }
66
-
67
- const mapStateToProps = (state, ownProps) => {
68
- const {singleClusterMode} = state;
69
- const {data: host} = state.host;
70
- const {pathname} = ownProps.location;
71
-
72
- return {
73
- singleClusterMode,
74
- host,
75
- pathname,
76
- theme: getSettingValue(state, THEME_KEY),
77
- clusterName: state.cluster.data?.Name || state.clusterInfo.title,
78
- };
79
- };
80
-
81
- const mapDispatchToProps = {
82
- getHostInfo,
83
- setSettingValue,
84
- getClusterInfo,
85
- };
86
-
87
- const ConnectedHeader = connect(mapStateToProps, mapDispatchToProps)(Header);
88
- export default withRouter(ConnectedHeader);
@@ -1,81 +0,0 @@
1
- .storage-disk-progress-bar {
2
- $block: &;
3
- position: relative;
4
-
5
- display: inline-block;
6
-
7
- width: 100%;
8
- height: var(--yc-text-body2-line-height);
9
-
10
- border: 1px solid var(--yc-color-infographics-misc-heavy);
11
- border-radius: 5px;
12
- background-color: var(--yc-color-infographics-misc-medium);
13
-
14
- #{$block}__filled {
15
- filter: brightness(0.3) saturate(3);
16
- }
17
-
18
- &_green {
19
- border-color: var(--yc-color-text-positive);
20
- background-color: var(--yc-color-text-positive);
21
- filter: opacity(0.8);
22
- }
23
-
24
- &_blue {
25
- border-color: var(--yc-color-infographics-info-heavy);
26
- background-color: var(--yc-color-infographics-info-medium);
27
- #{$block}__filled {
28
- filter: brightness(0.2) saturate(3);
29
- }
30
- }
31
-
32
- &_yellow {
33
- border-color: var(--yc-color-base-warning-heavy-hover);
34
- background-color: var(--yc-color-base-warning-heavy);
35
- filter: opacity(0.8);
36
- }
37
-
38
- &_orange {
39
- border-color: var(--yc-color-infographics-danger-medium);
40
- background-color: var(--yc-color-infographics-warning-medium);
41
- filter: opacity(0.8);
42
- #{$block}__filled {
43
- filter: brightness(0.7) saturate(3);
44
- }
45
- }
46
- &_red {
47
- border-color: var(--yc-color-base-danger-heavy-hover);
48
- background-color: var(--yc-color-base-danger-heavy);
49
- filter: opacity(0.8);
50
- #{$block}__filled {
51
- filter: brightness(0.3) saturate(4);
52
- }
53
- }
54
-
55
- &__filled {
56
- position: absolute;
57
- top: 0;
58
- left: 0;
59
-
60
- height: 100%;
61
-
62
- border-radius: 5px 0 0 5px;
63
- background-color: inherit;
64
- filter: brightness(0.6) saturate(2);
65
- }
66
- &__filled-title {
67
- position: absolute;
68
- top: 0;
69
- left: 5px;
70
-
71
- color: inherit;
72
-
73
- font-size: var(--yc-text-body-font-size);
74
- line-height: inherit;
75
- &_light {
76
- z-index: 100;
77
-
78
- color: var(--yc-color-text-light-primary);
79
- }
80
- }
81
- }
@@ -1,6 +0,0 @@
1
- @import '../../../styles/mixins.scss';
2
-
3
- .compute {
4
- @include flex-container();
5
- overflow: auto;
6
- }
@@ -1,116 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import {connect} from 'react-redux';
4
- import cn from 'bem-cn-lite';
5
-
6
- import {Loader, Button} from '@yandex-cloud/uikit';
7
-
8
- import IssuesViewer from './IssuesViewer/IssuesViewer';
9
-
10
- import {getHealthcheckInfo} from '../../../store/reducers/healthcheckInfo';
11
-
12
- import './Healthcheck.scss';
13
-
14
- const b = cn('healthcheck');
15
-
16
- class Healthcheck extends React.Component {
17
- static propTypes = {
18
- data: PropTypes.object,
19
- loading: PropTypes.bool,
20
- error: PropTypes.object,
21
- getHealthcheckInfo: PropTypes.func,
22
- tenant: PropTypes.string,
23
- };
24
-
25
- componentDidMount() {
26
- this.fetchHealthcheck();
27
- }
28
-
29
- fetchHealthcheck = () => {
30
- const {tenant} = this.props;
31
- this.props.getHealthcheckInfo(tenant);
32
- };
33
-
34
- renderLoader() {
35
- return (
36
- <div className="loader">
37
- <Loader size="l" />
38
- </div>
39
- );
40
- }
41
-
42
- renderOverviewStatus = () => {
43
- const {data} = this.props;
44
- const {self_check_result: selfCheckResult} = data;
45
- const modifier = selfCheckResult.toLowerCase();
46
-
47
- return (
48
- <div className={b('self-check-status')}>
49
- <h3 className={b('self-check-status-label')}>Self check status</h3>
50
- <div className={b('self-check-status-indicator', {[modifier]: true})} />
51
- {selfCheckResult}
52
- <div className={b('self-check-update')}>
53
- <Button size="s" onClick={this.fetchHealthcheck}>
54
- Update
55
- </Button>
56
- </div>
57
- </div>
58
- );
59
- };
60
-
61
- renderHealthcheckIssues() {
62
- const {data, showTooltip, hideTooltip} = this.props;
63
- const {issue_log: issueLog} = data;
64
-
65
- if (!issueLog) {
66
- return null;
67
- }
68
-
69
- return (
70
- <div className={b('issues')}>
71
- <h3>Issues</h3>
72
- <IssuesViewer
73
- issues={issueLog}
74
- showTooltip={showTooltip}
75
- hideTooltip={hideTooltip}
76
- />
77
- </div>
78
- );
79
- }
80
-
81
- render() {
82
- const {loading, error, data} = this.props;
83
-
84
- if (loading) {
85
- return this.renderLoader();
86
- } else if (error) {
87
- return <div>{error.statusText}</div>;
88
- } else if (data && data['self_check_result']) {
89
- return (
90
- <div className={b()}>
91
- {this.renderOverviewStatus()}
92
- {this.renderHealthcheckIssues()}
93
- </div>
94
- );
95
- } else {
96
- return <div className="error">no healthcheck data</div>;
97
- }
98
- }
99
- }
100
-
101
- function mapStateToProps(state) {
102
- const {data, loading, wasLoaded, error} = state.healthcheckInfo;
103
-
104
- return {
105
- data,
106
- loading,
107
- wasLoaded,
108
- error,
109
- };
110
- }
111
-
112
- const mapDispatchToProps = {
113
- getHealthcheckInfo,
114
- };
115
-
116
- export default connect(mapStateToProps, mapDispatchToProps)(Healthcheck);
@@ -1,64 +0,0 @@
1
- @import '../../../styles/mixins.scss';
2
-
3
- .healthcheck {
4
- padding: 25px 20px 20px 20px;
5
-
6
- &__message-container {
7
- padding: 15px 0;
8
- }
9
-
10
- &__loader-container {
11
- display: flex;
12
- justify-content: center;
13
- align-items: center;
14
- height: 100%;
15
- }
16
-
17
- &__self-check-status {
18
- display: flex;
19
- align-items: center;
20
- margin-bottom: 20px;
21
- }
22
-
23
- &__self-check-status-label {
24
- margin: 0 10px 0 0;
25
- }
26
-
27
- &__self-check-update {
28
- margin-left: 20px;
29
- }
30
-
31
- &__self-check-status-indicator {
32
- width: 16px;
33
- height: 16px;
34
- border-radius: 4px;
35
- margin-right: 4px;
36
-
37
- &_good,
38
- &_green {
39
- background-color: var(--yc-color-base-positive-heavy);
40
- }
41
- &_degraded,
42
- &_yellow {
43
- background-color: var(--yc-color-base-warning-heavy);
44
- }
45
-
46
- &_blue {
47
- background-color: var(--yc-color-base-info-heavy);
48
- }
49
-
50
- &_emergency,
51
- &_red {
52
- background: var(--yc-color-base-danger-heavy);
53
- }
54
- &_unspecified,
55
- &_gray,
56
- &_grey {
57
- background: var(--yc-color-text-complementary);
58
- }
59
- &_maintenance_required,
60
- &_orange {
61
- background: var(--yc-color-text-warning-heavy);
62
- }
63
- }
64
- }
@@ -1,84 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import cn from 'bem-cn-lite';
4
- import './Info.scss';
5
-
6
- import SchemaInfoViewer from '../../../Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer';
7
- import SchemaViewer from '../../../Tenant/Schema/SchemaViewer/SchemaViewer';
8
- import {OLAP_TABLE_TYPE} from '../SchemaMain/SchemaMain';
9
-
10
- const b = cn('schema-info');
11
-
12
- function prepareOlapTableSchema(tableSchema) {
13
- const {Name, Schema = {}} = tableSchema;
14
- const {Columns, KeyColumnNames} = Schema;
15
- const KeyColumnIds = KeyColumnNames?.map((name) => {
16
- const column = Columns?.find((el) => el.Name === name);
17
- return column.Id;
18
- });
19
-
20
- return {
21
- Columns,
22
- KeyColumnNames,
23
- Name,
24
- KeyColumnIds,
25
- };
26
- }
27
-
28
- function prepareOlapTableGeneral(tableData, olapStats) {
29
- const {ColumnShardCount} = tableData;
30
- const Bytes = olapStats?.reduce((acc, el) => {
31
- acc += parseInt(el.Bytes) ?? 0;
32
- return acc;
33
- }, 0);
34
- const Rows = olapStats?.reduce((acc, el) => {
35
- acc += parseInt(el.Rows) ?? 0;
36
- return acc;
37
- }, 0);
38
- const tabletIds = olapStats?.reduce((acc, el) => {
39
- acc.add(el.TabletId);
40
- return acc;
41
- }, new Set());
42
-
43
- return {
44
- PathDescription: {
45
- TableStats: {
46
- ColumnShardCount,
47
- Bytes: Bytes?.toLocaleString('ru-RU', {useGrouping: true}) ?? 0,
48
- Rows: Rows?.toLocaleString('ru-RU', {useGrouping: true}) ?? 0,
49
- Parts: tabletIds?.size ?? 0,
50
- },
51
- },
52
- };
53
- }
54
-
55
- class Info extends React.Component {
56
- static propTypes = {
57
- fullPath: PropTypes.string,
58
- currentItem: PropTypes.string,
59
- tableSchema: PropTypes.object,
60
- olapStats: PropTypes.array,
61
- type: PropTypes.string,
62
- };
63
- render() {
64
- const {currentItem, tableSchema, olapStats} = this.props;
65
- const fullPath = currentItem.Path;
66
-
67
- const schema =
68
- this.props.type === OLAP_TABLE_TYPE ? prepareOlapTableSchema(tableSchema) : tableSchema;
69
-
70
- const data =
71
- this.props.type === OLAP_TABLE_TYPE
72
- ? prepareOlapTableGeneral(tableSchema, olapStats)
73
- : currentItem;
74
-
75
- return (
76
- <div className={b()}>
77
- <SchemaInfoViewer fullPath={fullPath} data={data} />
78
- {schema && <SchemaViewer data={schema} />}
79
- </div>
80
- );
81
- }
82
- }
83
-
84
- export default Info;
@@ -1,3 +0,0 @@
1
- .schema-info {
2
- display: flex;
3
- }