ydb-embedded-ui 4.4.2 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/ContentWithPopup/ContentWithPopup.tsx +51 -0
  3. package/dist/components/CriticalActionDialog/CriticalActionDialog.tsx +3 -0
  4. package/dist/components/ExternalLinkWithIcon/ExternalLinkWithIcon.scss +7 -0
  5. package/dist/components/ExternalLinkWithIcon/ExternalLinkWithIcon.tsx +24 -0
  6. package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +2 -2
  7. package/dist/components/PoolBar/PoolBar.scss +6 -1
  8. package/dist/components/PoolBar/PoolBar.tsx +39 -0
  9. package/dist/components/PoolsGraph/PoolsGraph.scss +1 -1
  10. package/dist/components/PoolsGraph/PoolsGraph.tsx +23 -0
  11. package/dist/components/Tablet/Tablet.scss +4 -1
  12. package/dist/components/Tablet/Tablet.tsx +11 -35
  13. package/dist/components/{Tooltips/NodeEndpointsTooltip/NodeEndpointsTooltip.scss → TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.scss} +1 -1
  14. package/dist/components/{Tooltips/NodeEndpointsTooltip/NodeEndpointsTooltip.tsx → TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.tsx} +3 -3
  15. package/dist/components/TooltipsContent/PoolTooltipContent/PoolTooltipContent.tsx +24 -0
  16. package/dist/components/TooltipsContent/TabletTooltipContent/TabletTooltipContent.tsx +34 -0
  17. package/dist/components/TooltipsContent/index.ts +3 -0
  18. package/dist/containers/Cluster/Cluster.tsx +14 -10
  19. package/dist/containers/{ClusterInfo → Cluster/ClusterInfo}/ClusterInfo.scss +8 -40
  20. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +223 -0
  21. package/dist/containers/{ClusterInfo → Cluster/ClusterInfo}/utils.ts +1 -1
  22. package/dist/containers/Cluster/VersionsBar/VersionsBar.scss +27 -0
  23. package/dist/containers/Cluster/VersionsBar/VersionsBar.tsx +33 -0
  24. package/dist/containers/Header/Header.tsx +3 -6
  25. package/dist/containers/Nodes/Nodes.tsx +0 -11
  26. package/dist/containers/Nodes/getNodesColumns.tsx +3 -20
  27. package/dist/containers/Tablet/Tablet.scss +4 -0
  28. package/dist/containers/Tablet/Tablet.tsx +2 -1
  29. package/dist/containers/Tablet/TabletControls/TabletControls.tsx +19 -27
  30. package/dist/containers/Tablets/Tablets.tsx +1 -17
  31. package/dist/containers/TabletsFilters/TabletsFilters.js +2 -14
  32. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +2 -2
  33. package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +37 -38
  34. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +15 -28
  35. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +4 -14
  36. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +5 -3
  37. package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +2 -3
  38. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +3 -3
  39. package/dist/containers/Tenant/Tenant.tsx +14 -15
  40. package/dist/containers/Tenant/TenantPages.tsx +3 -6
  41. package/dist/containers/Tenant/utils/schemaActions.ts +4 -4
  42. package/dist/containers/Tenants/Tenants.js +3 -17
  43. package/dist/containers/Versions/NodesTable/NodesTable.tsx +4 -34
  44. package/dist/routes.ts +1 -1
  45. package/dist/store/reducers/index.ts +1 -1
  46. package/dist/store/reducers/tenant/constants.ts +19 -0
  47. package/dist/store/reducers/{tenant.js → tenant/tenant.ts} +27 -36
  48. package/dist/store/reducers/tenant/types.ts +25 -0
  49. package/dist/types/additionalProps.ts +11 -0
  50. package/dist/utils/index.js +2 -1
  51. package/dist/utils/tooltip.js +8 -80
  52. package/package.json +2 -1
  53. package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -25
  54. package/dist/components/Breadcrumbs/Breadcrumbs.scss +0 -5
  55. package/dist/components/Collapse/Collapse.js +0 -84
  56. package/dist/components/Collapse/Collapse.scss +0 -70
  57. package/dist/components/PoolBar/PoolBar.js +0 -52
  58. package/dist/components/PoolsGraph/PoolsGraph.js +0 -33
  59. package/dist/containers/ClusterInfo/ClusterInfo.tsx +0 -207
@@ -7,37 +7,36 @@ import {useLocation} from 'react-router';
7
7
 
8
8
  import {Switch, Tabs} from '@gravity-ui/uikit';
9
9
 
