ydb-embedded-ui 4.3.0 → 4.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/containers/App/Content.js +2 -8
  3. package/dist/containers/AsideNavigation/AsideNavigation.tsx +1 -1
  4. package/dist/containers/Cluster/Cluster.scss +4 -0
  5. package/dist/containers/Cluster/Cluster.tsx +14 -8
  6. package/dist/{components → containers}/ClusterInfo/ClusterInfo.scss +39 -0
  7. package/dist/containers/ClusterInfo/ClusterInfo.tsx +207 -0
  8. package/dist/containers/ClusterInfo/utils.ts +13 -0
  9. package/dist/containers/Header/Header.tsx +9 -16
  10. package/dist/containers/Nodes/Nodes.tsx +4 -6
  11. package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.tsx +2 -3
  12. package/dist/containers/Tenant/Diagnostics/Partitions/Headers/Headers.tsx +4 -4
  13. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.scss +4 -0
  14. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.tsx +2 -2
  15. package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.tsx +20 -26
  16. package/dist/containers/Tenant/Diagnostics/Partitions/i18n/en.json +1 -1
  17. package/dist/containers/Tenant/Diagnostics/Partitions/i18n/ru.json +1 -1
  18. package/dist/containers/UserSettings/Setting.tsx +82 -0
  19. package/dist/containers/UserSettings/UserSettings.tsx +61 -102
  20. package/dist/containers/UserSettings/i18n/en.json +20 -0
  21. package/dist/containers/UserSettings/i18n/index.ts +11 -0
  22. package/dist/containers/UserSettings/i18n/ru.json +20 -0
  23. package/dist/containers/Versions/GroupedNodesTree/GroupedNodesTree.scss +59 -0
  24. package/dist/containers/Versions/GroupedNodesTree/GroupedNodesTree.tsx +98 -0
  25. package/dist/containers/Versions/NodesTable/NodesTable.tsx +150 -0
  26. package/dist/containers/Versions/NodesTreeTitle/NodesTreeTitle.scss +55 -0
  27. package/dist/containers/Versions/NodesTreeTitle/NodesTreeTitle.tsx +62 -0
  28. package/dist/containers/Versions/Versions.scss +32 -0
  29. package/dist/containers/Versions/Versions.tsx +121 -0
  30. package/dist/containers/Versions/groupNodes.ts +124 -0
  31. package/dist/containers/Versions/types.ts +16 -0
  32. package/dist/routes.ts +0 -6
  33. package/dist/services/api.ts +3 -0
  34. package/dist/store/reducers/cluster/cluster.ts +4 -0
  35. package/dist/store/reducers/cluster/types.ts +3 -2
  36. package/dist/store/reducers/clusterNodes/clusterNodes.tsx +64 -0
  37. package/dist/store/reducers/clusterNodes/types.ts +22 -0
  38. package/dist/store/reducers/index.ts +2 -8
  39. package/dist/store/reducers/partitions/partitions.ts +2 -2
  40. package/dist/store/reducers/partitions/types.ts +1 -1
  41. package/dist/types/additionalProps.ts +5 -0
  42. package/dist/types/versions.ts +9 -0
  43. package/dist/utils/constants.ts +0 -11
  44. package/dist/utils/hooks/useSetting.ts +5 -3
  45. package/dist/utils/versions/getVersionsColors.ts +98 -0
  46. package/dist/utils/versions/index.ts +3 -0
  47. package/dist/utils/versions/parseNodesToVersionsValues.ts +28 -0
  48. package/dist/utils/versions/parseVersion.ts +23 -0
  49. package/package.json +1 -1
  50. package/dist/components/ClusterInfo/ClusterInfo.tsx +0 -239
  51. package/dist/components/FullGroupViewer/FullGroupViewer.js +0 -147
  52. package/dist/components/FullGroupViewer/FullGroupViewer.scss +0 -35
  53. package/dist/components/GroupTreeViewer/GroupTreeViewer.js +0 -87
  54. package/dist/components/GroupTreeViewer/GroupTreeViewer.scss +0 -16
  55. package/dist/components/GroupViewer/GroupViewer.js +0 -100
  56. package/dist/components/GroupViewer/GroupViewer.scss +0 -45
  57. package/dist/components/PDiskViewer/PDiskViewer.js +0 -79
  58. package/dist/components/PDiskViewer/PDiskViewer.scss +0 -46
  59. package/dist/components/TabletsViewer/TabletsViewer.js +0 -44
  60. package/dist/components/TabletsViewer/TabletsViewer.scss +0 -40
  61. package/dist/components/VerticalBars/VerticalBars.scss +0 -15
  62. package/dist/components/VerticalBars/VerticalBars.tsx +0 -38
  63. package/dist/components/VerticalBars/index.ts +0 -1
  64. package/dist/containers/Group/Group.js +0 -97
  65. package/dist/containers/Group/Group.scss +0 -6
  66. package/dist/containers/Header/Host/Host.js +0 -66
  67. package/dist/containers/Header/Host/Host.scss +0 -50
  68. package/dist/containers/Pdisk/Pdisk.js +0 -156
  69. package/dist/containers/Pdisk/Pdisk.scss +0 -42
  70. package/dist/containers/Pool/Pool.js +0 -170
  71. package/dist/containers/Pool/Pool.scss +0 -35
  72. package/dist/containers/Vdisk/Vdisk.js +0 -158
  73. package/dist/containers/Vdisk/Vdisk.scss +0 -42
  74. package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +0 -526
  75. package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.scss +0 -60
  76. package/dist/store/reducers/group.js +0 -49
  77. package/dist/store/reducers/pdisk.js +0 -51
  78. package/dist/store/reducers/pool.js +0 -42
  79. package/dist/store/reducers/vdisk.js +0 -49
