ydb-embedded-ui 2.4.4 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +42 -0
- package/dist/components/InfoViewer/InfoViewer.scss +3 -3
- package/dist/components/InfoViewer/formatters/schema.ts +2 -1
- package/dist/components/InfoViewer/schemaInfo/CDCStreamInfo.tsx +23 -22
- package/dist/components/InfoViewer/schemaInfo/PersQueueGroupInfo.tsx +8 -13
- package/dist/components/InfoViewer/schemaInfo/TableIndexInfo.tsx +2 -12
- package/dist/components/InfoViewer/schemaOverview/CDCStreamOverview.tsx +3 -16
- package/dist/components/InfoViewer/schemaOverview/PersQueueGroupOverview.tsx +8 -13
- package/dist/components/InfoViewer/utils.ts +6 -6
- package/dist/components/Loader/Loader.scss +6 -3
- package/dist/components/Loader/Loader.tsx +7 -5
- package/dist/components/Loader/index.ts +1 -0
- package/dist/components/UptimeFIlter/UptimeFilter.tsx +21 -0
- package/dist/components/UptimeFIlter/index.ts +1 -0
- package/dist/containers/Node/Node.scss +1 -0
- package/dist/containers/Node/Node.tsx +3 -8
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +0 -6
- package/dist/containers/Node/NodeStructure/NodeStructure.tsx +1 -1
- package/dist/containers/Nodes/Nodes.js +22 -10
- package/dist/{components → containers}/NodesViewer/NodesViewer.js +49 -62
- package/dist/{components → containers}/NodesViewer/NodesViewer.scss +0 -0
- package/dist/containers/Storage/Pdisk/Pdisk.scss +1 -1
- package/dist/containers/Storage/Pdisk/Pdisk.tsx +3 -9
- package/dist/containers/Storage/Pdisk/__tests__/colors.tsx +1 -1
- package/dist/containers/Storage/Storage.js +46 -11
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +39 -32
- package/dist/containers/Storage/StorageNodes/StorageNodes.scss +2 -2
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +35 -17
- package/dist/containers/Storage/StorageNodes/i18n/en.json +6 -4
- package/dist/containers/Storage/StorageNodes/i18n/ru.json +6 -4
- package/dist/containers/Storage/UsageFilter/UsageFilter.scss +10 -5
- package/dist/containers/Tenant/Acl/Acl.js +1 -7
- package/dist/containers/Tenant/Diagnostics/Compute/Compute.js +22 -14
- package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.tsx +52 -10
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.scss +0 -8
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.tsx +42 -15
- package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +0 -7
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +19 -15
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.tsx +13 -5
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +17 -4
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +50 -16
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +16 -2
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +1 -0
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +21 -13
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +1 -5
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +4 -4
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.js +1 -4
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.js +23 -28
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +2 -2
- package/dist/containers/Tenant/TenantPages.tsx +1 -1
- package/dist/containers/Tenant/utils/schema.ts +84 -0
- package/dist/containers/Tenant/utils/schemaActions.ts +9 -20
- package/dist/services/api.d.ts +17 -11
- package/dist/store/reducers/clusterNodes.js +29 -10
- package/dist/store/reducers/describe.ts +56 -14
- package/dist/store/reducers/healthcheckInfo.ts +23 -8
- package/dist/store/reducers/network.js +22 -1
- package/dist/store/reducers/nodes.js +37 -3
- package/dist/store/reducers/schema.ts +229 -0
- package/dist/store/reducers/storage.js +59 -5
- package/dist/types/api/enums.ts +10 -0
- package/dist/types/api/nodes.ts +96 -0
- package/dist/types/api/pdisk.ts +48 -0
- package/dist/types/api/schema.ts +148 -9
- package/dist/types/api/storage.ts +3 -173
- package/dist/types/api/tablet.ts +97 -0
- package/dist/types/api/vdisk.ts +120 -0
- package/dist/types/store/describe.ts +8 -2
- package/dist/types/store/healthcheck.ts +12 -0
- package/dist/types/store/schema.ts +52 -0
- package/dist/utils/index.js +6 -2
- package/dist/utils/nodes.ts +9 -0
- package/dist/utils/pdisk.ts +1 -1
- package/dist/utils/storage.ts +1 -1
- package/package.json +1 -1
- package/dist/store/reducers/schema.js +0 -148
@@ -1,4 +1,6 @@
|
|
1
1
|
.usage-filter {
|
2
|
+
min-width: 100px;
|
3
|
+
|
2
4
|
&__option {
|
3
5
|
flex-grow: 1;
|
4
6
|
|
@@ -10,22 +12,25 @@
|
|
10
12
|
}
|
11
13
|
|
12
14
|
&-meta {
|
13
|
-
padding: 0 5px;
|
14
15
|
position: relative;
|
15
|
-
|
16
|
+
|
17
|
+
padding: 0 5px;
|
18
|
+
|
16
19
|
font-size: var(--yc-text-caption-2-font-size);
|
17
20
|
line-height: var(--yc-text-caption-2-line-height);
|
21
|
+
|
22
|
+
border-radius: 3px;
|
18
23
|
}
|
19
24
|
|
20
25
|
&-bar {
|
21
26
|
position: absolute;
|
22
|
-
|
27
|
+
z-index: -1;
|
23
28
|
top: 0;
|
24
29
|
bottom: 0;
|
25
|
-
|
30
|
+
left: 0;
|
26
31
|
|
27
|
-
background-color: var(--yc-color-infographics-info-medium);
|
28
32
|
border-radius: 3px;
|
33
|
+
background-color: var(--yc-color-infographics-info-medium);
|
29
34
|
}
|
30
35
|
}
|
31
36
|
}
|
@@ -83,13 +83,7 @@ class Acl extends React.Component {
|
|
83
83
|
return null;
|
84
84
|
}
|
85
85
|
|
86
|
-
return
|
87
|
-
<DataTable
|
88
|
-
columns={this.COLUMNS}
|
89
|
-
data={acl}
|
90
|
-
settings={TABLE_SETTINGS}
|
91
|
-
/>
|
92
|
-
);
|
86
|
+
return <DataTable columns={this.COLUMNS} data={acl} settings={TABLE_SETTINGS} />;
|
93
87
|
};
|
94
88
|
|
95
89
|
renderOwner = () => {
|
@@ -2,16 +2,14 @@ import React from 'react';
|
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import {connect} from 'react-redux';
|
5
|
-
import {withRouter} from 'react-router-dom';
|
6
|
-
import qs from 'qs';
|
7
5
|
|
8
6
|
import {Loader} from '@gravity-ui/uikit';
|
9
7
|
|
10
|
-
import NodesViewer from '
|
8
|
+
import NodesViewer from '../../../NodesViewer/NodesViewer';
|
11
9
|
|
12
10
|
import {backend} from '../../../../store';
|
13
11
|
import {hideTooltip, showTooltip} from '../../../../store/reducers/tooltip';
|
14
|
-
import {getNodes, clearNodes} from '../../../../store/reducers/nodes';
|
12
|
+
import {getNodes, clearNodes, setDataWasNotLoaded} from '../../../../store/reducers/nodes';
|
15
13
|
|
16
14
|
import './Compute.scss';
|
17
15
|
import {AutoFetcher} from '../../../../utils/autofetcher';
|
@@ -28,6 +26,7 @@ class Compute extends React.Component {
|
|
28
26
|
autorefresh: PropTypes.bool,
|
29
27
|
error: PropTypes.object,
|
30
28
|
wasLoaded: PropTypes.bool,
|
29
|
+
setDataWasNotLoaded: PropTypes.func,
|
31
30
|
getNodes: PropTypes.func,
|
32
31
|
hideTooltip: PropTypes.func,
|
33
32
|
showTooltip: PropTypes.func,
|
@@ -50,12 +49,25 @@ class Compute extends React.Component {
|
|
50
49
|
}
|
51
50
|
|
52
51
|
componentDidUpdate(prevProps) {
|
53
|
-
const {autorefresh, getNodes, tenantName} = this.props;
|
52
|
+
const {autorefresh, getNodes, setDataWasNotLoaded, tenantName} = this.props;
|
54
53
|
|
55
|
-
|
56
|
-
|
54
|
+
const restartAutorefresh = () => {
|
55
|
+
this.autofetcher.stop();
|
57
56
|
this.autofetcher.start();
|
58
57
|
this.autofetcher.fetch(() => getNodes(tenantName));
|
58
|
+
};
|
59
|
+
|
60
|
+
if (tenantName !== prevProps.tenantName) {
|
61
|
+
setDataWasNotLoaded();
|
62
|
+
getNodes(tenantName);
|
63
|
+
if (autorefresh) {
|
64
|
+
restartAutorefresh();
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
if (autorefresh && !prevProps.autorefresh) {
|
69
|
+
getNodes(tenantName);
|
70
|
+
restartAutorefresh();
|
59
71
|
}
|
60
72
|
if (!autorefresh && prevProps.autorefresh) {
|
61
73
|
this.autofetcher.stop();
|
@@ -103,15 +115,10 @@ class Compute extends React.Component {
|
|
103
115
|
function mapStateToProps(state, ownProps) {
|
104
116
|
const {data, loading, wasLoaded, error} = state.nodes;
|
105
117
|
const {autorefresh} = state.schema;
|
106
|
-
const {search} = ownProps.location;
|
107
|
-
const queryParams = qs.parse(search, {
|
108
|
-
ignoreQueryPrefix: true,
|
109
|
-
});
|
110
|
-
const {name: tenantName} = queryParams;
|
111
118
|
const nodes = (data && data.Tenants && data.Tenants[0] && data.Tenants[0].Nodes) || [];
|
112
119
|
return {
|
120
|
+
...ownProps,
|
113
121
|
nodes,
|
114
|
-
tenantName,
|
115
122
|
loading,
|
116
123
|
wasLoaded,
|
117
124
|
error,
|
@@ -124,8 +131,9 @@ const mapDispatchToProps = {
|
|
124
131
|
clearNodes,
|
125
132
|
hideTooltip,
|
126
133
|
showTooltip,
|
134
|
+
setDataWasNotLoaded,
|
127
135
|
};
|
128
136
|
|
129
137
|
const ConnectedCompute = connect(mapStateToProps, mapDispatchToProps)(Compute);
|
130
138
|
|
131
|
-
export default
|
139
|
+
export default ConnectedCompute;
|
@@ -1,13 +1,24 @@
|
|
1
|
-
import {useEffect, useState} from 'react';
|
1
|
+
import {useCallback, useEffect, useState} from 'react';
|
2
2
|
import {useDispatch} from 'react-redux';
|
3
3
|
import block from 'bem-cn-lite';
|
4
4
|
|
5
5
|
import DataTable, {Column} from '@yandex-cloud/react-data-table';
|
6
6
|
|
7
|
+
import type {EPathType} from '../../../../types/api/schema';
|
8
|
+
import {Loader} from '../../../../components/Loader';
|
9
|
+
import {prepareQueryError} from '../../../../utils/query';
|
7
10
|
import {DEFAULT_TABLE_SETTINGS} from '../../../../utils/constants';
|
8
11
|
import {useAutofetcher, useTypedSelector} from '../../../../utils/hooks';
|
9
12
|
import {Search} from '../../../../components/Search';
|
10
|
-
import {
|
13
|
+
import {
|
14
|
+
getDescribe,
|
15
|
+
selectConsumers,
|
16
|
+
setCurrentDescribePath,
|
17
|
+
setDataWasNotLoaded,
|
18
|
+
} from '../../../../store/reducers/describe';
|
19
|
+
import {selectSchemaMergedChildrenPaths} from '../../../../store/reducers/schema';
|
20
|
+
|
21
|
+
import {isCdcStreamEntityType} from '../../utils/schema';
|
11
22
|
|
12
23
|
import i18n from './i18n';
|
13
24
|
|
@@ -17,18 +28,41 @@ const b = block('ydb-consumers');
|
|
17
28
|
|
18
29
|
interface ConsumersProps {
|
19
30
|
path: string;
|
31
|
+
type?: EPathType;
|
20
32
|
}
|
21
33
|
|
22
|
-
export const Consumers = ({path}: ConsumersProps) => {
|
23
|
-
const
|
34
|
+
export const Consumers = ({path, type}: ConsumersProps) => {
|
35
|
+
const dispatch = useDispatch();
|
24
36
|
|
25
|
-
const
|
26
|
-
|
27
|
-
|
37
|
+
const isCdcStream = isCdcStreamEntityType(type);
|
38
|
+
|
39
|
+
const mergedChildrenPaths = useTypedSelector((state) =>
|
40
|
+
selectSchemaMergedChildrenPaths(state, path, type),
|
41
|
+
);
|
28
42
|
|
29
|
-
|
43
|
+
const dataPath = isCdcStream ? mergedChildrenPaths?.[0] : path;
|
30
44
|
|
31
|
-
const
|
45
|
+
const fetchData = useCallback(
|
46
|
+
(isBackground: boolean) => {
|
47
|
+
if (!isBackground) {
|
48
|
+
dispatch(setDataWasNotLoaded());
|
49
|
+
}
|
50
|
+
|
51
|
+
if (dataPath) {
|
52
|
+
dispatch(setCurrentDescribePath(dataPath));
|
53
|
+
dispatch(getDescribe({path: dataPath}));
|
54
|
+
}
|
55
|
+
},
|
56
|
+
|
57
|
+
[dispatch, dataPath],
|
58
|
+
);
|
59
|
+
|
60
|
+
const {autorefresh} = useTypedSelector((state) => state.schema);
|
61
|
+
|
62
|
+
useAutofetcher(fetchData, [fetchData], autorefresh);
|
63
|
+
|
64
|
+
const {loading, wasLoaded, error} = useTypedSelector((state) => state.describe);
|
65
|
+
const consumers = useTypedSelector((state) => selectConsumers(state, dataPath));
|
32
66
|
|
33
67
|
const [consumersToRender, setConsumersToRender] = useState(consumers);
|
34
68
|
|
@@ -59,8 +93,16 @@ export const Consumers = ({path}: ConsumersProps) => {
|
|
59
93
|
},
|
60
94
|
];
|
61
95
|
|
96
|
+
if (loading && !wasLoaded) {
|
97
|
+
return <Loader size="m" />;
|
98
|
+
}
|
99
|
+
|
100
|
+
if (!loading && error) {
|
101
|
+
return <div className={b('message', 'error')}>{prepareQueryError(error)}</div>;
|
102
|
+
}
|
103
|
+
|
62
104
|
if (consumers.length === 0) {
|
63
|
-
return <div>{i18n('noConsumersMessage')}</div>;
|
105
|
+
return <div className={b('message')}>{i18n('noConsumersMessage')}</div>;
|
64
106
|
}
|
65
107
|
|
66
108
|
return (
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import {useCallback} from 'react';
|
2
|
-
import {useDispatch} from 'react-redux';
|
1
|
+
import {useCallback, useEffect, useState} from 'react';
|
2
|
+
import {shallowEqual, useDispatch} from 'react-redux';
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
// @ts-ignore
|
5
5
|
import JSONTree from 'react-json-inspector';
|
6
6
|
import 'react-json-inspector/json-inspector.css';
|
7
7
|
|
8
|
-
import {Loader} from '
|
8
|
+
import {Loader} from '../../../../components/Loader';
|
9
9
|
|
10
10
|
import {prepareQueryError} from '../../../../utils/query';
|
11
11
|
import {useAutofetcher, useTypedSelector} from '../../../../utils/hooks';
|
@@ -13,7 +13,12 @@ import {
|
|
13
13
|
getDescribe,
|
14
14
|
setDataWasNotLoaded,
|
15
15
|
setCurrentDescribePath,
|
16
|
+
getDescribeBatched,
|
16
17
|
} from '../../../../store/reducers/describe';
|
18
|
+
import {selectSchemaMergedChildrenPaths} from '../../../../store/reducers/schema';
|
19
|
+
import type {EPathType} from '../../../../types/api/schema';
|
20
|
+
|
21
|
+
import {isEntityWithMergedImplementation} from '../../utils/schema';
|
17
22
|
|
18
23
|
import './Describe.scss';
|
19
24
|
|
@@ -23,17 +28,39 @@ const expandMap = new Map();
|
|
23
28
|
|
24
29
|
interface IDescribeProps {
|
25
30
|
tenant: string;
|
31
|
+
type?: EPathType;
|
26
32
|
}
|
27
33
|
|
28
|
-
const Describe = ({tenant}: IDescribeProps) => {
|
34
|
+
const Describe = ({tenant, type}: IDescribeProps) => {
|
29
35
|
const dispatch = useDispatch();
|
30
36
|
|
31
37
|
const {currentDescribe, error, loading, wasLoaded} = useTypedSelector(
|
32
38
|
(state) => state.describe,
|
33
39
|
);
|
34
40
|
|
41
|
+
const [preparedDescribeData, setPreparedDescribeData] = useState<Object>();
|
42
|
+
|
43
|
+
useEffect(() => {
|
44
|
+
if (currentDescribe) {
|
45
|
+
const paths = Object.keys(currentDescribe);
|
46
|
+
|
47
|
+
if (paths.length === 1) {
|
48
|
+
setPreparedDescribeData(currentDescribe[paths[0]]);
|
49
|
+
} else {
|
50
|
+
setPreparedDescribeData(currentDescribe);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}, [currentDescribe]);
|
54
|
+
|
35
55
|
const {autorefresh, currentSchemaPath} = useTypedSelector((state) => state.schema);
|
36
56
|
|
57
|
+
const isEntityWithMergedImpl = isEntityWithMergedImplementation(type);
|
58
|
+
|
59
|
+
const mergedChildrenPaths = useTypedSelector(
|
60
|
+
(state) => selectSchemaMergedChildrenPaths(state, currentSchemaPath, type),
|
61
|
+
shallowEqual,
|
62
|
+
);
|
63
|
+
|
37
64
|
const fetchData = useCallback(
|
38
65
|
(isBackground: boolean) => {
|
39
66
|
if (!isBackground) {
|
@@ -41,28 +68,28 @@ const Describe = ({tenant}: IDescribeProps) => {
|
|
41
68
|
}
|
42
69
|
|
43
70
|
const path = currentSchemaPath || tenant;
|
44
|
-
|
45
71
|
dispatch(setCurrentDescribePath(path));
|
46
|
-
|
72
|
+
|
73
|
+
if (!isEntityWithMergedImpl) {
|
74
|
+
dispatch(getDescribe({path}));
|
75
|
+
} else if (mergedChildrenPaths) {
|
76
|
+
dispatch(getDescribeBatched([path, ...mergedChildrenPaths]));
|
77
|
+
}
|
47
78
|
},
|
48
|
-
[currentSchemaPath, tenant, dispatch],
|
79
|
+
[currentSchemaPath, tenant, mergedChildrenPaths, isEntityWithMergedImpl, dispatch],
|
49
80
|
);
|
50
81
|
|
51
82
|
useAutofetcher(fetchData, [fetchData], autorefresh);
|
52
83
|
|
53
|
-
if (loading && !wasLoaded) {
|
54
|
-
return
|
55
|
-
<div className={b('loader-container')}>
|
56
|
-
<Loader size="m" />
|
57
|
-
</div>
|
58
|
-
);
|
84
|
+
if ((loading && !wasLoaded) || (isEntityWithMergedImpl && !mergedChildrenPaths)) {
|
85
|
+
return <Loader size="m" />;
|
59
86
|
}
|
60
87
|
|
61
88
|
if (error) {
|
62
89
|
return <div className={b('message-container', 'error')}>{prepareQueryError(error)}</div>;
|
63
90
|
}
|
64
91
|
|
65
|
-
if (!loading && !
|
92
|
+
if (!loading && !preparedDescribeData) {
|
66
93
|
return <div className={b('message-container')}>Empty</div>;
|
67
94
|
}
|
68
95
|
|
@@ -70,7 +97,7 @@ const Describe = ({tenant}: IDescribeProps) => {
|
|
70
97
|
<div className={b()}>
|
71
98
|
<div className={b('result')}>
|
72
99
|
<JSONTree
|
73
|
-
data={
|
100
|
+
data={preparedDescribeData}
|
74
101
|
className={b('tree')}
|
75
102
|
onClick={({path}: {path: string}) => {
|
76
103
|
const newValue = !(expandMap.get(path) || false);
|
@@ -5,7 +5,9 @@ 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 {
|
8
|
+
import {Switch, Tabs} from '@gravity-ui/uikit';
|
9
|
+
|
10
|
+
import {Loader} from '../../../components/Loader';
|
9
11
|
|
10
12
|
//@ts-ignore
|
11
13
|
import TopQueries from './TopQueries/TopQueries';
|
@@ -36,6 +38,7 @@ import {GeneralPagesIds, DATABASE_PAGES, getPagesByType} from './DiagnosticsPage
|
|
36
38
|
//@ts-ignore
|
37
39
|
import {enableAutorefresh, disableAutorefresh} from '../../../store/reducers/schema';
|
38
40
|
import {setTopLevelTab, setDiagnosticsTab} from '../../../store/reducers/tenant';
|
41
|
+
import {isDatabaseEntityType} from '../utils/schema';
|
39
42
|
|
40
43
|
import './Diagnostics.scss';
|
41
44
|
|
@@ -64,17 +67,17 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
64
67
|
ignoreQueryPrefix: true,
|
65
68
|
});
|
66
69
|
|
67
|
-
const {name:
|
68
|
-
|
69
|
-
const
|
70
|
+
const {name: rootTenantName} = queryParams;
|
71
|
+
const tenantName = isDatabaseEntityType(props.type) ? currentSchemaPath : rootTenantName;
|
72
|
+
const isDatabase = isDatabaseEntityType(props.type) || currentSchemaPath === rootTenantName;
|
70
73
|
|
71
74
|
const pages = useMemo(() => {
|
72
|
-
if (
|
75
|
+
if (isDatabase) {
|
73
76
|
return DATABASE_PAGES;
|
74
77
|
}
|
75
78
|
|
76
79
|
return getPagesByType(props.type);
|
77
|
-
}, [props.type,
|
80
|
+
}, [props.type, isDatabase]);
|
78
81
|
|
79
82
|
const forwardToDiagnosticTab = (tab: GeneralPagesIds) => {
|
80
83
|
dispatch(setDiagnosticsTab(tab));
|
@@ -132,10 +135,15 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
132
135
|
return <TopShards path={tenantNameString} type={type} />;
|
133
136
|
}
|
134
137
|
case GeneralPagesIds.nodes: {
|
135
|
-
return
|
138
|
+
return (
|
139
|
+
<Compute
|
140
|
+
tenantName={tenantNameString}
|
141
|
+
additionalNodesInfo={props.additionalNodesInfo}
|
142
|
+
/>
|
143
|
+
);
|
136
144
|
}
|
137
145
|
case GeneralPagesIds.tablets: {
|
138
|
-
return <Tablets path={
|
146
|
+
return <Tablets path={currentSchemaPath} />;
|
139
147
|
}
|
140
148
|
case GeneralPagesIds.storage: {
|
141
149
|
return <Storage tenant={tenantNameString} database={true} />;
|
@@ -144,7 +152,7 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
144
152
|
return <Network path={tenantNameString} />;
|
145
153
|
}
|
146
154
|
case GeneralPagesIds.describe: {
|
147
|
-
return <Describe tenant={tenantNameString} />;
|
155
|
+
return <Describe tenant={tenantNameString} type={type} />;
|
148
156
|
}
|
149
157
|
case GeneralPagesIds.hotKeys: {
|
150
158
|
return <HotKeys type={type} />;
|
@@ -153,7 +161,7 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
153
161
|
return <Heatmap path={currentItem.Path} />;
|
154
162
|
}
|
155
163
|
case GeneralPagesIds.consumers: {
|
156
|
-
return <Consumers path={
|
164
|
+
return <Consumers path={currentSchemaPath} type={type} />;
|
157
165
|
}
|
158
166
|
default: {
|
159
167
|
return <div>No data...</div>;
|
@@ -196,11 +204,7 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
196
204
|
// After tabs are initially loaded it is no longer needed
|
197
205
|
// Thus there is no also "loading" check as in other parts of the project
|
198
206
|
if (!wasLoaded) {
|
199
|
-
return
|
200
|
-
<div className={b('loader')}>
|
201
|
-
<Loader size="l" />
|
202
|
-
</div>
|
203
|
-
);
|
207
|
+
return <Loader size="l" />;
|
204
208
|
}
|
205
209
|
|
206
210
|
return (
|
@@ -87,7 +87,7 @@ export const TABLE_PAGES = [overview, topShards, graph, tablets, hotKeys, descri
|
|
87
87
|
|
88
88
|
export const DIR_PAGES = [overview, topShards, describe];
|
89
89
|
|
90
|
-
export const CDC_STREAM_PAGES = [overview, describe];
|
90
|
+
export const CDC_STREAM_PAGES = [overview, consumers, describe];
|
91
91
|
export const TOPIC_PAGES = [overview, consumers, describe];
|
92
92
|
|
93
93
|
// verbose mapping to guarantee correct tabs for new path types
|
@@ -10,6 +10,7 @@ import {
|
|
10
10
|
getHealthcheckInfo,
|
11
11
|
selectIssuesTreeById,
|
12
12
|
selectIssuesTreesRoots,
|
13
|
+
setDataWasNotLoaded,
|
13
14
|
} from '../../../../store/reducers/healthcheckInfo';
|
14
15
|
|
15
16
|
import {Details} from './Details';
|
@@ -43,14 +44,21 @@ export const Healthcheck = (props: HealthcheckProps) => {
|
|
43
44
|
|
44
45
|
const {autorefresh} = useTypedSelector((state) => state.schema);
|
45
46
|
|
46
|
-
const fetchHealthcheck = useCallback(
|
47
|
-
|
48
|
-
|
47
|
+
const fetchHealthcheck = useCallback(
|
48
|
+
(isBackground = true) => {
|
49
|
+
if (!isBackground) {
|
50
|
+
dispatch(setDataWasNotLoaded());
|
51
|
+
}
|
52
|
+
|
53
|
+
dispatch(getHealthcheckInfo(tenant));
|
54
|
+
},
|
55
|
+
[dispatch, tenant],
|
56
|
+
);
|
49
57
|
|
50
58
|
useAutofetcher(
|
51
|
-
() => {
|
59
|
+
(isBackground) => {
|
52
60
|
if (fetchData) {
|
53
|
-
fetchHealthcheck();
|
61
|
+
fetchHealthcheck(isBackground);
|
54
62
|
}
|
55
63
|
},
|
56
64
|
[fetchData, fetchHealthcheck],
|
@@ -12,7 +12,7 @@ import Icon from '../../../../components/Icon/Icon';
|
|
12
12
|
import ProblemFilter, {problemFilterType} from '../../../../components/ProblemFilter/ProblemFilter';
|
13
13
|
import {Illustration} from '../../../../components/Illustration';
|
14
14
|
|
15
|
-
import {getNetworkInfo} from '../../../../store/reducers/network';
|
15
|
+
import {getNetworkInfo, setDataWasNotLoaded} from '../../../../store/reducers/network';
|
16
16
|
import {hideTooltip, showTooltip} from '../../../../store/reducers/tooltip';
|
17
17
|
import {ALL, PROBLEMS} from '../../../../utils/constants';
|
18
18
|
import {changeFilter} from '../../../../store/reducers/settings';
|
@@ -26,6 +26,7 @@ const b = cn('network');
|
|
26
26
|
class Network extends React.Component {
|
27
27
|
static propTypes = {
|
28
28
|
getNetworkInfo: PropTypes.func,
|
29
|
+
setDataWasNotLoaded: PropTypes.func,
|
29
30
|
netWorkInfo: PropTypes.object,
|
30
31
|
hideTooltip: PropTypes.func,
|
31
32
|
showTooltip: PropTypes.func,
|
@@ -75,16 +76,27 @@ class Network extends React.Component {
|
|
75
76
|
}
|
76
77
|
|
77
78
|
componentDidUpdate(prevProps) {
|
78
|
-
const {autorefresh, path} = this.props;
|
79
|
+
const {autorefresh, path, setDataWasNotLoaded, getNetworkInfo} = this.props;
|
79
80
|
|
80
|
-
|
81
|
-
|
81
|
+
const restartAutorefresh = () => {
|
82
|
+
this.autofetcher.stop();
|
82
83
|
this.autofetcher.start();
|
83
84
|
this.autofetcher.fetch(() => getNetworkInfo(path));
|
85
|
+
};
|
86
|
+
|
87
|
+
if (autorefresh && !prevProps.autorefresh) {
|
88
|
+
getNetworkInfo(path);
|
89
|
+
restartAutorefresh();
|
84
90
|
}
|
85
91
|
if (!autorefresh && prevProps.autorefresh) {
|
86
92
|
this.autofetcher.stop();
|
87
93
|
}
|
94
|
+
|
95
|
+
if (path !== prevProps.path) {
|
96
|
+
setDataWasNotLoaded();
|
97
|
+
getNetworkInfo(path);
|
98
|
+
restartAutorefresh();
|
99
|
+
}
|
88
100
|
}
|
89
101
|
|
90
102
|
componentWillUnmount() {
|
@@ -364,6 +376,7 @@ const mapDispatchToProps = {
|
|
364
376
|
hideTooltip,
|
365
377
|
showTooltip,
|
366
378
|
changeFilter,
|
379
|
+
setDataWasNotLoaded,
|
367
380
|
};
|
368
381
|
|
369
382
|
export default connect(mapStateToProps, mapDispatchToProps)(Network);
|