You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/10/28 11:54:51 UTC

[1/2] git commit: updated refs/heads/master to d538e43

Repository: cloudstack
Updated Branches:
  refs/heads/master bde75b49c -> d538e438e


CLOUDSTACK-8990: start a stopped machine on a specific determinable host on UI


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6cced18f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6cced18f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6cced18f

Branch: refs/heads/master
Commit: 6cced18fd67302eccaa560e80f55c2cf7f55a2ea
Parents: f241455
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Mon Oct 26 11:02:04 2015 +0100
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Mon Oct 26 14:29:29 2015 +0100

----------------------------------------------------------------------
 ui/css/cloudstack3.css  |   6 ++-
 ui/scripts/instances.js | 106 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 109 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6cced18f/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index 61301d5..a090fe8 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -12363,11 +12363,13 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
   background-position: 1px -583px;
 }
 
-.start .icon {
+.start .icon,
+.startByAdmin .icon {
   background-position: -169px -1px;
 }
 
-.start:hover .icon {
+.start:hover .icon,
+.startByAdmin:hover .icon {
   background-position: -169px -583px;
 }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6cced18f/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 9901cf7..5096297 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -520,6 +520,107 @@
                             poll: pollAsyncJobResult
                         }
                     },
+                    startByAdmin: {
+                        label: 'label.action.start.instance',
+                        createForm: {
+                            title: 'label.action.start.instance',
+                            desc: 'message.action.start.instance',
+                            fields: {
+                                hostId: {
+                                    label: 'label.host',
+                                    isHidden: function(args) {
+                                        if (isAdmin())
+                                            return false;
+                                        else
+                                            return true;
+                                    },
+                                    select: function(args) {
+                                        if (isAdmin()) {
+                                            $.ajax({
+                                                url: createURL("listHosts&state=Up&type=Routing&zoneid=" + args.context.instances[0].zoneid),
+                                                dataType: "json",
+                                                async: true,
+                                                success: function(json) {
+                                                    if (json.listhostsresponse.host != undefined) {
+                                                        hostObjs = json.listhostsresponse.host;
+                                                        var items = [{
+                                                            id: -1,
+                                                            description: 'Default'
+                                                        }];
+                                                        $(hostObjs).each(function() {
+                                                            items.push({
+                                                                id: this.id,
+                                                                description: this.name
+                                                            });
+                                                        });
+                                                        args.response.success({
+                                                            data: items
+                                                        });
+                                                    } else {
+                                                        cloudStack.dialog.notice({
+                                                            message: _l('No Hosts are avaialble')
+                                                        });
+                                                    }
+                                                }
+                                            });
+                                        } else {
+                                            args.response.success({
+                                                data: null
+                                            });
+                                        }
+                                    }
+                                },
+                            }
+                        },
+                        action: function(args) {
+                            var data = {
+                                id: args.context.instances[0].id
+                            }
+                            if (args.$form.find('.form-item[rel=hostId]').css("display") != "none" && args.data.hostId != -1) {
+                                $.extend(data, {
+                                    hostid: args.data.hostId
+                                });
+                            }
+                            $.ajax({
+                                url: createURL("startVirtualMachine"),
+                                data: data,
+                                dataType: "json",
+                                async: true,
+                                success: function(json) {
+                                    var jid = json.startvirtualmachineresponse.jobid;
+                                    args.response.success({
+                                        _custom: {
+                                            jobId: jid,
+                                            getUpdatedItem: function(json) {
+                                                return json.queryasyncjobresultresponse.jobresult.virtualmachine;
+                                            },
+                                            getActionFilter: function() {
+                                                return vmActionfilter;
+                                            }
+                                        }
+                                    });
+                                }
+                            });
+                        },
+                        messages: {
+                            confirm: function(args) {
+                                return 'message.action.start.instance';
+                            },
+                            notification: function(args) {
+                                return 'label.action.start.instance';
+                            },
+                            complete: function(args) {
+                                if (args.password != null) {
+                                    return 'label.vm.password' + ' ' + args.password;
+                                }
+
+                                return false;
+                            }
+                        },
+                        notification: {
+                            poll: pollAsyncJobResult
+                        }
+                    },
                     stop: {
                         label: 'label.action.stop.instance',
                         compactLabel: 'label.stop',
@@ -2464,7 +2565,10 @@
             allowedActions.push("viewConsole");
         } else if (jsonObj.state == 'Stopped') {
             allowedActions.push("edit");
-            allowedActions.push("start");
+            if (isAdmin())
+                allowedActions.push("startByAdmin");
+            else
+                allowedActions.push("start");
             allowedActions.push("destroy");
             allowedActions.push("reinstall");
 


[2/2] git commit: updated refs/heads/master to d538e43

Posted by re...@apache.org.
Merge pull request #978 from ustcweizhou/startvm-specific-host

CLOUDSTACK-8990: start a stopped machine on a specific determinable host on UI

* pr/978:
  CLOUDSTACK-8990: start a stopped machine on a specific determinable host on UI

Signed-off-by: Remi Bergsma <gi...@remi.nl>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d538e438
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d538e438
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d538e438

Branch: refs/heads/master
Commit: d538e438e77d4514cf452b453dcbc72ebdfe0dc4
Parents: bde75b4 6cced18
Author: Remi Bergsma <gi...@remi.nl>
Authored: Wed Oct 28 11:53:58 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Wed Oct 28 11:53:58 2015 +0100

----------------------------------------------------------------------
 ui/css/cloudstack3.css  |   6 ++-
 ui/scripts/instances.js | 106 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 109 insertions(+), 3 deletions(-)
----------------------------------------------------------------------