CKS: Fix port numbers displayed against ETCD nodes

This commit is contained in:
Pearl Dsilva 2024-05-28 11:50:17 -04:00 committed by nvazquez
parent 7483da21f2
commit 5a11451ce3
No known key found for this signature in database
GPG Key ID: 656E1BCC8CB54F84
1 changed files with 9 additions and 1 deletions

View File

@ -115,7 +115,7 @@
</template>
<template v-if="column.key === 'port'" :name="text" :record="record">
<span v-if="record.isexternalnode || (!record.isexternalnode && !record.isetcdnode)"> {{ cksSshStartingPort + index }} </span>
<span v-else> {{ etcdSshPort }} </span>
<span v-else> {{ parseInt(etcdSshPort) + parseInt(getEtcdIndex(record.name)) }} </span>
</template>
<template v-if="column.key === 'actions'">
<a-tooltip placement="bottom" >
@ -490,6 +490,14 @@ export default {
}).finally(() => {
this.parentFetchData()
})
},
getEtcdIndex (name) {
const lastIndex = name.lastIndexOf('-')
if (lastIndex > 0) {
return name.charAt(lastIndex - 1)
} else {
return null
}
}
}
}