From dd3757af949fac2f0723c972a7bac190a4b62dda Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 9 Nov 2011 10:24:19 -0800 Subject: [PATCH] cloudStack 3.0 new UI - service offering page - implement Delete action. --- ui/scripts/configuration.js | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 5f1de82390a..cf7d9f243bd 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -205,8 +205,42 @@ } }); } + }, + + 'delete': { + label: 'Delete service offering', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete this service offering?'; + }, + success: function(args) { + return 'Service offering is being deleted.'; + }, + notification: function(args) { + return 'Deleting service offering'; + }, + complete: function(args) { + return 'Service offering has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteServiceOffering&id=" + args.context.serviceOfferings[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success(); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } } - }, + }, + tabs: { details: { title: 'Details',