Commit ee26b5ef authored by Kostas Papadimitriou's avatar Kostas Papadimitriou Committed by Ilias Tsitsimpis
Browse files

ui: Include 'gateway_ip' in subnet create API call

Closes #67
parent 66fb8f6f
......@@ -314,7 +314,7 @@
});
},
create: function (name, type, cidr, dhcp, callback) {
create: function (name, type, cidr, dhcp, gateway, callback) {
var quota = synnefo.storage.quotas;
var params = {network:{name:name}};
var subnet_params = {subnet:{network_id:undefined}};
......@@ -324,6 +324,8 @@
if (cidr) { subnet_params.subnet.cidr = cidr; }
if (dhcp) { subnet_params.subnet.dhcp_enabled = dhcp; }
if (dhcp === false) { subnet_params.subnet.dhcp_enabled = false; }
subnet_params.subnet.gateway_ip = gateway || null;
var cb = function() {
callback && callback();
......
......@@ -206,6 +206,7 @@
var dhcp = this.dhcp_select.is(":checked");
var subnet = null;
var type = this.type_select.val();
var gateway = undefined;
if (dhcp) {
if (this.subnet_select.val() == "custom") {
......@@ -218,11 +219,12 @@
}
snf.storage.networks.create(name, type, subnet, dhcp, _.bind(function(){
this.hide();
// trigger parent view create handler
this.parent_view.post_create();
}, this));
snf.storage.networks.create(name, type, subnet, dhcp, gateway,
_.bind(function(){
this.hide();
// trigger parent view create handler
this.parent_view.post_create();
}, this));
},
beforeOpen: function() {
......
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