From 8445206ab6ecc0ca2d133e45fec55fa3f413e4f7 Mon Sep 17 00:00:00 2001 From: juanmont Date: Mon, 18 Jun 2018 17:06:07 +0200 Subject: [PATCH] B #2188: Fixed bug when tried to update address range with IP6_STATIC (#2195) (cherry picked from commit c4f893522933d33a5f22d00c3179845fa051c480) --- .../public/app/tabs/vnets-tab/utils/ar-tab.js | 20 ++++++++++++++++++- .../app/tabs/vnets-tab/utils/ar-tab/html.hbs | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab.js b/src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab.js index 4203c15b1d..a65a69c5a1 100644 --- a/src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab.js +++ b/src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab.js @@ -110,6 +110,8 @@ define(function(require) { function _onShow(){ this.securityGroupsTable.refreshResourceTableSelect(); + + $("input.slaac", this.ar_section).change(); } function _retrieve_ar_tab_data(){ @@ -144,7 +146,11 @@ define(function(require) { var field=$(this); if (field.val() != null && field.val().length){ //if has a length - data[field.attr('name')] = field.val(); + if (field.attr('name') === "SLAAC" && field[0].checked) { + data[field.attr('name')] = "on"; + } else { + data[field.attr('name')] = field.val(); + } } }); @@ -171,8 +177,20 @@ define(function(require) { } function _fill_ar_tab_data(ar_json){ + + if (ar_json["TYPE"] && ar_json["TYPE"].indexOf("_STATIC") >= 0 ){ + ar_json["TYPE"] = ar_json["TYPE"].replace("_STATIC", ""); + ar_json["SLAAC"] = "off"; + } + WizardFields.fill(this.ar_section, ar_json); + if (ar_json["SLAAC"] && ar_json["SLAAC"] === "off"){ + $("input.slaac", this.ar_section)[0].checked = false; + } + + $("input.slaac", this.ar_section).prop("disabled", true); + var fields = $('[wizard_field]',this.ar_section); fields.each(function(){ diff --git a/src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab/html.hbs b/src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab/html.hbs index 2c35851476..85aba1f4f4 100644 --- a/src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab/html.hbs +++ b/src/sunstone/public/app/tabs/vnets-tab/utils/ar-tab/html.hbs @@ -37,7 +37,7 @@
- +