Skip to content

Commit 788ad9a

Browse files
fix: display database name in node info (#543)
1 parent 1479670 commit 788ad9a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/components/FullNodeViewer/FullNodeViewer.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424

2525
.info-viewer__label {
26-
min-width: 60px;
26+
min-width: 100px;
2727
}
2828

2929
&__section-title {

src/components/FullNodeViewer/FullNodeViewer.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {TSystemStateInfo} from '../../types/api/nodes';
55
import {LOAD_AVERAGE_TIME_INTERVALS} from '../../utils/constants';
66
import {calcUptime} from '../../utils/dataFormatters/dataFormatters';
77

8-
import InfoViewer from '../InfoViewer/InfoViewer';
8+
import InfoViewer, {type InfoViewerItem} from '../InfoViewer/InfoViewer';
99
import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
1010
import {PoolUsage} from '../PoolUsage/PoolUsage';
1111

@@ -24,12 +24,19 @@ export const FullNodeViewer = ({node, className}: FullNodeViewerProps) => {
2424
value: Address,
2525
}));
2626

27-
const commonInfo = [
27+
const commonInfo: InfoViewerItem[] = [];
28+
29+
// Do not add DB field for static nodes (they have no Tenants)
30+
if (node?.Tenants?.length) {
31+
commonInfo.push({label: 'Database', value: node.Tenants[0]});
32+
}
33+
34+
commonInfo.push(
2835
{label: 'Version', value: node?.Version},
2936
{label: 'Uptime', value: calcUptime(node?.StartTime)},
3037
{label: 'DC', value: node?.DataCenterDescription},
3138
{label: 'Rack', value: node?.Rack},
32-
];
39+
);
3340

3441
const averageInfo = node?.LoadAverage?.map((load, loadIndex) => ({
3542
label: LOAD_AVERAGE_TIME_INTERVALS[loadIndex],

0 commit comments

Comments
 (0)