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 32D22117B1 for ; Mon, 28 Jul 2014 14:04:15 +0000 (UTC) Received: (qmail 97043 invoked by uid 500); 28 Jul 2014 14:04:14 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 96946 invoked by uid 500); 28 Jul 2014 14:04:14 -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 96733 invoked by uid 99); 28 Jul 2014 14:04:14 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2014 14:04:14 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B90909B7C55; Mon, 28 Jul 2014 14:04:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dahn@apache.org To: commits@cloudstack.apache.org Date: Mon, 28 Jul 2014 14:04:20 -0000 Message-Id: <11b7beadfdbb4a99851691a51c783d88@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/50] git commit: updated refs/heads/4.4 to d5220a8 CLOUDSTACK-6852: UI - attach volume action - VM dropdown - populate options based on whether module is included and whether service is enabled. (cherry picked from commit 9b9154132dbd41acddf4365779fc8af13a2acc4c) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c9d4395b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c9d4395b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c9d4395b Branch: refs/heads/4.4 Commit: c9d4395bba3dfe15992464808e124395208644f0 Parents: f769763 Author: Jessica Wang Authored: Thu Jun 5 13:44:57 2014 -0700 Committer: Daan Hoogland Committed: Mon Jul 28 16:02:26 2014 +0200 ---------------------------------------------------------------------- ui/scripts/storage.js | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c9d4395b/ui/scripts/storage.js ---------------------------------------------------------------------- diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 74d0201..7c19d66 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -905,6 +905,14 @@ }); } + + var drModuleIncluded = isModuleIncluded("dr"); + var volumeDrEnabled = false; + if (drModuleIncluded) { + volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]); + } + + $(['Running', 'Stopped']).each(function() { $.ajax({ url: createURL('listVirtualMachines'), @@ -914,11 +922,21 @@ async: false, success: function(json) { var instanceObjs = json.listvirtualmachinesresponse.virtualmachine; - $(instanceObjs).each(function() { - items.push({ - id: this.id, - description: this.displayname ? this.displayname : this.name - }); + $(instanceObjs).each(function() { + if (drModuleIncluded) { + var vmDrEnabled = cloudStack.dr.sharedFunctions.isVmDrEnabled(this); + if (vmDrEnabled == volumeDrEnabled) { + items.push({ + id: this.id, + description: this.displayname ? this.displayname : this.name + }); + } + } else { + items.push({ + id: this.id, + description: this.displayname ? this.displayname : this.name + }); + } }); } }); @@ -1993,7 +2011,7 @@ } if (jsonObj.state != "Creating") { - if (jsonObj.type == "ROOT") { + if (jsonObj.type == "ROOT") { if (jsonObj.vmstate == "Stopped") { allowedActions.push("createTemplate"); }