1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #2812: Add hypervisor attr to the update form

This commit is contained in:
Daniel Molina 2014-08-26 12:14:10 +02:00
parent e010cf6255
commit db72f7a37f

View File

@ -494,14 +494,18 @@ function updateTemplatesView(request, templates_list){
function generate_capacity_tab_content() {
var html =
'<div class="row vm_param">'+
'<div class="row">'+
'<div class="large-6 columns">'+
'<label>'+tr("Hypervisor")+'</label>'+
'<input type="radio" name="hypervisor" value="only_kvm" id="kvmRadio"><label for="kvmRadio">'+tr("KVM")+'</label>'+
'<input type="radio" name="hypervisor" value="only_vmware" id="vmwareRadio"><label for="vmwareRadio">'+tr("VMware")+'</label>'+
'<input type="radio" name="hypervisor" value="only_xen" id="xenRadio"><label for="xenRadio">'+tr("Xen")+'</label>'+
'<input type="radio" name="hypervisor" value="kvm" id="kvmRadio"><label for="kvmRadio">'+tr("KVM")+'</label>'+
'<input type="radio" name="hypervisor" value="vmware" id="vmwareRadio"><label for="vmwareRadio">'+tr("VMware")+'</label>'+
'<input type="radio" name="hypervisor" value="xen" id="xenRadio"><label for="xenRadio">'+tr("Xen")+'</label>'+
'</div>'+
'<div class="large-6 columns">'+
'<label>'+tr("Hybrid Cloud")+'</label>'+
'<input type="checkbox" name="hybrid" value="amazonRadio" id="amazonRadio"><label for="amazonRadio">'+tr("Amazon EC2")+'</label>'+
'<input type="checkbox" name="hybrid" value="softlayerRadio" id="softlayerRadio"><label for="softlayerRadio">'+tr("IBM Softlayer")+'</label>'+
'<input type="checkbox" name="hybrid" value="azureRadio" id="azureRadio"><label for="azureRadio">'+tr("Microsoft Azure")+'</label>'+
'</div>'+
'</div>'+
'<div class="row vm_param">'+
@ -620,7 +624,7 @@ function setup_capacity_tab_content(capacity_section) {
capacity_section.on("change", "input[name='hypervisor']", function(){
var context = $(this).closest("#create_template_form_wizard");
$(".hypervisor", context).hide();
$("." + this.value, context).show();
$(".only_" + this.value, context).show();
});
setup_capacity_inputs(capacity_section);
@ -3665,6 +3669,7 @@ function build_template(dialog){
addSectionJSON(vm_json,$('#capacityTab',dialog));
vm_json["DESCRIPTION"] = $('#DESCRIPTION',$('#capacityTab',dialog)).val();
vm_json["LOGO"] = $('#LOGO',$('#capacityTab',dialog)).val();
vm_json["HYPERVISOR"] = $('input[name="hypervisor"]:checked', $('#capacityTab',dialog)).val();
//
// OS
@ -3864,6 +3869,12 @@ var fillTemplatePopUp = function(template, dialog){
$("#DESCRIPTION", capacity_section).val(escapeDoubleQuotes(htmlDecode(template["DESCRIPTION"])));
delete template["DESCRIPTION"];
if (template["HYPERVISOR"]) {
$("input[name='hypervisor'][value='"+template["HYPERVISOR"]+"']", capacity_section).trigger("click")
delete template["HYPERVISOR"];
}
//
// DISKS
//