From 696f3f5fcb292495c63018060e7bb8dfb9be31f7 Mon Sep 17 00:00:00 2001 From: will Date: Mon, 11 Oct 2010 18:16:33 -0700 Subject: [PATCH] VMs in Error, Destroyed, or Creating state are no longer selectable as a VM during the application of a port forwarding rule in the UI. --- ui/scripts/cloud.core.network.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ui/scripts/cloud.core.network.js b/ui/scripts/cloud.core.network.js index e8c33f91057..7c5f27663ec 100644 --- a/ui/scripts/cloud.core.network.js +++ b/ui/scripts/cloud.core.network.js @@ -384,8 +384,10 @@ function showNetworkingTab(p_domainId, p_account) { var vmSelect = createPortForwardingRow.find("#vm").empty(); if (instances != null && instances.length > 0) { for (var i = 0; i < instances.length; i++) { - var html = $(""); - vmSelect.append(html); + if (instances[i].state != 'Destroyed' && instances[i].state != 'Error' && instances[i].state != 'Creating') { + var html = $(""); + vmSelect.append(html); + } } } } @@ -418,9 +420,11 @@ function showNetworkingTab(p_domainId, p_account) { var instances = json.listvirtualmachinesresponse.virtualmachine; var vmSelect = template.find("#row_container_edit #vm").empty(); if (instances != null && instances.length > 0) { - for (var i = 0; i < instances.length; i++) { - var html = $(""); - vmSelect.append(html); + for (var i = 0; i < instances.length; i++) { + if (instances[i].state != 'Destroyed' && instances[i].state != 'Error' && instances[i].state != 'Creating') { + var html = $(""); + vmSelect.append(html); + } } vmSelect.val(virtualMachineId); }