Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 70F7511F37 for ; Thu, 10 Apr 2014 20:57:36 +0000 (UTC) Received: (qmail 44196 invoked by uid 500); 10 Apr 2014 20:57:36 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 44155 invoked by uid 500); 10 Apr 2014 20:57:34 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 44132 invoked by uid 99); 10 Apr 2014 20:57:32 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Apr 2014 20:57:32 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 3DB7B989BC1; Thu, 10 Apr 2014 20:57:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jessicawang@apache.org To: commits@cloudstack.apache.org Message-Id: <99dfb799859f4905a798f1cbb84294c1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.4 to fc8e79c Date: Thu, 10 Apr 2014 20:57:32 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/4.4 75792bf08 -> fc8e79c17 CLOUDSTACK-6380: UI > hosts page > add new action "Disable Host", "Enable Host". Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fc8e79c1 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fc8e79c1 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fc8e79c1 Branch: refs/heads/4.4 Commit: fc8e79c17b3486b29b72cb2c51d66a606628f0f4 Parents: 75792bf Author: Jessica Wang Authored: Thu Apr 10 13:56:43 2014 -0700 Committer: Jessica Wang Committed: Thu Apr 10 13:57:21 2014 -0700 ---------------------------------------------------------------------- ui/scripts/system.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc8e79c1/ui/scripts/system.js ---------------------------------------------------------------------- diff --git a/ui/scripts/system.js b/ui/scripts/system.js index ab5cbe9..ce62936 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -14755,6 +14755,74 @@ } }, + enable: { + label: 'Enable Host', + action: function (args) { + var data = { + id: args.context.hosts[0].id, + allocationstate: "Enable" + }; + $.ajax({ + url: createURL("updateHost"), + data: data, + success: function (json) { + var item = json.updatehostresponse.host; + args.response.success({ + actionFilter: hostActionfilter, + data: item + }); + } + }); + }, + messages: { + confirm: function (args) { + return 'Please confirm that you want to enable the host'; + }, + notification: function (args) { + return 'Enable Host'; + } + }, + notification: { + poll: function (args) { + args.complete(); + } + } + }, + + disable: { + label: 'Disable Host', + action: function (args) { + var data = { + id: args.context.hosts[0].id, + allocationstate: "Disable" + }; + $.ajax({ + url: createURL("updateHost"), + data: data, + success: function (json) { + var item = json.updatehostresponse.host; + args.response.success({ + actionFilter: hostActionfilter, + data: item + }); + } + }); + }, + messages: { + confirm: function (args) { + return 'Please confirm that you want to disable the host'; + }, + notification: function (args) { + return 'Disable Host'; + } + }, + notification: { + poll: function (args) { + args.complete(); + } + } + }, + 'remove': { label: 'label.action.remove.host', messages: { @@ -18911,6 +18979,7 @@ if (jsonObj.resourcestate == "Enabled") { allowedActions.push("edit"); allowedActions.push("enableMaintenanceMode"); + allowedActions.push("disable"); if (jsonObj.state != "Disconnected") allowedActions.push("forceReconnect"); @@ -18927,6 +18996,7 @@ allowedActions.push("remove"); } else if (jsonObj.resourcestate == "Disabled") { allowedActions.push("edit"); + allowedActions.push("enable"); allowedActions.push("remove"); }