Commit 0af622df by Bence Dányi

firewall_gui: fix interactive group add/remove

parent 12048406
...@@ -89,7 +89,9 @@ var controllers = { ...@@ -89,7 +89,9 @@ var controllers = {
$scope.removeHostGroup = function(group) { $scope.removeHostGroup = function(group) {
for (var i in $scope.entity.groups) { for (var i in $scope.entity.groups) {
var group_ = $scope.entity.groups[i]; var group_ = $scope.entity.groups[i];
if (group_.name == group.name) { if (group_.name == group.name && group_.__created) {
$scope.entity.groups.splice(i, 1);
} else if (group_.name == group.name) {
group_.__destroyed = true; group_.__destroyed = true;
return; return;
} }
...@@ -116,7 +118,9 @@ var controllers = { ...@@ -116,7 +118,9 @@ var controllers = {
$scope.removeVlan = function(vlan) { $scope.removeVlan = function(vlan) {
for (var i in $scope.entity.vlans) { for (var i in $scope.entity.vlans) {
var vlan_ = $scope.entity.vlans[i]; var vlan_ = $scope.entity.vlans[i];
if (vlan_.name == vlan.name) { if (vlan_.name == vlan.name && vlan_.__created) {
$scope.entity.vlans.splice(i, 1);
} else if (vlan_.name == vlan.name) {
vlan_.__destroyed = true; vlan_.__destroyed = true;
return; return;
} }
......
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 sign in to comment