From 1b57182f4c5e265c6717d9d9e210fd0ba5991f96 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Tue, 1 Sep 2015 13:45:23 +0200 Subject: [PATCH] Feature #3786: Add keep on disk option for vCenter in Sunstone --- .../form-panels/create/wizard-tabs/general.js | 8 ++++++++ .../form-panels/create/wizard-tabs/general/html.hbs | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js index c943f4cfcf..3f342eaa01 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js @@ -106,6 +106,8 @@ define(function(require) { 'TYPE': 'vcenter', 'VM_TEMPLATE': $("#vcenter_template_uuid", context).val() } + + templateJSON["KEEP_DISKS_ON_DONE"] = $("#KEEP_DISKS", context).is(':checked')?"YES":"NO" } if ($('#sunstone_capacity_select:checked', context).length > 0) { @@ -132,6 +134,12 @@ define(function(require) { delete templateJSON["SUNSTONE_NETWORK_SELECT"] } + if (templateJSON["HYPERVISOR"] == 'vcenter' && + templateJSON["KEEP_DISKS_ON_DONE"].toLowerCase() == "yes" ) { + $("#KEEP_DISKS", context).attr("checked", "checked"); + delete templateJSON["KEEP_DISKS_ON_DONE"] + } + if (templateJSON["HYPERVISOR"]) { $("input[name='hypervisor'][value='"+templateJSON["HYPERVISOR"]+"']", context).trigger("click") delete templateJSON["HYPERVISOR"]; diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs index 21d2d9bd79..85a4912236 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs @@ -52,6 +52,17 @@ +
+
+
+ + +
+
+