From 432caf56b473d0016e9f07a1634187c47ba03b15 Mon Sep 17 00:00:00 2001 From: Abel Coronado Date: Thu, 19 Oct 2017 15:49:49 +0200 Subject: [PATCH] B #5473: Disabled actions can be scheduled (#538) --- .../form-panels/create/wizard-tabs/actions.js | 47 +++++++---------- .../templates-tab/form-panels/instantiate.js | 46 +++++++--------- .../public/app/tabs/vms-tab/panels/actions.js | 52 ++++++++----------- 3 files changed, 63 insertions(+), 82 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/actions.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/actions.js index 8292f9d3b7..061e004c5a 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/actions.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/actions.js @@ -67,39 +67,32 @@ define(function(require) { function _setup(context) { var that = this; - + var actions = ["terminate", "terminate-hard", "hold", "release", "stop", "suspend", "resume", "reboot", "reboot-hard", "poweroff", "poweroff-hard", "undeploy", "undeploy-hard", "snapshot-create"]; context.off('click', '#add_scheduling_temp_action'); context.on('click', '#add_scheduling_temp_action', function() { $("#add_scheduling_temp_action", context).attr("disabled", "disabled"); - $("#scheduling_temp_actions_table").append('\ + var html = '\ + \ + \ + \ + \ \ - \ - \ - \ \ \ - \ - \ - \ - \ - \ - '); - + \ + \ + \ + \ + \ + '; + $("#scheduling_temp_actions_table").append(html); return false; }); diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js index ef92a74a34..2c4a929a61 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js @@ -123,36 +123,30 @@ define(function(require) { context.off('click', '#add_scheduling_inst_action'); context.on('click', '#add_scheduling_inst_action', function() { + var actions = ["terminate", "terminate-hard", "hold", "release", "stop", "suspend", "resume", "reboot", "reboot-hard", "poweroff", "poweroff-hard", "undeploy", "undeploy-hard", "snapshot-create"]; $("#add_scheduling_inst_action", context).attr("disabled", "disabled"); - $("#scheduling_inst_actions_table").append('\ + var html = '\ + \ + \ + \ + \ \ - \ - \ - \ \ \ - \ - \ - \ - \ - \ - '); - + \ + \ + \ + \ + \ + '; + $("#scheduling_inst_actions_table").append(html); return false; }); diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/actions.js b/src/sunstone/public/app/tabs/vms-tab/panels/actions.js index 8da2c4d49a..13e3082fd3 100644 --- a/src/sunstone/public/app/tabs/vms-tab/panels/actions.js +++ b/src/sunstone/public/app/tabs/vms-tab/panels/actions.js @@ -23,6 +23,7 @@ define(function(require) { var Sunstone = require('sunstone'); var Humanize = require('utils/humanize'); var TemplateUtils = require('utils/template-utils'); + var Config = require('sunstone-config'); /* CONSTANTS @@ -83,39 +84,32 @@ define(function(require) { function _setup(context) { var that = this; + var actions = ["terminate", "terminate-hard", "hold", "release", "stop", "suspend", "resume", "reboot", "reboot-hard", "poweroff", "poweroff-hard", "undeploy", "undeploy-hard", "snapshot-create"]; context.off('click', '#add_scheduling_action'); context.on('click', '#add_scheduling_action', function() { $("#add_scheduling_action", context).attr("disabled", "disabled"); - $("#scheduling_actions_table").append('\ - \ - \ - \ + var html = '\ + \ + \ + \ \ - \ - \ - \ - \ - \ - \ - \ - \ - '); - + \ + \ + \ + \ + \ + \ + \ + \ + '; + $("#scheduling_actions_table").append(html); return false; });