diff --git a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.html b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.html index 0a88352..f3b4e5d 100644 --- a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.html +++ b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.html @@ -228,7 +228,7 @@ - + network subnet port diff --git a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.js b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.js index 4841b8f..9a831e7 100644 --- a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.js +++ b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.js @@ -119,7 +119,7 @@ this.instance.block_device_mapping_v2 = []; } if (typeof this.instance.networks === 'undefined'){ - this.instance.networks = [{}]; + this.instance.networks = []; } this.disable = { @@ -427,7 +427,7 @@ } return $scope.options.subnets.concat(resource_subnet); } - return $scope.options.networks; + return $scope.options.subnets; } $scope.get_floatingips_options = function(){ if ('networks.floating_ip' in $scope.connected_options){ @@ -561,8 +561,12 @@ for (var i = index; i < this.instance.networks.length; i=i+1){ $scope.how2config_networks[i] = $scope.how2config_networks[i+1]; } + delete $scope.how2config_networks[this.instance.networks.length]; this.instance.networks.splice(index, 1); - + for (var i = index; i < this.instance.networks.length; i=i+1){ + this.disable.networks[i] = this.disable.networks[i+1]; + } + delete this.disable.networks[this.instance.networks.length]; } this.add_networks = function(){ this.instance.networks.push({}) diff --git a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.spec.js b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.spec.js index 540568d..d3e1dd1 100644 --- a/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.spec.js +++ b/heat_dashboard/static/dashboard/project/heat_dashboard/template_generator/js/resources/os__nova__server/os__nova__server.spec.js @@ -272,7 +272,7 @@ var $ctrl = $isolateScope.$ctrl; $ctrl.add_networks(); - expect($scope.resource.networks.length).toEqual(2); + expect($scope.resource.networks.length).toEqual(1); }); it('networks should be successfully deleted', function() {