CLOUDSTACK-1974: cloudstack UI - Infrastructure menu - zone detail - public traffic type - IP Ranges tab - add action filter.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/56a1facb Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/56a1facb Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/56a1facb Branch: refs/heads/internallb Commit: 56a1facb9d6fedb867c712a1b3992ca182199ec6 Parents: 5516a5a Author: Jessica Wang <jessica.w...@citrix.com> Authored: Tue Apr 9 17:15:55 2013 -0700 Committer: Alena Prokharchyk <alena.prokharc...@citrix.com> Committed: Wed Apr 10 15:43:36 2013 -0700 ---------------------------------------------------------------------- ui/scripts/system.js | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/56a1facb/ui/scripts/system.js ---------------------------------------------------------------------- diff --git a/ui/scripts/system.js b/ui/scripts/system.js index d89f6b6..f74711d 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -565,6 +565,14 @@ }); } }, + actionPreFilter: function(args) { + var actionsToShow = ['destroy']; + if(args.context.multiRule[0].domain == 'ROOT' && args.context.multiRule[0].account.account == 'system') + actionsToShow.push('addAccount'); + else + actionsToShow.push('releaseFromAccount'); + return actionsToShow; + }, actions: { destroy: { label: 'label.remove.ip.range', @@ -588,7 +596,7 @@ } }); } - }, + }, /* releaseFromAccount: { label: 'Release from Account', @@ -643,7 +651,10 @@ }, action: function(args) { var data = { - id: args.context.multiRule[0].id + id: args.context.multiRule[0].id, + zoneid: args.context.multiRule[0].zoneid, + domainid: args.data.domainid, + account: args.data.account }; $.ajax({ url: createURL('dedicatePublicIpRange'), @@ -663,8 +674,8 @@ } }); } - } - */ + } + */ }, dataProvider: function(args) { $.ajax({