Skip to content

Commit

Permalink
feat(cluster-list): add context-path in cluster-list
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Sep 15, 2022
1 parent 5a1045f commit 3ae135a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/cluster/src/commands/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const formatStatus = status => {

const run = async function (argv) {
const clusters = await listClusters(argv)

const anyCustomContext = clusters.some(cluster => cluster.contextPath !== '')
const table = new Table({
head: [
'Name',
Expand All @@ -45,20 +45,21 @@ const run = async function (argv) {
'DHIS2 Version',
'DB Version',
'Status',
],
].concat(anyCustomContext ? 'Context Path' : []),
})

await Promise.all(
clusters.map(async cluster => {
const status = await getStatus(cluster)
table.push([
chalk.blue(cluster.name),
cluster.port,
cluster.channel,
cluster.dhis2Version,
cluster.dbVersion,
formatStatus(status),
])
chalk.blue(cluster.name),
cluster.port,
cluster.channel,
cluster.dhis2Version,
cluster.dbVersion,
formatStatus(status),
].concat(anyCustomContext ? cluster.contextPath : [])
)
})
)

Expand Down

0 comments on commit 3ae135a

Please sign in to comment.