ydb-embedded-ui 1.14.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +32 -0
- package/dist/assets/illustrations/dark/thumbsUp.svg +15 -0
- package/dist/assets/illustrations/light/thumbsUp.svg +15 -0
- package/dist/components/AsideNavigation/AsideHeader.tsx +1 -1
- package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.tsx +1 -1
- package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.tsx +1 -1
- package/dist/components/AsideNavigation/CompositeBar/CompositeBar.tsx +1 -1
- package/dist/components/AsideNavigation/Logo/Logo.tsx +1 -1
- package/dist/components/AsideNavigation/Settings/Settings.tsx +1 -1
- package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.tsx +1 -1
- package/dist/components/AsideNavigation/Settings/SettingsSearch/SettingsSearch.tsx +1 -1
- package/dist/components/AsideNavigation/Settings/collect-settings.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/ClusterInfo/ClusterInfo.tsx +1 -1
- package/dist/components/Collapse/Collapse.js +1 -1
- package/dist/components/CopyToClipboard/CopyToClipboard.tsx +1 -1
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +1 -1
- package/dist/components/EmptyState/EmptyState.scss +0 -1
- package/dist/components/EnableFullscreenButton/EnableFullscreenButton.tsx +1 -1
- package/dist/components/EntityStatus/EntityStatus.js +1 -1
- package/dist/components/Fullscreen/Fullscreen.tsx +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Illustration/Illustration.tsx +3 -1
- package/dist/components/Loader/Loader.tsx +1 -1
- package/dist/components/NodesViewer/NodesViewer.js +4 -2
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/ProblemFilter/ProblemFilter.js +1 -1
- package/dist/components/ShortyString/ShortyString.tsx +1 -1
- package/dist/components/TableSkeleton/TableSkeleton.tsx +1 -1
- package/dist/components/TabletsOverall/TabletsOverall.tsx +1 -1
- package/dist/containers/App/App.js +1 -1
- package/dist/containers/App/App.scss +0 -10
- package/dist/containers/App/Content.js +1 -1
- package/dist/containers/App/TipPopup/TipPopup.js +1 -1
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +1 -1
- package/dist/containers/Authentication/Authentication.tsx +1 -1
- package/dist/containers/Group/Group.js +1 -1
- package/dist/containers/Header/Header.tsx +1 -1
- package/dist/containers/Header/Host/Host.js +1 -1
- package/dist/containers/Heatmap/Heatmap.js +1 -1
- package/dist/containers/Node/Node.tsx +1 -1
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +1 -1
- package/dist/containers/Nodes/Nodes.js +3 -2
- package/dist/containers/Pdisk/Pdisk.js +1 -1
- package/dist/containers/Pool/Pool.js +3 -2
- package/dist/containers/ReduxTooltip/ReduxTooltip.js +1 -1
- package/dist/containers/Storage/EmptyFilter/EmptyFilter.tsx +34 -0
- package/dist/containers/Storage/EmptyFilter/i18n/en.json +4 -0
- package/dist/containers/Storage/EmptyFilter/i18n/index.ts +11 -0
- package/dist/containers/Storage/EmptyFilter/i18n/ru.json +4 -0
- package/dist/containers/Storage/Pdisk/Pdisk.tsx +1 -1
- package/dist/containers/Storage/Storage.js +3 -1
- package/dist/containers/Storage/StorageFilter/StorageFilter.tsx +1 -1
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +27 -6
- package/dist/containers/Storage/StorageGroups/i18n/en.json +6 -0
- package/dist/containers/Storage/StorageGroups/i18n/index.ts +11 -0
- package/dist/containers/Storage/StorageGroups/i18n/ru.json +6 -0
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +24 -7
- package/dist/containers/Storage/StorageNodes/i18n/en.json +6 -0
- package/dist/containers/Storage/StorageNodes/i18n/index.ts +11 -0
- package/dist/containers/Storage/StorageNodes/i18n/ru.json +6 -0
- package/dist/containers/Storage/UsageFilter/UsageFilter.tsx +1 -1
- package/dist/containers/Storage/Vdisk/Vdisk.js +1 -1
- package/dist/containers/Tablet/Tablet.js +1 -1
- package/dist/containers/Tablets/Tablets.js +1 -1
- package/dist/containers/TabletsFilters/TabletsFilters.js +1 -1
- package/dist/containers/Tenant/Acl/Acl.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Compute/Compute.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +1 -1
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.js +1 -1
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +3 -2
- package/dist/containers/Tenant/Diagnostics/Network/Network.scss +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +23 -23
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +3 -3
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +3 -3
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +1 -1
- package/dist/containers/Tenant/ObjectGeneralTabs/ObjectGeneralTabs.tsx +1 -1
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
- package/dist/containers/Tenant/Preview/Preview.js +1 -1
- package/dist/containers/Tenant/QueryEditor/Issues/Issues.scss +2 -3
- package/dist/containers/Tenant/QueryEditor/Issues/Issues.tsx +1 -1
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.tsx +1 -1
- package/dist/containers/Tenant/QueryEditor/QueryEditor.js +2 -2
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +61 -42
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.scss +8 -4
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +1 -1
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.js +1 -1
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +1 -1
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.scss +2 -2
- package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx +1 -1
- package/dist/containers/Tenants/Tenants.js +3 -2
- package/dist/containers/UserSettings/UserSettings.tsx +2 -2
- package/dist/containers/Vdisk/Vdisk.js +1 -1
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +1 -1
- package/dist/index.js +1 -1
- package/dist/setupTests.js +1 -1
- package/dist/store/reducers/executeTopQueries.js +6 -9
- package/dist/store/reducers/explainQuery.js +27 -32
- package/dist/store/reducers/olapStats.js +6 -8
- package/dist/store/reducers/shardsWorkload.js +6 -8
- package/dist/types/api/query.ts +32 -21
- package/dist/types/assets.d.ts +1 -1
- package/dist/types/store/query.ts +1 -1
- package/dist/utils/createToast.tsx +1 -1
- package/dist/utils/getNodesColumns.js +1 -1
- package/dist/utils/i18n/i18n.ts +1 -1
- package/dist/utils/prepareQueryExplain.ts +0 -4
- package/dist/utils/query.test.ts +59 -1
- package/dist/utils/query.ts +38 -4
- package/package.json +9 -11
@@ -0,0 +1,34 @@
|
|
1
|
+
import {Button} from '@gravity-ui/uikit';
|
2
|
+
|
3
|
+
import EmptyState from '../../../components/EmptyState/EmptyState';
|
4
|
+
import {Illustration} from '../../../components/Illustration';
|
5
|
+
|
6
|
+
import i18n from './i18n';
|
7
|
+
|
8
|
+
interface EmptyFilterProps {
|
9
|
+
title: string;
|
10
|
+
message?: string;
|
11
|
+
showAll?: string;
|
12
|
+
onShowAll?: VoidFunction;
|
13
|
+
}
|
14
|
+
|
15
|
+
export const EmptyFilter = ({
|
16
|
+
title,
|
17
|
+
message = i18n('default_message'),
|
18
|
+
showAll = i18n('default_button_label'),
|
19
|
+
onShowAll,
|
20
|
+
}: EmptyFilterProps) => (
|
21
|
+
<EmptyState
|
22
|
+
image={<Illustration name="thumbsUp" />}
|
23
|
+
title={title}
|
24
|
+
description={message}
|
25
|
+
actions={onShowAll && [
|
26
|
+
<Button
|
27
|
+
key="show-all"
|
28
|
+
onClick={onShowAll}
|
29
|
+
>
|
30
|
+
{showAll}
|
31
|
+
</Button>
|
32
|
+
]}
|
33
|
+
/>
|
34
|
+
);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import {i18n, Lang} from '../../../../utils/i18n';
|
2
|
+
|
3
|
+
import en from './en.json';
|
4
|
+
import ru from './ru.json';
|
5
|
+
|
6
|
+
const COMPONENT = 'ydb-storage-empty-filter';
|
7
|
+
|
8
|
+
i18n.registerKeyset(Lang.En, COMPONENT, en);
|
9
|
+
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
|
10
|
+
|
11
|
+
export default i18n.keyset(COMPONENT);
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import {connect} from 'react-redux';
|
4
4
|
import cn from 'bem-cn-lite';
|
5
5
|
import DataTable from '@yandex-cloud/react-data-table';
|
6
|
-
import {RadioButton, Label} from '@
|
6
|
+
import {RadioButton, Label} from '@gravity-ui/uikit';
|
7
7
|
|
8
8
|
import {StorageFilter} from './StorageFilter';
|
9
9
|
import {UsageFilter} from './UsageFilter';
|
@@ -186,6 +186,7 @@ class Storage extends React.Component {
|
|
186
186
|
data={flatListStorageEntities}
|
187
187
|
tableSettings={tableSettings}
|
188
188
|
nodes={nodes}
|
189
|
+
onShowAll={() => this.onGroupVisibilityChange(VisibleEntities.All)}
|
189
190
|
/>
|
190
191
|
)}
|
191
192
|
{storageType === StorageTypes.nodes && (
|
@@ -193,6 +194,7 @@ class Storage extends React.Component {
|
|
193
194
|
visibleEntities={visibleEntities}
|
194
195
|
data={flatListStorageEntities}
|
195
196
|
tableSettings={tableSettings}
|
197
|
+
onShowAll={() => this.onGroupVisibilityChange(VisibleEntities.All)}
|
196
198
|
/>
|
197
199
|
)}
|
198
200
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import DataTable, {Column, Settings, SortOrder} from '@yandex-cloud/react-data-table';
|
4
|
-
import {Label, Popover, PopoverBehavior} from '@
|
4
|
+
import {Label, Popover, PopoverBehavior} from '@gravity-ui/uikit';
|
5
5
|
|
6
6
|
import {Stack} from '../../../components/Stack/Stack';
|
7
7
|
//@ts-ignore
|
@@ -16,9 +16,11 @@ import {bytesToGB, bytesToSpeed} from '../../../utils/utils';
|
|
16
16
|
import {stringifyVdiskId} from '../../../utils';
|
17
17
|
import {getUsage, isFullDonorData} from '../../../utils/storage';
|
18
18
|
|
19
|
+
import {EmptyFilter} from '../EmptyFilter/EmptyFilter';
|
19
20
|
import Vdisk from '../Vdisk/Vdisk';
|
20
21
|
import {getDegradedSeverity, getUsageSeverity} from '../utils';
|
21
22
|
|
23
|
+
import i18n from './i18n';
|
22
24
|
import './StorageGroups.scss';
|
23
25
|
|
24
26
|
enum TableColumnsIds {
|
@@ -42,6 +44,7 @@ interface StorageGroupsProps {
|
|
42
44
|
nodes: any;
|
43
45
|
tableSettings: Settings;
|
44
46
|
visibleEntities: keyof typeof VisibleEntities;
|
47
|
+
onShowAll?: VoidFunction;
|
45
48
|
}
|
46
49
|
|
47
50
|
const tableColumnsNames: Record<TableColumnsIdsValues, string> = {
|
@@ -85,7 +88,7 @@ function setSortOrder(visibleEntities: keyof typeof VisibleEntities): SortOrder
|
|
85
88
|
}
|
86
89
|
}
|
87
90
|
|
88
|
-
function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGroupsProps) {
|
91
|
+
function StorageGroups({data, tableSettings, visibleEntities, nodes, onShowAll}: StorageGroupsProps) {
|
89
92
|
const allColumns: Column<any>[] = [
|
90
93
|
{
|
91
94
|
name: TableColumnsIds.PoolName,
|
@@ -253,17 +256,35 @@ function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGro
|
|
253
256
|
];
|
254
257
|
|
255
258
|
let columns = allColumns;
|
256
|
-
let emptyMessage = 'No such groups.';
|
257
259
|
|
258
260
|
if (visibleEntities === VisibleEntities.Space) {
|
259
261
|
columns = allColumns.filter((col) => col.name !== TableColumnsIds.Missing);
|
260
|
-
|
262
|
+
|
263
|
+
if (!data.length) {
|
264
|
+
return (
|
265
|
+
<EmptyFilter
|
266
|
+
title={i18n('empty.out_of_space')}
|
267
|
+
showAll={i18n('show_all')}
|
268
|
+
onShowAll={onShowAll}
|
269
|
+
/>
|
270
|
+
);
|
271
|
+
}
|
261
272
|
}
|
262
273
|
|
263
274
|
if (visibleEntities === VisibleEntities.Missing) {
|
264
275
|
columns = allColumns.filter((col) => col.name !== TableColumnsIds.UsedSpaceFlag);
|
265
|
-
|
276
|
+
|
277
|
+
if (!data.length) {
|
278
|
+
return (
|
279
|
+
<EmptyFilter
|
280
|
+
title={i18n('empty.degraded')}
|
281
|
+
showAll={i18n('show_all')}
|
282
|
+
onShowAll={onShowAll}
|
283
|
+
/>
|
284
|
+
);
|
285
|
+
}
|
266
286
|
}
|
287
|
+
|
267
288
|
return data ? (
|
268
289
|
<DataTable
|
269
290
|
key={visibleEntities as string}
|
@@ -272,7 +293,7 @@ function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGro
|
|
272
293
|
columns={columns}
|
273
294
|
settings={tableSettings}
|
274
295
|
initialSortOrder={setSortOrder(visibleEntities)}
|
275
|
-
emptyDataMessage={
|
296
|
+
emptyDataMessage={i18n('empty.default')}
|
276
297
|
/>
|
277
298
|
) : null;
|
278
299
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import {i18n, Lang} from '../../../../utils/i18n';
|
2
|
+
|
3
|
+
import en from './en.json';
|
4
|
+
import ru from './ru.json';
|
5
|
+
|
6
|
+
const COMPONENT = 'ydb-storage-groups';
|
7
|
+
|
8
|
+
i18n.registerKeyset(Lang.En, COMPONENT, en);
|
9
|
+
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
|
10
|
+
|
11
|
+
export default i18n.keyset(COMPONENT);
|
@@ -1,11 +1,15 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import DataTable, {Column, Settings, SortOrder} from '@yandex-cloud/react-data-table';
|
4
|
-
import {Popover, PopoverBehavior} from '@
|
4
|
+
import {Popover, PopoverBehavior} from '@gravity-ui/uikit';
|
5
|
+
|
5
6
|
//@ts-ignore
|
6
7
|
import {VisibleEntities} from '../../../store/reducers/storage';
|
8
|
+
|
9
|
+
import {EmptyFilter} from '../EmptyFilter/EmptyFilter';
|
7
10
|
import Pdisk from '../Pdisk/Pdisk';
|
8
11
|
|
12
|
+
import i18n from './i18n';
|
9
13
|
import './StorageNodes.scss';
|
10
14
|
|
11
15
|
enum TableColumnsIds {
|
@@ -19,11 +23,12 @@ enum TableColumnsIds {
|
|
19
23
|
type TableColumnsIdsKeys = keyof typeof TableColumnsIds;
|
20
24
|
type TableColumnsIdsValues = typeof TableColumnsIds[TableColumnsIdsKeys];
|
21
25
|
|
22
|
-
interface
|
26
|
+
interface StorageNodesProps {
|
23
27
|
data: any;
|
24
28
|
nodes: any;
|
25
29
|
tableSettings: Settings;
|
26
30
|
visibleEntities: keyof typeof VisibleEntities;
|
31
|
+
onShowAll?: VoidFunction;
|
27
32
|
}
|
28
33
|
|
29
34
|
const tableColumnsNames: Record<TableColumnsIdsValues, string> = {
|
@@ -56,7 +61,7 @@ function setSortOrder(visibleEntities: keyof typeof VisibleEntities): SortOrder
|
|
56
61
|
}
|
57
62
|
}
|
58
63
|
|
59
|
-
function StorageNodes({data, tableSettings, visibleEntities}:
|
64
|
+
function StorageNodes({data, tableSettings, visibleEntities, onShowAll}: StorageNodesProps) {
|
60
65
|
const allColumns: Column<any>[] = [
|
61
66
|
{
|
62
67
|
name: TableColumnsIds.NodeId,
|
@@ -114,14 +119,26 @@ function StorageNodes({data, tableSettings, visibleEntities}: StorageGroupsProps
|
|
114
119
|
];
|
115
120
|
|
116
121
|
let columns = allColumns;
|
117
|
-
let emptyMessage = 'No such nodes.';
|
118
122
|
|
119
123
|
if (visibleEntities === VisibleEntities.Space) {
|
120
124
|
columns = allColumns.filter((col) => col.name !== TableColumnsIds.Missing);
|
121
|
-
|
125
|
+
|
126
|
+
return (
|
127
|
+
<EmptyFilter
|
128
|
+
title={i18n('empty.out_of_space')}
|
129
|
+
showAll={i18n('show_all')}
|
130
|
+
onShowAll={onShowAll}
|
131
|
+
/>
|
132
|
+
);
|
122
133
|
}
|
123
134
|
if (visibleEntities === VisibleEntities.Missing) {
|
124
|
-
|
135
|
+
return (
|
136
|
+
<EmptyFilter
|
137
|
+
title={i18n('empty.degraded')}
|
138
|
+
showAll={i18n('show_all')}
|
139
|
+
onShowAll={onShowAll}
|
140
|
+
/>
|
141
|
+
);
|
125
142
|
}
|
126
143
|
|
127
144
|
return data ? (
|
@@ -132,7 +149,7 @@ function StorageNodes({data, tableSettings, visibleEntities}: StorageGroupsProps
|
|
132
149
|
columns={columns}
|
133
150
|
settings={tableSettings}
|
134
151
|
initialSortOrder={setSortOrder(visibleEntities)}
|
135
|
-
emptyDataMessage={
|
152
|
+
emptyDataMessage={i18n('empty.default')}
|
136
153
|
/>
|
137
154
|
) : null;
|
138
155
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import {i18n, Lang} from '../../../../utils/i18n';
|
2
|
+
|
3
|
+
import en from './en.json';
|
4
|
+
import ru from './ru.json';
|
5
|
+
|
6
|
+
const COMPONENT = 'ydb-storage-nodes';
|
7
|
+
|
8
|
+
i18n.registerKeyset(Lang.En, COMPONENT, en);
|
9
|
+
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
|
10
|
+
|
11
|
+
export default i18n.keyset(COMPONENT);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import {useEffect, useMemo, useRef, useState} from 'react';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
|
4
|
-
import {Select, SelectOption} from '@
|
4
|
+
import {Select, SelectOption} from '@gravity-ui/uikit';
|
5
5
|
|
6
6
|
import EntityStatus from "../../../components/EntityStatus/EntityStatus";
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, {useEffect, useState, useRef, useMemo} from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import cn from 'bem-cn-lite';
|
4
|
-
import {Label, Popup} from '@
|
4
|
+
import {Label, Popup} from '@gravity-ui/uikit';
|
5
5
|
|
6
6
|
import {bytesToGB, bytesToSpeed} from '../../../utils/utils';
|
7
7
|
import routes, {createHref} from '../../../routes';
|
@@ -15,7 +15,7 @@ import EntityStatus from '../../components/EntityStatus/EntityStatus';
|
|
15
15
|
import {Tag} from '../../components/Tag/Tag';
|
16
16
|
import Icon from '../../components/Icon/Icon';
|
17
17
|
import EmptyState from '../../components/EmptyState/EmptyState';
|
18
|
-
import {Link as ExternalLink, Button, Loader} from '@
|
18
|
+
import {Link as ExternalLink, Button, Loader} from '@gravity-ui/uikit';
|
19
19
|
import DataTable from '@yandex-cloud/react-data-table';
|
20
20
|
import CriticalActionDialog from '../../components/CriticalActionDialog/CriticalActionDialog';
|
21
21
|
import routes, {createHref} from '../../routes';
|
@@ -12,7 +12,7 @@ import {
|
|
12
12
|
import {showTooltip, hideTooltip} from '../../store/reducers/tooltip';
|
13
13
|
|
14
14
|
import Tablet from '../../components/Tablet/Tablet';
|
15
|
-
import {Loader, Select} from '@
|
15
|
+
import {Loader, Select} from '@gravity-ui/uikit';
|
16
16
|
import ReactList from 'react-list';
|
17
17
|
import {AutoFetcher} from '../../utils/autofetcher';
|
18
18
|
|
@@ -5,7 +5,7 @@ import cn from 'bem-cn-lite';
|
|
5
5
|
import qs from 'qs';
|
6
6
|
import _ from 'lodash';
|
7
7
|
|
8
|
-
import {Loader, Select} from '@
|
8
|
+
import {Loader, Select} from '@gravity-ui/uikit';
|
9
9
|
import ReactList from 'react-list';
|
10
10
|
|
11
11
|
import Tablet from '../../components/Tablet/Tablet';
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
import _ from 'lodash';
|
5
5
|
import {connect} from 'react-redux';
|
6
|
-
import {Loader} from '@
|
6
|
+
import {Loader} from '@gravity-ui/uikit';
|
7
7
|
import DataTable from '@yandex-cloud/react-data-table';
|
8
8
|
import {DEFAULT_TABLE_SETTINGS} from '../../../utils/constants';
|
9
9
|
|
@@ -5,7 +5,7 @@ import {connect} from 'react-redux';
|
|
5
5
|
import {withRouter} from 'react-router-dom';
|
6
6
|
import qs from 'qs';
|
7
7
|
|
8
|
-
import {Loader} from '@
|
8
|
+
import {Loader} from '@gravity-ui/uikit';
|
9
9
|
|
10
10
|
import NodesViewer from '../../../../components/NodesViewer/NodesViewer';
|
11
11
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
import {connect} from 'react-redux';
|
5
|
-
import {Loader} from '@
|
5
|
+
import {Loader} from '@gravity-ui/uikit';
|
6
6
|
import JSONTree from 'react-json-inspector';
|
7
7
|
|
8
8
|
import {getDescribe} from '../../../../store/reducers/describe';
|
@@ -2,7 +2,7 @@ import React, {useState} from 'react';
|
|
2
2
|
import {useSelector} from 'react-redux';
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
|
5
|
-
import {Button, Modal} from '@
|
5
|
+
import {Button, Modal} from '@gravity-ui/uikit';
|
6
6
|
|
7
7
|
import type {EPathType} from '../../../../types/api/schema';
|
8
8
|
//@ts-ignore
|
@@ -5,7 +5,7 @@ import {Link} from 'react-router-dom';
|
|
5
5
|
import {useDispatch, useSelector} from 'react-redux';
|
6
6
|
import {useLocation} from 'react-router';
|
7
7
|
|
8
|
-
import {Switch, Tabs} from '@
|
8
|
+
import {Switch, Tabs} from '@gravity-ui/uikit';
|
9
9
|
|
10
10
|
//@ts-ignore
|
11
11
|
import TopQueries from './TopQueries/TopQueries';
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import {connect} from 'react-redux';
|
4
4
|
import cn from 'bem-cn-lite';
|
5
5
|
|
6
|
-
import {Loader, Button} from '@
|
6
|
+
import {Loader, Button} from '@gravity-ui/uikit';
|
7
7
|
|
8
8
|
import IssuesViewer from './IssuesViewer/IssuesViewer';
|
9
9
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import {useEffect, useMemo} from 'react';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import {connect} from 'react-redux';
|
4
|
-
import {Loader} from '@
|
4
|
+
import {Loader} from '@gravity-ui/uikit';
|
5
5
|
import DataTable from '@yandex-cloud/react-data-table';
|
6
6
|
|
7
7
|
import Icon from '../../../../components/Icon/Icon';
|
@@ -5,11 +5,12 @@ import {connect} from 'react-redux';
|
|
5
5
|
import _ from 'lodash';
|
6
6
|
|
7
7
|
import {Link} from 'react-router-dom';
|
8
|
-
import {Loader, Checkbox} from '@
|
8
|
+
import {Loader, Checkbox} from '@gravity-ui/uikit';
|
9
9
|
|
10
10
|
import NodeNetwork from './NodeNetwork/NodeNetwork';
|
11
11
|
import Icon from '../../../../components/Icon/Icon';
|
12
12
|
import ProblemFilter, {problemFilterType} from '../../../../components/ProblemFilter/ProblemFilter';
|
13
|
+
import {Illustration} from '../../../../components/Illustration';
|
13
14
|
|
14
15
|
import {getNetworkInfo} from '../../../../store/reducers/network';
|
15
16
|
import {hideTooltip, showTooltip} from '../../../../store/reducers/tooltip';
|
@@ -242,7 +243,7 @@ class Network extends React.Component {
|
|
242
243
|
});
|
243
244
|
|
244
245
|
if (filter === PROBLEMS && problemNodesCount === 0) {
|
245
|
-
return <
|
246
|
+
return <Illustration name="thumbsUp" width="200" />;
|
246
247
|
} else {
|
247
248
|
return result;
|
248
249
|
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import {ReactNode, useEffect, useMemo} from 'react';
|
1
|
+
import {ReactNode, useCallback, useEffect, useMemo} from 'react';
|
2
2
|
import {useDispatch, useSelector} from 'react-redux';
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
|
5
|
-
import {Loader} from '@
|
5
|
+
import {Loader} from '@gravity-ui/uikit';
|
6
6
|
|
7
7
|
//@ts-ignore
|
8
8
|
import SchemaInfoViewer from '../../Schema/SchemaInfoViewer/SchemaInfoViewer';
|
@@ -22,14 +22,14 @@ import {getOlapStats} from '../../../../store/reducers/olapStats';
|
|
22
22
|
|
23
23
|
import './Overview.scss';
|
24
24
|
|
25
|
-
function prepareOlapTableGeneral(tableData: any, olapStats
|
25
|
+
function prepareOlapTableGeneral(tableData: any, olapStats?: any[]) {
|
26
26
|
const {ColumnShardCount} = tableData;
|
27
27
|
const Bytes = olapStats?.reduce((acc, el) => {
|
28
|
-
acc += parseInt(el.Bytes)
|
28
|
+
acc += parseInt(el.Bytes) || 0;
|
29
29
|
return acc;
|
30
30
|
}, 0);
|
31
31
|
const Rows = olapStats?.reduce((acc, el) => {
|
32
|
-
acc += parseInt(el.Rows)
|
32
|
+
acc += parseInt(el.Rows) || 0;
|
33
33
|
return acc;
|
34
34
|
}, 0);
|
35
35
|
const tabletIds = olapStats?.reduce((acc, el) => {
|
@@ -60,7 +60,10 @@ const b = cn('kv-tenant-overview');
|
|
60
60
|
const autofetcher = new AutoFetcher();
|
61
61
|
|
62
62
|
function Overview(props: OverviewProps) {
|
63
|
+
const {tenantName, type} = props;
|
64
|
+
|
63
65
|
const dispatch = useDispatch();
|
66
|
+
|
64
67
|
const {
|
65
68
|
currentSchema: currentItem = {},
|
66
69
|
loading,
|
@@ -69,45 +72,42 @@ function Overview(props: OverviewProps) {
|
|
69
72
|
currentSchemaPath,
|
70
73
|
} = useSelector((state: any) => state.schema);
|
71
74
|
|
72
|
-
const {
|
75
|
+
const {
|
76
|
+
data: { result: olapStats } = { result: undefined },
|
77
|
+
} = useSelector((state: any) => state.olapStats);
|
73
78
|
|
74
|
-
const fetchOverviewData = () => {
|
75
|
-
const {tenantName, type} = props;
|
79
|
+
const fetchOverviewData = useCallback(() => {
|
76
80
|
const schemaPath = currentSchemaPath || tenantName;
|
77
81
|
dispatch(getSchema({path: schemaPath}));
|
78
82
|
|
79
83
|
if (isTableType(type) && isColumnEntityType(type)) {
|
80
84
|
dispatch(getOlapStats({path: schemaPath}));
|
81
85
|
}
|
82
|
-
};
|
86
|
+
}, [currentSchemaPath, dispatch, tenantName, type]);
|
83
87
|
|
84
|
-
useEffect(
|
85
|
-
fetchOverviewData();
|
86
|
-
return () => {
|
87
|
-
autofetcher.stop();
|
88
|
-
};
|
89
|
-
}, []);
|
88
|
+
useEffect(fetchOverviewData, [fetchOverviewData]);
|
90
89
|
|
91
90
|
useEffect(() => {
|
91
|
+
autofetcher.stop();
|
92
|
+
|
92
93
|
if (autorefresh) {
|
93
|
-
fetchOverviewData();
|
94
|
-
autofetcher.stop();
|
95
94
|
autofetcher.start();
|
96
95
|
autofetcher.fetch(() => fetchOverviewData());
|
97
96
|
}
|
98
|
-
|
97
|
+
|
98
|
+
return () => {
|
99
99
|
autofetcher.stop();
|
100
|
-
}
|
101
|
-
}, [autorefresh]);
|
100
|
+
};
|
101
|
+
}, [autorefresh, fetchOverviewData]);
|
102
102
|
|
103
103
|
const tableSchema =
|
104
104
|
currentItem?.PathDescription?.Table || currentItem?.PathDescription?.ColumnTableDescription;
|
105
105
|
|
106
106
|
const schemaData = useMemo(() => {
|
107
|
-
return isTableType(
|
107
|
+
return isTableType(type) && isColumnEntityType(type)
|
108
108
|
? prepareOlapTableGeneral(tableSchema, olapStats)
|
109
109
|
: currentItem;
|
110
|
-
}, [
|
110
|
+
}, [type, tableSchema, olapStats, currentItem]);
|
111
111
|
|
112
112
|
const renderLoader = () => {
|
113
113
|
return (
|
@@ -133,7 +133,7 @@ function Overview(props: OverviewProps) {
|
|
133
133
|
[EPathType.EPathTypePersQueueGroup]: () => <PersQueueGroupInfo data={schemaData} />,
|
134
134
|
};
|
135
135
|
|
136
|
-
return (
|
136
|
+
return (type && pathTypeToComponent[type]?.()) || (
|
137
137
|
<SchemaInfoViewer fullPath={currentItem.Path} data={schemaData} />
|
138
138
|
);
|
139
139
|
}
|
@@ -17,7 +17,7 @@ import {TABLET_STATES} from '../../../../utils/constants';
|
|
17
17
|
|
18
18
|
import './TenantOverview.scss';
|
19
19
|
import {AutoFetcher} from '../../../../utils/autofetcher';
|
20
|
-
import {Loader} from '@
|
20
|
+
import {Loader} from '@gravity-ui/uikit';
|
21
21
|
|
22
22
|
const b = cn('tenant-overview');
|
23
23
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
import {connect} from 'react-redux';
|
5
5
|
import DataTable from '@yandex-cloud/react-data-table';
|
6
|
-
import {Loader} from '@
|
6
|
+
import {Loader} from '@gravity-ui/uikit';
|
7
7
|
|
8
8
|
import {changeUserInput} from '../../../../store/reducers/executeQuery';
|
9
9
|
import {sendQuery, setQueryOptions} from '../../../../store/reducers/executeTopQueries';
|
@@ -167,11 +167,11 @@ class TopQueries extends React.Component {
|
|
167
167
|
}
|
168
168
|
}
|
169
169
|
const mapStateToProps = (state) => {
|
170
|
-
const {loading, data, error, wasLoaded} = state.executeTopQueries;
|
170
|
+
const {loading, data = {}, error, wasLoaded} = state.executeTopQueries;
|
171
171
|
const {autorefresh} = state.schema;
|
172
172
|
return {
|
173
173
|
loading,
|
174
|
-
data,
|
174
|
+
data: data.result,
|
175
175
|
error,
|
176
176
|
wasLoaded,
|
177
177
|
autorefresh,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import {useState, useContext, useEffect, useMemo} from 'react';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import {connect} from 'react-redux';
|
4
|
-
import {Loader} from '@
|
4
|
+
import {Loader} from '@gravity-ui/uikit';
|
5
5
|
import DataTable from '@yandex-cloud/react-data-table';
|
6
6
|
|
7
7
|
import InternalLink from '../../../../components/InternalLink/InternalLink';
|
@@ -216,11 +216,11 @@ function TopShards({
|
|
216
216
|
}
|
217
217
|
|
218
218
|
const mapStateToProps = (state) => {
|
219
|
-
const {loading, data, error, wasLoaded} = state.shardsWorkload;
|
219
|
+
const {loading, data = {}, error, wasLoaded} = state.shardsWorkload;
|
220
220
|
const {autorefresh} = state.schema;
|
221
221
|
return {
|
222
222
|
loading,
|
223
|
-
data,
|
223
|
+
data: data.result,
|
224
224
|
error,
|
225
225
|
currentSchemaPath: state.schema?.currentSchema?.Path,
|
226
226
|
autorefresh,
|