Commit 8107b4ec authored by Kostas Papadimitriou's avatar Kostas Papadimitriou

ui: Conditionally prevent public v6 network prompt in vm create wizard

do not include public ipv6 networks in networks list if SNF:ANY_PUBLIC_IPV6
network is set in forced networks setting.
parent 1dd04d32
......@@ -1194,6 +1194,12 @@
},
initialize: function(options) {
var no_select_ipv6 = false;
var forced_networks = synnefo.config.forced_server_networks || [];
if (forced_networks.indexOf("SNF:ANY_PUBLIC_IPV6") > -1) {
no_select_ipv6 = true;
}
this.project = options.project;
this.quotas = this.project.quotas.get('cyclades.private_network');
options = options || {};
......@@ -1209,7 +1215,10 @@
this.non_floating_public = new Backbone.FilteredCollection(undefined, {
collection: synnefo.storage.networks,
collectionFilter: function(m) {
return m.get('is_public') && !m.get('is_floating')
var cidr = m.get('cidr') || '';
return m.get('is_public') &&
!m.get('is_floating') &&
!(no_select_ipv6 && cidr.indexOf(":") > -1);
}});
this.public_networks.add(this.non_floating_public.models);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment