From 8f60f6feca30156380452d0e37e1de1ca291fb51 Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Fri, 24 Apr 2020 17:28:52 +0200 Subject: [PATCH] F #2837: Force AR remove (#4591) --- src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb | 2 +- src/sunstone/public/app/tabs/vnets-tab/panels/ar.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb index 43a115563e..f9f13151fd 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb @@ -97,7 +97,7 @@ module OpenNebulaJSON end def rm_ar(params=Hash.new) - super(params['ar_id']) + super(params['ar_id'],params['force']) end def add_ar(params=Hash.new) diff --git a/src/sunstone/public/app/tabs/vnets-tab/panels/ar.js b/src/sunstone/public/app/tabs/vnets-tab/panels/ar.js index 8d38add215..dc71fae899 100644 --- a/src/sunstone/public/app/tabs/vnets-tab/panels/ar.js +++ b/src/sunstone/public/app/tabs/vnets-tab/panels/ar.js @@ -174,14 +174,15 @@ define(function(require) { context.off("click", 'button#rm_ar_button'); context.on("click", 'button#rm_ar_button', function(){ var ar_id = $(this).attr('ar_id'); - + var checkbox_code = '
'; Sunstone.getDialog(CONFIRM_DIALOG_ID).setParams({ //header : headerTabId: TAB_ID, - body : Locale.tr("This will delete all the addresses in this range"), + body : Locale.tr("This will delete all the addresses in this range") + checkbox_code, //question : submit : function(){ - var obj = {ar_id: ar_id}; + var force = $("#force_rm_ar").is(":checked"); + var obj = {ar_id: ar_id, force: force}; Sunstone.runAction('Network.rm_ar',that.element.ID,obj); return false;