ydb-embedded-ui 4.31.2 → 4.33.0

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 (37) hide show
  1. package/dist/components/CellWithPopover/CellWithPopover.scss +7 -0
  2. package/dist/components/Loader/Loader.tsx +3 -2
  3. package/dist/components/MetricChart/MetricChart.tsx +45 -4
  4. package/dist/components/MetricChart/index.ts +1 -1
  5. package/dist/components/MetricChart/types.ts +3 -0
  6. package/dist/components/VirtualTable/TableHead.tsx +127 -26
  7. package/dist/components/VirtualTable/TableRow.tsx +15 -2
  8. package/dist/components/VirtualTable/VirtualTable.scss +62 -60
  9. package/dist/components/VirtualTable/VirtualTable.tsx +11 -1
  10. package/dist/components/VirtualTable/types.ts +1 -0
  11. package/dist/components/VirtualTable/useIntersectionObserver.ts +1 -0
  12. package/dist/containers/Node/Node.tsx +9 -7
  13. package/dist/containers/Nodes/NodesWrapper.tsx +1 -0
  14. package/dist/containers/Nodes/VirtualNodes.tsx +11 -5
  15. package/dist/containers/Nodes/getNodesColumns.tsx +1 -0
  16. package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +2 -1
  17. package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +11 -6
  18. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.ts +2 -2
  19. package/dist/containers/Tenant/Diagnostics/TenantOverview/DefaultOverviewContent/DefaultOverviewContent.tsx +6 -0
  20. package/dist/containers/Tenant/Diagnostics/TenantOverview/{DefaultDashboard.tsx → DefaultOverviewContent/defaultDashboardConfig.ts} +3 -7
  21. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.tsx +3 -2
  22. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/{CpuDashboard.tsx → cpuDashboardConfig.ts} +2 -6
  23. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantDashboard/TenantDashboard.tsx +27 -9
  24. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.tsx +3 -2
  25. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/{MemoryDashboard.tsx → memoryDashboardConfig.ts} +2 -6
  26. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +3 -5
  27. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.tsx +1 -3
  28. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.tsx +6 -6
  29. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/{StorageDashboard.tsx → storageDashboardConfig.ts} +2 -6
  30. package/dist/containers/Tenant/Diagnostics/TenantOverview/utils.ts +3 -0
  31. package/dist/containers/UserSettings/i18n/en.json +2 -5
  32. package/dist/containers/UserSettings/i18n/ru.json +2 -5
  33. package/dist/containers/UserSettings/settings.ts +1 -12
  34. package/dist/services/settings.ts +0 -2
  35. package/dist/utils/constants.ts +0 -2
  36. package/dist/utils/hooks/useTableResize.ts +53 -0
  37. package/package.json +2 -1
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import {useEffect, useMemo, useRef} from 'react';
2
2
  import {useLocation, useRouteMatch} from 'react-router';
3
3
  import cn from 'bem-cn-lite';
4
4
  import {useDispatch} from 'react-redux';
@@ -8,7 +8,7 @@ import {Link} from 'react-router-dom';
8
8
 
9
9
  import {TABLETS, STORAGE, NODE_PAGES, OVERVIEW, STRUCTURE} from './NodePages';
10
10
  import {Tablets} from '../Tablets';
11
- import {Storage} from '../Storage/Storage';
11
+ import {StorageWrapper} from '../Storage/StorageWrapper';
12
12
  import NodeStructure from './NodeStructure/NodeStructure';
13
13
  import {Loader} from '../../components/Loader';
14
14
  import {BasicNodeViewer} from '../../components/BasicNodeViewer';
@@ -38,6 +38,8 @@ interface NodeProps {
38
38
  }
39
39
 
