You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2012/12/05 22:06:19 UTC
git commit: CLOUDSTACK-588:restoreVirtualMachine api functionality on
the UI while the VMs are in running or stopped state
Updated Branches:
refs/heads/master 40682fc43 -> 30dd34d25
CLOUDSTACK-588:restoreVirtualMachine api functionality on the UI while the VMs are in running or stopped state
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/30dd34d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/30dd34d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/30dd34d2
Branch: refs/heads/master
Commit: 30dd34d258051838f6ee2aca42be1070f910954d
Parents: 40682fc
Author: Pranav Saxena <pr...@citrix.com>
Authored: Thu Dec 6 02:35:49 2012 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu Dec 6 02:35:49 2012 +0530
----------------------------------------------------------------------
ui/css/cloudstack3.css | 9 +++++++++
ui/scripts/instances.js | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/30dd34d2/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index 1f862b0..f233095 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -11210,11 +11210,20 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
background-position: -168px -31px;
}
+.reset .icon{
+background-position: -168px -31px;
+}
+
.restoreVM:hover .icon,
.restore:hover .icon {
background-position: -168px -613px;
}
+
+.reset:hover .icon {
+ background-position: -168px -613px;
+}
+
.enableVPN .icon {
background-position: -198px -3px;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/30dd34d2/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index dc4768b..5b5ed18 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -475,6 +475,39 @@
}
},
+ reset: {
+ label: 'Reset VM',
+ messages:{
+ confirm:function(args) {
+ return 'Do you want to restore the VM ?';
+ },
+ notification:function(args) {
+ return 'Reset VM';
+ }
+ },
+
+ action:function(args){
+ $.ajax({
+ url: createURL("restoreVirtualMachine&virtualmachineid=" + args.context.instances[0].id),
+ dataType: "json",
+ async: true,
+ success: function(json) {
+ var item = json.restorevmresponse;
+ args.response.success({data:item});
+ }
+ });
+
+ },
+
+ notification: {
+ poll: function(args) {
+ args.complete({ data: { state: 'Stopped' }});
+ }
+ }
+
+ },
+
+
edit: {
label: 'label.edit',
action: function(args) {
@@ -1201,6 +1234,7 @@
allowedActions.push("restart");
allowedActions.push("destroy");
allowedActions.push("changeService");
+ allowedActions.push("reset");
if (isAdmin())
allowedActions.push("migrate");
@@ -1222,6 +1256,7 @@
allowedActions.push("edit");
allowedActions.push("start");
allowedActions.push("destroy");
+ allowedActions.push("reset");
if(isAdmin())
allowedActions.push("migrateToAnotherStorage");