From 11f3209c9f95b78ae19f7ef9a5fdbdea9ed5d151 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 30 Mar 2011 13:30:02 +0200 Subject: [PATCH] Feature #507: Added notification of actions where it proceeds. --- src/sunstone/public/js/plugins/hosts-tab.js | 22 +++++++---- src/sunstone/public/js/plugins/images-tab.js | 28 +++++++++----- src/sunstone/public/js/plugins/users-tab.js | 6 ++- src/sunstone/public/js/plugins/vms-tab.js | 40 +++++++++++++------- src/sunstone/public/js/plugins/vnets-tab.js | 12 ++++-- 5 files changed, 72 insertions(+), 36 deletions(-) diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index fbabbf1c29..08a10c6bae 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -110,7 +110,8 @@ var host_actions = { type: "create", call : OpenNebula.Host.create, callback : addHostElement, - error : onError + error : onError, + notify: true }, "Host.create_dialog" : { @@ -149,6 +150,7 @@ var host_actions = { }, callback: function(){}, error: onError, + notify:true }, "Host.autorefresh" : { @@ -176,7 +178,8 @@ var host_actions = { Sunstone.runAction("Host.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_hosts); }, - error : onError + error : onError, + notify:true }, "Host.delete" : { @@ -184,7 +187,8 @@ var host_actions = { call : OpenNebula.Host.delete, callback : deleteHostElement, elements: function() { return getSelectedNodes(dataTable_hosts); }, - error : onError + error : onError, + notify:true }, "Host.list" : { @@ -203,7 +207,8 @@ var host_actions = { callback : function(){ Sunstone.runAction("Cluster.list"); }, - error : onError + error : onError, + notify: true }, "Cluster.create_dialog" : { @@ -232,7 +237,8 @@ var host_actions = { //OpenNebula.Cluster.list({success: updateClustersView, error: onError}); Sunstone.runAction("Cluster.list"); }, - error : onError + error : onError, + notify:true }, "Cluster.addhost" : { @@ -242,14 +248,16 @@ var host_actions = { Sunstone.runAction("Host.show",req.request.data); }, elements: function() { return getSelectedNodes(dataTable_hosts); }, - error : onError + error : onError, + notify:true }, "Cluster.removehost" : { type: "multiple", call : OpenNebula.Cluster.removehost, callback : deleteHostElement, - error : onError + error : onError, + notify:true } }; diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 271905e73e..f53f89ad70 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -164,7 +164,8 @@ var image_actions = { type: "create", call: OpenNebula.Image.register, callback: addImageElement, - error: onError + error: onError, + notify:true }, "Image.create_dialog" : { @@ -228,7 +229,8 @@ var image_actions = { Sunstone.runAction("Image.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_images); }, - error: onError + error: onError, + notify: true }, "Image.addattr_dialog" : { @@ -260,6 +262,7 @@ var image_actions = { }, elements: function() { return getSelectedNodes(dataTable_images); }, error: onError, + notify: true }, "Image.rmattr_dialog" : { @@ -274,7 +277,8 @@ var image_actions = { Sunstone.runAction("Image.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_images); }, - error: onError + error: onError, + notify: true }, "Image.disable" : { @@ -284,7 +288,8 @@ var image_actions = { Sunstone.runAction("Image.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_images); }, - error: onError + error: onError, + notify: true }, "Image.persistent" : { @@ -294,7 +299,8 @@ var image_actions = { Sunstone.runAction("Image.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_images); }, - error: onError + error: onError, + notify: true }, "Image.nonpersistent" : { @@ -304,7 +310,8 @@ var image_actions = { Sunstone.runAction("Image.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_images); }, - error: onError + error: onError, + notify: true }, "Image.publish" : { @@ -314,7 +321,8 @@ var image_actions = { Sunstone.runAction("Image.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_images); }, - error: onError + error: onError, + notify: true }, "Image.unpublish" : { @@ -324,7 +332,8 @@ var image_actions = { Sunstone.runAction("Image.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_images); }, - error: onError + error: onError, + notify: true }, "Image.delete" : { @@ -334,7 +343,8 @@ var image_actions = { Sunstone.runAction("Image.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_images); }, - error: onError + error: onError, + notify: true } } diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index 85da5966e4..9e0ff4cfb3 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -59,7 +59,8 @@ var user_actions = { type: "create", call: OpenNebula.User.create, callback: addUserElement, - error: onError + error: onError, + notify: true }, "User.create_dialog" : { @@ -96,7 +97,8 @@ var user_actions = { call: OpenNebula.User.delete, callback: deleteUserElement, elements: function() { return getSelectedNodes(dataTable_users); }, - error: onError + error: onError, + notify: true }, } diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 6473e238f1..63edfb5b5e 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -502,7 +502,8 @@ var vm_actions = { type: "create", call: OpenNebula.VM.create, callback: addVMachineElement, - error: onError + error: onError, + notify: true }, "VM.create_dialog" : { @@ -554,6 +555,7 @@ var vm_actions = { }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, error: onError, + notify: true }, "VM.migrate" : { @@ -563,7 +565,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.livemigrate" : { @@ -573,7 +576,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.hold" : { @@ -583,7 +587,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.release" : { @@ -593,7 +598,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.suspend" : { @@ -603,7 +609,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.resume" : { @@ -613,7 +620,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.stop" : { @@ -623,7 +631,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.restart" : { @@ -633,7 +642,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.shutdown" : { @@ -643,7 +653,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.cancel" : { @@ -653,7 +664,8 @@ var vm_actions = { Sunstone.runAction("VM.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.delete" : { @@ -661,7 +673,8 @@ var vm_actions = { call: OpenNebula.VM.delete, callback: deleteVMachineElement, elements: function() { return getSelectedNodes(dataTable_vMachines); }, - error: onError + error: onError, + notify: true }, "VM.log" : { @@ -669,8 +682,7 @@ var vm_actions = { call: OpenNebula.VM.log, callback: function(req,res) { //after calling VM.log we process the answer - //update the tab and pop it up again with the updated - //info and the log tab selected + //update the tab and pop it up again var log_lines = res.split("\n"); var colored_log = ''; for (line in log_lines){ diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index d6036b34d5..af745dc48f 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -131,7 +131,8 @@ var vnet_actions = { type: "create", call: OpenNebula.Network.create, callback: addVNetworkElement, - error: onError + error: onError, + notify: true }, "Network.create_dialog" : { @@ -183,7 +184,8 @@ var vnet_actions = { Sunstone.runAction("Network.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vNetworks); }, - error: onError + error: onError, + notify: true }, "Network.unpublish" : { @@ -193,7 +195,8 @@ var vnet_actions = { Sunstone.runAction("Network.show",req.request.data[0]); }, elements: function() { return getSelectedNodes(dataTable_vNetworks); }, - error: onError + error: onError, + notify: true }, "Network.delete" : { @@ -201,7 +204,8 @@ var vnet_actions = { call: OpenNebula.Network.delete, callback: deleteVNetworkElement, elements: function() { return getSelectedNodes(dataTable_vNetworks); }, - error: onError + error: onError, + notify: true } }