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
@@ -10,10 +10,12 @@ import ProblemFilter, {problemFilterType} from '../../components/ProblemFilter/P
10
10
 
11
11
  import {hideTooltip, showTooltip} from '../../store/reducers/tooltip';
12
12
  import {withSearch} from '../../HOCS';
13
- import {AUTO_RELOAD_INTERVAL, ALL} from '../../utils/constants';
13
+ import {AUTO_RELOAD_INTERVAL, ALL, DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
14
14
  import {getFilteredNodes} from '../../store/reducers/clusterNodes';
15
15
  import {getNodes} from '../../store/reducers/nodes';
16
16
  import {changeFilter} from '../../store/reducers/settings';
17
+ import {setHeader} from '../../store/reducers/header';
18
+ import routes, {CLUSTER_PAGES, createHref} from '../../routes';
17
19
  import {calcUptime} from '../../utils';
18
20
  import {getNodesColumns} from '../../utils/getNodesColumns';
19
21
 
@@ -21,13 +23,6 @@ import './Nodes.scss';
21
23
 
22
24
  const b = cn('cluster-nodes');
23
25
 
24
- const tableSettings = {
25
- displayIndices: false,
26
- stickyHead: DataTable.MOVING,
27
- syncHeadOnResize: true,
28
- dynamicRender: true,
29
- };
30
-
31
26
  class Nodes extends React.Component {
32
27
  static renderLoader() {
33
28
  return (
@@ -49,14 +44,22 @@ class Nodes extends React.Component {
49
44
  handleSearchQuery: PropTypes.func,
50
45
  filter: problemFilterType,
51
46
  changeFilter: PropTypes.func,
47
+ setHeader: PropTypes.func,
52
48
  className: PropTypes.string,
53
49
  singleClusterMode: PropTypes.bool,
54
50
  additionalNodesInfo: PropTypes.object,
55
51
  };
56
52
 
57
53
  componentDidMount() {
58
- this.props.getNodesList();
59
- this.reloadDescriptor = setInterval(() => this.props.getNodesList(), AUTO_RELOAD_INTERVAL);
54
+ const {getNodesList, setHeader} = this.props;
55
+ getNodesList();
56
+ this.reloadDescriptor = setInterval(() => getNodesList(), AUTO_RELOAD_INTERVAL);
57
+ setHeader([
58
+ {
59
+ text: CLUSTER_PAGES.nodes.title,
60
+ link: createHref(routes.cluster, {activeTab: CLUSTER_PAGES.nodes.id}),
61
+ },
62
+ ]);
60
63
  }
61
64
 
62
65
  componentWillUnmount() {
@@ -76,18 +79,15 @@ class Nodes extends React.Component {
76
79
 
77
80
  return (
78
81
  <div className={b('controls')}>
79
- <div className={b('controls-left')}>
80
- <TextInput
81
- className={b('search')}
82
- size="s"
83
- placeholder="Host name…"
84
- text={searchQuery}
85
- onUpdate={this.handleSearchQueryChange}
86
- hasClear
87
- />
88
- <ProblemFilter value={filter} onChange={this.handleFilterChange} />
89
- <Label theme="info" size="m">{`Nodes: ${nodes.length}`}</Label>
90
- </div>
82
+ <TextInput
83
+ className={b('search')}
84
+ placeholder="Host name"
85
+ text={searchQuery}
86
+ onUpdate={this.handleSearchQueryChange}
87
+ hasClear
88
+ />
89
+ <ProblemFilter value={filter} onChange={this.handleFilterChange} />
90
+ <Label theme="info" size="m">{`Nodes: ${nodes?.length}`}</Label>
91
91
  </div>
92
92
  );
93
93
  }
@@ -123,24 +123,24 @@ class Nodes extends React.Component {
123
123
  }));
124
124
 
125
125
  if (preparedNodes.length === 0) {
126
- if (filter === ALL) {
127
- return <div className="error">no nodes data</div>;
126
+ if (filter !== ALL) {
127
+ return <div className="no-problem" />;
128
128
  }
129
- return <div className="no-problem" />;
130
129
  }
131
130
 
132
131
  return (
133
132
  <div className={b('table-wrapper')}>
134
133
  <div className={b('table-content')}>
135
134
  <DataTable
136
- theme="internal"
135
+ theme="yandex-cloud"
137
136
  data={preparedNodes}
138
137
  columns={columns}
139
- settings={tableSettings}
138
+ settings={DEFAULT_TABLE_SETTINGS}
140
139
  initialSortOrder={{
141
140
  columnId: 'NodeId',
142
141
  order: DataTable.ASCENDING,
143
142
  }}
143
+ emptyDataMessage='No such nodes'
144
144
  />
145
145
  </div>
146
146
  </div>
@@ -188,6 +188,7 @@ const mapDispatchToProps = {
188
188
  hideTooltip,
189
189
  showTooltip,
190
190
  changeFilter,
191
+ setHeader,
191
192
  };
192
193
 
193
194
  export default withSearch(connect(mapStateToProps, mapDispatchToProps)(Nodes));
@@ -2,26 +2,14 @@
2
2
 
3
3
  .cluster-nodes {
4
4
  overflow: auto;
5
+ @include flex-container();
5
6
 
6
7
  &__search {
7
- width: 255px;
8
- margin: 0 15px 0 0;
8
+ @include search();
9
9
  }
10
10
 
11
11
  &__controls {
12
- display: flex;
13
- justify-content: space-between;
14
-
15
- margin: 17px 0;
16
- }
17
-
18
- &__controls-left {
19
- display: flex;
20
- align-items: center;
21
-
22
- & > * {
23
- margin-right: 25px;
24
- }
12
+ @include controls();
25
13
  }
26
14
 
27
15
  &__show-all-wrapper {
@@ -39,12 +27,12 @@
39
27
  &__table-content {
40
28
  overflow: auto;
41
29
 
30
+ height: 100%;
31
+
42
32
  @include freeze-nth-column(1);
43
33
  @include freeze-nth-column(2, 80px);
44
- @include freeze-nth-column(3, 120px);
45
34
 
46
35
  @include table-styles;
47
36
  @include table-sticky-styles;
48
37
  }
49
- @include flex-container();
50
38
  }
@@ -1,8 +1,8 @@
1
1
  @import '../../styles/mixins.scss';
2
2
 
3
3
  .pdisk {
4
- @include container-fluid();
5
4
  padding: 20px;
5
+ @include container-fluid();
6
6
 
7
7
  .info-viewer__items {
8
8
  grid-template-columns: auto;
@@ -18,11 +18,12 @@
18
18
  }
19
19
 
20
20
  &__title {
21
+ margin-right: 16px;
22
+
21
23
  font-size: var(--yc-text-body2-font-size);
22
- line-height: var(--yc-text-body2-line-height);
23
24
  font-weight: 500;
25
+ line-height: var(--yc-text-body2-line-height);
24
26
  text-transform: uppercase;
25
- margin-right: 16px;
26
27
  }
27
28
 
28
29
  &__section {
@@ -34,7 +35,8 @@
34
35
  }
35
36
 
36
37
  &__link {
37
- color: var(--yc-color-base-special);
38
38
  text-decoration: none;
39
+
40
+ color: var(--yc-color-base-special);
39
41
  }
40
42
  }
@@ -8,11 +8,12 @@
8
8
  }
9
9
 
10
10
  &__title {
11
+ margin-right: 16px;
12
+
11
13
  font-size: var(--yc-text-body2-font-size);
12
- line-height: var(--yc-text-body2-line-height);
13
14
  font-weight: 500;
15
+ line-height: var(--yc-text-body2-line-height);
14
16
  text-transform: uppercase;
15
- margin-right: 16px;
16
17
 
17
18
  &_groups {
18
19
  margin-right: 32px;
@@ -22,11 +23,13 @@
22
23
  &__controls {
23
24
  display: flex;
24
25
  align-items: center;
25
- margin: 25px 0 10px 0;
26
+
27
+ margin: 25px 0 10px;
26
28
  }
27
29
 
28
30
  &__breadcrumbs {
29
- font-size: var(--yc-text-body2-font-size);
30
31
  padding: 20px 0;
32
+
33
+ font-size: var(--yc-text-body2-font-size);
31
34
  }
32
35
  }
@@ -1,8 +1,9 @@
1
1
  @import '../../styles/mixins.scss';
2
2
 
3
3
  .popup2 {
4
- animation: none !important;
5
4
  max-width: 300px;
5
+
6
+ animation: none !important;
6
7
  }
7
8
 
8
9
  .pool-tooltip,
@@ -14,6 +15,7 @@
14
15
 
15
16
  &__label {
16
17
  padding-right: 15px;
18
+
17
19
  color: var(--yc-color-text-secondary);
18
20
  }
19
21
  }
@@ -49,6 +51,7 @@
49
51
 
50
52
  .cell-tooltip {
51
53
  padding: 10px;
54
+
52
55
  word-break: break-word;
53
56
  }
54
57
 
@@ -56,6 +59,7 @@
56
59
  padding: 10px;
57
60
  &__label {
58
61
  padding-right: 15px;
62
+
59
63
  color: var(--yc-color-text-secondary);
60
64
  }
61
65
 
@@ -0,0 +1,77 @@
1
+ .storage-disk-progress-bar {
2
+ $block: &;
3
+ position: relative;
4
+
5
+ display: inline-block;
6
+
7
+ width: 100%;
8
+ max-width: 200px;
9
+ height: var(--yc-text-body2-line-height);
10
+
11
+ border: 1px solid var(--yc-color-infographics-misc-medium);
12
+ border-radius: 2px;
13
+ background-color: var(--yc-color-infographics-misc-light);
14
+
15
+ #{$block}__filled {
16
+ background-color: var(--yc-color-infographics-misc-medium);
17
+ }
18
+
19
+ &_green {
20
+ border: 1px solid var(--yc-color-infographics-positive-heavy);
21
+ background-color: var(--yc-color-infographics-positive-light);
22
+ #{$block}__filled {
23
+ background-color: var(--yc-color-infographics-positive-heavy);
24
+ }
25
+ }
26
+
27
+ &_blue {
28
+ border: 1px solid var(--yc-color-infographics-info-medium);
29
+ background-color: var(--yc-color-infographics-info-light);
30
+ #{$block}__filled {
31
+ background-color: var(--yc-color-infographics-info-medium);
32
+ }
33
+ }
34
+
35
+ &_yellow {
36
+ border: 1px solid var(--yc-color-infographics-warning-heavy);
37
+ background-color: var(--yc-color-infographics-yellow-light);
38
+ #{$block}__filled {
39
+ background-color: var(--yc-color-infographics-warning-heavy);
40
+ }
41
+ }
42
+
43
+ &_orange {
44
+ border: 1px solid var(--yc-color-base-warning-orange);
45
+ background-color: var(--yc-color-infographics-warning-light);
46
+ #{$block}__filled {
47
+ background-color: var(--yc-color-base-warning-orange);
48
+ }
49
+ }
50
+ &_red {
51
+ border: 1px solid var(--yc-color-infographics-danger-heavy);
52
+ background-color: var(--yc-color-infographics-danger-light);
53
+ #{$block}__filled {
54
+ background-color: var(--yc-color-infographics-danger-heavy);
55
+ }
56
+ }
57
+
58
+ &__filled {
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+
63
+ height: 100%;
64
+
65
+ border-radius: 2px 0 0 2px;
66
+ }
67
+ &__filled-title {
68
+ position: absolute;
69
+ top: 0;
70
+ left: 5px;
71
+
72
+ font-size: var(--yc-text-body-font-size);
73
+ line-height: inherit;
74
+
75
+ color: inherit;
76
+ }
77
+ }
@@ -44,7 +44,7 @@ function DiskStateProgressBar({
44
44
  {diskAllocatedPercent >= 0 && (
45
45
  <React.Fragment>
46
46
  <div className={b('filled')} style={{width: `${diskAllocatedPercent}%`}} />
47
- <div className={b('filled-title', {light: diskAllocatedPercent > 7})}>
47
+ <div className={b('filled-title')}>
48
48
  {`${Math.round(diskAllocatedPercent)}%`}
49
49
  </div>
50
50
  </React.Fragment>
@@ -1,5 +1,7 @@
1
1
  .pdisk-storage {
2
+ display: flex;
2
3
  flex-grow: 1;
4
+ align-items: center;
3
5
 
4
6
  margin-right: 10px;
5
7
 
@@ -13,18 +15,18 @@
13
15
  }
14
16
  &__popup-content {
15
17
  display: grid;
16
- column-gap: 5px;
17
18
  justify-items: stretch;
19
+ column-gap: 5px;
18
20
  }
19
21
  &__popup-section-name {
22
+ grid-column: 1 / 3;
23
+
20
24
  margin: 5px 0;
21
25
 
26
+ font-weight: 500;
22
27
  text-align: center;
23
28
 
24
29
  border-bottom: 1px solid var(--yc-color-line-generic);
25
-
26
- font-weight: 500;
27
- grid-column: 1 / 3;
28
30
  }
29
31
  &__property {
30
32
  text-align: right;
@@ -153,8 +153,7 @@ function Pdisk(props: PDiskProps) {
153
153
  <DiskStateProgressBar
154
154
  diskAllocatedPercent={pdiskAllocatedPercent}
155
155
  severity={severity as keyof typeof diskProgressColors}
156
- // href={createHref(routes.pdisk, {id: props.PDiskId}, {node_id: props.NodeId})}
157
- href={createHref(routes.vdisk, null, {
156
+ href={createHref(routes.vdisk, undefined, {
158
157
  pdiskId: props.PDiskId,
159
158
  nodeId: props.NodeId,
160
159
  })}
@@ -6,7 +6,7 @@ import DataTable from '@yandex-cloud/react-data-table';
6
6
  import {Loader, RadioButton, Label} from '@yandex-cloud/uikit';
7
7
 
8
8
  import StorageFilter from './StorageFilter/StorageFilter';
9
- import {AutoFetcher} from '../Cluster/Cluster';
9
+ import {AutoFetcher} from '../../utils/autofetcher';
10
10
 
11
11
  import {
12
12
  getStorageInfo,
@@ -22,6 +22,9 @@ import {
22
22
  import {getNodesList} from '../../store/reducers/clusterNodes';
23
23
  import StorageGroups from './StorageGroups/StorageGroups';
24
24
  import StorageNodes from './StorageNodes/StorageNodes';
25
+ import {DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
26
+ import {setHeader} from '../../store/reducers/header';
27
+ import routes, {CLUSTER_PAGES, createHref} from '../../routes';
25
28
 
26
29
  import './Storage.scss';
27
30
 
@@ -33,13 +36,9 @@ const FILTER_OPTIONS = {
33
36
  };
34
37
 
35
38
  const tableSettings = {
36
- displayIndices: false,
37
- stickyHead: DataTable.MOVING,
38
- syncHeadOnResize: true,
39
- dynamicRender: true,
39
+ ...DEFAULT_TABLE_SETTINGS,
40
40
  defaultOrder: DataTable.DESCENDING,
41
- stripedRows: true,
42
- stickyTop: 68,
41
+ stickyTop: 62,
43
42
  };
44
43
 
45
44
  class Storage extends React.Component {
@@ -47,29 +46,53 @@ class Storage extends React.Component {
47
46
  loading: PropTypes.bool,
48
47
  error: PropTypes.object,
49
48
  wasLoaded: PropTypes.bool,
49
+ autorefresh: PropTypes.bool,
50
+ database: PropTypes.bool,
50
51
  getStorageInfo: PropTypes.func,
51
52
  setInitialState: PropTypes.func,
52
53
  flatListStorageEntities: PropTypes.array,
53
54
  setStorageFilter: PropTypes.func,
54
55
  setVisibleEntities: PropTypes.func,
55
56
  visibleEntities: PropTypes.string,
57
+ setHeader: PropTypes.func,
58
+ tenant: PropTypes.string,
56
59
  };
57
60
 
58
61
  componentDidMount() {
59
- const {tenant, nodeId, setVisibleEntities, storageType} = this.props;
62
+ const {
63
+ tenant,
64
+ nodeId,
65
+ setVisibleEntities,
66
+ storageType,
67
+ setHeader,
68
+ getNodesList,
69
+ getStorageInfo,
70
+ } = this.props;
71
+ setHeader([
72
+ {
73
+ text: CLUSTER_PAGES.storage.title,
74
+ link: createHref(routes.cluster, {activeTab: CLUSTER_PAGES.storage.id}),
75
+ },
76
+ ]);
60
77
  this.autofetcher = new AutoFetcher();
61
- this.props.getNodesList();
78
+ getNodesList();
62
79
  if (tenant || nodeId) {
63
80
  setVisibleEntities(VisibleEntities.All);
81
+ getStorageInfo({
82
+ tenant,
83
+ filter: FILTER_OPTIONS.All,
84
+ nodeId,
85
+ type: storageType,
86
+ });
64
87
  } else {
65
- this.props.getStorageInfo({
88
+ getStorageInfo({
66
89
  tenant,
67
90
  nodeId,
68
91
  filter: FILTER_OPTIONS.Missing,
69
92
  type: storageType,
70
93
  });
71
94
  this.autofetcher.fetch(() =>
72
- this.props.getStorageInfo({
95
+ getStorageInfo({
73
96
  tenant,
74
97
  nodeId,
75
98
  filter: FILTER_OPTIONS.Missing,
@@ -80,11 +103,24 @@ class Storage extends React.Component {
80
103
  }
81
104
 
82
105
  componentDidUpdate(prevProps) {
83
- const {tenant, visibleEntities, getStorageInfo, nodeId, storageType} = this.props;
84
- if (
85
- storageType !== prevProps.storageType ||
86
- visibleEntities !== prevProps.visibleEntities
87
- ) {
106
+ const {
107
+ tenant,
108
+ visibleEntities,
109
+ getStorageInfo,
110
+ nodeId,
111
+ storageType,
112
+ autorefresh,
113
+ database,
114
+ } = this.props;
115
+
116
+ const startFetch = () => {
117
+ getStorageInfo({
118
+ tenant,
119
+ filter: FILTER_OPTIONS[visibleEntities],
120
+ nodeId,
121
+ type: storageType,
122
+ });
123
+
88
124
  this.autofetcher.stop();
89
125
  this.autofetcher.start();
90
126
  this.autofetcher.fetch(() =>
@@ -95,13 +131,21 @@ class Storage extends React.Component {
95
131
  type: storageType,
96
132
  }),
97
133
  );
134
+ };
98
135
 
99
- getStorageInfo({
100
- tenant,
101
- filter: FILTER_OPTIONS[visibleEntities],
102
- nodeId,
103
- type: storageType,
104
- });
136
+ if (database && !autorefresh && prevProps.autorefresh) {
137
+ this.autofetcher.stop();
138
+ }
139
+ if (database && autorefresh && !prevProps.autorefresh) {
140
+ startFetch();
141
+ }
142
+
143
+ if (
144
+ (storageType !== prevProps.storageType ||
145
+ visibleEntities !== prevProps.visibleEntities) &&
146
+ (!database || (database && autorefresh))
147
+ ) {
148
+ startFetch();
105
149
  }
106
150
  }
107
151
 
@@ -113,7 +157,7 @@ class Storage extends React.Component {
113
157
  renderLoader() {
114
158
  return (
115
159
  <div className={b('loader')}>
116
- <Loader size="l" />
160
+ <Loader size="m" />
117
161
  </div>
118
162
  );
119
163
  }
@@ -157,17 +201,13 @@ class Storage extends React.Component {
157
201
  this.props;
158
202
  return (
159
203
  <div className={b('controls')}>
160
- <div className={b('filter')}>
204
+ <div className={b('search')}>
161
205
  <StorageFilter
162
206
  changeReduxStorageFilter={setStorageFilter}
163
207
  storageType={storageType}
164
208
  />
165
209
  </div>
166
- <RadioButton
167
- value={visibleEntities}
168
- onUpdate={this.onGroupVisibilityChange}
169
- className={b('control')}
170
- >
210
+ <RadioButton value={visibleEntities} onUpdate={this.onGroupVisibilityChange}>
171
211
  <RadioButton.Option value={VisibleEntities.Missing}>
172
212
  {VisibleEntities.Missing}
173
213
  </RadioButton.Option>
@@ -179,11 +219,7 @@ class Storage extends React.Component {
179
219
  </RadioButton.Option>
180
220
  </RadioButton>
181
221
 
182
- <RadioButton
183
- value={storageType}
184
- onUpdate={this.onStorageTypeChange}
185
- className={b('control')}
186
- >
222
+ <RadioButton value={storageType} onUpdate={this.onStorageTypeChange}>
187
223
  <RadioButton.Option value={StorageTypes.groups}>
188
224
  {StorageTypes.groups}
189
225
  </RadioButton.Option>
@@ -227,6 +263,7 @@ function mapStateToProps(state) {
227
263
 
228
264
  return {
229
265
  flatListStorageEntities: getFilteredEntities(state),
266
+ autorefresh: state.schema.autorefresh,
230
267
  nodes: getNodesObject(state),
231
268
  loading,
232
269
  wasLoaded,
@@ -244,6 +281,7 @@ const mapDispatchToProps = {
244
281
  setVisibleEntities: setVisibleEntities,
245
282
  getNodesList,
246
283
  setStorageType,
284
+ setHeader,
247
285
  };
248
286
 
249
287
  export default connect(mapStateToProps, mapDispatchToProps)(Storage);
@@ -1,8 +1,10 @@
1
+ @import '../../styles/mixins.scss';
2
+
1
3
  .global-storage {
2
4
  display: flex;
3
5
  overflow: auto;
4
- align-items: flex-start;
5
6
  flex-direction: column;
7
+ align-items: flex-start;
6
8
 
7
9
  height: 100%;
8
10
  max-height: 100%;
@@ -12,29 +14,21 @@
12
14
  z-index: 2;
13
15
  top: 0;
14
16
 
15
- display: flex;
16
- align-items: center;
17
-
18
17
  width: 100%;
19
- padding: 20px 0;
20
18
 
21
19
  background-color: var(--yc-color-base-background);
20
+ @include controls();
22
21
  }
23
- &__filter {
24
- display: inline-block;
25
-
26
- width: 300px;
27
- margin-right: 15px;
28
- }
29
- &__control {
30
- margin-right: 15px;
22
+ &__search {
23
+ @include search();
31
24
  }
25
+
32
26
  &__table-wrapper {
33
27
  display: flex;
34
28
  flex: 1 1 auto;
35
29
  flex-direction: column;
36
30
 
37
- width: 100%;
31
+ min-width: 100%;
38
32
 
39
33
  font-size: var(--yc-text-body2-font-size);
40
34
  line-height: var(--yc-text-body2-line-height);
@@ -43,6 +37,10 @@
43
37
  // stylelint-disable-next-line declaration-no-important
44
38
  height: var(--yc-text-body2-line-height) !important;
45
39
  }
40
+
41
+ table {
42
+ min-width: 100%;
43
+ }
46
44
  }
47
45
 
48
46
  &__loader {
@@ -25,15 +25,7 @@ function StorageFilter(props) {
25
25
  const placeholder =
26
26
  props.storageType === StorageTypes.groups ? 'Group ID, Pool name' : 'Node ID, FQDN';
27
27
 
28
- return (
29
- <TextInput
30
- autoFocus
31
- placeholder={placeholder}
32
- value={filter}
33
- onUpdate={changeFilter}
34
- hasClear
35
- />
36
- );
28
+ return <TextInput placeholder={placeholder} value={filter} onUpdate={changeFilter} hasClear />;
37
29
  }
38
30
 
39
31
  export default StorageFilter;
@@ -4,6 +4,8 @@
4
4
  overflow-x: auto;
5
5
  overflow-y: hidden;
6
6
  justify-content: center;
7
+
8
+ min-width: 500px;
7
9
  }
8
10
  &__pool-name-wrapper {
9
11
  display: flex;
@@ -221,7 +221,7 @@ function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGro
221
221
  return data ? (
222
222
  <DataTable
223
223
  key={visibleEntities as string}
224
- theme="internal"
224
+ theme="yandex-cloud"
225
225
  data={data}
226
226
  columns={columns}
227
227
  settings={tableSettings}