40
40
  function Node(props: NodeProps) {
41
+ const container = useRef<HTMLDivElement>(null);
42
+
41
43
  const dispatch = useDispatch();
42
44
  const location = useLocation();
43
45
 
@@ -50,7 +52,7 @@ function Node(props: NodeProps) {
50
52
  const {id: nodeId, activeTab} = match.params;
51
53
  const {tenantName: tenantNameFromQuery} = parseQuery(location);
52
54
 
53
- const {activeTabVerified, nodeTabs} = React.useMemo(() => {
55
+ const {activeTabVerified, nodeTabs} = useMemo(() => {
54
56
  const hasStorage = node?.Roles?.find((el) => el === STORAGE_ROLE);
55
57
 
56
58
  let actualActiveTab = activeTab;
@@ -69,7 +71,7 @@ function Node(props: NodeProps) {
69
71
  return {activeTabVerified: actualActiveTab, nodeTabs: actualNodeTabs};
70
72
  }, [activeTab, node]);
71
73
 
72
- React.useEffect(() => {
74
+ useEffect(() => {
73
75
  const tenantName = node?.Tenants?.[0] || tenantNameFromQuery?.toString();
74
76
 
75
77
  dispatch(
@@ -81,7 +83,7 @@ function Node(props: NodeProps) {
81
83
  );
82
84
  }, [dispatch, node, nodeId, tenantNameFromQuery]);
83
85
 
84
- React.useEffect(() => {
86
+ useEffect(() => {
85
87
  const fetchData = () => dispatch(getNodeInfo(nodeId));
86
88
  fetchData();
87
89
  autofetcher.start();
@@ -119,7 +121,7 @@ function Node(props: NodeProps) {
119
121
  case STORAGE: {
120
122
  return (
121
123
  <div className={b('storage')}>
122
- <Storage nodeId={nodeId} />
124
+ <StorageWrapper nodeId={nodeId} parentContainer={container.current} />
123
125
  </div>
124
126
  );
125
127
  }
@@ -146,7 +148,7 @@ function Node(props: NodeProps) {
146
148
  } else {
147
149
  if (node) {
148
150
  return (
149
- <div className={b(null, props.className)}>
151
+ <div className={b(null, props.className)} ref={container}>
150
152
  <BasicNodeViewer
151
153
  node={node}
152
154
  additionalNodesProps={props.additionalNodesProps}
@@ -6,6 +6,7 @@ import {VirtualNodes} from './VirtualNodes';
6
6
  import {Nodes} from './Nodes';
7
7
 
8
8
  interface NodesWrapperProps {
9
+ path?: string;
9
10
  parentContainer?: Element | null;
10
11
  additionalNodesProps?: AdditionalNodesProps;
11
12
  }
@@ -13,6 +13,7 @@ import {
13
13
  isSortableNodesProperty,
14
14
  isUnavailableNode,
15
15
  } from '../../utils/nodes';
16
+ import {updateColumnsWidth, useTableResize} from '../../utils/hooks/useTableResize';
16
17
 
17
18
  import {Search} from '../../components/Search';
18
19
  import {ProblemFilter} from '../../components/ProblemFilter';
@@ -38,26 +39,30 @@ import './Nodes.scss';
38
39
  const b = cn('ydb-nodes');
39
40
 
40
41
  interface NodesProps {
42
+ path?: string;
41
43
  parentContainer?: Element | null;
42
44
  additionalNodesProps?: AdditionalNodesProps;
43
45
  }
44
46
 
45
- export const VirtualNodes = ({parentContainer, additionalNodesProps}: NodesProps) => {
47
+ export const VirtualNodes = ({path, parentContainer, additionalNodesProps}: NodesProps) => {
46
48
  const [searchValue, setSearchValue] = useState('');
47
49
  const [problemFilter, setProblemFilter] = useState<ProblemFilterValue>(ProblemFilterValues.ALL);
48
50
  const [uptimeFilter, setUptimeFilter] = useState<NodesUptimeFilterValues>(
49
51
  NodesUptimeFilterValues.All,
50
52
  );
51
53
 
54
+ const [tableColumnsWidthSetup, setTableColumnsWidth] = useTableResize('nodesTableColumnsWidth');
55
+
52
56
  const filters = useMemo(() => {
53
- return [searchValue, problemFilter, uptimeFilter];
54
- }, [searchValue, problemFilter, uptimeFilter]);
57
+ return [path, searchValue, problemFilter, uptimeFilter];
58
+ }, [path, searchValue, problemFilter, uptimeFilter]);
55
59
 
56
60
  const fetchData = useCallback<FetchData<NodesPreparedEntity>>(
57
61
  async (limit, offset, {sortOrder, columnId} = {}) => {
58
62
  return await getNodes({
59
63
  limit,
60
64
  offset,
65
+ path,
61
66
  filter: searchValue,
62
67
  problems_only: getProblemParamValue(problemFilter),
63
68
  uptime: getUptimeParamValue(uptimeFilter),
@@ -65,7 +70,7 @@ export const VirtualNodes = ({parentContainer, additionalNodesProps}: NodesProps
65
70
  sortValue: columnId as NodesSortValue,
66
71
  });
67
72
  },
68
- [problemFilter, searchValue, uptimeFilter],
73
+ [path, problemFilter, searchValue, uptimeFilter],
69
74
  );
70
75
 
71
76
  const getRowClassName: GetRowClassName<NodesPreparedEntity> = (row) => {
@@ -116,7 +121,7 @@ export const VirtualNodes = ({parentContainer, additionalNodesProps}: NodesProps
116
121
  getNodeRef: additionalNodesProps?.getNodeRef,
117
122
  });
118
123
 
119
- const columns = rawColumns.map((column) => {
124
+ const columns = updateColumnsWidth(rawColumns, tableColumnsWidthSetup).map((column) => {
120
125
  return {...column, sortable: isSortableNodesProperty(column.name)};
121
126
  });
122
127
 
@@ -131,6 +136,7 @@ export const VirtualNodes = ({parentContainer, additionalNodesProps}: NodesProps
131
136
  renderEmptyDataMessage={renderEmptyDataMessage}
132
137
  dependencyArray={filters}
133
138
  getRowClassName={getRowClassName}
139
+ onColumnsResize={setTableColumnsWidth}
134
140
  />
135
141
  );
136
142
  };
@@ -89,6 +89,7 @@ const versionColumn: NodesColumn = {
89
89
  return <CellWithPopover content={row.Version}>{row.Version}</CellWithPopover>;
90
90
  },
91
91
  sortable: false,
92
+ resizeable: true,
92
93
  };
93
94
 
94
95
  const uptimeColumn: NodesColumn = {
@@ -45,7 +45,8 @@
45
45
  padding-top: 0;
46
46
  }
47
47
 
48
- .data-table__sticky_moving {
48
+ .data-table__sticky_moving,
49
+ .ydb-virtual-table__head {
49
50
  top: 46px !important;
50
51
  }
51
52
  }
@@ -1,4 +1,4 @@
1
- import {useMemo} from 'react';
1
+ import {useMemo, useRef} from 'react';
2
2
  import qs from 'qs';
3
3
  import cn from 'bem-cn-lite';
4
4
  import {Link} from 'react-router-dom';
@@ -20,8 +20,8 @@ import {TENANT_DIAGNOSTICS_TABS_IDS} from '../../../store/reducers/tenant/consta
20
20
  import {Loader} from '../../../components/Loader';
21
21
 
22
22
  import {Heatmap} from '../../Heatmap';
23
- import {Nodes} from '../../Nodes';
24
- import {Storage} from '../../Storage/Storage';
23
+ import {NodesWrapper} from '../../Nodes/NodesWrapper';
24
+ import {StorageWrapper} from '../../Storage/StorageWrapper';
25
25
  import {Tablets} from '../../Tablets';
26
26
 
27
27
  import Describe from './Describe/Describe';
@@ -49,6 +49,8 @@ interface DiagnosticsProps {
49
49
  const b = cn('kv-tenant-diagnostics');
50
50
 
51
51
  function Diagnostics(props: DiagnosticsProps) {
52
+ const container = useRef<HTMLDivElement>(null);
53
+
52
54
  const dispatch = useDispatch();
53
55
  const {currentSchemaPath, autorefresh, wasLoaded} = useSelector((state: any) => state.schema);
54
56
  const {diagnosticsTab = TENANT_DIAGNOSTICS_TABS_IDS.overview} = useTypedSelector(
@@ -121,9 +123,10 @@ function Diagnostics(props: DiagnosticsProps) {
121
123
  }
122
124
  case TENANT_DIAGNOSTICS_TABS_IDS.nodes: {
123
125
  return (
124
- <Nodes
126
+ <NodesWrapper
125
127
  path={currentSchemaPath}
126
128
  additionalNodesProps={props.additionalNodesProps}
129
+ parentContainer={container.current}
127
130
  />
128
131
  );
129
132
  }
@@ -131,7 +134,9 @@ function Diagnostics(props: DiagnosticsProps) {
131
134
  return <Tablets path={currentSchemaPath} />;
132
135
  }
133
136
  case TENANT_DIAGNOSTICS_TABS_IDS.storage: {
134
- return <Storage tenant={tenantNameString} />;
137
+ return (
138
+ <StorageWrapper tenant={tenantNameString} parentContainer={container.current} />
139
+ );
135
140
  }
136
141
  case TENANT_DIAGNOSTICS_TABS_IDS.network: {
137
142
  return <Network path={tenantNameString} />;
@@ -196,7 +201,7 @@ function Diagnostics(props: DiagnosticsProps) {
196
201
  }
197
202
 
198
203
  return (
199
- <div className={b()}>
204
+ <div className={b()} ref={container}>
200
205
  {renderTabs()}
201
206
  <div className={b('page-wrapper')}>{renderTabContent()}</div>
202
207
  </div>
@@ -100,14 +100,14 @@ const prepareTableGeneralInfo = (PartitionConfig: TPartitionConfig, TTLSettings?
100
100
  {label: 'Partitioning by load', value: partitioningByLoad},
101
101
  {
102
102
  label: 'Min number of partitions',
103
- value: PartitioningPolicy.MinPartitionsCount || 0,
103
+ value: formatNumber(PartitioningPolicy.MinPartitionsCount || 0),
104
104
  },
105
105
  );
106
106
 
107
107
  if (PartitioningPolicy.MaxPartitionsCount) {
108
108
  generalTableInfo.push({
109
109
  label: 'Max number of partitions',
110
- value: PartitioningPolicy.MaxPartitionsCount || 0,
110
+ value: formatNumber(PartitioningPolicy.MaxPartitionsCount),
111
111
  });
112
112
  }
113
113
 
@@ -0,0 +1,6 @@
1
+ import {TenantDashboard} from '../TenantDashboard/TenantDashboard';
2
+ import {defaultDashboardConfig} from './defaultDashboardConfig';
3
+
4
+ export const DefaultOverviewContent = () => {
5
+ return <TenantDashboard charts={defaultDashboardConfig} />;
6
+ };
@@ -1,7 +1,7 @@
1
- import {type ChartConfig, TenantDashboard} from './TenantDashboard/TenantDashboard';
2
- import i18n from './i18n';
1
+ import type {ChartConfig} from '../TenantDashboard/TenantDashboard';
2
+ import i18n from '../i18n';
3
3
 
4
- const defaultDashboardConfig: ChartConfig[] = [
4
+ export const defaultDashboardConfig: ChartConfig[] = [
5
5
  {
6
6
  title: i18n('charts.queries-per-second'),
7
7
  metrics: [
@@ -44,7 +44,3 @@ const defaultDashboardConfig: ChartConfig[] = [
44
44
  },
45
45
  },
46
46
  ];
47
-
48
- export const DefaultDashboard = () => {
49
- return <TenantDashboard charts={defaultDashboardConfig} />;
50
- };
@@ -1,5 +1,6 @@
1
1
  import type {AdditionalNodesProps} from '../../../../../types/additionalProps';
2
- import {CpuDashboard} from './CpuDashboard';
2
+ import {TenantDashboard} from '../TenantDashboard/TenantDashboard';
3
+ import {cpuDashboardConfig} from './cpuDashboardConfig';
3
4
  import {TopNodesByLoad} from './TopNodesByLoad';
4
5
  import {TopNodesByCpu} from './TopNodesByCpu';
5
6
  import {TopShards} from './TopShards';
@@ -13,7 +14,7 @@ interface TenantCpuProps {
13
14
  export function TenantCpu({path, additionalNodesProps}: TenantCpuProps) {
14
15
  return (
15
16
  <>
16
- <CpuDashboard />
17
+ <TenantDashboard charts={cpuDashboardConfig} />
17
18
  <TopNodesByLoad path={path} additionalNodesProps={additionalNodesProps} />
18
19
  <TopNodesByCpu path={path} additionalNodesProps={additionalNodesProps} />
19
20
  <TopShards path={path} />
@@ -1,7 +1,7 @@
1
- import {type ChartConfig, TenantDashboard} from '../TenantDashboard/TenantDashboard';
1
+ import type {ChartConfig} from '../TenantDashboard/TenantDashboard';
2
2
  import i18n from '../i18n';
3
3
 
4
- const cpuDashboardConfig: ChartConfig[] = [
4
+ export const cpuDashboardConfig: ChartConfig[] = [
5
5
  {
6
6
  title: i18n('charts.cpu-usage'),
7
7
  metrics: [
@@ -12,7 +12,3 @@ const cpuDashboardConfig: ChartConfig[] = [
12
12
  ],
13
13
  },
14
14
  ];
15
-
16
- export const CpuDashboard = () => {
17
- return <TenantDashboard charts={cpuDashboardConfig} />;
18
- };
@@ -1,14 +1,15 @@
1
+ import {useState} from 'react';
1
2
  import {StringParam, useQueryParam} from 'use-query-params';
2
3
 
3
4
  import {cn} from '../../../../../utils/cn';
4
5
  import type {TimeFrame} from '../../../../../utils/timeframes';
5
- import {useSetting, useTypedSelector} from '../../../../../utils/hooks';
6
- import {DISPLAY_CHARTS_IN_DB_DIAGNOSTICS_KEY} from '../../../../../utils/constants';
6
+ import {useTypedSelector} from '../../../../../utils/hooks';
7
7
  import {TimeFrameSelector} from '../../../../../components/TimeFrameSelector/TimeFrameSelector';
8
8
  import {
9
9
  type ChartOptions,
10
10
  MetricChart,
11
11
  type MetricDescription,
12
+ type ChartDataStatus,
12
13
  } from '../../../../../components/MetricChart';
13
14
 
14
15
  import './TenantDashboard.scss';
@@ -29,15 +30,29 @@ interface TenantDashboardProps {
29
30
  }
30
31
 
31
32
  export const TenantDashboard = ({charts}: TenantDashboardProps) => {
33
+ const [isDashboardHidden, setIsDashboardHidden] = useState<boolean>(true);
34
+
32
35
  const [timeFrame = '1h', setTimeframe] = useQueryParam('timeframe', StringParam);
33
36
 
34
37
  const {autorefresh} = useTypedSelector((state) => state.schema);
35
38
 
36
- const [chartsEnabled] = useSetting(DISPLAY_CHARTS_IN_DB_DIAGNOSTICS_KEY);
39
+ // Refetch data only if dashboard successfully loaded
40
+ const shouldRefresh = autorefresh && !isDashboardHidden;
37
41
 
38
- if (!chartsEnabled) {
39
- return null;
40
- }
42
+ /**
43
+ * Charts should be hidden, if they are not enabled:
44
+ * 1. GraphShard is not enabled
45
+ * 2. ydb version does not have /viewer/json/render endpoint (400, 404, CORS error, etc.)
46
+ *
47
+ * If at least one chart successfully loaded, dashboard should be shown
48
+ * @link https://github.com/ydb-platform/ydb-embedded-ui/issues/659
49
+ * @todo disable only for specific errors ('GraphShard is not enabled') after ydb-stable-24 is generally used
50
+ */
51
+ const handleChartDataStatusChange = (chartStatus: ChartDataStatus) => {
52
+ if (chartStatus === 'success') {
53
+ setIsDashboardHidden(false);
54
+ }
55
+ };
41
56
 
42
57
  // If there is only one chart, display it with full width
43
58
  const chartWidth = charts.length === 1 ? CHART_WIDTH_FULL : CHART_WIDTH;
@@ -45,23 +60,26 @@ export const TenantDashboard = ({charts}: TenantDashboardProps) => {
45
60
 
46
61
  const renderContent = () => {
47
62
  return charts.map((chartConfig) => {
63
+ const chartId = chartConfig.metrics.map(({target}) => target).join('&');
48
64
  return (
49
65
  <MetricChart
50
- key={chartConfig.metrics.map(({target}) => target).join('&')}
66
+ key={chartId}
51
67
  title={chartConfig.title}
52
68
  metrics={chartConfig.metrics}
53
69
  timeFrame={timeFrame as TimeFrame}
54
70
  chartOptions={chartConfig.options}
55
- autorefresh={autorefresh}
71
+ autorefresh={shouldRefresh}
56
72
  width={chartWidth}
57
73
  height={chartHeight}
74
+ onChartDataStatusChange={handleChartDataStatusChange}
75
+ isChartVisible={!isDashboardHidden}
58
76
  />
59
77
  );
60
78
  });
61
79
  };
62
80
 
63
81
  return (
64
- <div className={b(null)}>
82
+ <div className={b(null)} style={{display: isDashboardHidden ? 'none' : undefined}}>
65
83
  <div className={b('controls')}>
66
84
  <TimeFrameSelector value={timeFrame as TimeFrame} onChange={setTimeframe} />
67
85
  </div>
@@ -1,4 +1,5 @@
1
- import {MemoryDashboard} from './MemoryDashboard';
1
+ import {TenantDashboard} from '../TenantDashboard/TenantDashboard';
2
+ import {memoryDashboardConfig} from './memoryDashboardConfig';
2
3
  import {TopNodesByMemory} from './TopNodesByMemory';
3
4
 
4
5
  interface TenantMemoryProps {
@@ -8,7 +9,7 @@ interface TenantMemoryProps {
8
9
  export function TenantMemory({path}: TenantMemoryProps) {
9
10
  return (
10
11
  <>
11
- <MemoryDashboard />
12
+ <TenantDashboard charts={memoryDashboardConfig} />
12
13
  <TopNodesByMemory path={path} />
13
14
  </>
14
15
  );
@@ -1,7 +1,7 @@
1
- import {type ChartConfig, TenantDashboard} from '../TenantDashboard/TenantDashboard';
1
+ import type {ChartConfig} from '../TenantDashboard/TenantDashboard';
2
2
  import i18n from '../i18n';
3
3
 
4
- const memoryDashboardConfig: ChartConfig[] = [
4
+ export const memoryDashboardConfig: ChartConfig[] = [
5
5
  {
6
6
  title: i18n('charts.memory-usage'),
7
7
  metrics: [
@@ -15,7 +15,3 @@ const memoryDashboardConfig: ChartConfig[] = [
15
15
  },
16
16
  },
17
17
  ];
18
-
19
- export const MemoryDashboard = () => {
20
- return <TenantDashboard charts={memoryDashboardConfig} />;
21
- };
@@ -1,4 +1,3 @@
1
- import cn from 'bem-cn-lite';
2
1
  import {useCallback} from 'react';
3
2
  import {useDispatch} from 'react-redux';
4
3
 
@@ -17,12 +16,11 @@ import {HealthcheckDetails} from './Healthcheck/HealthcheckDetails';
17
16
  import {MetricsCards, type TenantMetrics} from './MetricsCards/MetricsCards';
18
17
  import {TenantStorage} from './TenantStorage/TenantStorage';
19
18
  import {TenantMemory} from './TenantMemory/TenantMemory';
20
- import {DefaultDashboard} from './DefaultDashboard';
19
+ import {DefaultOverviewContent} from './DefaultOverviewContent/DefaultOverviewContent';
21
20
  import {useHealthcheck} from './useHealthcheck';
22
21
 
23
22
  import './TenantOverview.scss';
24
-
25
- const b = cn('tenant-overview');
23
+ import {b} from './utils';
26
24
 
27
25
  interface TenantOverviewProps {
28
26
  tenantName: string;
@@ -141,7 +139,7 @@ export function TenantOverview({
141
139
  );
142
140
  }
143
141
  default: {
144
- return <DefaultDashboard />;
142
+ return <DefaultOverviewContent />;
145
143
  }
146
144
  }
147
145
  };
@@ -1,5 +1,4 @@
1
1
  import type {ReactNode} from 'react';
2
- import cn from 'bem-cn-lite';
3
2
 
4
3
  import DataTable from '@gravity-ui/react-data-table';
5
4
  import type {DataTableProps} from '@gravity-ui/react-data-table';
@@ -11,8 +10,7 @@ import {
11
10
  import type {IResponseError} from '../../../../types/api/error';
12
11
  import {TableSkeleton} from '../../../../components/TableSkeleton/TableSkeleton';
13
12
  import {ResponseError} from '../../../../components/Errors/ResponseError';
14
-
15
- const b = cn('tenant-overview');
13
+ import {b} from './utils';
16
14
 
17
15
  interface TenantOverviewTableLayoutProps<T> extends Omit<DataTableProps<T>, 'theme'> {
18
16
  title: ReactNode;
@@ -1,17 +1,16 @@
1
- import cn from 'bem-cn-lite';
2
-
3
1
  import InfoViewer from '../../../../../components/InfoViewer/InfoViewer';
4
2
  import {ProgressViewer} from '../../../../../components/ProgressViewer/ProgressViewer';
5
3
  import {formatStorageValues} from '../../../../../utils/dataFormatters/dataFormatters';
6
4
  import {getSizeWithSignificantDigits} from '../../../../../utils/bytesParsers';
7
5
 
6
+ import {TenantDashboard} from '../TenantDashboard/TenantDashboard';
7
+
8
8
  import '../TenantOverview.scss';
9
9
 
10
- import {StorageDashboard} from './StorageDashboard';
10
+ import {storageDashboardConfig} from './storageDashboardConfig';
11
11
  import {TopTables} from './TopTables';
12
12
  import {TopGroups} from './TopGroups';
13
-
14
- const b = cn('tenant-overview');
13
+ import {b} from '../utils';
15
14
 
16
15
  export interface TenantStorageMetrics {
17
16
  blobStorageUsed?: number;
@@ -61,9 +60,10 @@ export function TenantStorage({tenantName, metrics}: TenantStorageProps) {
61
60
  ),
62
61
  },
63
62
  ];
63
+
64
64
  return (
65
65
  <>
66
- <StorageDashboard />
66
+ <TenantDashboard charts={storageDashboardConfig} />
67
67
  <InfoViewer className={b('storage-info')} title="Storage details" info={info} />
68
68
  <TopTables path={tenantName} />
69
69
  <TopGroups tenant={tenantName} />
@@ -1,7 +1,7 @@
1
- import {type ChartConfig, TenantDashboard} from '../TenantDashboard/TenantDashboard';
1
+ import type {ChartConfig} from '../TenantDashboard/TenantDashboard';
2
2
  import i18n from '../i18n';
3
3
 
4
- const storageDashboardConfig: ChartConfig[] = [
4
+ export const storageDashboardConfig: ChartConfig[] = [
5
5
  {
6
6
  title: i18n('charts.storage-usage'),
7
7
  metrics: [
@@ -15,7 +15,3 @@ const storageDashboardConfig: ChartConfig[] = [
15
15
  },
16
16
  },
17
17
  ];
18
-
19
- export const StorageDashboard = () => {
20
- return <TenantDashboard charts={storageDashboardConfig} />;
21
- };
@@ -0,0 +1,3 @@
1
+ import {cn} from '../../../../utils/cn';
2
+
3
+ export const b = cn('tenant-overview');
@@ -19,12 +19,9 @@
19
19
  "settings.useNodesEndpoint.title": "Break the Nodes tab in Diagnostics",
20
20
  "settings.useNodesEndpoint.popover": "Use /viewer/json/nodes endpoint for Nodes Tab in diagnostics. It could return incorrect data on some versions",
21
21
 
22
- "settings.useVirtualTables.title": "Use table with data load on scroll for Nodes and Storage cluster tabs",
22
+ "settings.useVirtualTables.title": "Use table with data load on scroll for Nodes and Storage tabs",
23
23
  "settings.useVirtualTables.popover": "It will increase performance, but could work unstable",
24
24
 
25
25
  "settings.queryUseMultiSchema.title": "Allow queries with multiple result sets",
26
- "settings.queryUseMultiSchema.popover": "Use 'multi' schema for queries that enables queries with multiple result sets. Returns nothing on versions 23-3 and older",
27
-
28
- "settings.displayChartsInDbDiagnostics.title": "Display charts in database diagnostics",
29
- "settings.displayChartsInDbDiagnostics.popover": "Incorrect data may be displayed (shows data only for the database related to the current node), does not work well on static nodes"
26
+ "settings.queryUseMultiSchema.popover": "Use 'multi' schema for queries that enables queries with multiple result sets. Returns nothing on versions 23-3 and older"
30
27
  }
@@ -19,12 +19,9 @@
19
19
  "settings.useNodesEndpoint.title": "Сломать вкладку Nodes в диагностике",
20
20
  "settings.useNodesEndpoint.popover": "Использовать эндпоинт /viewer/json/nodes для вкладки Nodes в диагностике. Может возвращать некорректные данные на некоторых версиях",
21
21
 
22
- "settings.useVirtualTables.title": "Использовать таблицу с загрузкой данных по скроллу для вкладок Nodes и Storage кластера",
22
+ "settings.useVirtualTables.title": "Использовать таблицу с загрузкой данных по скроллу для вкладок Nodes и Storage",
23
23
  "settings.useVirtualTables.popover": "Это улучшит производительность, но может работать нестабильно",
24
24
 
25
25
  "settings.queryUseMultiSchema.title": "Разрешить запросы с несколькими результатами",
26
- "settings.queryUseMultiSchema.popover": "Использовать для запросов схему 'multi', которая позволяет выполнять запросы с несколькими результатами. На версиях 23-3 и старше результат не возвращается вообще",
27
-
28
- "settings.displayChartsInDbDiagnostics.title": "Показывать графики в диагностике базы данных",
29
- "settings.displayChartsInDbDiagnostics.popover": "Могут отображаться неправильные данные (показывает данные только для базы, относящейся к текущей ноде), плохо работает на статических нодах"
26
+ "settings.queryUseMultiSchema.popover": "Использовать для запросов схему 'multi', которая позволяет выполнять запросы с несколькими результатами. На версиях 23-3 и старше результат не возвращается вообще"
30
27
  }
@@ -10,7 +10,6 @@ import {
10
10
  USE_BACKEND_PARAMS_FOR_TABLES_KEY,
11
11
  USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY,
12
12
  QUERY_USE_MULTI_SCHEMA_KEY,
13
- DISPLAY_CHARTS_IN_DB_DIAGNOSTICS_KEY,
14
13
  } from '../../utils/constants';
15
14
  import {Lang, defaultLang} from '../../utils/i18n';
16
15
 
@@ -95,11 +94,6 @@ export const queryUseMultiSchemaSetting: SettingProps = {
95
94
  title: i18n('settings.queryUseMultiSchema.title'),
96
95
  helpPopoverContent: i18n('settings.queryUseMultiSchema.popover'),
97
96
  };
98
- export const displayChartsInDbDiagnosticsSetting: SettingProps = {
99
- settingKey: DISPLAY_CHARTS_IN_DB_DIAGNOSTICS_KEY,
100
- title: i18n('settings.displayChartsInDbDiagnostics.title'),
101
- helpPopoverContent: i18n('settings.displayChartsInDbDiagnostics.popover'),
102
- };
103
97
 
104
98
  export const appearanceSection: SettingsSection = {
105
99
  id: 'appearanceSection',
@@ -109,12 +103,7 @@ export const appearanceSection: SettingsSection = {
109
103
  export const experimentsSection: SettingsSection = {
110
104
  id: 'experimentsSection',
111
105
  title: i18n('section.experiments'),
112
- settings: [
113
- useNodesEndpointSetting,
114
- useVirtualTables,
115
- queryUseMultiSchemaSetting,
116
- displayChartsInDbDiagnosticsSetting,
117
- ],
106
+ settings: [useNodesEndpointSetting, useVirtualTables, queryUseMultiSchemaSetting],
118
107
  };
119
108
 
120
109
  export const generalPage: SettingsPage = {
@@ -3,7 +3,6 @@ import {TENANT_PAGES_IDS} from '../store/reducers/tenant/constants';
3
3
  import {
4
4
  ASIDE_HEADER_COMPACT_KEY,
5
5
  CLUSTER_INFO_HIDDEN_KEY,
6
- DISPLAY_CHARTS_IN_DB_DIAGNOSTICS_KEY,
7
6
  INVERTED_DISKS_KEY,
8
7
  LANGUAGE_KEY,
9
8
  LAST_USED_QUERY_ACTION_KEY,
@@ -38,7 +37,6 @@ export const DEFAULT_USER_SETTINGS: SettingsObject = {
38
37
  [PARTITIONS_HIDDEN_COLUMNS_KEY]: [],
39
38
  [CLUSTER_INFO_HIDDEN_KEY]: true,
40
39
  [USE_BACKEND_PARAMS_FOR_TABLES_KEY]: false,
41
- [DISPLAY_CHARTS_IN_DB_DIAGNOSTICS_KEY]: false,
42
40
  };
43
41
 
44
42
  class SettingsManager {
@@ -127,5 +127,3 @@ export const USE_BACKEND_PARAMS_FOR_TABLES_KEY = 'useBackendParamsForTables';
127
127
 
128
128
  // Enable schema that supports multiple resultsets
129
129
  export const QUERY_USE_MULTI_SCHEMA_KEY = 'queryUseMultiSchema';
130
-
131
- export const DISPLAY_CHARTS_IN_DB_DIAGNOSTICS_KEY = 'displayChartsInDbDiagnostics';