|
88 | 88 | url: createURL("listZones&available=true"), |
89 | 89 | dataType: "json", |
90 | 90 | async: true, |
91 | | - success: function(json) { |
92 | | - var items = json.listzonesresponse.zone; |
93 | | - args.response.success({descriptionField: 'name', data: items}); |
| 91 | + success: function(json) { |
| 92 | + var zoneObjs; |
| 93 | + if(args.context.zoneType == null || args.context.zoneType == '') { //all types |
| 94 | + zoneObjs = json.listzonesresponse.zone; |
| 95 | + } |
| 96 | + else { //Basic type or Advanced type |
| 97 | + zoneObjs = []; |
| 98 | + var items = json.listzonesresponse.zone; |
| 99 | + if(items != null) { |
| 100 | + for(var i = 0; i < items.length; i++) { |
| 101 | + if(items[i].networktype == args.context.zoneType) |
| 102 | + zoneObjs.push(items[i]); |
| 103 | + } |
| 104 | + } |
| 105 | + } |
| 106 | + args.response.success({descriptionField: 'name', data: zoneObjs}); |
94 | 107 | } |
95 | 108 | }); |
96 | 109 | } |
|
208 | 221 | availabilityZone: { |
209 | 222 | label: 'label.availability.zone', |
210 | 223 | docID: 'helpUploadVolumeZone', |
211 | | - select: function(args) { |
212 | | - $.ajax({ |
| 224 | + select: function(args) { |
| 225 | + $.ajax({ |
213 | 226 | url: createURL("listZones&available=true"), |
214 | 227 | dataType: "json", |
215 | 228 | async: true, |
216 | | - success: function(json) { |
217 | | - var items = json.listzonesresponse.zone; |
218 | | - args.response.success({descriptionField: 'name', data: items}); |
| 229 | + success: function(json) { |
| 230 | + var zoneObjs; |
| 231 | + if(args.context.zoneType == null || args.context.zoneType == '') { //all types |
| 232 | + zoneObjs = json.listzonesresponse.zone; |
| 233 | + } |
| 234 | + else { //Basic type or Advanced type |
| 235 | + zoneObjs = []; |
| 236 | + var items = json.listzonesresponse.zone; |
| 237 | + if(items != null) { |
| 238 | + for(var i = 0; i < items.length; i++) { |
| 239 | + if(items[i].networktype == args.context.zoneType) |
| 240 | + zoneObjs.push(items[i]); |
| 241 | + } |
| 242 | + } |
| 243 | + } |
| 244 | + args.response.success({descriptionField: 'name', data: zoneObjs}); |
219 | 245 | } |
220 | | - }); |
| 246 | + }); |
221 | 247 | } |
222 | 248 | }, |
223 | 249 | format: { |
|
0 commit comments