ui: Allow set IPv6 when deploying advanced network Zone with SG via UI (#4083)

Advanced Network with Security Groups is a great option for deploying a Zone with IPv6 address support. However, it is not possible to set IPv6 DNS + IPv6 CIDR + IPv6 gateway via the zoneWizard UI.

Currently, the workaround is to either (i) create a new network (the default guest network would not support IPv6), (ii) deploy a zone via API, or (iii) to run a MySQL update query to set the default guest network IPv6 config.

This PR adds a small enhancement on the UI Zone deployment to allow deploying a Zone with Advanced Network with Security Groups + IPv6 CIDR, IPv6 gateway, and IPv6 DNS.

Note that API [1] offers full support for such action, therefore there is no need for changing the API. It is just a small enhancement on UI that might be useful in the meantime that we wait for the new ACS UI.

[1] https://cloudstack.apache.org/api/apidocs-4.13/apis/createNetwork.html
This commit is contained in:
Gabriel Beims Bräscher 2020-06-12 01:39:50 -03:00 committed by GitHub
parent 9361fef20f
commit 195385f5b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -406,6 +406,9 @@
args.$form.find('[rel=ip6dns1]').hide();
args.$form.find('[rel=ip6dns2]').hide();
args.$form.find('[rel=ip6cidr]').hide();
args.$form.find('[rel=ip6gateway]').hide();
} else { //Advanced zone
if (args.data["zone-advanced-sg-enabled"] != "on") { //Advanced SG-disabled zone
args.$form.find('[rel=networkOfferingId]').hide();
@ -413,12 +416,18 @@
args.$form.find('[rel=ip6dns1]').show();
args.$form.find('[rel=ip6dns2]').show();
args.$form.find('[rel=ip6cidr]').hide();
args.$form.find('[rel=ip6gateway]').hide();
} else { //Advanced SG-enabled zone
args.$form.find('[rel=networkOfferingId]').show(); //will be used to create a guest network during zone creation
args.$form.find('[rel=guestcidraddress]').hide();
args.$form.find('[rel=ip6dns1]').hide();
args.$form.find('[rel=ip6dns2]').hide();
args.$form.find('[rel=ip6dns1]').show();
args.$form.find('[rel=ip6dns2]').show();
args.$form.find('[rel=ip6cidr]').show();
args.$form.find('[rel=ip6gateway]').show();
}
}
},
@ -461,6 +470,21 @@
}
},
ip6cidr: {
label: 'label.ipv6.CIDR',
validation: {
required: false,
ipv6cidr: true
}
},
ip6gateway: {
label: 'label.ipv6.gateway',
validation: {
required: false,
ipv6: true
}
},
internaldns1: {
label: 'label.internal.dns.1',
validation: {
@ -3878,6 +3902,16 @@
endip: args.data.guestTraffic.guestEndIp
});
}
if (args.data.zone.ip6cidr != null && args.data.zone.ip6cidr.length > 0) {
$.extend(data, {
ip6cidr: args.data.zone.ip6cidr
});
}
if (args.data.zone.ip6gateway != null && args.data.zone.ip6gateway.length > 0) {
$.extend(data, {
ip6gateway: args.data.zone.ip6gateway
});
}
}
$.ajax({