ydb-embedded-ui 0.1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -3
  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 +175 -0
  136. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +319 -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 +95 -0
  141. package/dist/containers/Tenant/QueryEditor/QueryEditor.js +319 -268
  142. package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +47 -18
  143. package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +190 -75
  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/executeQuery.js +36 -2
  175. package/dist/store/reducers/fullscreen.ts +31 -0
  176. package/dist/store/reducers/header.ts +23 -0
  177. package/dist/store/reducers/hotKeys.js +1 -1
  178. package/dist/store/reducers/index.js +6 -0
  179. package/dist/store/reducers/saveQuery.ts +33 -0
  180. package/dist/store/reducers/schema.js +14 -0
  181. package/dist/store/reducers/shardsWorkload.js +1 -1
  182. package/dist/store/state-url-mapping.js +1 -1
  183. package/dist/store/utils.js +2 -6
  184. package/dist/styles/mixins.scss +49 -34
  185. package/dist/utils/autofetcher.ts +51 -0
  186. package/dist/utils/constants.js +26 -7
  187. package/dist/utils/createToast.tsx +23 -0
  188. package/dist/utils/getNodesColumns.js +25 -28
  189. package/dist/utils/index.js +6 -2
  190. package/package.json +8 -4
  191. package/dist/components/SplitPane/SplitPane.js +0 -368
  192. package/dist/components/TenantOverview/TenantOverview.js +0 -148
  193. package/dist/containers/Cluster/Cluster.js +0 -168
  194. package/dist/containers/Header/Header.js +0 -88
  195. package/dist/containers/StorageV2/DiskStateProgressBar/DiskStateProgressBar.scss +0 -81
  196. package/dist/containers/Tenant/Compute/Compute.scss +0 -6
  197. package/dist/containers/Tenant/Healthcheck/Healthcheck.js +0 -116
  198. package/dist/containers/Tenant/Healthcheck/Healthcheck.scss +0 -64
  199. package/dist/containers/Tenant/Schema/Info/Info.js +0 -84
  200. package/dist/containers/Tenant/Schema/Info/Info.scss +0 -3
  201. package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.js +0 -439
  202. package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.scss +0 -90
  203. package/dist/containers/Tenant/Schema/SchemaPages.js +0 -56
  204. package/dist/containers/Tenant/Tenant.js +0 -199
  205. package/dist/containers/Tenant/TenantPages.js +0 -35
