ydb-embedded-ui 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +23 -0
- package/dist/assets/icons/question.svg +1 -0
- package/dist/components/ClusterInfo/ClusterInfo.tsx +8 -4
- package/dist/components/FullNodeViewer/FullNodeViewer.scss +4 -9
- package/dist/components/InfoViewer/InfoViewer.scss +3 -2
- package/dist/components/InternalLink/InternalLink.js +8 -0
- package/dist/components/Loader/Loader.scss +5 -0
- package/dist/components/Loader/Loader.tsx +16 -0
- package/dist/components/PDiskViewer/PDiskViewer.js +3 -4
- package/dist/containers/App/App.scss +4 -0
- package/dist/containers/App/Content.js +0 -2
- package/dist/containers/AppIcons/AppIcons.js +4 -0
- package/dist/containers/Authentication/Authentication.tsx +1 -1
- package/dist/containers/Cluster/Cluster.tsx +1 -1
- package/dist/containers/Header/Header.tsx +6 -1
- package/dist/containers/Heatmap/Heatmap.js +0 -1
- package/dist/containers/Node/Node.scss +12 -1
- package/dist/containers/Node/Node.tsx +187 -0
- package/dist/containers/Node/NodeOverview/NodeOverview.scss +0 -0
- package/dist/containers/Node/NodeOverview/NodeOverview.tsx +23 -0
- package/dist/containers/Node/NodePages.js +16 -0
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +148 -0
- package/dist/containers/Node/NodeStructure/NodeStructure.tsx +153 -0
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +299 -0
- package/dist/containers/Node/NodeStructure/Vdisk.tsx +153 -0
- package/dist/containers/Pdisk/Pdisk.js +2 -5
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.scss +10 -3
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.tsx +20 -15
- package/dist/containers/Storage/Pdisk/Pdisk.scss +1 -0
- package/dist/containers/Storage/Pdisk/Pdisk.tsx +7 -5
- package/dist/containers/Storage/Storage.js +12 -9
- package/dist/containers/Storage/StorageGroups/StorageGroups.scss +2 -1
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +2 -2
- package/dist/containers/Storage/StorageNodes/StorageNodes.scss +3 -2
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +2 -2
- package/dist/containers/Storage/Vdisk/Vdisk.js +7 -6
- package/dist/containers/Storage/Vdisk/Vdisk.scss +1 -0
- package/dist/containers/Tablet/Tablet.js +2 -7
- package/dist/containers/Tablets/Tablets.js +4 -12
- package/dist/containers/Tenant/Acl/Acl.js +0 -3
- package/dist/containers/Tenant/Diagnostics/Compute/Compute.js +1 -3
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +3 -6
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
- package/dist/containers/Tenant/QueryEditor/QueryEditor.js +24 -24
- package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +4 -0
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +4 -1
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss +1 -0
- package/dist/containers/Vdisk/Vdisk.js +2 -4
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +4 -6
- package/dist/services/api.js +0 -1
- package/dist/store/reducers/executeQuery.js +1 -1
- package/dist/store/reducers/header.ts +1 -1
- package/dist/store/reducers/node.js +98 -3
- package/dist/store/reducers/nodes.js +0 -3
- package/dist/store/reducers/storage.js +8 -2
- package/dist/store/reducers/tablets.js +0 -3
- package/dist/utils/constants.js +0 -6
- package/dist/utils/getNodesColumns.js +2 -9
- package/dist/utils/utils.js +10 -1
- package/package.json +39 -29
- package/dist/containers/Node/Node.js +0 -184
@@ -1,184 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
import {connect} from 'react-redux';
|
5
|
-
import _ from 'lodash';
|
6
|
-
|
7
|
-
import {Loader, Tabs} from '@yandex-cloud/uikit';
|
8
|
-
import {withRouter, Link} from 'react-router-dom';
|
9
|
-
|
10
|
-
import FullNodeViewer from '../../components/FullNodeViewer/FullNodeViewer';
|
11
|
-
import {TABLETS, STORAGE, NODE_PAGES} from './NodePages';
|
12
|
-
import Tablets from '../Tablets/Tablets';
|
13
|
-
import Storage from '../Storage/Storage';
|
14
|
-
|
15
|
-
import {getNodeInfo} from '../../store/reducers/node';
|
16
|
-
import {NODE_AUTO_RELOAD_INTERVAL} from '../../utils/constants';
|
17
|
-
import routes, {createHref} from '../../routes';
|
18
|
-
import {backend} from '../../store';
|
19
|
-
|
20
|
-
import './Node.scss';
|
21
|
-
|
22
|
-
const b = cn('node');
|
23
|
-
|
24
|
-
export const STORAGE_ROLE = 'Storage';
|
25
|
-
|
26
|
-
class Node extends React.Component {
|
27
|
-
static renderLoader() {
|
28
|
-
return (
|
29
|
-
<div className={'loader'}>
|
30
|
-
<Loader size="l" />
|
31
|
-
</div>
|
32
|
-
);
|
33
|
-
}
|
34
|
-
|
35
|
-
static propTypes = {
|
36
|
-
className: PropTypes.string,
|
37
|
-
getNodeInfo: PropTypes.func,
|
38
|
-
match: PropTypes.object,
|
39
|
-
loading: PropTypes.bool,
|
40
|
-
wasLoaded: PropTypes.bool,
|
41
|
-
error: PropTypes.bool,
|
42
|
-
node: PropTypes.object,
|
43
|
-
activeTab: PropTypes.string,
|
44
|
-
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
45
|
-
additionalNodesInfo: PropTypes.object,
|
46
|
-
};
|
47
|
-
|
48
|
-
static defaultProps = {
|
49
|
-
className: '',
|
50
|
-
};
|
51
|
-
|
52
|
-
state = {
|
53
|
-
activeTab: '',
|
54
|
-
};
|
55
|
-
|
56
|
-
componentDidMount() {
|
57
|
-
const {id} = this.props.match.params;
|
58
|
-
this.setState({activeTab: this.props.activeTab});
|
59
|
-
this.props.getNodeInfo(id);
|
60
|
-
this.reloadDescriptor = setInterval(
|
61
|
-
() => this.props.getNodeInfo(id),
|
62
|
-
NODE_AUTO_RELOAD_INTERVAL,
|
63
|
-
);
|
64
|
-
}
|
65
|
-
|
66
|
-
componentDidUpdate() {
|
67
|
-
const {node} = this.props;
|
68
|
-
let {activeTab} = this.props;
|
69
|
-
if (node) {
|
70
|
-
const hasStorage = _.find(node.Roles, (el) => el === STORAGE_ROLE);
|
71
|
-
if (!hasStorage) {
|
72
|
-
activeTab = TABLETS;
|
73
|
-
}
|
74
|
-
this.setState((prev) => {
|
75
|
-
if (prev.activeTab !== activeTab) {
|
76
|
-
return {activeTab};
|
77
|
-
}
|
78
|
-
});
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
|
-
componentWillUnmount() {
|
83
|
-
clearInterval(this.reloadDescriptor);
|
84
|
-
}
|
85
|
-
|
86
|
-
renderTabs() {
|
87
|
-
const {node} = this.props;
|
88
|
-
const {id} = this.props.match.params;
|
89
|
-
const hasStorage = _.find(node?.Roles, (el) => el === STORAGE_ROLE);
|
90
|
-
|
91
|
-
const filteredNodesPages = hasStorage
|
92
|
-
? NODE_PAGES
|
93
|
-
: NODE_PAGES.filter((el) => el.id !== STORAGE);
|
94
|
-
const pages = filteredNodesPages.map((page) => {
|
95
|
-
return {
|
96
|
-
...page,
|
97
|
-
path: createHref(routes.node, {id, activeTab: page.id}),
|
98
|
-
};
|
99
|
-
});
|
100
|
-
|
101
|
-
return (
|
102
|
-
<div className={b('tabs')}>
|
103
|
-
<Tabs
|
104
|
-
items={pages}
|
105
|
-
activeTab={this.state.activeTab}
|
106
|
-
wrapTo={({path, id}, node) => (
|
107
|
-
<Link to={path} key={id} className={b('tab')}>
|
108
|
-
{node}
|
109
|
-
</Link>
|
110
|
-
)}
|
111
|
-
allowNotSelected={true}
|
112
|
-
/>
|
113
|
-
</div>
|
114
|
-
);
|
115
|
-
}
|
116
|
-
renderTabContent() {
|
117
|
-
const {activeTab} = this.state;
|
118
|
-
const {id} = this.props.match.params;
|
119
|
-
|
120
|
-
switch (activeTab) {
|
121
|
-
case STORAGE: {
|
122
|
-
return (
|
123
|
-
<div className={b('storage')}>
|
124
|
-
<Storage nodeId={id} />
|
125
|
-
</div>
|
126
|
-
);
|
127
|
-
}
|
128
|
-
case TABLETS: {
|
129
|
-
return <Tablets nodeId={id} />;
|
130
|
-
}
|
131
|
-
default:
|
132
|
-
return false;
|
133
|
-
}
|
134
|
-
}
|
135
|
-
|
136
|
-
render() {
|
137
|
-
const {className, loading, wasLoaded, error, node, additionalNodesInfo} = this.props;
|
138
|
-
|
139
|
-
if (loading && !wasLoaded) {
|
140
|
-
return Node.renderLoader();
|
141
|
-
} else if (error) {
|
142
|
-
return <div>{error.statusText}</div>;
|
143
|
-
} else {
|
144
|
-
if (node) {
|
145
|
-
return (
|
146
|
-
<div className={`${b()} ${className}`}>
|
147
|
-
<FullNodeViewer
|
148
|
-
node={node}
|
149
|
-
backend={backend}
|
150
|
-
additionalNodesInfo={additionalNodesInfo}
|
151
|
-
/>
|
152
|
-
{this.renderTabs()}
|
153
|
-
|
154
|
-
<div className={b('content')}>{this.renderTabContent()}</div>
|
155
|
-
</div>
|
156
|
-
);
|
157
|
-
}
|
158
|
-
return <div className="error">no node data</div>;
|
159
|
-
}
|
160
|
-
}
|
161
|
-
}
|
162
|
-
|
163
|
-
const mapStateToProps = (state, ownProps) => {
|
164
|
-
const {wasLoaded, loading} = state.node;
|
165
|
-
const {activeTab} = ownProps.match.params;
|
166
|
-
let {data: node} = state.node;
|
167
|
-
|
168
|
-
if (node) {
|
169
|
-
node = node.SystemStateInfo ? node.SystemStateInfo[0] : undefined;
|
170
|
-
}
|
171
|
-
|
172
|
-
return {
|
173
|
-
node,
|
174
|
-
activeTab,
|
175
|
-
wasLoaded,
|
176
|
-
loading,
|
177
|
-
};
|
178
|
-
};
|
179
|
-
|
180
|
-
const mapDispatchToProps = {
|
181
|
-
getNodeInfo,
|
182
|
-
};
|
183
|
-
|
184
|
-
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Node));
|