From fb05e8ee86d33605efe7903d61b99cf2cd8b4b43 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 15 May 2012 11:45:27 +0200 Subject: [PATCH] Feature #1055: add reset action to sunstone (cherry picked from commit 05e8223d1b70e8eafc473dc091aa1e1681e088e5) --- .../models/OpenNebulaJSON/VirtualMachineJSON.rb | 1 + src/sunstone/public/js/opennebula.js | 3 +++ src/sunstone/public/js/plugins/vms-tab.js | 14 ++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb index c1bb20009e..f8240be10d 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb @@ -60,6 +60,7 @@ module OpenNebulaJSON when "stop" then self.stop when "suspend" then self.suspend when "restart" then self.restart + when "reset" then self.reset when "saveas" then self.save_as(action_hash['params']) when "shutdown" then self.shutdown when "reboot" then self.reboot diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index a69f0e9809..1b26612c1c 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -615,6 +615,9 @@ var OpenNebula = { "reboot" : function(params){ OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"reboot"); }, + "reset" : function(params){ + OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"reset"); + }, "log": function(params){ OpenNebula.Action.show(params,OpenNebula.VM.resource,"log"); diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 3f621dbe2f..784b5be34f 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -301,6 +301,15 @@ var vm_actions = { notify: true }, + "VM.reset" : { + type: "multiple", + call: OpenNebula.VM.reset, + callback: vmShow, + elements: vmElements, + error: onError, + notify: true + }, + "VM.resubmit" : { type: "multiple", call: OpenNebula.VM.resubmit, @@ -569,6 +578,11 @@ var vm_buttons = { text: tr("Reboot"), tip: tr("This will send a reboot action to running VMs") }, + "VM.reset" : { + type: "confirm", + text: tr("Reset"), + tip: tr("This will perform a hard reboot on selected VMs") + }, "VM.saveasmultiple" : { type: "action", text: tr("Save as")