Builds page - Fix bad labels display

When a node is attached multiple labels then all labels are
displayed without seperator.

This changes make sure the labels column is called "Labels" and
that each node's labels is separated by a comma.

Change-Id: I8d3d90ef131847ee6319bb19ec00a07bfd0e82a8
This commit is contained in:
Fabien Boucher 2019-07-26 14:56:25 +02:00
parent 267345125f
commit 09846f7640
1 changed files with 4 additions and 2 deletions

View File

@ -44,6 +44,7 @@ class NodesPage extends Refreshable {
const headerFormat = value => <Table.Heading>{value}</Table.Heading>
const cellFormat = value => <Table.Cell>{value}</Table.Cell>
const cellLabelsFormat = value => <Table.Cell>{value.join(',')}</Table.Cell>
const cellPreFormat = value => (
<Table.Cell style={{fontFamily: 'Menlo,Monaco,Consolas,monospace'}}>
{value}
@ -55,14 +56,15 @@ class NodesPage extends Refreshable {
const columns = []
const myColumns = [
'id', 'label', 'connection', 'server', 'provider', 'state',
'id', 'labels', 'connection', 'server', 'provider', 'state',
'age', 'comment'
]
myColumns.forEach(column => {
let formatter = cellFormat
let prop = column
if (column === 'label') {
if (column === 'labels') {
prop = 'type'
formatter = cellLabelsFormat
} else if (column === 'connection') {
prop = 'connection_type'
} else if (column === 'server') {