ydb-embedded-ui 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/containers/App/Content.js +2 -8
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +1 -1
- package/dist/containers/Cluster/Cluster.scss +4 -0
- package/dist/containers/Cluster/Cluster.tsx +14 -8
- package/dist/{components → containers}/ClusterInfo/ClusterInfo.scss +39 -0
- package/dist/containers/ClusterInfo/ClusterInfo.tsx +207 -0
- package/dist/containers/ClusterInfo/utils.ts +13 -0
- package/dist/containers/Header/Header.tsx +9 -16
- package/dist/containers/Nodes/Nodes.tsx +4 -6
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.tsx +2 -3
- package/dist/containers/Tenant/Diagnostics/Partitions/Headers/Headers.tsx +4 -4
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.scss +4 -0
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.tsx +2 -2
- package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.tsx +20 -26
- package/dist/containers/Tenant/Diagnostics/Partitions/i18n/en.json +1 -1
- package/dist/containers/Tenant/Diagnostics/Partitions/i18n/ru.json +1 -1
- package/dist/containers/UserSettings/Setting.tsx +82 -0
- package/dist/containers/UserSettings/UserSettings.tsx +61 -102
- package/dist/containers/UserSettings/i18n/en.json +20 -0
- package/dist/containers/UserSettings/i18n/index.ts +11 -0
- package/dist/containers/UserSettings/i18n/ru.json +20 -0
- package/dist/containers/Versions/GroupedNodesTree/GroupedNodesTree.scss +59 -0
- package/dist/containers/Versions/GroupedNodesTree/GroupedNodesTree.tsx +98 -0
- package/dist/containers/Versions/NodesTable/NodesTable.tsx +150 -0
- package/dist/containers/Versions/NodesTreeTitle/NodesTreeTitle.scss +55 -0
- package/dist/containers/Versions/NodesTreeTitle/NodesTreeTitle.tsx +62 -0
- package/dist/containers/Versions/Versions.scss +32 -0
- package/dist/containers/Versions/Versions.tsx +121 -0
- package/dist/containers/Versions/groupNodes.ts +124 -0
- package/dist/containers/Versions/types.ts +16 -0
- package/dist/routes.ts +0 -6
- package/dist/services/api.ts +3 -0
- package/dist/store/reducers/cluster/cluster.ts +4 -0
- package/dist/store/reducers/cluster/types.ts +3 -2
- package/dist/store/reducers/clusterNodes/clusterNodes.tsx +64 -0
- package/dist/store/reducers/clusterNodes/types.ts +22 -0
- package/dist/store/reducers/index.ts +2 -8
- package/dist/store/reducers/partitions/partitions.ts +2 -2
- package/dist/store/reducers/partitions/types.ts +1 -1
- package/dist/types/additionalProps.ts +5 -0
- package/dist/types/versions.ts +9 -0
- package/dist/utils/constants.ts +0 -11
- package/dist/utils/hooks/useSetting.ts +5 -3
- package/dist/utils/versions/getVersionsColors.ts +98 -0
- package/dist/utils/versions/index.ts +3 -0
- package/dist/utils/versions/parseNodesToVersionsValues.ts +28 -0
- package/dist/utils/versions/parseVersion.ts +23 -0
- package/package.json +1 -1
- package/dist/components/ClusterInfo/ClusterInfo.tsx +0 -239
- package/dist/components/FullGroupViewer/FullGroupViewer.js +0 -147
- package/dist/components/FullGroupViewer/FullGroupViewer.scss +0 -35
- package/dist/components/GroupTreeViewer/GroupTreeViewer.js +0 -87
- package/dist/components/GroupTreeViewer/GroupTreeViewer.scss +0 -16
- package/dist/components/GroupViewer/GroupViewer.js +0 -100
- package/dist/components/GroupViewer/GroupViewer.scss +0 -45
- package/dist/components/PDiskViewer/PDiskViewer.js +0 -79
- package/dist/components/PDiskViewer/PDiskViewer.scss +0 -46
- package/dist/components/TabletsViewer/TabletsViewer.js +0 -44
- package/dist/components/TabletsViewer/TabletsViewer.scss +0 -40
- package/dist/components/VerticalBars/VerticalBars.scss +0 -15
- package/dist/components/VerticalBars/VerticalBars.tsx +0 -38
- package/dist/components/VerticalBars/index.ts +0 -1
- package/dist/containers/Group/Group.js +0 -97
- package/dist/containers/Group/Group.scss +0 -6
- package/dist/containers/Header/Host/Host.js +0 -66
- package/dist/containers/Header/Host/Host.scss +0 -50
- package/dist/containers/Pdisk/Pdisk.js +0 -156
- package/dist/containers/Pdisk/Pdisk.scss +0 -42
- package/dist/containers/Pool/Pool.js +0 -170
- package/dist/containers/Pool/Pool.scss +0 -35
- package/dist/containers/Vdisk/Vdisk.js +0 -158
- package/dist/containers/Vdisk/Vdisk.scss +0 -42
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +0 -526
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.scss +0 -60
- package/dist/store/reducers/group.js +0 -49
- package/dist/store/reducers/pdisk.js +0 -51
- package/dist/store/reducers/pool.js +0 -42
- package/dist/store/reducers/vdisk.js +0 -49
@@ -1,147 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import cn from 'bem-cn-lite';
|
3
|
-
import PropTypes from 'prop-types';
|
4
|
-
|
5
|
-
import DataTable from '@gravity-ui/react-data-table';
|
6
|
-
|
7
|
-
import InfoViewer from '../InfoViewer/InfoViewer';
|
8
|
-
import EntityStatus from '../EntityStatus/EntityStatus';
|
9
|
-
import ProgressViewer from '../ProgressViewer/ProgressViewer';
|
10
|
-
import Breadcrumbs from '../Breadcrumbs/Breadcrumbs';
|
11
|
-
|
12
|
-
import {stringifyVdiskId, formatStorageValues} from '../../utils';
|
13
|
-
import {DEFAULT_TABLE_SETTINGS, PDISK_CATEGORIES} from '../../utils/constants';
|
14
|
-
import routes, {createHref} from '../../routes';
|
15
|
-
|
16
|
-
import './FullGroupViewer.scss';
|
17
|
-
|
18
|
-
const b = cn('full-group-viewer');
|
19
|
-
|
20
|
-
const tableSettings = {
|
21
|
-
...DEFAULT_TABLE_SETTINGS,
|
22
|
-
stickyHead: DataTable.FIXED,
|
23
|
-
};
|
24
|
-
|
25
|
-
class FullGroupViewer extends React.Component {
|
26
|
-
static propTypes = {
|
27
|
-
className: PropTypes.string,
|
28
|
-
group: PropTypes.object.isRequired,
|
29
|
-
};
|
30
|
-
|
31
|
-
static defaultProps = {
|
32
|
-
className: '',
|
33
|
-
};
|
34
|
-
|
35
|
-
renderContent = () => {
|
36
|
-
const {group} = this.props;
|
37
|
-
const data = group.VDisks;
|
38
|
-
const columns = [
|
39
|
-
{
|
40
|
-
name: 'VDiskId',
|
41
|
-
header: 'VDisk',
|
42
|
-
render: ({value, row}) => (
|
43
|
-
<EntityStatus
|
44
|
-
status={row.Overall}
|
45
|
-
name={stringifyVdiskId(value)}
|
46
|
-
path={createHref(routes.vdisk, null, {
|
47
|
-
vdiskId: stringifyVdiskId(value),
|
48
|
-
})}
|
49
|
-
/>
|
50
|
-
),
|
51
|
-
},
|
52
|
-
{
|
53
|
-
name: 'pdisk',
|
54
|
-
header: 'PDisk',
|
55
|
-
// eslint-disable-next-line no-confusing-arrow
|
56
|
-
render: ({row}) =>
|
57
|
-
row.PDisk ? (
|
58
|
-
<EntityStatus
|
59
|
-
path={createHref(
|
60
|
-
routes.pdisk,
|
61
|
-
{id: row.PDisk.PDiskId},
|
62
|
-
{node_id: row.PDisk.NodeId},
|
63
|
-
)}
|
64
|
-
status={row.PDisk.Overall}
|
65
|
-
name={`${row.NodeId}-${row.PDisk.PDiskId}`}
|
66
|
-
/>
|
67
|
-
) : (
|
68
|
-
<div className="error">—</div>
|
69
|
-
),
|
70
|
-
},
|
71
|
-
{
|
72
|
-
name: 'space',
|
73
|
-
header: 'Space',
|
74
|
-
width: '150px',
|
75
|
-
// eslint-disable-next-line no-confusing-arrow
|
76
|
-
render: ({row}) =>
|
77
|
-
row.PDisk ? (
|
78
|
-
<ProgressViewer
|
79
|
-
capacity={row.PDisk.TotalSize}
|
80
|
-
value={row.PDisk.TotalSize - row.PDisk.AvailableSize}
|
81
|
-
formatValues={formatStorageValues}
|
82
|
-
/>
|
83
|
-
) : (
|
84
|
-
<div className="error">—</div>
|
85
|
-
),
|
86
|
-
},
|
87
|
-
{
|
88
|
-
name: 'category',
|
89
|
-
header: 'Category',
|
90
|
-
// eslint-disable-next-line no-confusing-arrow
|
91
|
-
render: ({row}) =>
|
92
|
-
row.PDisk ? (
|
93
|
-
PDISK_CATEGORIES[row.PDisk.Category]
|
94
|
-
) : (
|
95
|
-
<div className="error">—</div>
|
96
|
-
),
|
97
|
-
align: DataTable.RIGHT,
|
98
|
-
},
|
99
|
-
{
|
100
|
-
name: 'path',
|
101
|
-
header: 'Path',
|
102
|
-
// eslint-disable-next-line no-confusing-arrow
|
103
|
-
render: ({row}) => (row.PDisk ? row.PDisk.Path : <div className="error">—</div>),
|
104
|
-
},
|
105
|
-
{
|
106
|
-
name: 'guid',
|
107
|
-
header: 'Guid',
|
108
|
-
// eslint-disable-next-line no-confusing-arrow
|
109
|
-
render: ({row}) => (row.PDisk ? row.PDisk.Guid : <div className="error">—</div>),
|
110
|
-
align: DataTable.RIGHT,
|
111
|
-
},
|
112
|
-
];
|
113
|
-
|
114
|
-
const groupInfo = [
|
115
|
-
{label: 'Generation', value: group.GroupGeneration},
|
116
|
-
{label: 'Latency', value: <EntityStatus status={group.Latency} />},
|
117
|
-
{label: 'Erasure', value: group.ErasureSpecies},
|
118
|
-
];
|
119
|
-
|
120
|
-
const breadcrumbsItems = [{text: 'Database'}, {text: 'Storage Pool'}, {text: 'BS Group'}];
|
121
|
-
|
122
|
-
return (
|
123
|
-
<React.Fragment>
|
124
|
-
<Breadcrumbs items={breadcrumbsItems} />
|
125
|
-
<InfoViewer className={b('section')} info={groupInfo} title={'Info'} />
|
126
|
-
<DataTable
|
127
|
-
cls={b('disks')}
|
128
|
-
columns={columns}
|
129
|
-
data={data}
|
130
|
-
settings={tableSettings}
|
131
|
-
/>
|
132
|
-
</React.Fragment>
|
133
|
-
);
|
134
|
-
};
|
135
|
-
|
136
|
-
render() {
|
137
|
-
const {className, group} = this.props;
|
138
|
-
|
139
|
-
return (
|
140
|
-
<div className={`${b()} ${className}`}>
|
141
|
-
{group ? this.renderContent() : <div className="error">no group data</div>}
|
142
|
-
</div>
|
143
|
-
);
|
144
|
-
}
|
145
|
-
}
|
146
|
-
|
147
|
-
export default FullGroupViewer;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
@import '../../styles/mixins';
|
2
|
-
|
3
|
-
.full-group-viewer {
|
4
|
-
overflow: auto;
|
5
|
-
@include container-fluid();
|
6
|
-
@include flex-container();
|
7
|
-
|
8
|
-
&__section {
|
9
|
-
display: inline-block;
|
10
|
-
|
11
|
-
min-width: 315px;
|
12
|
-
margin-right: 40px;
|
13
|
-
|
14
|
-
border-radius: 5px;
|
15
|
-
|
16
|
-
.info-viewer__label {
|
17
|
-
min-width: 75px;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
.info-viewer__items {
|
22
|
-
grid-template-columns: max-content;
|
23
|
-
}
|
24
|
-
|
25
|
-
.data-table {
|
26
|
-
overflow: auto;
|
27
|
-
|
28
|
-
margin-top: 50px;
|
29
|
-
@include flex-container();
|
30
|
-
}
|
31
|
-
|
32
|
-
.data-table__table {
|
33
|
-
width: 100%;
|
34
|
-
}
|
35
|
-
}
|
@@ -1,87 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
import {withRouter} from 'react-router';
|
5
|
-
|
6
|
-
import {TreeView} from 'ydb-ui-components';
|
7
|
-
|
8
|
-
import GroupViewer from '../GroupViewer/GroupViewer';
|
9
|
-
import PDiskViewer from '../PDiskViewer/PDiskViewer';
|
10
|
-
import EntityStatus from '../EntityStatus/EntityStatus';
|
11
|
-
import {stringifyVdiskId} from '../../utils';
|
12
|
-
import routes, {createHref} from '../../routes';
|
13
|
-
import {backend} from '../../store';
|
14
|
-
|
15
|
-
import './GroupTreeViewer.scss';
|
16
|
-
|
17
|
-
const b = cn('group-tree-viewer');
|
18
|
-
|
19
|
-
class GroupTreeViewer extends React.Component {
|
20
|
-
static propTypes = {
|
21
|
-
group: PropTypes.object.isRequired,
|
22
|
-
collapsed: PropTypes.bool,
|
23
|
-
onClick: PropTypes.func,
|
24
|
-
};
|
25
|
-
|
26
|
-
static ITEM_HEIGHT_COLLAPSED = 38;
|
27
|
-
static GROUP_ITEM_HEIGHT = 34;
|
28
|
-
|
29
|
-
static makeGetHeight = (groups, extendedGroups) => (index) => {
|
30
|
-
const {VDisks} = groups[index];
|
31
|
-
const countVDisks = VDisks?.length;
|
32
|
-
const parentHeight = GroupTreeViewer.ITEM_HEIGHT_COLLAPSED;
|
33
|
-
const childHeight = GroupTreeViewer.GROUP_ITEM_HEIGHT;
|
34
|
-
|
35
|
-
if (extendedGroups.has(index)) {
|
36
|
-
return parentHeight + countVDisks * childHeight;
|
37
|
-
}
|
38
|
-
|
39
|
-
return parentHeight;
|
40
|
-
};
|
41
|
-
|
42
|
-
render() {
|
43
|
-
const {group, collapsed, onClick} = this.props;
|
44
|
-
const label2 = (
|
45
|
-
<div>
|
46
|
-
<GroupViewer key={group.GroupID} group={group} />
|
47
|
-
</div>
|
48
|
-
);
|
49
|
-
if (group && Object.keys(group).length) {
|
50
|
-
return (
|
51
|
-
<div className={b()}>
|
52
|
-
<TreeView
|
53
|
-
key={group.GroupID}
|
54
|
-
name={label2}
|
55
|
-
collapsed={collapsed}
|
56
|
-
onClick={onClick}
|
57
|
-
>
|
58
|
-
{group.VDisks?.map((disk, diskIndex) => (
|
59
|
-
<div key={diskIndex} className={b('row')}>
|
60
|
-
<EntityStatus
|
61
|
-
className={b('disk')}
|
62
|
-
status={disk.Overall}
|
63
|
-
name={stringifyVdiskId(disk.VDiskId)}
|
64
|
-
label="VDiskID"
|
65
|
-
path={createHref(routes.vdisk, null, {
|
66
|
-
vdiskId: stringifyVdiskId(disk.VDiskId),
|
67
|
-
})}
|
68
|
-
/>
|
69
|
-
|
70
|
-
<PDiskViewer
|
71
|
-
className={b('disk')}
|
72
|
-
disk={disk.PDisk}
|
73
|
-
key={disk.Guid}
|
74
|
-
backend={backend}
|
75
|
-
/>
|
76
|
-
</div>
|
77
|
-
))}
|
78
|
-
</TreeView>
|
79
|
-
</div>
|
80
|
-
);
|
81
|
-
} else {
|
82
|
-
return <div className={b()}>No data</div>;
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
|
87
|
-
export default withRouter(GroupTreeViewer);
|
@@ -1,100 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
|
5
|
-
import EntityStatus from '../EntityStatus/EntityStatus';
|
6
|
-
import ProgressViewer from '../ProgressViewer/ProgressViewer';
|
7
|
-
|
8
|
-
import routes, {createHref} from '../../routes';
|
9
|
-
import {formatStorageValues, formatThroughput, formatIOPS} from '../../utils';
|
10
|
-
|
11
|
-
import './GroupViewer.scss';
|
12
|
-
|
13
|
-
const b = cn('group-viewer');
|
14
|
-
|
15
|
-
class GroupViewer extends React.Component {
|
16
|
-
static propTypes = {
|
17
|
-
group: PropTypes.object.isRequired,
|
18
|
-
className: PropTypes.string,
|
19
|
-
};
|
20
|
-
|
21
|
-
static defaultProps = {
|
22
|
-
className: '',
|
23
|
-
};
|
24
|
-
|
25
|
-
render() {
|
26
|
-
const {group, className} = this.props;
|
27
|
-
const {
|
28
|
-
GroupID = 'no id',
|
29
|
-
Overall = 'gray',
|
30
|
-
VDisks,
|
31
|
-
ErasureSpecies,
|
32
|
-
Latency = 'gray',
|
33
|
-
AcquiredIOPS,
|
34
|
-
AcquiredSize,
|
35
|
-
AcquiredThroughput,
|
36
|
-
MaximumIOPS,
|
37
|
-
MaximumSize,
|
38
|
-
MaximumThroughput,
|
39
|
-
} = group;
|
40
|
-
if (group && Object.keys(group).length) {
|
41
|
-
return (
|
42
|
-
<div className={`${b()} ${className}`}>
|
43
|
-
<div className={b('group')}>
|
44
|
-
<EntityStatus
|
45
|
-
name={GroupID}
|
46
|
-
status={Overall}
|
47
|
-
path={createHref(routes.group, {id: GroupID})}
|
48
|
-
className={b('name')}
|
49
|
-
/>
|
50
|
-
</div>
|
51
|
-
|
52
|
-
<div className={b('latency')}>
|
53
|
-
<EntityStatus name="Latency" status={Latency} />
|
54
|
-
</div>
|
55
|
-
|
56
|
-
<div className={b('label')}>{(VDisks && VDisks.length) || 0} Vdisks</div>
|
57
|
-
<div className={b('label')}>{ErasureSpecies || 'no ErasureSpecies info'}</div>
|
58
|
-
<div className={b('vdisks')}>
|
59
|
-
{VDisks?.map((disk) => (
|
60
|
-
<div key={disk.Guid} className={b('disk-overall')}>
|
61
|
-
<EntityStatus status={disk.Overall} />
|
62
|
-
</div>
|
63
|
-
))}
|
64
|
-
</div>
|
65
|
-
|
66
|
-
<div className={b('progress')}>
|
67
|
-
<ProgressViewer
|
68
|
-
value={AcquiredSize}
|
69
|
-
capacity={MaximumSize}
|
70
|
-
colorizeProgress={true}
|
71
|
-
formatValues={formatStorageValues}
|
72
|
-
/>
|
73
|
-
</div>
|
74
|
-
|
75
|
-
<div className={b('progress')}>
|
76
|
-
<ProgressViewer
|
77
|
-
value={AcquiredIOPS}
|
78
|
-
capacity={MaximumIOPS}
|
79
|
-
colorizeProgress={true}
|
80
|
-
formatValues={formatIOPS}
|
81
|
-
/>
|
82
|
-
</div>
|
83
|
-
|
84
|
-
<div className={b('progress')}>
|
85
|
-
<ProgressViewer
|
86
|
-
value={AcquiredThroughput}
|
87
|
-
capacity={MaximumThroughput}
|
88
|
-
colorizeProgress={true}
|
89
|
-
formatValues={formatThroughput}
|
90
|
-
/>
|
91
|
-
</div>
|
92
|
-
</div>
|
93
|
-
);
|
94
|
-
} else {
|
95
|
-
return <div className={b()}>No data</div>;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
export default GroupViewer;
|
@@ -1,45 +0,0 @@
|
|
1
|
-
.group-viewer {
|
2
|
-
display: flex;
|
3
|
-
align-items: center;
|
4
|
-
&__group {
|
5
|
-
margin-right: 20px;
|
6
|
-
}
|
7
|
-
|
8
|
-
&__label {
|
9
|
-
margin-right: 20px;
|
10
|
-
|
11
|
-
font-size: var(--yc-text-body-1-font-size);
|
12
|
-
|
13
|
-
color: var(--yc-color-text-complementary);
|
14
|
-
}
|
15
|
-
|
16
|
-
&__name {
|
17
|
-
display: inline-block;
|
18
|
-
|
19
|
-
text-decoration: none;
|
20
|
-
|
21
|
-
color: var(--yc-color-base-special);
|
22
|
-
|
23
|
-
&:before {
|
24
|
-
transform: translateY(3px);
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
&__latency {
|
29
|
-
margin-right: 20px;
|
30
|
-
}
|
31
|
-
|
32
|
-
&__vdisks {
|
33
|
-
display: flex;
|
34
|
-
}
|
35
|
-
|
36
|
-
&__disk-overall {
|
37
|
-
.entity-status:before {
|
38
|
-
margin-right: 5px;
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
&__progress {
|
43
|
-
margin-right: 10px;
|
44
|
-
}
|
45
|
-
}
|
@@ -1,79 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
|
5
|
-
import ProgressViewer from '../ProgressViewer/ProgressViewer';
|
6
|
-
import EntityStatus from '../EntityStatus/EntityStatus';
|
7
|
-
|
8
|
-
import {formatStorageValues} from '../../utils';
|
9
|
-
import routes, {createHref} from '../../routes';
|
10
|
-
|
11
|
-
import {getDefaultNodePath} from '../../containers/Node/NodePages';
|
12
|
-
|
13
|
-
import './PDiskViewer.scss';
|
14
|
-
|
15
|
-
const b = cn('pdisk-viewer');
|
16
|
-
|
17
|
-
class PDiskViewer extends React.Component {
|
18
|
-
static propTypes = {
|
19
|
-
disk: PropTypes.object.isRequired,
|
20
|
-
className: PropTypes.string,
|
21
|
-
};
|
22
|
-
|
23
|
-
static defaultProps = {
|
24
|
-
className: '',
|
25
|
-
};
|
26
|
-
|
27
|
-
render() {
|
28
|
-
const {disk, className} = this.props;
|
29
|
-
|
30
|
-
if (disk) {
|
31
|
-
return (
|
32
|
-
<div className={`${b()} ${className}`}>
|
33
|
-
{disk && (
|
34
|
-
<div className={b('item')}>
|
35
|
-
<EntityStatus
|
36
|
-
status={disk.Realtime}
|
37
|
-
path={createHref(
|
38
|
-
routes.pdisk,
|
39
|
-
{id: disk.PDiskId},
|
40
|
-
{node_id: disk.NodeId},
|
41
|
-
)}
|
42
|
-
label="PDiskID"
|
43
|
-
name={disk.PDiskId}
|
44
|
-
/>
|
45
|
-
</div>
|
46
|
-
)}
|
47
|
-
|
48
|
-
{disk && (
|
49
|
-
<div className={b('item')}>
|
50
|
-
<EntityStatus
|
51
|
-
status={'green'}
|
52
|
-
label="NodeID"
|
53
|
-
path={getDefaultNodePath(disk.NodeId)}
|
54
|
-
name={disk.NodeId}
|
55
|
-
/>
|
56
|
-
</div>
|
57
|
-
)}
|
58
|
-
|
59
|
-
{disk && (
|
60
|
-
<ProgressViewer
|
61
|
-
value={disk.TotalSize - disk.AvailableSize || 0}
|
62
|
-
capacity={disk.TotalSize || 0}
|
63
|
-
formatValues={formatStorageValues}
|
64
|
-
colorizeProgress={true}
|
65
|
-
className={b('size')}
|
66
|
-
/>
|
67
|
-
)}
|
68
|
-
<div className={b('item')}>
|
69
|
-
{disk && <div className={b('label')}>{disk.Path || 'no path'}</div>}
|
70
|
-
</div>
|
71
|
-
</div>
|
72
|
-
);
|
73
|
-
} else {
|
74
|
-
return <div className="error">no PDisk data</div>;
|
75
|
-
}
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
export default PDiskViewer;
|
@@ -1,46 +0,0 @@
|
|
1
|
-
.pdisk-viewer {
|
2
|
-
display: flex;
|
3
|
-
align-items: center;
|
4
|
-
|
5
|
-
&__item,
|
6
|
-
&__size {
|
7
|
-
margin-right: 24px;
|
8
|
-
|
9
|
-
font-size: var(--yc-text-body-2-font-size);
|
10
|
-
line-height: 0;
|
11
|
-
|
12
|
-
color: var(--yc-color-text-complementary);
|
13
|
-
}
|
14
|
-
|
15
|
-
&__item .entity-status {
|
16
|
-
min-width: 100px;
|
17
|
-
}
|
18
|
-
|
19
|
-
&__item .entity-status a {
|
20
|
-
overflow: initial;
|
21
|
-
}
|
22
|
-
|
23
|
-
&__row {
|
24
|
-
display: flex;
|
25
|
-
align-items: center;
|
26
|
-
}
|
27
|
-
|
28
|
-
&__size {
|
29
|
-
width: 120px;
|
30
|
-
|
31
|
-
font-size: 10px;
|
32
|
-
|
33
|
-
color: var(--yc-color-text-complementary);
|
34
|
-
}
|
35
|
-
|
36
|
-
&__label {
|
37
|
-
margin: 0 5px;
|
38
|
-
&_link {
|
39
|
-
display: inline-block;
|
40
|
-
|
41
|
-
text-decoration: none;
|
42
|
-
|
43
|
-
color: var(--yc-color-base-special);
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import cn from 'bem-cn-lite';
|
3
|
-
import PropTypes from 'prop-types';
|
4
|
-
import {formatNumber} from '../../utils';
|
5
|
-
import './TabletsViewer.scss';
|
6
|
-
|
7
|
-
import {TABLET_STATES} from '../../utils/constants';
|
8
|
-
|
9
|
-
const b = cn('tablets-viewer');
|
10
|
-
|
11
|
-
const prepareStates = (states) => {
|
12
|
-
return states.map((state) => {
|
13
|
-
return {
|
14
|
-
label: TABLET_STATES[state.VolatileState],
|
15
|
-
count: formatNumber(state.Count),
|
16
|
-
};
|
17
|
-
});
|
18
|
-
};
|
19
|
-
|
20
|
-
class TabletsViewer extends React.Component {
|
21
|
-
static propTypes = {
|
22
|
-
tablets: PropTypes.array,
|
23
|
-
};
|
24
|
-
renderTabletInfo = (item, index) => {
|
25
|
-
return (
|
26
|
-
<div key={index} className={b('row')}>
|
27
|
-
<div className={b('tablet-label')}>{item.label}</div>
|
28
|
-
<span>{item.count}</span>
|
29
|
-
</div>
|
30
|
-
);
|
31
|
-
};
|
32
|
-
render() {
|
33
|
-
const {tablets = []} = this.props;
|
34
|
-
const preparedStates = prepareStates(tablets);
|
35
|
-
|
36
|
-
return (
|
37
|
-
<div className={b()}>
|
38
|
-
<div className={b('grid')}>{preparedStates.map(this.renderTabletInfo)}</div>
|
39
|
-
</div>
|
40
|
-
);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
export default TabletsViewer;
|
@@ -1,40 +0,0 @@
|
|
1
|
-
.tablets-viewer {
|
2
|
-
&__grid {
|
3
|
-
display: grid;
|
4
|
-
grid-gap: 8px;
|
5
|
-
|
6
|
-
grid-template-columns: repeat(auto-fill, 125px);
|
7
|
-
}
|
8
|
-
|
9
|
-
&__row {
|
10
|
-
display: flex;
|
11
|
-
align-items: center;
|
12
|
-
|
13
|
-
margin: 0;
|
14
|
-
}
|
15
|
-
|
16
|
-
&__tablet-label {
|
17
|
-
min-width: 60px;
|
18
|
-
margin-right: 20px;
|
19
|
-
|
20
|
-
font-size: var(--yc-text-body-1-font-size);
|
21
|
-
line-height: 18px;
|
22
|
-
white-space: nowrap;
|
23
|
-
text-transform: capitalize;
|
24
|
-
|
25
|
-
color: var(--yc-color-text-hint);
|
26
|
-
|
27
|
-
.yc-root_theme_dark & {
|
28
|
-
color: var(--yc-color-text-hint);
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
&__title {
|
33
|
-
margin: 0;
|
34
|
-
margin-bottom: 16px;
|
35
|
-
|
36
|
-
font-size: var(--yc-text-body-2-font-size);
|
37
|
-
font-weight: bold;
|
38
|
-
line-height: 20px;
|
39
|
-
}
|
40
|
-
}
|