mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 04:36:48 +00:00
fix: serve compute JSON endpoints as application/json, build chipset list safely
compute_graph (text/javascript) and the machine type, disk bus, video model and domain capability views (text/html) return JSON; send it as application/json. create_instance_w1.html builds the chipset <option> elements with .val().text() instead of string concatenation.
This commit is contained in:
parent
d250915e17
commit
e76149c71a
3 changed files with 26 additions and 14 deletions
|
|
@ -106,12 +106,9 @@
|
|||
$("#select_chipset").find('option').remove();
|
||||
$("#select_archs").val(arch);
|
||||
$.each(data['machines'], function(i, item) {
|
||||
if (item == '{{ default_machine }}') {
|
||||
var selected = 'selected';
|
||||
}else{
|
||||
var selected = '';
|
||||
}
|
||||
$("#select_chipset").append('<option value="' + item + '"' + selected +'>' + item + '</option>');
|
||||
$("#select_chipset").append(
|
||||
$("<option>").val(item).text(item).prop("selected", item == '{{ default_machine }}')
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue