From 7af448791f20670017edfa0065dedac3c26649f6 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 10 Feb 2014 13:19:13 +0100 Subject: [PATCH] feature #1589: Show the ID for new resources --- src/sunstone/public/js/plugins/clusters-tab.js | 4 ++-- src/sunstone/public/js/plugins/datastores-tab.js | 8 +++++--- src/sunstone/public/js/plugins/files-tab.js | 8 +++++--- src/sunstone/public/js/plugins/groups-tab.js | 8 +++++--- src/sunstone/public/js/plugins/hosts-tab.js | 8 +++++--- src/sunstone/public/js/plugins/images-tab.js | 2 +- src/sunstone/public/js/plugins/oneflow-templates.js | 4 ++-- src/sunstone/public/js/plugins/templates-tab.js | 2 +- src/sunstone/public/js/plugins/users-tab.js | 8 +++++--- src/sunstone/public/js/plugins/vnets-tab.js | 8 +++++--- 10 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index ac2db346dd..3bedb5a61b 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -942,9 +942,9 @@ var cluster_actions = { //Sunstone.runAction('Cluster.list'); // Sunstone.runAction('Cluster.show',response.CLUSTER.ID); + notifyCustom(tr("Cluster created"), " ID: " + response.CLUSTER.ID, false); }, - error: onError, - notify: true + error: onError }, "Cluster.create_dialog" : { diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 71e207810f..77027df9ea 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -386,9 +386,11 @@ var datastore_actions = { "Datastore.create" : { type: "create", call : OpenNebula.Datastore.create, - callback : addDatastoreElement, - error : onError, - notify: true + callback : function(request, response) { + addDatastoreElement(request, response); + notifyCustom(tr("Datastore created"), " ID: " + response.DATASTORE.ID, false); + }, + error : onError }, "Datastore.create_dialog" : { diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js index 58d01b7b47..b5af1e0ce8 100644 --- a/src/sunstone/public/js/plugins/files-tab.js +++ b/src/sunstone/public/js/plugins/files-tab.js @@ -212,9 +212,11 @@ var file_actions = { "File.create" : { type: "create", call: OpenNebula.Image.create, - callback: addFileElement, - error: onError, - notify:true + callback: function(request, response) { + addFileElement(request, response); + notifyCustom(tr("File created"), " ID: " + response.IMAGE.ID, false); + }, + error: onError }, "File.create_dialog" : { diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index 3c1076cd88..eb32455a46 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -292,9 +292,11 @@ var group_actions = { "Group.create" : { type: "create", call : OpenNebula.Group.create, - callback : addGroupElement, - error : onError, - notify: true + callback : function(request, response) { + addGroupElement(request, response); + notifyCustom(tr("Group created"), " ID: " + response.GROUP.ID, false); + }, + error : onError }, "Group.create_dialog" : { diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index dbd14d552f..4762d0c68e 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -199,9 +199,11 @@ var host_actions = { "Host.create" : { type: "create", call : OpenNebula.Host.create, - callback : addHostElement, - error : onError, - notify: true + callback : function(request, response) { + addHostElement(request, response); + notifyCustom(tr("Host created"), " ID: " + response.HOST.ID, false); + }, + error : onError }, "Host.create_dialog" : { diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 281a8acded..ee87c36cb6 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -349,7 +349,7 @@ var image_actions = { callback: function(request, response){ addImageElement(request, response); $create_image_dialog.trigger("reveal:close") - notifyCustom(tr("Image created "), "ID: " + response.IMAGE.ID, false) + notifyCustom(tr("Image created"), " ID: " + response.IMAGE.ID, false) }, error: onError }, diff --git a/src/sunstone/public/js/plugins/oneflow-templates.js b/src/sunstone/public/js/plugins/oneflow-templates.js index b9a07f8261..8198406722 100644 --- a/src/sunstone/public/js/plugins/oneflow-templates.js +++ b/src/sunstone/public/js/plugins/oneflow-templates.js @@ -432,9 +432,9 @@ var service_template_actions = { $('table#current_roles tbody', dialog).empty(); $('select[name="parents"]', dialog).empty(); addServiceTemplateElement(req, res); + notifyCustom(tr("Service Template created"), " ID: " + req.DOCUMENT.ID, false); }, - error: onError, - notify:true + error: onError }, "ServiceTemplate.create_dialog" : { diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 78e1a0b82d..6439db2562 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -315,7 +315,7 @@ var template_actions = { $create_template_dialog.trigger("reveal:close") $create_template_dialog.empty(); addTemplateElement(request, response); - notifyCustom(tr("Template created "), "ID: " + response.VMTEMPLATE.ID, false) + notifyCustom(tr("Template created"), " ID: " + response.VMTEMPLATE.ID, false) }, error: onError }, diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index b99ac2f941..6a5bc79c1f 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -389,9 +389,11 @@ var user_actions = { "User.create" : { type: "create", call: OpenNebula.User.create, - callback: addUserElement, - error: onError, - notify: true + callback: function(request, response) { + addUserElement(request, response); + notifyCustom(tr("User created"), " ID: " + response.USER.ID, false); + }, + error: onError }, "User.create_dialog" : { diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index 1057715a84..0b0ca11acc 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -481,9 +481,11 @@ var vnet_actions = { "Network.create" : { type: "create", call: OpenNebula.Network.create, - callback: addVNetworkElement, - error: onError, - notify: true + callback: function(request, response) { + addVNetworkElement(request, response); + notifyCustom(tr("Virtual Network created"), " ID: " + response.VNET.ID, false); + }, + error: onError }, "Network.create_dialog" : {