From 152e58c444e0304337bb3022d4cecd9cf733954a Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 23 Feb 2012 14:42:29 -0800 Subject: [PATCH] Fix destroy system VM action --- ui/scripts/system.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index d8480039efc..958aeda9134 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -3446,7 +3446,8 @@ indicator: { 'Running': 'on', 'Stopped': 'off', - 'Error': 'off' + 'Error': 'off', + 'Destroyed': 'off' } } }, @@ -3589,7 +3590,7 @@ } }, - 'delete': { + destroy: { label: 'label.action.destroy.systemvm', messages: { confirm: function(args) { @@ -3608,13 +3609,10 @@ var jid = json.destroysystemvmresponse.jobid; args.response.success({ _custom: { - jobId: jid, - getUpdatedItem: function(json) { - //return {}; //nothing in this systemVM needs to be updated, in fact, this whole systemVM has being destroyed + getUpdatedItem: function() { + return { state: 'Destroyed' }; }, - getActionFilter: function() { - return systemvmActionfilter; - } + jobId: jid } }); } @@ -7307,17 +7305,17 @@ if (jsonObj.state == 'Running') { allowedActions.push("stop"); allowedActions.push("restart"); - allowedActions.push("delete"); //destroy + allowedActions.push("destroy"); //destroy allowedActions.push("viewConsole"); if (isAdmin()) allowedActions.push("migrate"); } else if (jsonObj.state == 'Stopped') { allowedActions.push("start"); - allowedActions.push("delete"); //destroy + allowedActions.push("destroy"); //destroy } else if (jsonObj.state == 'Error') { - allowedActions.push("delete"); //destroy + allowedActions.push("destroy"); //destroy } return allowedActions; }