From 48e949dd7f23350a82a868b43ecdfa6ef0c4b374 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 16 Apr 2012 17:22:17 -0700 Subject: [PATCH] cloudstack 3.0 UI - add zone wizard - hypervisor dropdown - make XenServer as default option. --- ui/scripts/zoneWizard.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 3d31261b77c..a8a341e58ab 100644 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -328,17 +328,19 @@ $.ajax({ url: createURL('listHypervisors'), data: { listAll: true }, - success: function(json) { + success: function(json) { + var items = json.listhypervisorsresponse.hypervisor; + var array1 = []; + if(items != null) { + for(var i = 0; i < items.length; i++) { + if(items[i].name == "XenServer") + array1.unshift({id: items[i].name, description: items[i].name}); + else + array1.push({id: items[i].name, description: items[i].name}); + } + } args.response.success({ - data: $.map( - json.listhypervisorsresponse.hypervisor, - function(hypervisor) { - return { - id: hypervisor.name, - description: hypervisor.name - }; - } - ) + data: array1 }); } });