Skip to content

Commit 61da0b0

Browse files
fix: move node roles to a separate column
1 parent 40005d3 commit 61da0b0

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

src/components/FullNodeViewer/FullNodeViewer.scss

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
display: flex;
88
flex-direction: column;
99

10-
width: 500px;
10+
width: max-content;
11+
min-width: 300px;
12+
max-width: 500px;
1113

1214
&_pools {
1315
display: grid;
@@ -24,4 +26,8 @@
2426
&__section-title {
2527
@include mixins.info-viewer-title();
2628
}
29+
30+
&__role {
31+
color: var(--g-color-text-secondary);
32+
}
2733
}

src/components/FullNodeViewer/FullNodeViewer.tsx

+14-13
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ export const FullNodeViewer = ({node, className}: FullNodeViewerProps) => {
4545
if (node?.Rack) {
4646
commonInfo.push({label: i18n('rack'), value: node?.Rack});
4747
}
48-
if (node?.Roles && node?.Roles.length) {
49-
commonInfo.push({
50-
label: i18n('roles'),
51-
value: (
52-
<Flex direction={'column'}>
53-
{node.Roles.map((role) => {
54-
return <div key={role}>{role}</div>;
55-
})}
56-
</Flex>
57-
),
58-
});
59-
}
6048

6149
if (developerUIHref) {
6250
commonInfo.push({
@@ -83,7 +71,7 @@ export const FullNodeViewer = ({node, className}: FullNodeViewerProps) => {
8371

8472
return (
8573
<div className={b(null, className)}>
86-
<Flex wrap gap={2}>
74+
<Flex wrap gap={4}>
8775
<Flex direction="column" gap={2}>
8876
<InfoViewer
8977
title={i18n('title.common-info')}
@@ -116,6 +104,19 @@ export const FullNodeViewer = ({node, className}: FullNodeViewerProps) => {
116104
info={averageInfo}
117105
/>
118106
</Flex>
107+
108+
{node.Roles && node.Roles.length ? (
109+
<Flex direction="column" gap={2}>
110+
<div className={b('section')}>
111+
<div className={b('section-title')}>{i18n('title.roles')}</div>
112+
{node?.Roles?.map((role) => (
113+
<div className={b('role')} key={role}>
114+
{role}
115+
</div>
116+
))}
117+
</div>
118+
</Flex>
119+
) : null}
119120
</Flex>
120121
</div>
121122
);

src/components/FullNodeViewer/i18n/en.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"version": "Version",
55
"dc": "DC",
66
"rack": "Rack",
7-
"roles": "Roles",
87
"links": "Links",
98

109
"la-interval-1m": "1 min",
@@ -16,6 +15,7 @@
1615

1716
"title.common-info": "Common info",
1817
"title.endpoints": "Endpoints",
18+
"title.roles": "Roles",
1919
"title.pools": "Pools",
2020
"title.load-average": "Load average"
2121
}

0 commit comments

Comments
 (0)