10
+ import type {EPathType} from '../../../types/api/schema';
11
+
12
+ import {useTypedSelector} from '../../../utils/hooks';
13
+ import routes, {createHref} from '../../../routes';
14
+ import type {TenantDiagnosticsTab, TenantGeneralTab} from '../../../store/reducers/tenant/types';
15
+ import {enableAutorefresh, disableAutorefresh} from '../../../store/reducers/schema';
16
+ import {setTopLevelTab, setDiagnosticsTab} from '../../../store/reducers/tenant/tenant';
17
+ import {TENANT_DIAGNOSTICS_TABS_IDS} from '../../../store/reducers/tenant/constants';
18
+
10
19
  import {Loader} from '../../../components/Loader';
11
20
 
12
- import {TopQueries} from './TopQueries';
13
- //@ts-ignore
14
- import DetailedOverview from './DetailedOverview/DetailedOverview';
15
- import {TopShards} from './TopShards';
16
- //@ts-ignore
17
- import Storage from '../../Storage/Storage';
18
- //@ts-ignore
19
- import Network from './Network/Network';
20
- //@ts-ignore
21
- import Describe from './Describe/Describe';
22
- //@ts-ignore
23
- import HotKeys from './HotKeys/HotKeys';
24
- //@ts-ignore
25
21
  import {Heatmap} from '../../Heatmap';
26
22
  import {Nodes} from '../../Nodes';
27
- //@ts-ignore
23
+ import Storage from '../../Storage/Storage';
28
24
  import {Tablets} from '../../Tablets';
29
- import {Consumers} from './Consumers';
25
+
26
+ import Describe from './Describe/Describe';
27
+ import HotKeys from './HotKeys/HotKeys';
28
+ import Network from './Network/Network';
30
29
  import {Partitions} from './Partitions/Partitions';
30
+ import {Consumers} from './Consumers';
31
+ import {TopQueries} from './TopQueries';
32
+ import {TopShards} from './TopShards';
33
+ import DetailedOverview from './DetailedOverview/DetailedOverview';
31
34
 
32
- import routes, {createHref} from '../../../routes';
33
- import type {EPathType} from '../../../types/api/schema';
34
- import {TenantGeneralTabsIds, TenantTabsGroups} from '../TenantPages';
35
- import {GeneralPagesIds, DATABASE_PAGES, getPagesByType} from './DiagnosticsPages';
36
- //@ts-ignore
37
- import {enableAutorefresh, disableAutorefresh} from '../../../store/reducers/schema';
38
- import {setTopLevelTab, setDiagnosticsTab} from '../../../store/reducers/tenant';
39
35
  import {isDatabaseEntityType} from '../utils/schema';
40
36
 
37
+ import {TenantTabsGroups} from '../TenantPages';
38
+ import {DATABASE_PAGES, getPagesByType} from './DiagnosticsPages';
39
+
41
40
  import './Diagnostics.scss';
42
41
 
