ydb-embedded-ui 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +9 -0
- package/dist/components/BasicNodeViewer/BasicNodeViewer.tsx +2 -3
- package/dist/components/ClusterInfo/ClusterInfo.tsx +14 -36
- package/dist/components/CopyToClipboard/CopyToClipboard.tsx +1 -2
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +1 -1
- package/dist/components/EmptyState/{EmptyState.js → EmptyState.tsx} +12 -15
- package/dist/components/EmptyState/index.ts +1 -0
- package/dist/components/EnableFullscreenButton/EnableFullscreenButton.tsx +7 -2
- package/dist/components/Errors/403/AccessDenied.tsx +1 -1
- package/dist/components/Fullscreen/Fullscreen.tsx +1 -1
- package/dist/components/Icon/Icon.tsx +33 -0
- package/dist/components/Icon/index.ts +1 -0
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.tsx +1 -1
- package/dist/components/Tablet/Tablet.tsx +59 -0
- package/dist/components/Tablet/index.ts +1 -0
- package/dist/components/Tag/Tag.tsx +16 -0
- package/dist/components/Tag/index.ts +1 -0
- package/dist/components/Tags/Tags.tsx +22 -0
- package/dist/components/Tags/index.ts +1 -0
- package/dist/containers/Header/Header.tsx +2 -3
- package/dist/containers/Header/Host/Host.js +1 -1
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +1 -1
- package/dist/containers/Nodes/getNodesColumns.tsx +1 -1
- package/dist/containers/Storage/EmptyFilter/EmptyFilter.tsx +8 -9
- package/dist/containers/Tablet/Tablet.js +6 -6
- package/dist/containers/Tablets/Tablets.scss +0 -4
- package/dist/containers/Tablets/Tablets.tsx +1 -2
- package/dist/containers/TabletsFilters/TabletsFilters.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Consumers/TopicStats/ConsumersTopicStats.scss +1 -1
- package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +27 -1
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +1 -2
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.tsx +23 -13
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +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/QueryEditor.js +1 -1
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +1 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +1 -1
- package/dist/containers/Tenant/TenantPages.tsx +1 -2
- package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx +2 -2
- package/dist/services/api.d.ts +11 -0
- package/dist/services/api.js +3 -3
- package/dist/store/reducers/consumer.ts +14 -0
- package/dist/store/reducers/{host.js → host.ts} +9 -5
- package/dist/store/reducers/shardsWorkload.ts +4 -0
- package/dist/store/reducers/tablet.ts +111 -0
- package/dist/store/state-url-mapping.js +3 -0
- package/dist/types/api/cluster.ts +34 -0
- package/dist/types/api/systemState.ts +13 -0
- package/dist/types/api/tablet.ts +12 -4
- package/dist/types/store/consumer.ts +10 -2
- package/dist/types/store/host.ts +23 -0
- package/dist/types/store/tablet.ts +50 -0
- package/dist/types/store/tooltip.ts +3 -1
- package/package.json +7 -5
- package/dist/components/Icon/Icon.js +0 -28
- package/dist/components/Tablet/Tablet.js +0 -61
- package/dist/components/Tag/Tag.js +0 -14
- package/dist/components/Tags/Tags.js +0 -36
- package/dist/store/reducers/tablet.js +0 -94
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ydb-embedded-ui",
|
3
|
-
"version": "3.4.
|
3
|
+
"version": "3.4.1",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"react-redux": "7.2.6",
|
31
31
|
"react-router": "5.2.1",
|
32
32
|
"react-router-dom": "5.3.0",
|
33
|
-
"react-scripts": "
|
33
|
+
"react-scripts": "5.0.1",
|
34
34
|
"react-split": "2.0.14",
|
35
35
|
"react-transition-group": "4.4.2",
|
36
36
|
"redux": "4.0.1",
|
@@ -44,7 +44,7 @@
|
|
44
44
|
"scripts": {
|
45
45
|
"start": "react-app-rewired start",
|
46
46
|
"dev": "DISABLE_ESLINT_PLUGIN=true TSC_COMPILE_ON_ERROR=true REACT_APP_BACKEND=http://localhost:8765 npm start",
|
47
|
-
"build": "react-app-rewired build",
|
47
|
+
"build": "DISABLE_ESLINT_PLUGIN=true react-app-rewired build",
|
48
48
|
"//build:embedded": "echo 'PUBLIC_URL is a setting for create-react-app. Embedded version is built and hosted as is on ydb servers, with no way of knowing the final URL pattern. PUBLIC_URL=. keeps paths to all static relative, allowing servers to handle them as needed'",
|
49
49
|
"build:embedded": "rm -rf build && PUBLIC_URL=. REACT_APP_BACKEND=http://localhost:8765 npm run build",
|
50
50
|
"lint:styles": "stylelint 'src/**/*.scss'",
|
@@ -103,7 +103,7 @@
|
|
103
103
|
"@gravity-ui/prettier-config": "^1.0.1",
|
104
104
|
"@gravity-ui/stylelint-config": "^1.0.1",
|
105
105
|
"@gravity-ui/tsconfig": "^1.0.0",
|
106
|
-
"@gravity-ui/uikit": "^3.
|
106
|
+
"@gravity-ui/uikit": "^3.20.2",
|
107
107
|
"@testing-library/jest-dom": "^5.15.0",
|
108
108
|
"@testing-library/react": "^11.2.7",
|
109
109
|
"@testing-library/user-event": "^12.8.3",
|
@@ -123,12 +123,14 @@
|
|
123
123
|
"lint-staged": "^12.3.7",
|
124
124
|
"postcss": "^8.4.6",
|
125
125
|
"prettier": "^2.5.1",
|
126
|
+
"qs": "^6.11.0",
|
126
127
|
"react": "^17.0.2",
|
127
128
|
"react-app-rewired": "^2.1.11",
|
128
129
|
"react-dom": "^17.0.2",
|
129
130
|
"stylelint": "^14.3.0",
|
130
131
|
"ts-jest": "^28.0.7",
|
131
|
-
"typescript": "^4.5.5"
|
132
|
+
"typescript": "^4.5.5",
|
133
|
+
"url": "^0.11.0"
|
132
134
|
},
|
133
135
|
"peerDependencies": {
|
134
136
|
"@gravity-ui/uikit": "^3.0.1"
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import PropTypes from 'prop-types';
|
2
|
-
import {Icon as UiKitIcon} from '@gravity-ui/uikit';
|
3
|
-
|
4
|
-
export default function Icon({name, height, width, viewBox, className, onClick}) {
|
5
|
-
return (
|
6
|
-
<UiKitIcon
|
7
|
-
data={{id: `icon.${name}`, viewBox}}
|
8
|
-
height={height}
|
9
|
-
width={width}
|
10
|
-
className={className}
|
11
|
-
onClick={onClick}
|
12
|
-
/>
|
13
|
-
);
|
14
|
-
}
|
15
|
-
|
16
|
-
Icon.propTypes = {
|
17
|
-
name: PropTypes.string.isRequired,
|
18
|
-
height: PropTypes.number,
|
19
|
-
width: PropTypes.number,
|
20
|
-
viewBox: PropTypes.string,
|
21
|
-
className: PropTypes.string,
|
22
|
-
onClick: PropTypes.func,
|
23
|
-
};
|
24
|
-
Icon.defaultProps = {
|
25
|
-
height: 16,
|
26
|
-
width: 16,
|
27
|
-
viewBox: '0 0 16 16',
|
28
|
-
};
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
|
5
|
-
import {InternalLink} from '../InternalLink';
|
6
|
-
|
7
|
-
import {getTabletLabel} from '../../utils/constants';
|
8
|
-
import routes, {createHref} from '../../routes';
|
9
|
-
|
10
|
-
import './Tablet.scss';
|
11
|
-
|
12
|
-
const b = cn('tablet');
|
13
|
-
|
14
|
-
class Tablet extends React.PureComponent {
|
15
|
-
static propTypes = {
|
16
|
-
className: PropTypes.string,
|
17
|
-
tablet: PropTypes.object,
|
18
|
-
onMouseEnter: PropTypes.func,
|
19
|
-
onMouseLeave: PropTypes.func,
|
20
|
-
};
|
21
|
-
static defaultProps = {
|
22
|
-
onMouseEnter: () => {},
|
23
|
-
onMouseLeave: () => {},
|
24
|
-
};
|
25
|
-
ref = React.createRef();
|
26
|
-
_onTabletMouseEnter = () => {
|
27
|
-
const {tablet} = this.props;
|
28
|
-
this.props.onMouseEnter(this.ref.current, tablet, 'tablet');
|
29
|
-
};
|
30
|
-
_onTabletClick = () => {
|
31
|
-
const {tablet = {}} = this.props;
|
32
|
-
const {TabletId: id} = tablet;
|
33
|
-
|
34
|
-
if (id) {
|
35
|
-
this.props.onMouseLeave();
|
36
|
-
}
|
37
|
-
};
|
38
|
-
render() {
|
39
|
-
const {tablet = {}} = this.props;
|
40
|
-
const {TabletId: id} = tablet;
|
41
|
-
const status = tablet.Overall?.toLowerCase();
|
42
|
-
|
43
|
-
return (
|
44
|
-
<InternalLink
|
45
|
-
onClick={this._onTabletClick}
|
46
|
-
to={id && createHref(routes.tablet, {id})}
|
47
|
-
className={b('wrapper')}
|
48
|
-
>
|
49
|
-
<div
|
50
|
-
ref={this.ref}
|
51
|
-
className={b({status})}
|
52
|
-
onMouseEnter={this._onTabletMouseEnter}
|
53
|
-
onMouseLeave={this.props.onMouseLeave}
|
54
|
-
>
|
55
|
-
<div className={b('type')}>{[getTabletLabel(tablet.Type)]}</div>
|
56
|
-
</div>
|
57
|
-
</InternalLink>
|
58
|
-
);
|
59
|
-
}
|
60
|
-
}
|
61
|
-
export default Tablet;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import PropTypes from 'prop-types';
|
2
|
-
import cn from 'bem-cn-lite';
|
3
|
-
import './Tag.scss';
|
4
|
-
|
5
|
-
const b = cn('tag');
|
6
|
-
|
7
|
-
export const Tag = ({text, type}) => {
|
8
|
-
return <div className={b({type})}>{text}</div>;
|
9
|
-
};
|
10
|
-
|
11
|
-
Tag.propTypes = {
|
12
|
-
text: PropTypes.string,
|
13
|
-
type: PropTypes.string,
|
14
|
-
};
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
|
5
|
-
import {Tag} from '../Tag/Tag';
|
6
|
-
|
7
|
-
import './Tags.scss';
|
8
|
-
|
9
|
-
const b = cn('tags');
|
10
|
-
|
11
|
-
class Tags extends React.Component {
|
12
|
-
static propTypes = {
|
13
|
-
className: PropTypes.string,
|
14
|
-
tags: PropTypes.arrayOf(PropTypes.string).isRequired,
|
15
|
-
tagsType: PropTypes.string,
|
16
|
-
};
|
17
|
-
|
18
|
-
static defaultProps = {
|
19
|
-
className: '',
|
20
|
-
};
|
21
|
-
|
22
|
-
render() {
|
23
|
-
const {tags, className, tagsType} = this.props;
|
24
|
-
|
25
|
-
return (
|
26
|
-
<div className={`${b()} ${className}`}>
|
27
|
-
{tags &&
|
28
|
-
tags.map((tag, tagIndex) => (
|
29
|
-
<Tag text={tag} key={tagIndex} type={tagsType}></Tag>
|
30
|
-
))}
|
31
|
-
</div>
|
32
|
-
);
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
export default Tags;
|
@@ -1,94 +0,0 @@
|
|
1
|
-
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
-
import '../../services/api';
|
3
|
-
import _ from 'lodash';
|
4
|
-
|
5
|
-
const FETCH_TABLET = createRequestActionTypes('TABLET', 'FETCH_TABLET');
|
6
|
-
const FETCH_TABLET_DESCRIBE = createRequestActionTypes('TABLET', 'FETCH_TABLET_DESCRIBE');
|
7
|
-
|
8
|
-
const tablet = (state = {loading: false, tenantPath: '-'}, action) => {
|
9
|
-
switch (action.type) {
|
10
|
-
case FETCH_TABLET.REQUEST: {
|
11
|
-
return {
|
12
|
-
...state,
|
13
|
-
loading: true,
|
14
|
-
};
|
15
|
-
}
|
16
|
-
case FETCH_TABLET.SUCCESS: {
|
17
|
-
const {tablet, history} = action.data;
|
18
|
-
const {TabletId: id} = tablet;
|
19
|
-
return {
|
20
|
-
...state,
|
21
|
-
id,
|
22
|
-
data: tablet,
|
23
|
-
history,
|
24
|
-
loading: false,
|
25
|
-
error: undefined,
|
26
|
-
};
|
27
|
-
}
|
28
|
-
case FETCH_TABLET.FAILURE: {
|
29
|
-
return {
|
30
|
-
...state,
|
31
|
-
error: action.error,
|
32
|
-
loading: false,
|
33
|
-
};
|
34
|
-
}
|
35
|
-
case FETCH_TABLET_DESCRIBE.SUCCESS: {
|
36
|
-
const {tenantPath} = action.data;
|
37
|
-
|
38
|
-
return {
|
39
|
-
...state,
|
40
|
-
tenantPath,
|
41
|
-
error: undefined,
|
42
|
-
};
|
43
|
-
}
|
44
|
-
default:
|
45
|
-
return state;
|
46
|
-
}
|
47
|
-
};
|
48
|
-
|
49
|
-
export const getTablet = (id) => {
|
50
|
-
return createApiRequest({
|
51
|
-
request: Promise.all([window.api.getTablet({id}), window.api.getTabletHistory({id})]),
|
52
|
-
actions: FETCH_TABLET,
|
53
|
-
dataHandler: ([tabletData, history]) => {
|
54
|
-
const historyData = Object.keys(history).reduce((list, nodeId) => {
|
55
|
-
const tabletInfo = history[nodeId]?.TabletStateInfo;
|
56
|
-
if (tabletInfo && tabletInfo.length) {
|
57
|
-
const leaderTablet =
|
58
|
-
_.find(tabletInfo, (t) => t.Master || t.Leader) || tabletInfo[0];
|
59
|
-
const {ChangeTime, Generation, State, Master, SlaveId, Leader, FollowerId} =
|
60
|
-
leaderTablet;
|
61
|
-
list.push({
|
62
|
-
nodeId,
|
63
|
-
generation: Generation,
|
64
|
-
changeTime: ChangeTime,
|
65
|
-
state: State,
|
66
|
-
leader: Master || Leader,
|
67
|
-
followerId: SlaveId || FollowerId,
|
68
|
-
});
|
69
|
-
}
|
70
|
-
return list;
|
71
|
-
}, []);
|
72
|
-
|
73
|
-
const {TabletStateInfo = []} = tabletData;
|
74
|
-
const [tablet = {}] = TabletStateInfo;
|
75
|
-
|
76
|
-
return {tablet, history: historyData};
|
77
|
-
},
|
78
|
-
});
|
79
|
-
};
|
80
|
-
|
81
|
-
export const getTabletDescribe = (TenantId) => {
|
82
|
-
return createApiRequest({
|
83
|
-
request: window.api.getTabletDescribe(TenantId),
|
84
|
-
actions: FETCH_TABLET_DESCRIBE,
|
85
|
-
dataHandler: (tabletDescribe) => {
|
86
|
-
const {SchemeShard, PathId} = TenantId;
|
87
|
-
const tenantPath = tabletDescribe.Path || `${SchemeShard}:${PathId}`;
|
88
|
-
|
89
|
-
return {tenantPath};
|
90
|
-
},
|
91
|
-
});
|
92
|
-
};
|
93
|
-
|
94
|
-
export default tablet;
|