From e157c76ccfac418a64e5a169a4ce13cc419e0fa3 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Fri, 25 May 2012 10:59:56 -0700 Subject: [PATCH] CS-13091: Remove enable/disable physical network actions Due to limitations in the API, for now the enable/disable functionality for physical networks will be removed. reviewed-by: jessica --- ui/scripts/system.js | 84 +++----------------------------------------- 1 file changed, 4 insertions(+), 80 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index a60cb29c10f..18ed9a9e26a 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -1827,81 +1827,7 @@ notification: { poll: pollAsyncJobResult } - }, - enable: { - label: 'label.action.enable.physical.network', - messages: { - confirm: function(args) { - return 'message.action.enable.physical.network'; - }, - notification: function(args) { - return 'label.action.enable.physical.network'; - } - }, - action: function(args) { - $.ajax({ - url: createURL('updatePhysicalNetwork'), - data: { - id: args.context.physicalNetworks[0].id, - state: 'Enabled' - }, - success: function(json) { - args.response.success({ - _custom: { - jobId: json.updatephysicalnetworkresponse.jobid, - getUpdatedItem: function(json) { - return { - state: 'Enabled' - }; - }, - getActionFilter: function() { - return cloudStack.actionFilter.physicalNetwork; - } - } - }); - }, - error: function(json) { args.response.error(parseXMLHttpResponse(json)); } - }); - }, - notification: { poll: pollAsyncJobResult } - }, - disable: { - label: 'label.action.disable.physical.network', - messages: { - confirm: function(args) { - return 'message.action.disable.physical.network'; - }, - notification: function(args) { - return 'label.action.disable.physical.network'; - } - }, - action: function(args) { - $.ajax({ - url: createURL('updatePhysicalNetwork'), - data: { - id: args.context.physicalNetworks[0].id, - state: 'Disabled' - }, - success: function(json) { - args.response.success({ - _custom: { - jobId: json.updatephysicalnetworkresponse.jobid, - getUpdatedItem: function(json) { - return { - state: 'Disabled' - }; - }, - getActionFilter: function() { - return cloudStack.actionFilter.physicalNetwork; - } - } - }); - }, - error: function(json) { args.response.error(parseXMLHttpResponse(json)); } - }); - }, - notification: { poll: pollAsyncJobResult } - } + } } }, dataProvider: function(args) { @@ -9315,12 +9241,10 @@ cloudStack.actionFilter.physicalNetwork = function(args) { var state = args.context.item.state; - if (state == 'Enabled') { - return ['disable', 'remove']; - } else if (state == 'Disabled') { - return ['enable', 'remove']; + if (state != 'Destroyed') { + return ['remove']; } - + return []; }; })($, cloudStack);