cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to afcf6d0
Date Thu, 10 Apr 2014 20:58:23 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 11f5bdd78 -> afcf6d041


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/afcf6d04
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/afcf6d04
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/afcf6d04

Branch: refs/heads/master
Commit: afcf6d041d9ee5ae0d6c266b7b83d6d52de58884
Parents: 11f5bdd
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu Apr 10 13:56:43 2014 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu Apr 10 13:58:10 2014 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf6d04/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");
         }
         


Mime
View raw message