From ff4b55fff8b93d5e56acad2b1b059bd8ee55cbf4 Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Wed, 17 Apr 2013 21:06:38 +0800 Subject: [PATCH] Fix CLOUDSTACK-1852 showing disconnected host as suitable target during system vms migration --- ui/scripts/system.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index dbe177a9e23..73bf3fd4160 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -2410,15 +2410,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -2986,15 +2984,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -5272,15 +5268,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.systemVMs[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -6011,15 +6005,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -6473,15 +6465,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.systemVMs[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); }