@@ -1,439 +0,0 @@
1
- import React from 'react';
2
- import cn from 'bem-cn-lite';
3
- import PropTypes from 'prop-types';
4
- import {connect} from 'react-redux';
5
- import _ from 'lodash';
6
-
7
- import {
8
- Link as ExternalLink,
9
- Tabs,
10
- ClipboardButton,
11
- HelpTooltip,
12
- Switch,
13
- } from '@yandex-cloud/uikit';
14
- import SplitPane from '../../../../components/SplitPane';
15
-
16
- import Info from '../Info/Info';
17
- import {
18
- GENERAL_SCHEMA_PAGES,
19
- TABLETS,
20
- INFO,
21
- QUERY,
22
- GRAPH,
23
- PREVIEW,
24
- DESCRIBE,
25
- ACL,
26
- TOP_QUERIES,
27
- TOP_SHARDS,
28
- HOT_KEYS,
29
- TABLE_SCHEMA_PAGES,
30
- } from '../SchemaPages';
31
- import QueryEditor from '../../../Tenant/QueryEditor/QueryEditor';
32
- import Preview from '../../../Tenant/Preview/Preview';
33
- import Tablets from '../../../Tablets/Tablets';
34
- import Heatmap from '../../../Heatmap/Heatmap';
35
- import Describe from '../../../Tenant/Describe/Describe';
36
- import Acl from '../../../Tenant/Acl/Acl';
37
- import TopQueries from '../../../Tenant/TopQueries/TopQueries';
38
- import TopShards from '../../../Tenant/TopShards/TopShards';
39
- import SchemaNode from '../SchemaNode/SchemaNode';
40
- import HotKeys from '../HotKeys/HotKeys';
41
-
42
- import {getDescribe} from '../../../../store/reducers/describe';
43
- import {getSchemaAcl} from '../../../../store/reducers/schemaAcl';
44
- import {getSchema, enableAutorefresh, disableAutorefresh} from '../../../../store/reducers/schema';
45
- import {getOlapStats} from '../../../../store/reducers/olapStats';
46
- import {DEFAULT_SIZE_SHEMA_TREE_PANE_KEY} from '../../../../utils/constants';
47
- import routes, {createHref} from '../../../../routes';
48
-
49
- import {AutoFetcher} from '../../../Cluster/Cluster';
50
-
51
- import './SchemaMain.scss';
52
- import HistoryContext from '../../../../contexts/HistoryContext';
53
- const b = cn('schema-main');
54
-
55
- export const TABLE_TYPE = 'Table';
56
- export const OLAP_TABLE_TYPE = 'OlapTable';
57
- export const OLAP_STORE_TYPE = 'OlapStore';
58
-
59
- class SchemaMain extends React.Component {
60
- static propTypes = {
61
- tenantName: PropTypes.string,
62
- activeTab: PropTypes.string,
63
- currentItem: PropTypes.object,
64
- tenant: PropTypes.object,
65
- tenantNodes: PropTypes.array,
66
- tenantActiveTab: PropTypes.string,
67
- host: PropTypes.object,
68
- singleClusterMode: PropTypes.bool,
69
- getBackend: PropTypes.func,
70
- };
71
-
72
- autofetcher;
73
-
74
- state = {
75
- entityType: '',
76
- };
77
-
78
- componentDidMount() {
79
- this.autofetcher = new AutoFetcher();
80
- this.autofetcher.active = false;
81
- this.fetchData();
82
- this.setState({entityType: this.getEntityType()});
83
- }
84
-
85
- componentDidUpdate(prevProps) {
86
- const {
87
- autorefresh,
88
- schemaPath,
89
- disableAutorefresh,
90
- activeTab,
91
- getOlapStats,
92
- schemaPath: path,
93
- } = this.props;
94
-
95
- const entityType = this.getEntityType();
96
-
97
- if (entityType !== this.state.entityType) {
98
- this.setState({entityType});
99
- if (entityType === OLAP_TABLE_TYPE) {
100
- getOlapStats({path});
101
- }
102
- }
103
-
104
- if (schemaPath !== prevProps.schemaPath) {
105
- this.fetchData();
106
- if (autorefresh) {
107
- disableAutorefresh();
108
- this.autofetcher.stop();
109
- }
110
- }
111
- switch (activeTab) {
112
- case INFO:
113
- case DESCRIBE:
114
- case ACL:
115
- if (!this.autofetcher.active && autorefresh) {
116
- this.fetchData();
117
- this.autofetcher.start();
118
- this.autofetcher.fetch(() => this.fetchData());
119
- }
120
- break;
121
-
122
- default:
123
- if (this.autofetcher.active) {
124
- this.autofetcher.stop();
125
- }
126
- }
127
-
128
- if (!autorefresh && prevProps.autorefresh) {
129
- this.autofetcher.stop();
130
- }
131
- }
132
- componentWillUnmount() {
133
- this.autofetcher.stop();
134
- }
135
-
136
- fetchData = () => {
137
- const {
138
- getSchema,
139
- getDescribe,
140
- getSchemaAcl,
141
- schemaPath: path,
142
- tenantName,
143
- getOlapStats,
144
- } = this.props;
145
-
146
- const entityType = this.getEntityType();
147
-
148
- if (entityType === OLAP_TABLE_TYPE) {
149
- getOlapStats({path});
150
- }
151
-
152
- getSchema({path: tenantName});
153
- getSchema({path});
154
- getDescribe({path});
155
- getSchemaAcl({path});
156
- };
157
-
158
- changeSchemaTab = (tab) => {
159
- const {tenantName, tenantActiveTab, queryParams} = this.props;
160
- this.history.push(
161
- createHref(
162
- routes.tenant,
163
- {page: tenantActiveTab},
164
- {...queryParams, name: tenantName, schemaTab: tab},
165
- ),
166
- );
167
- };
168
- renderSchemaTab() {
169
- const {currentItem, tenantName, activeTab, tenant, theme, olapStats} = this.props;
170
- const entityType = this.getEntityType();
171
- const tableSchema =
172
- currentItem?.PathDescription?.Table ||
173
- currentItem?.PathDescription?.OlapTableDescription;
174
-
175
- if (currentItem.Status !== 'StatusSuccess') {
176
- return <div>no data</div>;
177
- }
178
-
179
- switch (activeTab) {
180
- case QUERY: {
181
- return <QueryEditor path={tenantName} theme={theme} />;
182
- }
183
- case TABLETS: {
184
- return (
185
- <Tablets
186
- tenant={tenant}
187
- currentSchemaItem={currentItem}
188
- path={currentItem.Path}
189
- />
190
- );
191
- }
192
- case INFO: {
193
- return (
194
- <Info
195
- tableSchema={tableSchema}
196
- currentItem={currentItem}
197
- type={entityType}
198
- olapStats={olapStats}
199
- />
200
- );
201
- }
202
- case GRAPH: {
203
- return (
204
- <Heatmap
205
- tenant={tenant}
206
- currentSchemaItem={currentItem}
207
- path={currentItem.Path}
208
- />
209
- );
210
- }
211
- case PREVIEW: {
212
- const partCount = currentItem?.PathDescription?.TableStats?.PartCount;
213
-
214
- return (
215
- <Preview
216
- database={tenantName}
217
- table={currentItem.Path}
218
- type={entityType}
219
- partCount={partCount}
220
- />
221
- );
222
- }
223
- case DESCRIBE: {
224
- return <Describe />;
225
- }
226
- case ACL: {
227
- return <Acl />;
228
- }
229
- case TOP_QUERIES: {
230
- return (
231
- <TopQueries
232
- path={tenantName}
233
- changeSchemaTab={this.changeSchemaTab}
234
- type={entityType}
235
- />
236
- );
237
- }
238
- case TOP_SHARDS: {
239
- return <TopShards path={tenantName} type={entityType} />;
240
- }
241
- case HOT_KEYS: {
242
- if (entityType === TABLE_TYPE) {
243
- return <HotKeys path={tenantName} />;
244
- }
245
- return this.changeSchemaTab(INFO);
246
- }
247
- default:
248
- return false;
249
- }
250
- }
251
- getEntityType = () => {
252
- const {currentItem} = this.props;
253
- const pathType = currentItem?.PathDescription?.Self?.PathType;
254
-
255
- return pathType && pathType.replace('EPathType', '');
256
- };
257
-
258
- setAutorefresh = () => {
259
- const {autorefresh, enableAutorefresh, disableAutorefresh} = this.props;
260
- if (autorefresh) {
261
- disableAutorefresh();
262
- } else {
263
- enableAutorefresh();
264
- }
265
- };
266
-
267
- renderInfo = () => {
268
- const {
269
- currentItem: {Path, Status, Reason},
270
- autorefresh,
271
- } = this.props;
272
- const entityType = this.getEntityType();
273
-
274
- let message;
275
- if (!entityType && Status && Reason) {
276
- message = `${Status}: ${Reason}`;
277
- }
278
-
279
- return (
280
- <div className={b('info-wrapper')}>
281
- <div className={b('info')}>
282
- {entityType ? (
283
- <div className={b('entity-type')}>{entityType}</div>
284
- ) : (
285
- <div className={b('entity-type', {error: true})}>
286
- <HelpTooltip content={message} offset={{left: 0}} />
287
- </div>
288
- )}
289
- <div>{Path}</div>
290
- <span className={b('clipboard-button')}>
291
- <ClipboardButton text={Path} size={16} />
292
- </span>
293
- </div>
294
- <Switch
295
- onUpdate={this.setAutorefresh}
296
- checked={autorefresh}
297
- content="Autorefresh"
298
- />
299
- </div>
300
- );
301
- };
302
-
303
- onChange = (size) => {
304
- this.setDefaultSizePane(size);
305
- };
306
- setDefaultSizePane = (size) => {
307
- localStorage.setItem(DEFAULT_SIZE_SHEMA_TREE_PANE_KEY, size);
308
- };
309
- getDefaultSizePane = () => {
310
- let size = localStorage.getItem(DEFAULT_SIZE_SHEMA_TREE_PANE_KEY) || 250;
311
- size = `${size}px`;
312
-
313
- return size;
314
- };
315
-
316
- renderContent() {
317
- const {tenantName, tenantData = null, activeTab} = this.props;
318
- const entityType = this.getEntityType();
319
-
320
- const pages =
321
- entityType === TABLE_TYPE
322
- ? [...GENERAL_SCHEMA_PAGES, ...TABLE_SCHEMA_PAGES]
323
- : GENERAL_SCHEMA_PAGES;
324
-
325
- return (
326
- <div className={b()}>
327
- <SplitPane
328
- split="vertical"
329
- defaultSize={this.getDefaultSizePane()}
330
- maxSize={500}
331
- minSize={250}
332
- onChange={this.onChange}
333
- >
334
- <div className={b('tree')}>
335
- <SchemaNode fullPath={tenantName} data={tenantData} isRoot />
336
- </div>
337
- <div className={b('content')}>
338
- {this.renderInfo()}
339
- <div className={b('tabs')}>
340
- <Tabs
341
- items={pages}
342
- activeTab={activeTab}
343
- wrapTo={({id}, node) => (
344
- <span
345
- onClick={() => this.changeSchemaTab(id)}
346
- key={id}
347
- className={b('tab')}
348
- >
349
- {node}
350
- </span>
351
- )}
352
- allowNotSelected={true}
353
- />
354
- </div>
355
- <div className={b('tab-content')}>{this.renderSchemaTab()}</div>
356
- </div>
357
- </SplitPane>
358
- </div>
359
- );
360
- }
361
- renderHost = (item, index) => {
362
- const {tenantActiveTab, tenant, activeTab, getBackend} = this.props;
363
- const {Name: name} = tenant;
364
- const {backend} = item;
365
- const href = createHref(
366
- routes.tenant,
367
- {page: tenantActiveTab},
368
- {
369
- name,
370
- schemaTab: activeTab,
371
- backend: getBackend ? getBackend(backend) : undefined,
372
- },
373
- );
374
-
375
- return (
376
- <li className={b('host-link')}>
377
- <ExternalLink key={index} href={href} target="_self">
378
- {backend}
379
- </ExternalLink>
380
- </li>
381
- );
382
- };
383
- renderHosts() {
384
- const {tenantNodes} = this.props;
385
-
386
- return (
387
- <div className={b('hosts')}>
388
- <div className={b('hosts-message')}>Select endpoint to browse schema</div>
389
- <ul className={b('hosts-list')}>{tenantNodes.map(this.renderHost)}</ul>
390
- </div>
391
- );
392
- }
393
- render() {
394
- const {tenantNodes = [], host, singleClusterMode} = this.props;
395
- const correctHost = tenantNodes.map((node) => node.id).includes(host.NodeId);
396
-
397
- return (
398
- <HistoryContext.Consumer>
399
- {(history) => {
400
- this.history = history;
401
- return singleClusterMode || correctHost || !tenantNodes.length
402
- ? this.renderContent()
403
- : this.renderHosts();
404
- }}
405
- </HistoryContext.Consumer>
406
- );
407
- }
408
- }
409
-
410
- function mapStateToProps(state, ownProps) {
411
- const {currentSchema = {}, currentSchemaPath, data, autorefresh} = state.schema;
412
- const {data: olapStats} = state.olapStats;
413
- const {tenant = {}, tenantNodes} = state.tenant;
414
- const {data: host} = state.host;
415
- const {singleClusterMode} = state;
416
-
417
- return {
418
- singleClusterMode,
419
- currentItem: currentSchema,
420
- tenant,
421
- tenantNodes,
422
- tenantData: _.get(data[ownProps.tenantName], 'PathDescription.Self'),
423
- host,
424
- schemaPath: currentSchemaPath || ownProps.tenantName,
425
- autorefresh,
426
- olapStats,
427
- };
428
- }
429
-
430
- const mapDispatchToProps = {
431
- getDescribe,
432
- getSchemaAcl,
433
- getSchema,
434
- enableAutorefresh,
435
- disableAutorefresh,
436
- getOlapStats,
437
- };
438
-
439
- export default connect(mapStateToProps, mapDispatchToProps)(SchemaMain);
@@ -1,90 +0,0 @@
1
- @import '../../../../styles/mixins';
2
-
3
- .schema-main {
4
- display: flex;
5
- flex: 1 1 auto;
6
- overflow: auto;
7
- position: relative;
8
-
9
- &__tree {
10
- display: flex;
11
- flex: 0 0 auto;
12
- padding-left: 15px;
13
- padding-top: 15px;
14
- overflow: auto;
15
- height: 100%;
16
-
17
- .tree-view_item {
18
- padding: 2px 0;
19
- margin: 0;
20
- }
21
-
22
- & > div > .tree-view {
23
- padding-bottom: 15px;
24
- }
25
- }
26
- &__content {
27
- display: flex;
28
- flex-direction: column;
29
- flex: 1 1 auto;
30
- overflow: auto;
31
- height: 100%;
32
- }
33
- &__info-wrapper {
34
- display: flex;
35
- justify-content: space-between;
36
- align-items: center;
37
- padding: 15px 15px 5px;
38
- }
39
- &__info {
40
- display: flex;
41
- align-items: center;
42
- }
43
- &__entity-type {
44
- padding: 3px 8px;
45
- margin-right: 5px;
46
- border-radius: 3px;
47
- background-color: var(--yc-color-base-generic);
48
- text-transform: lowercase;
49
-
50
- &_error {
51
- padding: 3px 0;
52
- background-color: transparent;
53
- }
54
- }
55
-
56
- &__tabs {
57
- padding: 0 15px;
58
- }
59
-
60
- &__tab-content {
61
- display: flex;
62
- flex-direction: column;
63
- flex: 1 1 auto;
64
- padding: 0 15px;
65
- overflow-y: auto;
66
- }
67
-
68
- &__hosts {
69
- padding: 15px;
70
- }
71
- &__hosts-message {
72
- @include body2-typography();
73
- margin-bottom: 10px;
74
- }
75
- &__hosts-list {
76
- margin: 10px 0;
77
- padding-left: 7px;
78
- list-style-type: none;
79
- }
80
- &__host-link {
81
- font-size: var(--yc-text-body2-font-size);
82
- line-height: var(--yc-text-body2-line-height);
83
- margin-bottom: 3px;
84
- }
85
-
86
- &__clipboard-button {
87
- margin-left: 5px;
88
- color: var(--yc-color-text-secondary);
89
- }
90
- }
@@ -1,56 +0,0 @@
1
- export const QUERY = 'Query';
2
- export const INFO = 'Info';
3
- export const PREVIEW = 'Preview';
4
- export const TABLETS = 'Tablets';
5
- export const GRAPH = 'Graph';
6
- export const DESCRIBE = 'Describe';
7
- export const ACL = 'ACL';
8
- export const TOP_QUERIES = 'Top queries';
9
- export const TOP_SHARDS = 'Top shards';
10
- export const HOT_KEYS = 'Hot keys';
11
-
12
- export const GENERAL_SCHEMA_PAGES = [
13
- {
14
- id: INFO,
15
- name: 'Info',
16
- },
17
- {
18
- id: PREVIEW,
19
- name: 'Preview',
20
- },
21
- {
22
- id: GRAPH,
23
- name: 'Graph',
24
- },
25
- {
26
- id: DESCRIBE,
27
- name: DESCRIBE,
28
- },
29
- {
30
- id: QUERY,
31
- name: 'Query',
32
- },
33
- {
34
- id: TABLETS,
35
- name: 'Tablets',
36
- },
37
- {
38
- id: ACL,
39
- name: 'ACL',
40
- },
41
- {
42
- id: TOP_QUERIES,
43
- name: 'Top queries',
44
- },
45
- {
46
- id: TOP_SHARDS,
47
- name: 'Top shards',
48
- },
49
- ];
50
-
51
- export const TABLE_SCHEMA_PAGES = [
52
- {
53
- id: HOT_KEYS,
54
- name: 'Hot keys',
55
- },
56
- ];