Skip to content

Commit eaa4123

Browse files
VNF: fix UI bugs and polish (#8227)
1 parent c7ed4ca commit eaa4123

13 files changed

Lines changed: 67 additions & 24 deletions

File tree

api/src/main/java/com/cloud/network/VNF.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public enum AccessDetail {
6868
}
6969

7070
public enum VnfDetail {
71-
ICON,
7271
VERSION,
7372
VENDOR,
7473
MAINTAINER

api/src/main/java/com/cloud/server/ResourceTag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
3030
public enum ResourceObjectType {
3131
UserVm(true, true, true),
3232
Template(true, true, true),
33-
VnfTemplate(true, true, true),
33+
VnfTemplate(false, false, true),
3434
ISO(true, false, true),
3535
Volume(true, true),
3636
Snapshot(true, false),

server/src/main/java/com/cloud/tags/ResourceManagerUtilImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public class ResourceManagerUtilImpl implements ResourceManagerUtil {
8181
s_typeMap.put(ResourceTag.ResourceObjectType.UserVm, UserVmVO.class);
8282
s_typeMap.put(ResourceTag.ResourceObjectType.Volume, VolumeVO.class);
8383
s_typeMap.put(ResourceTag.ResourceObjectType.Template, VMTemplateVO.class);
84+
s_typeMap.put(ResourceTag.ResourceObjectType.VnfTemplate, VMTemplateVO.class);
8485
s_typeMap.put(ResourceTag.ResourceObjectType.ISO, VMTemplateVO.class);
8586
s_typeMap.put(ResourceTag.ResourceObjectType.Snapshot, SnapshotVO.class);
8687
s_typeMap.put(ResourceTag.ResourceObjectType.Network, NetworkVO.class);

ui/public/locales/en.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,7 +2208,7 @@
22082208
"label.vnf.appliance": "VNF Appliance",
22092209
"label.vnf.appliances": "VNF appliances",
22102210
"label.vnf.appliance.add": "Add VNF Appliance",
2211-
"label.vnf.appliance.access.methods": "Management access information of this VNF appliance",
2211+
"label.vnf.appliance.access.methods": "Management access information for this VNF appliance",
22122212
"label.vnf.app.action.destroy": "Destroy VNF appliance",
22132213
"label.vnf.app.action.edit": "Edit VNF appliance",
22142214
"label.vnf.app.action.expunge": "Expunge VNF appliance",
@@ -2220,24 +2220,25 @@
22202220
"label.vnf.app.action.stop": "Stop VNF appliance",
22212221
"label.vnf.app.action.reboot": "Reboot VNF appliance",
22222222
"label.vnf.app.action.reinstall": "Reinstall VNF appliance",
2223-
"label.vnf.cidr.list": "Source cidr list of rules",
2223+
"label.vnf.cidr.list": "CIDR from which access to the VNF appliance’s Management interface should be allowed from",
22242224
"label.vnf.cidr.list.tooltip": "the CIDR list to forward traffic from to the VNF management interface. Multiple entries must be separated by a single comma character (,). The default value is 0.0.0.0/0.",
2225-
"label.vnf.configure.management": "Configure rules for VNF management interfaces",
2226-
"label.vnf.configure.management.tooltip": "True by default, security group or network rules (source nat and firewall rules) will be configured for VNF management interfaces. False otherwise.",
2225+
"label.vnf.configure.management": "Configure Firewall and Port Forwarding rules for VNF's management interfaces",
2226+
"label.vnf.configure.management.tooltip": "True by default, security group or network rules (source nat and firewall rules) will be configured for VNF management interfaces. False otherwise. Learn what rules are configured at http://docs.cloudstack.apache.org/en/latest/adminguide/networking/vnf_templates_appliances.html#deploying-vnf-appliances",
22272227
"label.vnf.detail.add": "Add VNF detail",
22282228
"label.vnf.detail.remove": "Remove VNF detail",
2229-
"label.vnf.details": "VNF details",
2229+
"label.vnf.details": "VNF Details",
22302230
"label.vnf.nic.add": "Add VNF nic",
22312231
"label.vnf.nic.delete": "Delete VNF nic",
22322232
"label.vnf.nic.description": "Description of VNF nic",
2233-
"label.vnf.nic.deviceid": "Device ID of VNF nic. It starts with 0",
2233+
"label.vnf.nic.deviceid": "Device ID of VNF nic. It starts with 0. The NIC with deviceid as 0 for VNF appliance will be the default NIC.",
22342234
"label.vnf.nic.edit": "Edit VNF nic",
22352235
"label.vnf.nic.management": "Management NIC",
22362236
"label.vnf.nic.management.description": "True if the VNF nic is a management interface. False otherwise",
2237+
"label.vnf.nic.mappings": "VNF NIC mappings",
22372238
"label.vnf.nic.name": "Name of VNF nic",
22382239
"label.vnf.nic.remove": "Remove VNF nic",
22392240
"label.vnf.nic.required": "True if VNF nic is required. Otherwise optional",
2240-
"label.vnf.nics": "VNF nics",
2241+
"label.vnf.nics": "VNF Nics",
22412242
"label.vnf.settings": "VNF settings",
22422243
"label.vnf.templates": "VNF templates",
22432244
"label.vnf.template.register": "Register VNF template",
@@ -2494,6 +2495,8 @@
24942495
"message.config.health.monitor.failed": "Configure Health Monitor failed",
24952496
"message.config.sticky.policy.failed": "Failed to configure sticky policy.",
24962497
"message.config.sticky.policy.processing": "Updating sticky policy...",
2498+
"message.configure.network.ip.and.mac": "Please configure the IP address and mac address of networks if needed.",
2499+
"message.configure.network.select.default.network": "Please configure the IP address and mac address of networks if needed. Please select a network as the default network.",
24972500
"message.configuring.guest.traffic": "Configuring guest traffic",
24982501
"message.configuring.physical.networks": "Configuring physical Networks",
24992502
"message.configuring.public.traffic": "Configuring public traffic",
@@ -3198,17 +3201,19 @@
31983201
"message.vm.state.stopped": "Instance is stopped.",
31993202
"message.vm.state.stopping": "Instance is being stopped.",
32003203
"message.vm.state.unknown": "Instance state is unknown.",
3201-
"message.vnf.appliance.networks": "Please select Networks for the new VNF appliance.",
3204+
"message.vnf.appliance.networks": "Please select the networks for the new VNF appliance.",
32023205
"message.vnf.credentials.change": "Please change the password(s) of the VNF appliance immediately.",
32033206
"message.vnf.credentials.default": "The default credentials(s) of the VNF appliance",
32043207
"message.vnf.credentials.in.template.vnf.details": "Please find the default credentials for this VNF in the details of the VNF template.",
3205-
"message.vnf.error.deviceid.should.be.continuous": "The deviceid of selected VNF NICs should be continuous.",
3208+
"message.vnf.error.deviceid.should.be.consecutive": "The deviceid of selected VNF NICs should be consecutive.",
32063209
"message.vnf.error.network.is.already.used": "Network has been used by multiple NICs of the new VNF appliance.",
3207-
"message.vnf.error.no.networks": "Please select networks for NICs of the new VNF appliance.",
3210+
"message.vnf.error.network.should.be.used": "All selected networks should be used as VNF Nics",
3211+
"message.vnf.error.no.networks": "Please select the networks for the new VNF appliance.",
32083212
"message.vnf.error.no.network.for.required.deviceid": "Please select a Network for required NIC of the new VNF appliance.",
32093213
"message.vnf.nic.move.up.fail": "Failed to move up this NIC",
32103214
"message.vnf.nic.move.down.fail": "Failed to move down this NIC",
3211-
"message.vnf.select.networks": "Please select a Network for each VNF nic. ",
3215+
"message.vnf.no.credentials": "No credentials found for the VNF appliance.",
3216+
"message.vnf.select.networks": "Please select the relevant network for each VNF NIC.",
32123217
"message.volume.state.allocated": "The volume is allocated but has not been created yet.",
32133218
"message.volume.state.attaching": "The volume is attaching to a volume from Ready state.",
32143219
"message.volume.state.copying": "The volume is being copied from the image store to primary storage, in case it's an uploaded volume.",

ui/src/components/header/CreateMenu.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,25 @@
133133
</a-row>
134134
</router-link>
135135
</a-menu-item>
136+
<a-menu-item style="width: 100%; padding: 12px" v-if="'deployVnfAppliance' in $store.getters.apis">
137+
<router-link :to="{ path: '/action/deployVnfAppliance'}">
138+
<a-row>
139+
<a-col style="margin-right: 12px">
140+
<a-avatar :style="{ backgroundColor: $config.theme['@primary-color'] }">
141+
<template #icon>
142+
<font-awesome-icon :icon="['fa-solid', 'fa-dharmachakra']" />
143+
</template>
144+
</a-avatar>
145+
</a-col>
146+
<a-col>
147+
<h3 style="margin-bottom: 0px;">
148+
{{ $t('label.vnf.appliance') }}
149+
</h3>
150+
<small>{{ $t('label.vnf.appliance.add') }}</small>
151+
</a-col>
152+
</a-row>
153+
</router-link>
154+
</a-menu-item>
136155
</a-menu>
137156
</template>
138157
<a-button type="primary">

ui/src/components/view/DetailsTab.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,11 @@ export default {
207207
}
208208
209209
const managementDeviceIds = []
210-
for (const vnfnic of this.resource.vnfnics) {
211-
if (vnfnic.management) {
212-
managementDeviceIds.push(vnfnic.deviceid)
210+
if (this.resource.vnfnics) {
211+
for (const vnfnic of this.resource.vnfnics) {
212+
if (vnfnic.management) {
213+
managementDeviceIds.push(vnfnic.deviceid)
214+
}
213215
}
214216
}
215217
const managementIps = []

ui/src/config/section/network.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ export default {
325325
title: 'label.vnf.appliances',
326326
icon: 'gateway-outlined',
327327
permission: ['listVirtualMachinesMetrics'],
328+
resourceType: 'UserVm',
328329
params: () => {
329330
return { details: 'servoff,tmpl,nics', isvnf: true }
330331
},

ui/src/views/compute/DeployVnfAppliance.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@
365365
</template>
366366
</a-step>
367367
<a-step
368-
:title="$t('label.vnf.nics')"
368+
:title="$t('label.vnf.nic.mappings')"
369369
:status="zoneSelected ? 'process' : 'wait'"
370370
v-if="showVnfNicsSection">
371371
<template #description>
@@ -1906,7 +1906,6 @@ export default {
19061906
}
19071907
},
19081908
updateDefaultNetworks (id) {
1909-
this.defaultnetworkid = id
19101909
this.form.defaultnetworkid = id
19111910
},
19121911
updateNetworkConfig (networks) {
@@ -2038,7 +2037,7 @@ export default {
20382037
if (templateVnfNic.deviceid !== nextDeviceId) {
20392038
this.$notification.error({
20402039
message: this.$t('message.request.failed'),
2041-
description: this.$t('message.vnf.error.deviceid.should.be.continuous')
2040+
description: this.$t('message.vnf.error.deviceid.should.be.consecutive')
20422041
})
20432042
return
20442043
}
@@ -2316,7 +2315,11 @@ export default {
23162315
if (vm.password) {
23172316
credentials.push('New password : ' + vm.password)
23182317
}
2319-
credentials.push(this.$t('message.vnf.credentials.change'))
2318+
if (credentials.length > 0) {
2319+
credentials.push(this.$t('message.vnf.credentials.change'))
2320+
} else {
2321+
credentials.push(this.$t('message.vnf.no.credentials'))
2322+
}
23202323
this.$notification.success({
23212324
message: `${this.$t('message.vnf.credentials.default')} ` + name,
23222325
description: (<span v-html={credentials.join('<br>')}></span>),

ui/src/views/compute/MigrateVMStorage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default {
134134
},
135135
submitForm () {
136136
var isUserVm = true
137-
if (this.$route.meta.name !== 'vm') {
137+
if (this.$route.meta.resourceType !== 'UserVm') {
138138
isUserVm = false
139139
}
140140
var migrateApi = isUserVm ? 'migrateVirtualMachine' : 'migrateSystemVm'

ui/src/views/compute/MigrateWizard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export default {
197197
},
198198
computed: {
199199
isUserVm () {
200-
return this.$route.meta.name === 'vm'
200+
return this.$route.meta.resourceType === 'UserVm'
201201
}
202202
},
203203
watch: {

0 commit comments

Comments
 (0)