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
@@ -5,65 +5,66 @@ import _ from 'lodash';
5
5
  import {connect} from 'react-redux';
6
6
  import {Loader} from '@yandex-cloud/uikit';
7
7
  import DataTable from '@yandex-cloud/react-data-table';
8
+ import {DEFAULT_TABLE_SETTINGS} from '../../../utils/constants';
8
9
 
9
10
  import './Acl.scss';
10
11
 
11
12
  const b = cn('kv-acl');
12
13
 
13
- const TABLE_SETTINGS = {
14
- displayIndices: false,
15
- syncHeadOnResize: true,
16
- stickyHead: DataTable.MOVING,
17
- };
18
14
  const COLUMN_WIDTH = 140;
19
- const COLUMNS = [
20
- {
21
- name: 'AccessType',
22
- header: 'Access Type',
23
- sortable: false,
24
- width: COLUMN_WIDTH,
25
- },
26
- {
27
- name: 'AccessRights',
28
- header: 'Access Rights',
29
- render: ({value}) => {
30
- return _.map(value, (item, index) => {
31
- return <div key={index}>{item}</div>;
32
- });
33
- },
34
- width: COLUMN_WIDTH,
35
- sortable: false,
36
- },
37
- {
38
- name: 'Subject',
39
- sortable: false,
40
- // eslint-disable-next-line react/display-name
41
- render: ({value}) => {
42
- return Acl.prepareLogin(value);
43
- },
44
- width: COLUMN_WIDTH,
45
- },
46
- {
47
- name: 'InheritanceType',
48
- header: 'Inheritance Type',
49
- render: ({value}) => {
50
- return _.map(value, (item, index) => {
51
- return <div key={index}>{item}</div>;
52
- });
53
- },
54
- width: COLUMN_WIDTH,
55
- sortable: false,
56
- },
57
- ];
58
15
 
