Skip to content

Commit f3b2c9c

Browse files
bernardodemarcodhslove
authored andcommitted
UI: Fixes and minor enhacements to the Public IP Addresses section (apache#10351)
1 parent 7c700f9 commit f3b2c9c

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

ui/src/components/view/ListView.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@
163163
 
164164
<a-tag>static-nat</a-tag>
165165
</span>
166+
<span v-if="record.issystem">
167+
&nbsp;
168+
<a-tag>system</a-tag>
169+
</span>
166170
</template>
167171
<template v-if="column.key === 'ip6address'" href="javascript:;">
168172
<span>{{ ipV6Address(text, record) }}</span>
@@ -438,8 +442,8 @@
438442
<status :text="record.enabled ? record.enabled.toString() : 'false'" />
439443
{{ record.enabled ? 'Enabled' : 'Disabled' }}
440444
</template>
441-
<template v-if="['created', 'sent', 'removed', 'effectiveDate', 'endDate'].includes(column.key) || (['startdate'].includes(column.key) && ['webhook'].includes($route.path.split('/')[1])) || (column.key === 'allocated' && ['asnumbers', 'publicip', 'ipv4subnets'].includes($route.meta.name) && text)">
442-
{{ $toLocaleDate(text) }}
445+
<template v-if="['created', 'sent', 'removed', 'effectiveDate', 'endDate', 'allocated'].includes(column.key) || (['startdate'].includes(column.key) && ['webhook'].includes($route.path.split('/')[1])) || (column.key === 'allocated' && ['asnumbers', 'publicip', 'ipv4subnets'].includes($route.meta.name) && text)">
446+
{{ text && $toLocaleDate(text) }}
443447
</template>
444448
<template v-if="['startdate', 'enddate'].includes(column.key) && ['vm', 'vnfapp'].includes($route.path.split('/')[1])">
445449
{{ getDateAtTimeZone(text, record.timezone) }}

ui/src/config/section/network.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,10 +841,13 @@ export default {
841841
message: 'message.action.release.ip',
842842
docHelp: 'adminguide/networking_and_traffic.html#releasing-an-ip-address-alloted-to-a-vpc',
843843
dataView: true,
844-
show: (record) => { return record.state === 'Allocated' && !record.issourcenat },
844+
show: (record) => { return record.state === 'Allocated' && !record.issourcenat && !record.issystem },
845845
groupAction: true,
846846
popup: true,
847-
groupMap: (selection) => { return selection.map(x => { return { id: x } }) }
847+
groupMap: (selection) => { return selection.map(x => { return { id: x } }) },
848+
groupShow: (selectedIps) => {
849+
return selectedIps.every((ip) => ip.state === 'Allocated' && !ip.issourcenat && !ip.issystem)
850+
}
848851
},
849852
{
850853
api: 'reserveIpAddress',
@@ -864,7 +867,10 @@ export default {
864867
show: (record) => { return record.state === 'Reserved' },
865868
groupAction: true,
866869
popup: true,
867-
groupMap: (selection) => { return selection.map(x => { return { id: x } }) }
870+
groupMap: (selection) => { return selection.map(x => { return { id: x } }) },
871+
groupShow: (selectedIps) => {
872+
return selectedIps.every((ip) => ip.state === 'Reserved')
873+
}
868874
}
869875
]
870876
},

0 commit comments

Comments
 (0)