@@ -1,158 +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
-
6
- import {Link} from 'react-router-dom';
7
- import {Loader} from '@gravity-ui/uikit';
8
-
9
- import InfoViewer from '../../components/InfoViewer/InfoViewer';
10
- import EntityStatus from '../../components/EntityStatus/EntityStatus';
11
-
12
- import {getVdiskInfo, clearStore} from '../../store/reducers/vdisk';
13
- import {VDISK_AUTO_RELOAD_INTERVAL} from '../../utils/constants';
14
- import {formatBytes, calcUptime, stringifyVdiskId} from '../../utils';
15
- import routes, {createHref} from '../../routes';
16
- import {getDefaultNodePath} from '../Node/NodePages';
17
-
18
- import './Vdisk.scss';
19
-
20
- const b = cn('vdisk');
21
-
22
- class Vdisk extends React.Component {
23
- static renderLoader() {
24
- return (
25
- <div className={'loader'}>
26
- <Loader size="l" />
27
- </div>
28
- );
29
- }
30
-
31
- static propTypes = {
32
- className: PropTypes.string,
33
- loading: PropTypes.bool,
34
- wasLoaded: PropTypes.bool,
35
- error: PropTypes.bool,
36
- getVdiskInfo: PropTypes.func,
37
- clearStore: PropTypes.func,
38
- vdisk: PropTypes.object,
39
- location: PropTypes.object,
40
- };
41
-
42
- static defaultProps = {
43
- className: '',
44
- };
45
-
46
- componentDidMount() {
47
- const {id} = this.props.match.params;
48
-
49
- this.props.getVdiskInfo(id);
50
- this.reloadDescriptor = setInterval(
51
- () => this.props.getVdiskInfo(id),
52
- VDISK_AUTO_RELOAD_INTERVAL,
53
- );
54
- }
55
-
56
- componentWillUnmount() {
57
- this.props.clearStore();
58
- clearInterval(this.reloadDescriptor);
59
- }
60
-
61
- renderContent = () => {
62
- const {
63
- AllocatedSize,
64
- ChangeTime,
65
- DiskSpace,
66
- FrontQueues,
67
- Guid,
68
- NodeId,
69
- PDiskId,
70
- Replicated,
71
- VDiskState,
72
- VDiskId,
73
- } = this.props.vdisk;
74
-
75
- const vdiskInfo = [
76
- {label: 'Allocated Size', value: formatBytes(AllocatedSize)},
77
- {label: 'Change Time', value: calcUptime(ChangeTime)},
78
- {label: 'Disk Space', value: <EntityStatus status={DiskSpace} />},
79
- {label: 'Front Queues', value: <EntityStatus status={FrontQueues} />},
80
- {label: 'Guid', value: Guid},
81
- {
82
- label: 'NodeId',
83
- value: (
84
- <Link className={b('link')} to={getDefaultNodePath(NodeId)}>
85
- {NodeId}
86
- </Link>
87
- ),
88
- },
89
- {
90
- label: 'PDiskId',
91
- value: (
92
- <Link
93
- className={b('link')}
94
- to={createHref(routes.pdisk, {id: PDiskId}, {node_id: NodeId})}
95
- >
96
- {PDiskId}
97
- </Link>
98
- ),
99
- },
100
- {label: 'Replicated', value: Replicated ? '✓' : '☓'},
101
- {
102
- label: 'VDiskState',
103
- value: VDiskState,
104
- },
105
- ];
106
-
107
- return (
108
- <div className={b()}>
109
- <div className={b('row')}>
110
- <span className={b('title')}>VDisk </span>
111
- <EntityStatus
112
- status={VDiskState === 'OK' ? 'green' : 'red'}
113
- name={stringifyVdiskId(VDiskId)}
114
- />
115
- </div>
116
-
117
- <div className={b('column')}>
118
- <InfoViewer className={b('section')} info={vdiskInfo} />
119
- </div>
120
- </div>
121
- );
122
- };
123
-
124
- render() {
125
- const {loading, wasLoaded, error} = this.props;
126
-
127
- if (loading && !wasLoaded) {
128
- return Vdisk.renderLoader();
129
- } else if (error) {
130
- return <div>{error.statusText}</div>;
131
- } else {
132
- return this.renderContent();
133
- }
134
- }
135
- }
136
-
137
- const mapStateToProps = (state) => {
138
- const {data, wasLoaded, loading, error} = state.vdisk;
139
-
140
- let vdisk;
141
- if (data) {
142
- vdisk = data.VDiskStateInfo[0];
143
- }
144
-
145
- return {
146
- vdisk,
147
- wasLoaded,
148
- loading,
149
- error,
150
- };
151
- };
152
-
153
- const mapDispatchToProps = {
154
- getVdiskInfo,
155
- clearStore,
156
- };
157
-
158
- export default connect(mapStateToProps, mapDispatchToProps)(Vdisk);
@@ -1,42 +0,0 @@
1
- @import '../../styles/mixins.scss';
2
-
3
- .vdisk {
4
- padding: 20px;
5
- @include container-fluid();
6
-
7
- .info-viewer__items {
8
- grid-template-columns: max-content;
9
- }
10
-
11
- &__row {
12
- display: flex;
13
- }
14
-
15
- &__column {
16
- display: flex;
17
- flex-direction: column;
18
- }
19
-
20
- &__title {
21
- margin-right: 16px;
22
-
23
- font-size: var(--yc-text-body-2-font-size);
24
- font-weight: 500;
25
- line-height: var(--yc-text-body-2-line-height);
26
- text-transform: uppercase;
27
- }
28
-
29
- &__section {
30
- padding: 15px 0;
31
-
32
- .info-viewer__label {
33
- min-width: 205px;
34
- }
35
- }
36
-
37
- &__link {
38
- text-decoration: none;
39
-
40
- color: var(--yc-color-base-special);
41
- }
42
- }