From bf72a36ea809ec0f9b354bf6a72dd2a09e1fcf6f Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 8 Apr 2013 14:39:18 -0700 Subject: [PATCH] CLOUDSTACK-1974: cloudstack UI - Infrastructure menu - zone detail - public traffic type - IP Ranges tab - add new action "Release from account", "Add Account" for existing IP Ranges. --- ui/scripts/system.js | 78 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 8d08584dc60..d89f6b69dcd 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -588,7 +588,83 @@ } }); } - } + }, + /* + releaseFromAccount: { + label: 'Release from Account', + action: function(args) { + $.ajax({ + url: createURL('releasePublicIpRange'), + data: { + id: args.context.multiRule[0].id + }, + success: function(json) { + args.response.success({ + notification: { + label: 'release from account', + poll: function(args) { + args.complete(); + } + } + }); + }, + error: function(json) { + args.response.error(parseXMLHttpResponse(json)); + } + }); + } + }, + addAccount: { + label: 'Add Account', + createForm: { + title: 'Add Account', + fields: { + account: { label: 'Account' }, + domainid: { + label: 'Domain', + select: function(args) { + $.ajax({ + url: createURL('listDomains'), + data: { listAll: true }, + success: function(json) { + args.response.success({ + data: $.map(json.listdomainsresponse.domain, function(domain) { + return { + id: domain.id, + description: domain.path + }; + }) + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.multiRule[0].id + }; + $.ajax({ + url: createURL('dedicatePublicIpRange'), + data: data, + success: function(json) { + args.response.success({ + notification: { + label: 'Add Account', + poll: function(args) { + args.complete(); + } + } + }); + }, + error: function(json) { + args.response.error(parseXMLHttpResponse(json)); + } + }); + } + } + */ }, dataProvider: function(args) { $.ajax({