Skip to content

Commit 4c91cc7

Browse files
authored
ui: change ipaddress tab label for shared networks (#8305)
In UI, shared network IP addresses are shown in a tab named Public IP addresses inside the network view. Public IP addresses have their own subsection in the UI. Network → Public IP address. Shared network IP addresses are not shown in this view. This is confusing for users and Public IP addresses tab in the network view has been renamed as IP addresses for a shared network. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 7243946 commit 4c91cc7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

ui/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,7 @@
10301030
"label.ipv6.dns1": "IPv6 DNS1",
10311031
"label.ipv6.dns2": "IPv6 DNS2",
10321032
"label.ipv6.subnets": "IPv6 Subnets",
1033+
"label.ip.addresses": "IP Addresses",
10331034
"label.iqn": "Target IQN",
10341035
"label.is.in.progress": "is in progress",
10351036
"label.is.shared": "Is shared",

ui/src/components/view/ResourceView.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<template v-for="tab in tabs" :key="tab.name">
4545
<a-tab-pane
4646
:key="tab.name"
47-
:tab="$t('label.' + tab.name)"
47+
:tab="$t('label.' + tabName(tab))"
4848
v-if="showTab(tab)">
4949
<keep-alive>
5050
<component
@@ -158,6 +158,12 @@ export default {
158158
)
159159
this.$emit('onTabChange', key)
160160
},
161+
tabName (tab) {
162+
if (typeof tab.name === 'function') {
163+
return tab.name(this.resource)
164+
}
165+
return tab.name
166+
},
161167
showTab (tab) {
162168
if (this.networkService && this.networkService.service && tab.networkServiceFilter) {
163169
return tab.networkServiceFilter(this.networkService.service)

ui/src/config/section/network.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default {
6565
component: shallowRef(defineAsyncComponent(() => import('@/views/network/Ipv6FirewallRulesTab.vue'))),
6666
show: (record, route, user) => { return record.type === 'Isolated' && ['IPv6', 'DualStack'].includes(record.internetprotocol) && !('vpcid' in record) && 'listIpv6FirewallRules' in store.getters.apis && (['Admin', 'DomainAdmin'].includes(user.roletype) || record.account === user.account || record.projectid) }
6767
}, {
68-
name: 'public.ip.addresses',
68+
name: (record) => { return record.type === 'Shared' ? 'ip.addresses' : 'public.ip.addresses' },
6969
component: shallowRef(defineAsyncComponent(() => import('@/views/network/IpAddressesTab.vue'))),
7070
show: (record, route, user) => { return 'listPublicIpAddresses' in store.getters.apis && (record.type === 'Shared' || (record.type === 'Isolated' && !('vpcid' in record) && (['Admin', 'DomainAdmin'].includes(user.roletype) || record.account === user.account || record.projectid))) }
7171
}, {

0 commit comments

Comments
 (0)