43
42
  interface DiagnosticsProps {
@@ -51,8 +50,8 @@ const b = cn('kv-tenant-diagnostics');
51
50
  function Diagnostics(props: DiagnosticsProps) {
52
51
  const dispatch = useDispatch();
53
52
  const {currentSchemaPath, autorefresh} = useSelector((state: any) => state.schema);
54
- const {diagnosticsTab = GeneralPagesIds.overview, wasLoaded} = useSelector(
55
- (state: any) => state.tenant,
53
+ const {diagnosticsTab = TENANT_DIAGNOSTICS_TABS_IDS.overview, wasLoaded} = useTypedSelector(
54
+ (state) => state.tenant,
56
55
  );
57
56
 
58
57
  const location = useLocation();
@@ -73,7 +72,7 @@ function Diagnostics(props: DiagnosticsProps) {
73
72
  return getPagesByType(props.type);
74
73
  }, [props.type, isDatabase]);
75
74
 
76
- const forwardToDiagnosticTab = (tab: GeneralPagesIds) => {
75
+ const forwardToDiagnosticTab = (tab: TenantDiagnosticsTab) => {
77
76
  dispatch(setDiagnosticsTab(tab));
78
77
  };
79
78
  const activeTab = useMemo(() => {
@@ -97,7 +96,7 @@ function Diagnostics(props: DiagnosticsProps) {
97
96
  }
98
97
  };
99
98
 
100
- const forwardToGeneralTab = (tab: TenantGeneralTabsIds) => {
99
+ const forwardToGeneralTab = (tab: TenantGeneralTab) => {
101
100
  dispatch(setTopLevelTab(tab));
102
101
  };
103
102
 
@@ -107,7 +106,7 @@ function Diagnostics(props: DiagnosticsProps) {
107
106
  const tenantNameString = tenantName as string;
108
107
 
109
108
  switch (diagnosticsTab) {
110
- case GeneralPagesIds.overview: {
109
+ case TENANT_DIAGNOSTICS_TABS_IDS.overview: {
111
110
  return (
112
111
  <DetailedOverview
113
112
  type={type}
@@ -116,7 +115,7 @@ function Diagnostics(props: DiagnosticsProps) {
116
115
  />
117
116
  );
118
117
  }
119
- case GeneralPagesIds.topQueries: {
118
+ case TENANT_DIAGNOSTICS_TABS_IDS.topQueries: {
120
119
  return (
121
120
  <TopQueries
122
121
  path={tenantNameString}
@@ -125,10 +124,10 @@ function Diagnostics(props: DiagnosticsProps) {
125
124
  />
126
125
  );
127
126
  }
128
- case GeneralPagesIds.topShards: {
127
+ case TENANT_DIAGNOSTICS_TABS_IDS.topShards: {
129
128
  return <TopShards tenantPath={tenantNameString} type={type} />;
130
129
  }
131
- case GeneralPagesIds.nodes: {
130
+ case TENANT_DIAGNOSTICS_TABS_IDS.nodes: {
132
131
  return (
133
132
  <Nodes
134
133
  path={currentSchemaPath}
@@ -137,28 +136,28 @@ function Diagnostics(props: DiagnosticsProps) {
137
136
  />
138
137
  );
139
138
  }
140
- case GeneralPagesIds.tablets: {
139
+ case TENANT_DIAGNOSTICS_TABS_IDS.tablets: {
141
140
  return <Tablets path={currentSchemaPath} />;
142
141
  }
143
- case GeneralPagesIds.storage: {
142
+ case TENANT_DIAGNOSTICS_TABS_IDS.storage: {
144
143
  return <Storage tenant={tenantNameString} database={true} />;
145
144
  }
146
- case GeneralPagesIds.network: {
145
+ case TENANT_DIAGNOSTICS_TABS_IDS.network: {
147
146
  return <Network path={tenantNameString} />;
148
147
  }
149
- case GeneralPagesIds.describe: {
148
+ case TENANT_DIAGNOSTICS_TABS_IDS.describe: {
150
149
  return <Describe tenant={tenantNameString} type={type} />;
151
150
  }
152
- case GeneralPagesIds.hotKeys: {
151
+ case TENANT_DIAGNOSTICS_TABS_IDS.hotKeys: {
153
152
  return <HotKeys type={type} />;
154
153
  }
155
- case GeneralPagesIds.graph: {
154
+ case TENANT_DIAGNOSTICS_TABS_IDS.graph: {
156
155
  return <Heatmap path={currentSchemaPath} />;
157
156
  }
158
- case GeneralPagesIds.consumers: {
157
+ case TENANT_DIAGNOSTICS_TABS_IDS.consumers: {
159
158
  return <Consumers path={currentSchemaPath} type={type} />;
160
159
  }
161
- case GeneralPagesIds.partitions: {
160
+ case TENANT_DIAGNOSTICS_TABS_IDS.partitions: {
162
161
  return <Partitions path={currentSchemaPath} />;
163
162
  }
164
163
  default: {
@@ -1,80 +1,67 @@
1
+ import type {TenantDiagnosticsTab} from '../../../store/reducers/tenant/types';
2
+ import {TENANT_DIAGNOSTICS_TABS_IDS} from '../../../store/reducers/tenant/constants';
1
3
  import {EPathType} from '../../../types/api/schema';
2
4
 
3
- export enum GeneralPagesIds {
4
- 'overview' = 'Overview',
5
- 'topQueries' = 'topQueries',
6
- 'topShards' = 'topShards',
7
- 'nodes' = 'Nodes',
8
- 'tablets' = 'Tablets',
9
- 'storage' = 'Storage',
10
- 'network' = 'Network',
11
- 'describe' = 'Describe',
12
- 'hotKeys' = 'hotKeys',
13
- 'graph' = 'graph',
14
- 'consumers' = 'consumers',
15
- 'partitions' = 'partitions',
16
- }
17
-
18
5
  type Page = {
19
- id: GeneralPagesIds;
6
+ id: TenantDiagnosticsTab;
20
7
  title: string;
21
8
  };
22
9
 
23
10
  const overview = {
24
- id: GeneralPagesIds.overview,
11
+ id: TENANT_DIAGNOSTICS_TABS_IDS.overview,
25
12
  title: 'Info',
26
13
  };
27
14
 
28
15
  const topQueries = {
29
- id: GeneralPagesIds.topQueries,
16
+ id: TENANT_DIAGNOSTICS_TABS_IDS.topQueries,
30
17
  title: 'Top queries',
31
18
  };
32
19
 
33
20
  const topShards = {
34
- id: GeneralPagesIds.topShards,
21
+ id: TENANT_DIAGNOSTICS_TABS_IDS.topShards,
35
22
  title: 'Top shards',
36
23
  };
37
24
 
38
25
  const nodes = {
39
- id: GeneralPagesIds.nodes,
26
+ id: TENANT_DIAGNOSTICS_TABS_IDS.nodes,
40
27
  title: 'Nodes',
41
28
  };
42
29
 
43
30
  const tablets = {
44
- id: GeneralPagesIds.tablets,
31
+ id: TENANT_DIAGNOSTICS_TABS_IDS.tablets,
45
32
  title: 'Tablets',
46
33
  };
47
34
  const storage = {
48
- id: GeneralPagesIds.storage,
35
+ id: TENANT_DIAGNOSTICS_TABS_IDS.storage,
49
36
  title: 'Storage',
50
37
  };
51
38
  const network = {
52
- id: GeneralPagesIds.network,
39
+ id: TENANT_DIAGNOSTICS_TABS_IDS.network,
53
40
  title: 'Network',
54
41
  };
55
42
 
56
43
  const describe = {
57
- id: GeneralPagesIds.describe,
44
+ id: TENANT_DIAGNOSTICS_TABS_IDS.describe,
58
45
  title: 'Describe',
59
46
  };
60
47
 
61
48
  const hotKeys = {
62
- id: GeneralPagesIds.hotKeys,
49
+ id: TENANT_DIAGNOSTICS_TABS_IDS.hotKeys,
63
50
  title: 'Hot keys',
64
51
  };
65
52
 
66
53
  const graph = {
67
- id: GeneralPagesIds.graph,
54
+ id: TENANT_DIAGNOSTICS_TABS_IDS.graph,
68
55
  title: 'Graph',
69
56
  };
70
57
 
71
58
  const consumers = {
72
- id: GeneralPagesIds.consumers,
59
+ id: TENANT_DIAGNOSTICS_TABS_IDS.consumers,
73
60
  title: 'Consumers',
74
61
  };
75
62
 
76
63
  const partitions = {
77
- id: GeneralPagesIds.partitions,
64
+ id: TENANT_DIAGNOSTICS_TABS_IDS.partitions,
78
65
  title: 'Partitions',
79
66
  };
80
67
 
@@ -9,8 +9,7 @@ import InfoViewer from '../../../../components/InfoViewer/InfoViewer';
9
9
  import PoolUsage from '../../../../components/PoolUsage/PoolUsage';
10
10
  import {Tablet} from '../../../../components/Tablet';
11
11
 
12
- import {hideTooltip, showTooltip} from '../../../../store/reducers/tooltip';
13
- import {getTenantInfo} from '../../../../store/reducers/tenant';
12
+ import {getTenantInfo} from '../../../../store/reducers/tenant/tenant';
14
13
 
15
14
  import {formatCPU} from '../../../../utils';
16
15
  import {bytesToGB} from '../../../../utils/utils';
@@ -44,8 +43,6 @@ class TenantOverview extends React.Component {
44
43
  loading: PropTypes.bool,
45
44
  autorefresh: PropTypes.bool,
46
45
  tenant: PropTypes.object,
47
- hideTooltip: PropTypes.func,
48
- showTooltip: PropTypes.func,
49
46
  systemTablets: PropTypes.array,
50
47
  additionalTenantInfo: PropTypes.func,
51
48
  tenantName: PropTypes.string,
@@ -102,7 +99,7 @@ class TenantOverview extends React.Component {
102
99
  };
103
100
 
104
101
  render() {
105
- const {tenant, hideTooltip, showTooltip, loading} = this.props;
102
+ const {tenant, loading} = this.props;
106
103
  const {
107
104
  Metrics = {},
108
105
  PoolStats,
@@ -162,12 +159,7 @@ class TenantOverview extends React.Component {
162
159
  <div className={b('system-tablets')}>
163
160
  {SystemTablets &&
164
161
  SystemTablets.map((tablet, tabletIndex) => (
165
- <Tablet
166
- onMouseEnter={showTooltip}
167
- onMouseLeave={hideTooltip}
168
- key={tabletIndex}
169
- tablet={tablet}
170
- />
162
+ <Tablet key={tabletIndex} tablet={tablet} />
171
163
  ))}
172
164
  </div>
173
165
  <div className={b('common-info')}>
@@ -199,7 +191,7 @@ class TenantOverview extends React.Component {
199
191
  }
200
192
 
201
193
  function mapStateToProps(state) {
202
- const {tenant = {}, loading, data: {status} = {}} = state.tenant;
194
+ const {tenant = {}, loading, error: {status} = {}} = state.tenant;
203
195
  const {autorefresh} = state.schema;
204
196
 
205
197
  return {
@@ -211,8 +203,6 @@ function mapStateToProps(state) {
211
203
  }
212
204
 
213
205
  const mapDispatchToProps = {
214
- hideTooltip,
215
- showTooltip,
216
206
  getTenantInfo,
217
207
  };
218
208
 
@@ -22,7 +22,9 @@ import type {KeyValueRow} from '../../../../types/api/query';
22
22
  import type {EPathType} from '../../../../types/api/schema';
23
23
  import type {ITopQueriesFilters} from '../../../../types/store/executeTopQueries';
24
24
  import type {IQueryResult} from '../../../../types/store/query';
25
+ import type {TenantGeneralTab} from '../../../../store/reducers/tenant/types';
25
26
 
27
+ import {TENANT_GENERAL_TABS_IDS} from '../../../../store/reducers/tenant/constants';
26
28
  import {formatDateTime, formatNumber} from '../../../../utils';
27
29
  import {DEFAULT_TABLE_SETTINGS, HOUR_IN_SECONDS} from '../../../../utils/constants';
28
30
  import {useAutofetcher, useTypedSelector} from '../../../../utils/hooks';
@@ -30,7 +32,7 @@ import {prepareQueryError} from '../../../../utils/query';
30
32
  import routes, {createHref} from '../../../../routes';
31
33
 
32
34
  import {isColumnEntityType} from '../../utils/schema';
33
- import {TenantGeneralTabsIds, TenantTabsGroups} from '../../TenantPages';
35
+ import {TenantTabsGroups} from '../../TenantPages';
34
36
 
35
37
  import i18n from './i18n';
36
38
  import './TopQueries.scss';
@@ -86,7 +88,7 @@ const COLUMNS: Column<KeyValueRow>[] = [
86
88
 
87
89
  interface TopQueriesProps {
88
90
  path: string;
89
- changeSchemaTab: (tab: TenantGeneralTabsIds) => void;
91
+ changeSchemaTab: (tab: TenantGeneralTab) => void;
90
92
  type?: EPathType;
91
93
  }
92
94
 
@@ -178,7 +180,7 @@ export const TopQueries = ({path, type}: TopQueriesProps) => {
178
180
 
179
181
  const queryPath = createHref(routes.tenant, undefined, {
180
182
  ...queryParams,
181
- [TenantTabsGroups.general]: TenantGeneralTabsIds.query,
183
+ [TenantTabsGroups.general]: TENANT_GENERAL_TABS_IDS.query,
182
184
  });
183
185
 
184
186
  history.push(queryPath);
@@ -5,12 +5,11 @@ import cn from 'bem-cn-lite';
5
5
  import {useThemeValue} from '@gravity-ui/uikit';
6
6
 
7
7
  import type {EPathType} from '../../../types/api/schema';
8
+ import {TENANT_GENERAL_TABS_IDS} from '../../../store/reducers/tenant/constants';
8
9
 
9
10
  import QueryEditor from '../QueryEditor/QueryEditor';
10
11
  import Diagnostics from '../Diagnostics/Diagnostics';
11
12
 
12
- import {TenantGeneralTabsIds} from '../TenantPages';
13
-
14
13
  import './ObjectGeneral.scss';
15
14
 
16
15
  const b = cn('object-general');
@@ -35,7 +34,7 @@ function ObjectGeneral(props: ObjectGeneralProps) {
35
34
  const renderTabContent = () => {
36
35
  const {type, additionalTenantInfo, additionalNodesInfo} = props;
37
36
  switch (generalTab) {
38
- case TenantGeneralTabsIds.query: {
37
+ case TENANT_GENERAL_TABS_IDS.query: {
39
38
  return <QueryEditor path={tenantName as string} theme={theme} type={type} />;
40
39
  }
41
40
  default: {
@@ -35,7 +35,6 @@ import {
35
35
  DEFAULT_SIZE_TENANT_SUMMARY_KEY,
36
36
  } from '../../../utils/constants';
37
37
  import {
38
- TenantGeneralTabsIds,
39
38
  TenantInfoTabsIds,
40
39
  TenantTabsGroups,
41
40
  TENANT_INFO_TABS,
@@ -48,7 +47,8 @@ import {
48
47
  PaneVisibilityToggleButtons,
49
48
  } from '../utils/paneVisibilityToggleHelpers';
50
49
  import {setShowPreview} from '../../../store/reducers/schema';
51
- import {setTopLevelTab} from '../../../store/reducers/tenant';
50
+ import {setTopLevelTab} from '../../../store/reducers/tenant/tenant';
51
+ import {TENANT_GENERAL_TABS_IDS} from '../../../store/reducers/tenant/constants';
52
52
 
53
53
  import './ObjectSummary.scss';
54
54
 
@@ -275,7 +275,7 @@ function ObjectSummary(props: ObjectSummaryProps) {
275
275
 
276
276
  const onOpenPreview = () => {
277
277
  dispatch(setShowPreview(true));
278
- dispatch(setTopLevelTab(TenantGeneralTabsIds.query));
278
+ dispatch(setTopLevelTab(TENANT_GENERAL_TABS_IDS.query));
279
279
  };
280
280
 
281
281
  const renderCommonInfoControls = () => {
@@ -4,28 +4,27 @@ import cn from 'bem-cn-lite';
4
4
  import {useLocation} from 'react-router';
5
5
  import qs from 'qs';
6
6
 
7
- import {AccessDenied} from '../../components/Errors/403';
7
+ import type {TEvDescribeSchemeResult} from '../../types/api/schema';
8
8
 
9
+ import {DEFAULT_IS_TENANT_SUMMARY_COLLAPSED, DEFAULT_SIZE_TENANT_KEY} from '../../utils/constants';
10
+ import {useTypedSelector} from '../../utils/hooks';
11
+ import routes, {CLUSTER_PAGES, createHref} from '../../routes';
9
12
  import {setHeader} from '../../store/reducers/header';
13
+ import {disableAutorefresh, getSchema, resetLoadingState} from '../../store/reducers/schema';
14
+ import {getSchemaAcl} from '../../store/reducers/schemaAcl';
15
+ import {getTenantInfo, clearTenant} from '../../store/reducers/tenant/tenant';
16
+
17
+ import SplitPane from '../../components/SplitPane';
18
+ import {AccessDenied} from '../../components/Errors/403';
19
+
10
20
  import ObjectGeneralTabs from './ObjectGeneralTabs/ObjectGeneralTabs';
11
21
  import ObjectSummary from './ObjectSummary/ObjectSummary';
12
22
  import ObjectGeneral from './ObjectGeneral/ObjectGeneral';
13
- //@ts-ignore
14
- import SplitPane from '../../components/SplitPane';
15
- //@ts-ignore
16
- import {DEFAULT_IS_TENANT_SUMMARY_COLLAPSED, DEFAULT_SIZE_TENANT_KEY} from '../../utils/constants';
17
- //@ts-ignore
18
- import {disableAutorefresh, getSchema, resetLoadingState} from '../../store/reducers/schema';
19
- //@ts-ignore
20
- import {getSchemaAcl} from '../../store/reducers/schemaAcl';
23
+
21
24
  import {
22
25
  PaneVisibilityActionTypes,
23
26
  paneVisibilityToggleReducerCreator,
24
27
  } from './utils/paneVisibilityToggleHelpers';
25
- //@ts-ignore
26
- import {getTenantInfo, clearTenant} from '../../store/reducers/tenant';
27
- import routes, {CLUSTER_PAGES, createHref} from '../../routes';
28
- import type {TEvDescribeSchemeResult} from '../../types/api/schema';
29
28
 
30
29
  import './Tenant.scss';
31
30
 
@@ -63,8 +62,8 @@ function Tenant(props: TenantProps) {
63
62
  const {PathType: currentPathType, PathSubType: currentPathSubType} =
64
63
  (currentItem as TEvDescribeSchemeResult).PathDescription?.Self || {};
65
64
 
66
- const {data: {status: tenantStatus = 200} = {}} = useSelector((state: any) => state.tenant);
67
- const {error: {status: schemaStatus = 200} = {}} = useSelector((state: any) => state.schema);
65
+ const {error: {status: tenantStatus = 200} = {}} = useTypedSelector((state) => state.tenant);
66
+ const {error: {status: schemaStatus = 200} = {}} = useTypedSelector((state) => state.schema);
68
67
 
69
68
  const dispatch = useDispatch();
70
69
 
@@ -1,9 +1,6 @@
1
1
  import {Icon} from '../../components/Icon';
2
+ import {TENANT_GENERAL_TABS_IDS} from '../../store/reducers/tenant/constants';
2
3
 
3
- export enum TenantGeneralTabsIds {
4
- query = 'query',
5
- diagnostics = 'diagnostics',
6
- }
7
4
  export enum TenantInfoTabsIds {
8
5
  overview = 'overview',
9
6
  acl = 'acl',
@@ -18,12 +15,12 @@ export enum TenantTabsGroups {
18
15
 
19
16
  export const TENANT_GENERAL_TABS = [
20
17
  {
21
- id: TenantGeneralTabsIds.query,
18
+ id: TENANT_GENERAL_TABS_IDS.query,
22
19
  title: 'Query',
23
20
  icon: <Icon name="query" viewBox="0 0 16 16" />,
24
21
  },
25
22
  {
26
- id: TenantGeneralTabsIds.diagnostics,
23
+ id: TENANT_GENERAL_TABS_IDS.diagnostics,
27
24
  title: 'Diagnostics',
28
25
  icon: <Icon name="diagnostics" viewBox="0 0 17 16" />,
29
26
  },
@@ -3,9 +3,9 @@ import type {NavigationTreeNodeType, NavigationTreeProps} from 'ydb-ui-component
3
3
 
4
4
  import {changeUserInput} from '../../../store/reducers/executeQuery';
5
5
  import {setShowPreview} from '../../../store/reducers/schema';
6
- import {setTopLevelTab} from '../../../store/reducers/tenant';
6
+ import {setTopLevelTab} from '../../../store/reducers/tenant/tenant';
7
+ import {TENANT_GENERAL_TABS_IDS} from '../../../store/reducers/tenant/constants';
7
8
  import createToast from '../../../utils/createToast';
8
- import {TenantGeneralTabsIds} from '../TenantPages';
9
9
 
10
10
  const createTableTemplate = (path: string) => {
11
11
  return `CREATE TABLE \`${path}/my_table\`
@@ -37,7 +37,7 @@ const bindActions = (
37
37
  ) => {
38
38
  const inputQuery = (tmpl: (path: string) => string) => () => {
39
39
  dispatch(changeUserInput({input: tmpl(path)}));
40
- dispatch(setTopLevelTab(TenantGeneralTabsIds.query));
40
+ dispatch(setTopLevelTab(TENANT_GENERAL_TABS_IDS.query));
41
41
  setActivePath(path);
42
42
  };
43
43
 
@@ -66,7 +66,7 @@ const bindActions = (
66
66
  },
67
67
  openPreview: () => {
68
68
  dispatch(setShowPreview(true));
69
- dispatch(setTopLevelTab(TenantGeneralTabsIds.query));
69
+ dispatch(setTopLevelTab(TENANT_GENERAL_TABS_IDS.query));
70
70
  setActivePath(path);
71
71
  },
72
72
  };
@@ -9,7 +9,7 @@ import DataTable from '@gravity-ui/react-data-table';
9
9
  import {Loader, TextInput, Button} from '@gravity-ui/uikit';
10
10
 
11
11
  import EntityStatus from '../../components/EntityStatus/EntityStatus';
12
- import PoolsGraph from '../../components/PoolsGraph/PoolsGraph';
12
+ import {PoolsGraph} from '../../components/PoolsGraph/PoolsGraph';
13
13
  import {TabletsStatistic} from '../../components/TabletsStatistic';
14
14
  import {ProblemFilter} from '../../components/ProblemFilter';
15
15
  import {Illustration} from '../../components/Illustration';
@@ -17,7 +17,6 @@ import {AutoFetcher} from '../../utils/autofetcher';
17
17
 
18
18
  import routes, {CLUSTER_PAGES, createHref} from '../../routes';
19
19
  import {formatCPU, formatBytesToGigabyte, formatNumber} from '../../utils';
20
- import {hideTooltip, showTooltip} from '../../store/reducers/tooltip';
21
20
  import {withSearch} from '../../HOCS';
22
21
  import {DEFAULT_TABLE_SETTINGS, TENANT_INITIAL_TAB_KEY} from '../../utils/constants';
23
22
  import {getTenantsInfo} from '../../store/reducers/tenants/tenants';
@@ -50,8 +49,6 @@ class Tenants extends React.Component {
50
49
  error: PropTypes.bool,
51
50
  getTenantsInfo: PropTypes.func,
52
51
  tenants: PropTypes.array,
53
- showTooltip: PropTypes.func,
54
- hideTooltip: PropTypes.func,
55
52
  searchQuery: PropTypes.string,
56
53
  handleSearchQuery: PropTypes.func,
57
54
  setHeader: PropTypes.func,
@@ -121,8 +118,6 @@ class Tenants extends React.Component {
121
118
  const {
122
119
  tenants = [],
123
120
  searchQuery,
124
- showTooltip,
125
- hideTooltip,
126
121
  filter,
127
122
  handleSearchQuery,
128
123
  additionalTenantsInfo = {},
@@ -291,15 +286,8 @@ class Tenants extends React.Component {
291
286
  sortAccessor: ({PoolStats = []}) =>
292
287
  PoolStats.reduce((acc, item) => acc + item.Usage, 0),
293
288
  defaultOrder: DataTable.DESCENDING,
294
- align: DataTable.CENTER,
295
- render: ({value}) => (
296
- <PoolsGraph
297
- onMouseEnter={showTooltip}
298
- onMouseLeave={hideTooltip}
299
- rowInfo={value}
300
- pools={value}
301
- />
302
- ),
289
+ align: DataTable.LEFT,
290
+ render: ({value}) => <PoolsGraph rowInfo={value} pools={value} />,
303
291
  },
304
292
  {
305
293
  name: 'Tablets',
@@ -374,8 +362,6 @@ const mapStateToProps = (state) => {
374
362
 
375
363
  const mapDispatchToProps = {
376
364
  getTenantsInfo,
377
- hideTooltip,
378
- showTooltip,
379
365
  changeFilter,
380
366
  setHeader,
381
367
  };
@@ -1,26 +1,15 @@
1
- import {useDispatch} from 'react-redux';
2
-
3
1
  import DataTable, {Column} from '@gravity-ui/react-data-table';
4
2
 
5
3
  import type {PreparedClusterNode} from '../../../store/reducers/clusterNodes/types';
6
- import type {ShowTooltipFunction} from '../../../types/store/tooltip';
7
-
8
- import {hideTooltip, showTooltip} from '../../../store/reducers/tooltip';
9
4
  import {isUnavailableNode} from '../../../utils/nodes';
10
5
  import {formatBytes} from '../../../utils';
11
6
  import {getDefaultNodePath} from '../../Node/NodePages';
12
7
 
13
8
  import ProgressViewer from '../../../components/ProgressViewer/ProgressViewer';
14
- import PoolsGraph from '../../../components/PoolsGraph/PoolsGraph';
9
+ import {PoolsGraph} from '../../../components/PoolsGraph/PoolsGraph';
15
10
  import EntityStatus from '../../../components/EntityStatus/EntityStatus';
16
11
 
17
- const getColumns = ({
18
- onShowTooltip,
19
- onHideTooltip,
20
- }: {
21
- onShowTooltip: (...args: Parameters<ShowTooltipFunction>) => void;
22
- onHideTooltip: VoidFunction;
23
- }): Column<PreparedClusterNode>[] => [
12
+ const columns: Column<PreparedClusterNode>[] = [
24
13
  {
25
14
  name: 'NodeId',
26
15
  header: '#',
@@ -89,16 +78,7 @@ const getColumns = ({
89
78
  PoolStats.reduce((acc, item) => acc + (item.Usage || 0), 0),
90
79
  defaultOrder: DataTable.DESCENDING,
91
80
  width: '120px',
92
- render: ({row}) =>
93
- row.PoolStats ? (
94
- <PoolsGraph
95
- onMouseEnter={onShowTooltip}
96
- onMouseLeave={onHideTooltip}
97
- pools={row.PoolStats}
98
- />
99
- ) : (
100
- '—'
101
- ),
81
+ render: ({row}) => (row.PoolStats ? <PoolsGraph pools={row.PoolStats} /> : '—'),
102
82
  align: DataTable.LEFT,
103
83
  },
104
84
  {
@@ -127,21 +107,11 @@ interface NodesTableProps {
127
107
  }
128
108
 
129
109
  export const NodesTable = ({nodes}: NodesTableProps) => {
130
- const dispatch = useDispatch();
131
-
132
- const onShowTooltip = (...args: Parameters<ShowTooltipFunction>) => {
133
- dispatch(showTooltip(...args));
134
- };
135
-
136
- const onHideTooltip = () => {
137
- dispatch(hideTooltip());
138
- };
139
-
140
110
  return (
141
111
  <DataTable
142
112
  theme="yandex-cloud"
143
113
  data={nodes}
144
- columns={getColumns({onShowTooltip, onHideTooltip})}
114
+ columns={columns}
145
115
  settings={{
146
116
  displayIndices: false,
147
117
  }}
package/dist/routes.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import qs from 'qs';
2
2
  import {compile} from 'path-to-regexp';
3
3
  import isEmpty from 'lodash/isEmpty';
4
- //@ts-ignore
4
+
5
5
  import {backend, clusterName, webVersion} from './store';
6
6
 
7
7
  const routes = {
@@ -3,7 +3,7 @@ import {combineReducers} from 'redux';
3
3
  import nodes from './nodes';
4
4
  import cluster from './cluster/cluster';
5
5
  import clusterNodes from './clusterNodes/clusterNodes';
6
- import tenant from './tenant';
6
+ import tenant from './tenant/tenant';
7
7
  import storage from './storage';
8
8
  import node from './node';
9
9
  import tooltip from './tooltip';