59
16
  class Acl extends React.Component {
60
17
  static propTypes = {
61
18
  error: PropTypes.string,
62
19
  acl: PropTypes.array,
63
20
  loading: PropTypes.bool,
21
+ additionalTenantInfo: PropTypes.object,
64
22
  };
65
23
 
66
- static prepareLogin = (value) => {
24
+ COLUMNS = [
25
+ {
26
+ name: 'AccessType',
27
+ header: 'Access Type',
28
+ sortable: false,
29
+ width: COLUMN_WIDTH,
30
+ },
31
+ {
32
+ name: 'AccessRights',
33
+ header: 'Access Rights',
34
+ render: ({value}) => {
35
+ return _.map(value, (item, index) => {
36
+ return <div key={index}>{item}</div>;
37
+ });
38
+ },
39
+ width: COLUMN_WIDTH,
40
+ sortable: false,
41
+ },
42
+ {
43
+ name: 'Subject',
44
+ sortable: false,
45
+ // eslint-disable-next-line react/display-name
46
+ render: ({value}) => {
47
+ return this.prepareLogin(value);
48
+ },
49
+ width: COLUMN_WIDTH,
50
+ },
51
+ {
52
+ name: 'InheritanceType',
53
+ header: 'Inheritance Type',
54
+ render: ({value}) => {
55
+ return _.map(value, (item, index) => {
56
+ return <div key={index}>{item}</div>;
57
+ });
58
+ },
59
+ width: COLUMN_WIDTH,
60
+ sortable: false,
61
+ },
62
+ ];
63
+
64
+ prepareLogin = (value) => {
65
+ if (this.props.prepareLogin) {
66
+ return this.props.additionalTenantInfo?.prepareLogin(value);
67
+ }
67
68
  if (value && value.endsWith('@staff') && !value.startsWith('svc_')) {
68
69
  const login = value.split('@')[0];
69
70
  return login;
@@ -79,7 +80,13 @@ class Acl extends React.Component {
79
80
  return null;
80
81
  }
81
82
 
82
- return <DataTable columns={COLUMNS} data={acl} settings={TABLE_SETTINGS} />;
83
+ return (
84
+ <DataTable
85
+ columns={this.COLUMNS}
86
+ data={acl}
87
+ settings={{...DEFAULT_TABLE_SETTINGS, stickyTop: 36}}
88
+ />
89
+ );
83
90
  };
84
91
 
85
92
  renderOwner = () => {
@@ -92,7 +99,7 @@ class Acl extends React.Component {
92
99
  return (
93
100
  <div className={b('owner-container')}>
94
101
  <span className={b('owner-label')}>Owner: </span>
95
- {Acl.prepareLogin(owner)}
102
+ {this.prepareLogin(owner)}
96
103
  </div>
97
104
  );
98
105
  };
@@ -1,22 +1,28 @@
1
1
  @import '../../../styles/mixins.scss';
2
2
 
3
3
  .kv-acl {
4
+ padding: 0 12px 16px;
5
+ @include query-data-table;
4
6
  &__message-container {
5
- padding: 15px 0;
7
+ padding: 0 12px 16px;
6
8
  }
7
9
 
8
10
  &__loader-container {
9
11
  display: flex;
10
12
  justify-content: center;
11
13
  align-items: center;
14
+
12
15
  height: 100%;
13
16
  }
14
17
 
15
- @include query-data-table;
16
-
17
18
  &__owner-container {
18
- margin: 10px;
19
+ position: sticky;
20
+ z-index: 2;
21
+ top: 0;
19
22
 
23
+ padding-bottom: 16px;
24
+
25
+ background-color: var(--yc-color-base-background);
20
26
  .yc-staff-card {
21
27
  display: inline-block;
22
28
  }
@@ -25,10 +31,15 @@
25
31
  &__text {
26
32
  font-size: var(--yc-text-body-font-size);
27
33
  line-height: var(--yc-text-body-line-height);
34
+
28
35
  color: var(--yc-color-text-primary);
29
36
 
30
37
  &::first-letter {
31
38
  color: var(--yc-color-text-danger);
32
39
  }
33
40
  }
41
+
42
+ &__result {
43
+ overflow: auto;
44
+ }
34
45
  }
@@ -7,14 +7,14 @@ import qs from 'qs';
7
7
 
8
8
  import {Loader} from '@yandex-cloud/uikit';
9
9
 
10
- import NodesViewer from '../../../components/NodesViewer/NodesViewer';
10
+ import NodesViewer from '../../../../components/NodesViewer/NodesViewer';
11
11
 
12
- import {backend} from '../../../store';
13
- import {hideTooltip, showTooltip} from '../../../store/reducers/tooltip';
14
- import {getNodes, clearNodes} from '../../../store/reducers/nodes';
15
- import {AUTO_RELOAD_INTERVAL} from '../../../utils/constants';
12
+ import {backend} from '../../../../store';
13
+ import {hideTooltip, showTooltip} from '../../../../store/reducers/tooltip';
14
+ import {getNodes, clearNodes} from '../../../../store/reducers/nodes';
16
15
 
17
16
  import './Compute.scss';
17
+ import {AutoFetcher} from '../../../../utils/autofetcher';
18
18
 
19
19
  const b = cn('compute');
20
20
 
@@ -25,6 +25,7 @@ class Compute extends React.Component {
25
25
  tenantName: PropTypes.string,
26
26
  nodes: PropTypes.object,
27
27
  loading: PropTypes.bool,
28
+ autorefresh: PropTypes.bool,
28
29
  error: PropTypes.object,
29
30
  wasLoaded: PropTypes.bool,
30
31
  getNodes: PropTypes.func,
@@ -33,30 +34,50 @@ class Compute extends React.Component {
33
34
  timeoutForRequest: PropTypes.number,
34
35
  };
35
36
 
37
+ autofetcher;
38
+
36
39
  componentDidMount() {
37
- const {getNodes, tenantName} = this.props;
40
+ const {getNodes, tenantName, autorefresh} = this.props;
41
+
42
+ this.autofetcher = new AutoFetcher();
38
43
 
39
44
  if (tenantName) {
40
45
  getNodes(tenantName);
41
- this.reloadDescriptor = setInterval(() => getNodes(tenantName), AUTO_RELOAD_INTERVAL);
46
+ if (autorefresh) {
47
+ this.autofetcher.start();
48
+ this.autofetcher.fetch(() => getNodes(tenantName));
49
+ }
50
+ }
51
+ }
52
+
53
+ componentDidUpdate(prevProps) {
54
+ const {autorefresh, getNodes, tenantName} = this.props;
55
+
56
+ if (autorefresh && !prevProps.autorefresh) {
57
+ getNodes(tenantName);
58
+ this.autofetcher.start();
59
+ this.autofetcher.fetch(() => getNodes(tenantName));
60
+ }
61
+ if (!autorefresh && prevProps.autorefresh) {
62
+ this.autofetcher.stop();
42
63
  }
43
64
  }
44
65
 
45
66
  componentWillUnmount() {
46
67
  this.props.clearNodes();
47
- clearInterval(this.reloadDescriptor);
68
+ this.autofetcher.stop();
48
69
  }
49
70
 
50
71
  renderLoader() {
51
72
  return (
52
- <div className="loader">
53
- <Loader size="l" />
73
+ <div className={b('loader')}>
74
+ <Loader size="m" />
54
75
  </div>
55
76
  );
56
77
  }
57
78
 
58
79
  render() {
59
- const {nodes, loading, wasLoaded, error, tenantName} = this.props;
80
+ const {nodes, error, tenantName, wasLoaded, loading} = this.props;
60
81
  if (!tenantName) {
61
82
  return <div className="error">no tenant name in the query string</div>;
62
83
  } else if (loading && !wasLoaded) {
@@ -82,12 +103,13 @@ class Compute extends React.Component {
82
103
 
83
104
  function mapStateToProps(state, ownProps) {
84
105
  const {data, loading, wasLoaded, error, timeoutForRequest} = state.nodes;
106
+ const {autorefresh} = state.schema;
85
107
  const {search} = ownProps.location;
86
108
  const queryParams = qs.parse(search, {
87
109
  ignoreQueryPrefix: true,
88
110
  });
89
111
  const {name: tenantName} = queryParams;
90
- const nodes = (data && data.Tenants && data.Tenants[0] && data.Tenants[0].Nodes) || {};
112
+ const nodes = (data && data.Tenants && data.Tenants[0] && data.Tenants[0].Nodes) || [];
91
113
  return {
92
114
  nodes,
93
115
  tenantName,
@@ -95,6 +117,7 @@ function mapStateToProps(state, ownProps) {
95
117
  loading,
96
118
  wasLoaded,
97
119
  error,
120
+ autorefresh,
98
121
  };
99
122
  }
100
123
 
@@ -0,0 +1,14 @@
1
+ @import '../../../../styles/mixins.scss';
2
+
3
+ .compute {
4
+ overflow: auto;
5
+
6
+ height: 100%;
7
+ max-height: 100%;
8
+ @include flex-container();
9
+
10
+ &__loader {
11
+ display: flex;
12
+ justify-content: center;
13
+ }
14
+ }
@@ -5,8 +5,11 @@ import {connect} from 'react-redux';
5
5
  import {Loader} from '@yandex-cloud/uikit';
6
6
  import JSONTree from 'react-json-inspector';
7
7
 
8
+ import {getDescribe} from '../../../../store/reducers/describe';
9
+
8
10
  import './Describe.scss';
9
11
  import 'react-json-inspector/json-inspector.css';
12
+ import {AutoFetcher} from '../../../../utils/autofetcher';
10
13
 
11
14
  const b = cn('kv-describe');
12
15
 
@@ -17,8 +20,47 @@ class Describe extends React.Component {
17
20
  error: PropTypes.string,
18
21
  data: PropTypes.array,
19
22
  loading: PropTypes.bool,
23
+ wasLoaded: PropTypes.bool,
24
+ autorefresh: PropTypes.bool,
25
+ tenant: PropTypes.string,
20
26
  };
21
27
 
28
+ autofetcher;
29
+
30
+ componentDidMount() {
31
+ const {autorefresh} = this.props;
32
+ this.autofetcher = new AutoFetcher();
33
+ this.fetchData();
34
+ if (autorefresh) {
35
+ this.autofetcher.start();
36
+ this.autofetcher.fetch(() => this.fetchData);
37
+ }
38
+ }
39
+
40
+ componentDidUpdate(prevProps) {
41
+ const {autorefresh} = this.props;
42
+
43
+ if (autorefresh && !prevProps.autorefresh) {
44
+ this.fetchData();
45
+ this.autofetcher.stop();
46
+ this.autofetcher.start();
47
+ this.autofetcher.fetch(() => this.fetchData());
48
+ }
49
+ if (!autorefresh && prevProps.autorefresh) {
50
+ this.autofetcher.stop();
51
+ }
52
+ }
53
+
54
+ componentWillUnmount() {
55
+ this.autofetcher.stop();
56
+ }
57
+
58
+ fetchData() {
59
+ const {getDescribe, tenant, currentSchemaPath} = this.props;
60
+ const path = currentSchemaPath || tenant;
61
+ getDescribe({path});
62
+ }
63
+
22
64
  renderDescribeJson = () => {
23
65
  const {data} = this.props;
24
66
 
@@ -69,13 +111,20 @@ class Describe extends React.Component {
69
111
 
70
112
  const mapStateToProps = (state) => {
71
113
  const {loading, error, currentDescribe, wasLoaded} = state.describe;
114
+ const {autorefresh, currentSchemaPath} = state.schema;
72
115
 
73
116
  return {
74
117
  data: currentDescribe,
75
118
  loading,
76
119
  error,
77
120
  wasLoaded,
121
+ autorefresh,
122
+ currentSchemaPath,
78
123
  };
79
124
  };
80
125
 
81
- export default connect(mapStateToProps)(Describe);
126
+ const mapDispatchToProps = {
127
+ getDescribe,
128
+ };
129
+
130
+ export default connect(mapStateToProps, mapDispatchToProps)(Describe);
@@ -1,4 +1,4 @@
1
- @import '../../../styles/mixins.scss';
1
+ @import '../../../../styles/mixins.scss';
2
2
 
3
3
  .kv-describe {
4
4
  &__message-container {
@@ -6,16 +6,18 @@
6
6
  }
7
7
 
8
8
  &__result {
9
- padding: 10px 20px 20px 0;
10
9
  display: flex;
11
- flex: 0 0 auto;
12
10
  overflow: auto;
11
+ flex: 0 0 auto;
12
+
13
+ padding: 10px 20px 20px 0;
13
14
  }
14
15
 
15
16
  &__loader-container {
16
17
  display: flex;
17
18
  justify-content: center;
18
19
  align-items: center;
20
+
19
21
  height: 100%;
20
22
  }
21
23
 
@@ -0,0 +1,27 @@
1
+ .kv-detailed-overview {
2
+ display: flex;
3
+ gap: 10px;
4
+ &__section {
5
+ display: flex;
6
+ flex: 0 0 50%;
7
+ flex-direction: column;
8
+ }
9
+
10
+ &__modal {
11
+ & .yc-modal__content {
12
+ position: relative;
13
+ }
14
+ }
15
+
16
+ &__close-modal-button {
17
+ position: absolute;
18
+ top: 10px;
19
+ right: 10px;
20
+
21
+ & .yc-button__text {
22
+ display: flex;
23
+
24
+ margin: 0 4px;
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,88 @@
1
+ import React, {useState} from 'react';
2
+ import {useSelector} from 'react-redux';
3
+ import cn from 'bem-cn-lite';
4
+
5
+ import {Button, Modal} from '@yandex-cloud/uikit';
6
+ //@ts-ignore
7
+ import Icon from '../../../../components/Icon/Icon';
8
+ import Overview from '../Overview/Overview';
9
+ //@ts-ignore
10
+ import Healthcheck from '../Healthcheck/Healthcheck';
11
+ //@ts-ignore
12
+ import TenantOverview from '../TenantOverview/TenantOverview';
13
+
14
+ import './DetailedOverview.scss';
15
+
16
+ interface DetailedOverviewProps {
17
+ type: string;
18
+ className?: string;
19
+ tenantName: string;
20
+ additionalTenantInfo?: any;
21
+ }
22
+
23
+ const b = cn('kv-detailed-overview');
24
+
25
+ function DetailedOverview(props: DetailedOverviewProps) {
26
+ const [isModalVisible, setIsModalVisible] = useState(false);
27
+
28
+ const {
29
+ currentSchemaPath,
30
+ } = useSelector((state: any) => state.schema);
31
+
32
+ const openModalHandler = () => {
33
+ setIsModalVisible(true);
34
+ };
35
+
36
+ const closeModalHandler = () => {
37
+ setIsModalVisible(false);
38
+ };
39
+
40
+ const renderModal = () => {
41
+ return (
42
+ <Modal open={isModalVisible} onClose={closeModalHandler} className={b('modal')}>
43
+ <Healthcheck tenant={props.tenantName} />
44
+ <Button
45
+ className={b('close-modal-button')}
46
+ onClick={closeModalHandler}
47
+ view="flat-secondary"
48
+ title='Close'
49
+ >
50
+ <Icon name="close" viewBox={'0 0 16 16 '} height={20} width={20} />
51
+ </Button>
52
+ </Modal>
53
+ );
54
+ };
55
+
56
+ const renderContent = () => {
57
+ const {type, tenantName, additionalTenantInfo} = props;
58
+ const isTenant = tenantName === currentSchemaPath;
59
+ return (
60
+ <div className={b()}>
61
+ <div className={b('section')}>
62
+ {!isTenant && (
63
+ <Overview type={type} tenantName={tenantName} />
64
+ )}
65
+ {isTenant && <TenantOverview tenantName={tenantName} additionalTenantInfo={additionalTenantInfo}/>}
66
+ </div>
67
+ {isTenant && (
68
+ <div className={b('section')}>
69
+ <Healthcheck
70
+ tenant={tenantName}
71
+ preview={true}
72
+ showMoreHandler={openModalHandler}
73
+ />
74
+ </div>
75
+ )}
76
+ </div>
77
+ );
78
+ };
79
+
80
+ return (
81
+ <React.Fragment>
82
+ {renderContent()}
83
+ {renderModal()}
84
+ </React.Fragment>
85
+ );
86
+ }
87
+
88
+ export default DetailedOverview;
@@ -0,0 +1,50 @@
1
+ .kv-tenant-diagnostics {
2
+ overflow: hidden;
3
+
4
+ height: 100%;
5
+ &__header-wrapper {
6
+ position: sticky;
7
+ z-index: 2;
8
+ top: 0;
9
+ left: 0;
10
+
11
+ padding: 13px 20px 16px;
12
+
13
+ background-color: var(--yc-color-base-background);
14
+ }
15
+
16
+ &__tabs {
17
+ display: flex;
18
+ justify-content: space-between;
19
+ align-items: center;
20
+
21
+ box-shadow: inset 0 -1px 0 0 var(--yc-color-line-generic);
22
+ & .yc-tabs_direction_horizontal {
23
+ box-shadow: unset;
24
+ }
25
+ }
26
+
27
+ &__tab {
28
+ margin-right: 40px;
29
+
30
+ text-decoration: none;
31
+
32
+ &:first-letter {
33
+ text-transform: uppercase;
34
+ }
35
+ }
36
+
37
+ &__page-wrapper {
38
+ overflow: auto;
39
+
40
+ width: 100%;
41
+ height: calc(100% - 69px);
42
+ padding: 0 20px;
43
+
44
+ & .global-storage {
45
+ height: calc(100% + 16px);
46
+ max-height: calc(100% + 16px);
47
+ margin-top: -16px;
48
+ }
49
+ }
50
+ }