Skip to content

Commit 3075a64

Browse files
committed
Fix VPC network offerings listing in isolated network creation form
1 parent 9ae696d commit 3075a64

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

ui/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3727,6 +3727,7 @@
37273727
"message.warn.filetype": "jpg, jpeg, png, bmp and svg are the only supported image formats.",
37283728
"message.warn.importing.instance.without.nic": "WARNING: This Instance is being imported without NICs and many Network resources will not be available. Consider creating a NIC via vCenter before importing or as soon as the Instance is imported.",
37293729
"message.warn.zone.mtu.update": "Please note that this limit won't affect pre-existing Network's MTU settings",
3730+
"message.warn.vpc.offerings": "VPC offerings will be shown only if the selected account has at least one VPC.",
37303731
"message.webhook.deliveries.time.filter": "Webhook deliveries list can be filtered based on date-time. Select 'Custom' for specifying start and end date range.",
37313732
"message.zone.creation.complete": "Zone creation complete.",
37323733
"message.zone.detail.description": "Populate Zone details.",

ui/public/locales/pt_BR.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,6 +2510,7 @@
25102510
"message.vr.alert.upon.network.offering.creation.others": "Como nenhum dos servi\u00e7os obrigat\u00f3rios para cria\u00e7\u00e3o do VR (VPN, DHCP, DNS, Firewall, LB, UserData, SourceNat, StaticNat, PortForwarding) foram habilitados, o VR n\u00e3o ser\u00e1 criado e a oferta de computa\u00e7\u00e3o n\u00e3o ser\u00e1 usada.",
25112511
"message.warn.filetype": "jpg, jpeg, png, bmp e svg s\u00e3o os \u00fanicos formatos de imagem suportados",
25122512
"message.warn.importing.instance.without.nic": "AVISO: essa inst\u00e2ncia est\u00e1 sendo importada sem NICs e muitos recursos de rede n\u00e3o estar\u00e3o dispon\u00edveis. Considere criar uma NIC antes de importar via VCenter ou assim que a inst\u00e2ncia for importada.",
2513+
"message.warn.vpc.offerings": "Ofertas de VPC s\u00c3o exibidas somente caso a conta selecionada possua ao menos uma VPC.",
25132514
"message.zone.creation.complete": "Cria\u00e7\u00e3o de zona completa",
25142515
"message.zone.detail.description": "Preencha os detalhes da zona",
25152516
"message.zone.detail.hint": "Uma zona \u00e9 a maior unidade organizacional no CloudStack, e normalmente corresponde a um \u00fanico datacenter. As zonas proporcionam isolamento f\u00edsico e redund\u00e2ncia. Uma zona consiste em um ou mais pods (cada um contendo hosts e servidores de armazenamento prim\u00e1rio) e um servidor de armazenamento secund\u00e1rio que \u00e9 compartilhado por todos os pods da zona.",

ui/src/views/network/CreateIsolatedNetworkForm.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@
9696
{{ opt.displaytext || opt.name || opt.description }}
9797
</a-select-option>
9898
</a-select>
99+
<a-alert type="warning" v-if="!this.hasVPC">
100+
<template #message>
101+
<span v-html="$t('message.warn.vpc.offerings')"/>
102+
</template>
103+
</a-alert>
99104
</a-form-item>
100105
<a-form-item ref="asnumber" name="asnumber" v-if="isASNumberRequired()">
101106
<template #label>
@@ -369,7 +374,8 @@ export default {
369374
setMTU: false,
370375
asNumberLoading: false,
371376
selectedAsNumber: 0,
372-
asNumbersZone: []
377+
asNumbersZone: [],
378+
hasVPC: true
373379
}
374380
},
375381
watch: {
@@ -515,13 +521,17 @@ export default {
515521
if (this.vpc !== null) { // from VPC section
516522
this.fetchNetworkOfferingData(true)
517523
} else { // from guest network section
518-
var params = {}
524+
var params = {
525+
account: this.owner.account,
526+
projectid: this.owner.projectid,
527+
domainid: this.owner.domainid
528+
}
519529
this.networkOfferingLoading = true
520530
if ('listVPCs' in this.$store.getters.apis) {
521531
api('listVPCs', params).then(json => {
522532
const listVPCs = json.listvpcsresponse.vpc
523-
var vpcAvailable = this.arrayHasItems(listVPCs)
524-
if (vpcAvailable === false) {
533+
this.hasVPC = this.arrayHasItems(listVPCs)
534+
if (this.hasVPC === false) {
525535
this.fetchNetworkOfferingData(false)
526536
} else {
527537
this.fetchNetworkOfferingData()

0 commit comments

Comments
 (0)