Skip to content

Commit 4824f0d

Browse files
feat(ClusterInfo): update versions bar, rework DC and Tablets fields (#407)
1 parent 9c799d8 commit 4824f0d

File tree

12 files changed

+351
-251
lines changed

12 files changed

+351
-251
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.ydb-external-link-with-icon {
2+
display: flex;
3+
flex-wrap: nowrap;
4+
align-items: center;
5+
6+
white-space: nowrap;
7+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import block from 'bem-cn-lite';
2+
3+
import {Link} from '@gravity-ui/uikit';
4+
5+
import {IconWrapper} from '../Icon/Icon';
6+
7+
import './ExternalLinkWithIcon.scss';
8+
9+
const b = block('ydb-external-link-with-icon');
10+
11+
interface ExternalLinkWithIconProps {
12+
title: string;
13+
url: string;
14+
}
15+
16+
export const ExternalLinkWithIcon = ({title, url}: ExternalLinkWithIconProps) => {
17+
return (
18+
<Link href={url} target="_blank" className={b()}>
19+
{title}
20+
{'\u00a0'}
21+
<IconWrapper name="external" viewBox={'0 0 16 16'} width={16} height={16} />
22+
</Link>
23+
);
24+
};

src/components/Tablet/Tablet.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.tablet {
22
display: flex;
33
justify-content: center;
4-
align-items: center;
54

65
width: 18px;
76
height: 18px;

src/containers/Cluster/Cluster.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {useRouteMatch} from 'react-router';
22
import cn from 'bem-cn-lite';
33

4-
import type {AdditionalVersionsProps} from '../../types/additionalProps';
4+
import type {AdditionalClusterProps, AdditionalVersionsProps} from '../../types/additionalProps';
55
import routes, {CLUSTER_PAGES} from '../../routes';
66

7-
import {ClusterInfo} from '../ClusterInfo/ClusterInfo';
7+
import {ClusterInfo} from './ClusterInfo/ClusterInfo';
88
import Tenants from '../Tenants/Tenants';
99
import {Nodes} from '../Nodes/Nodes';
1010
import Storage from '../Storage/Storage';
@@ -14,32 +14,36 @@ import './Cluster.scss';
1414
const b = cn('cluster');
1515

1616
interface ClusterProps {
17-
additionalClusterInfo?: any;
1817
additionalTenantsInfo?: any;
1918
additionalNodesInfo?: any;
19+
additionalClusterProps?: AdditionalClusterProps;
2020
additionalVersionsProps?: AdditionalVersionsProps;
2121
}
2222

23-
function Cluster(props: ClusterProps) {
23+
function Cluster({
24+
additionalTenantsInfo,
25+
additionalNodesInfo,
26+
additionalClusterProps,
27+
additionalVersionsProps,
28+
}: ClusterProps) {
2429
const match = useRouteMatch<{activeTab?: string}>(routes.cluster);
2530
const activeTab = match?.params?.activeTab ?? CLUSTER_PAGES.tenants.id;
2631
const renderRoutes = () => {
2732
switch (activeTab) {
2833
case CLUSTER_PAGES.tenants.id: {
29-
return <Tenants {...props} />;
34+
return <Tenants additionalTenantsInfo={additionalTenantsInfo} />;
3035
}
3136
case CLUSTER_PAGES.nodes.id: {
32-
return <Nodes additionalNodesInfo={props.additionalNodesInfo} />;
37+
return <Nodes additionalNodesInfo={additionalNodesInfo} />;
3338
}
3439
case CLUSTER_PAGES.storage.id: {
35-
//@ts-ignore
36-
return <Storage {...props} />;
40+
return <Storage additionalNodesInfo={additionalNodesInfo} />;
3741
}
3842
case CLUSTER_PAGES.cluster.id: {
3943
return (
4044
<ClusterInfo
41-
additionalClusterInfo={props.additionalClusterInfo}
42-
additionalVersionsProps={props.additionalVersionsProps}
45+
additionalClusterProps={additionalClusterProps}
46+
additionalVersionsProps={additionalVersionsProps}
4347
/>
4448
);
4549
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../styles/mixins';
1+
@import '../../../styles/mixins';
22

33
.cluster-info {
44
$_: &;
@@ -20,31 +20,14 @@
2020
background: var(--yc-color-base-background);
2121
}
2222

23-
&__loader {
24-
display: flex;
25-
justify-content: center;
26-
27-
margin-top: 16px;
28-
}
29-
30-
&__common {
23+
&__title {
3124
display: flex;
3225
align-items: center;
3326

3427
margin-top: 16px;
3528
margin-bottom: 20px;
3629
}
3730

38-
&__title {
39-
margin-bottom: 15px;
40-
41-
font-weight: 600;
42-
}
43-
44-
&__url {
45-
margin-right: 14px;
46-
}
47-
4831
&__metric-field {
4932
margin-top: -8px;
5033
}
@@ -54,8 +37,6 @@
5437
flex-wrap: wrap;
5538
align-items: center;
5639

57-
margin-left: 15px;
58-
5940
& .tablet {
6041
margin-bottom: 2px;
6142
}
@@ -81,31 +62,18 @@
8162
margin-left: 15px;
8263
padding: 0 !important;
8364
}
84-
&__clipboard-button {
85-
display: flex;
86-
align-items: center;
8765

88-
margin-left: 5px;
89-
}
90-
&__progress-label {
91-
margin: 0 10px 0 0;
66+
&__links {
67+
display: flex;
68+
flex-flow: row wrap;
9269

93-
font-weight: 200;
70+
gap: 12px;
9471
}
9572

96-
&__version-progress {
73+
&__clipboard-button {
9774
display: flex;
9875
align-items: center;
9976

100-
width: $progress_width;
101-
margin-top: 20px;
102-
103-
& .yc-progress {
104-
width: $progress_width;
105-
}
106-
}
107-
108-
& .yc-progress__stack {
109-
cursor: pointer;
77+
margin-left: 5px;
11078
}
11179
}

0 commit comments

Comments
 (0)