bug 14525: cloudstack 3.0 UI - Instance page - attach ISO action - populate ISO dropdown by 3 listISOs API call with 3 different isofilter parameter.

This commit is contained in:
Jessica Wang 2012-03-28 15:42:29 -07:00
parent c5d3e63708
commit 4a742c73a7
1 changed files with 37 additions and 6 deletions

View File

@ -1029,19 +1029,50 @@
iso: {
label: 'ISO',
select: function(args) {
var items = [];//???
var map = {};
$.ajax({
url: createURL("listIsos&isReady=true&isofilter=executable"),
url: createURL("listIsos&isReady=true&isofilter=featured"),
dataType: "json",
async: true,
async: false,
success: function(json) {
var isos = json.listisosresponse.iso;
var items = [];
var isos = json.listisosresponse.iso;
$(isos).each(function() {
items.push({id: this.id, description: this.displaytext});
});
args.response.success({data: items});
map[this.id] = 1;
});
}
});
$.ajax({
url: createURL("listIsos&isReady=true&isofilter=community"),
dataType: "json",
async: false,
success: function(json) {
var isos = json.listisosresponse.iso;
$(isos).each(function() {
if(!(this.id in map)) {
items.push({id: this.id, description: this.displaytext});
map[this.id] = 1;
}
});
}
});
$.ajax({
url: createURL("listIsos&isReady=true&isofilter=selfexecutable"),
dataType: "json",
async: false,
success: function(json) {
var isos = json.listisosresponse.iso;
$(isos).each(function() {
if(!(this.id in map)) {
items.push({id: this.id, description: this.displaytext});
map[this.id] = 1;
}
});
}
});
args.response.success({data: items});
}
}
}