Merge pull request #7690 from catherineluse/ip

IP addresses render properly in Cluster Management
This commit is contained in:
Catherine Luse 2022-12-13 12:23:03 -07:00 committed by GitHub
commit 0011efd896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View File

@ -37,13 +37,13 @@ export default {
<template v-else>
-
</template>
/
<template>
<template v-if="isIp(row.internalIp) && internalSameAsExternal">
/ {{ t('tableHeaders.internalIpSameAsExternal') }}
<template v-if="internalSameAsExternal && isIp(row.internalIp)">
{{ t('tableHeaders.internalIpSameAsExternal') }}
</template>
<template v-else-if="isIp(row.internalIp)">
/<CopyToClipboard
{{ row.internalIp }}<CopyToClipboard
label-as="tooltip"
:text="row.internalIp"
class="icon-btn"

View File

@ -243,12 +243,14 @@ export default class CapiMachine extends SteveModel {
}
get internalIp() {
// This shows in the IP address column for RKE2 nodes in the
// list of nodes in the cluster detail page of Cluster Management.
const internal = this.status?.addresses?.find(({ type }) => {
return type === ADDRESSES.INTERNAL_IP;
});
})?.address;
if (internal) {
return internal.address;
return internal;
}
return this.t('generic.none');
@ -257,10 +259,10 @@ export default class CapiMachine extends SteveModel {
get externalIp() {
const external = this.status?.addresses?.find(({ type }) => {
return type === ADDRESSES.EXTERNAL_IP;
});
})?.address;
if (external) {
return external.address;
return external;
}
return this.t('generic.none');

View File

@ -126,8 +126,8 @@ export default class MgmtNode extends HybridModel {
}
get internalIp() {
// This shows in the IP address column for the list of
// nodes in the cluster detail page of Cluster Management.
// This shows in the IP address column for RKE1 nodes in the
// list of nodes in the cluster detail page of Cluster Management.
const internal = this.status?.addresses?.find(({ type }) => {
return type === ADDRESSES.INTERNAL_IP;