CS-15883: cloudstack 3.0 UI - VPC - VM Wizard - step 1 - zone dropdown - populate only one zone, the one that the VPC is under.

This commit is contained in:
Jessica Wang 2012-08-09 17:07:09 -07:00
parent 143a0223e7
commit f2a927b9fa
1 changed files with 22 additions and 21 deletions

View File

@ -29,28 +29,29 @@
// Data providers for each wizard step
steps: [
// Step 1: Setup
function(args) {
$.ajax({
url: createURL("listZones&available=true"),
dataType: "json",
async: false,
success: function(json) {
zoneObjs = json.listzonesresponse.zone;
var items;
if(args.initArgs.pluginForm != null && args.initArgs.pluginForm.name == "vpcTierInstanceWizard") { //from VPC Tier chart
items = $.grep(zoneObjs, function(zoneObj) {
return zoneObj.networktype == 'Advanced';
});
// Step 1: Setup
function(args) {
if(args.initArgs.pluginForm != null && args.initArgs.pluginForm.name == "vpcTierInstanceWizard") { //from VPC Tier chart
//populate only one zone to the dropdown, the zone which the VPC is under.
zoneObjs = [{
id: args.context.vpc[0].zoneid,
name: args.context.vpc[0].zonename,
networktype: 'Advanced'
}];
args.response.success({ data: {zones: zoneObjs}});
}
else { //from Instance page
$.ajax({
url: createURL("listZones&available=true"),
dataType: "json",
async: false,
success: function(json) {
zoneObjs = json.listzonesresponse.zone;
args.response.success({ data: {zones: zoneObjs}});
}
else { //from Instance page
items = zoneObjs;
}
args.response.success({ data: {zones: items}});
}
});
});
}
},
// Step 2: Select template