From fa824b00ade01db1ae5ee7ccb981f611f5301bcc Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 15 May 2012 12:46:08 +0200 Subject: [PATCH] Feature #1055: Add reboot and reset to self-service (cherry picked from commit 150db00efffa0c20c5df29d18fa16c92a90b022f) --- src/cloud/occi/lib/ui/public/js/occi.js | 8 ++++++ .../occi/lib/ui/public/js/plugins/compute.js | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/cloud/occi/lib/ui/public/js/occi.js b/src/cloud/occi/lib/ui/public/js/occi.js index 829dff782c..7bb36ee7bf 100644 --- a/src/cloud/occi/lib/ui/public/js/occi.js +++ b/src/cloud/occi/lib/ui/public/js/occi.js @@ -415,6 +415,14 @@ var OCCI = { params.data.body = { state : "STOPPED" }; OCCI.Action.update(params,OCCI.VM.resource,"stop"); }, + "reboot": function(params){ + params.data.body = { state : "REBOOT" }; + OCCI.Action.update(params,OCCI.VM.resource,"reboot"); + }, + "reset": function(params){ + params.data.body = { state : "RESET" }; + OCCI.Action.update(params,OCCI.VM.resource,"reset"); + }, "cancel": function(params){ params.data.body = { state : "CANCEL" }; OCCI.Action.update(params,OCCI.VM.resource,"cancel"); diff --git a/src/cloud/occi/lib/ui/public/js/plugins/compute.js b/src/cloud/occi/lib/ui/public/js/plugins/compute.js index dabafb3edc..13084dec10 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/compute.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/compute.js @@ -214,6 +214,24 @@ var vm_actions = { notify: true }, + "VM.reboot" : { + type: "multiple", + call: OCCI.VM.reboot, + callback: updateVMachineElement, + elements: vmElements, + error: onError, + notify: true + }, + + "VM.reset" : { + type: "multiple", + call: OCCI.VM.reset, + callback: updateVMachineElement, + elements: vmElements, + error: onError, + notify: true + }, + "VM.cancel" : { type: "multiple", call: OCCI.VM.cancel, @@ -336,6 +354,16 @@ var vm_buttons = { text: tr("Stop"), tip: "This will stop selected VMs" }, + "VM.reboot" : { + type: "confirm", + text: tr("Reboot"), + tip: "This will reboot [via acpi] selected VMs" + }, + "VM.reset" : { + type: "confirm", + text: tr("Reset"), + tip: "This will perform a hard reset on selected VMs" + }, "VM.cancel" : { type: "confirm", text: tr("Cancel"),