Skip to content

Commit 68789b7

Browse files
author
Jessica Wang
committed
volume-upload: tempalates > upload template from local > format dropdown > show different options upon selected hypervisor.
1 parent 7a3c230 commit 68789b7

1 file changed

Lines changed: 66 additions & 15 deletions

File tree

‎ui/scripts/templates.js‎

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -778,29 +778,80 @@
778778
});
779779
}
780780
},
781-
781+
782782
format: {
783783
label: 'label.format',
784784
docID: 'helpRegisterTemplateFormat',
785+
dependsOn: 'hypervisor',
785786
select: function(args) {
786-
var items = [];
787-
items.push({
788-
id: 'VHD',
789-
description: 'VHD'
790-
});
791-
items.push({
792-
id: 'RAW',
793-
description: 'RAW'
794-
});
795-
items.push({
796-
id: 'QCOW2',
797-
description: 'QCOW2'
798-
});
787+
var items = [];
788+
if (args.hypervisor == "XenServer") {
789+
items.push({
790+
id: 'VHD',
791+
description: 'VHD'
792+
});
793+
} else if (args.hypervisor == "VMware") {
794+
/*
795+
items.push({
796+
id: 'OVA',
797+
description: 'OVA'
798+
});
799+
*/
800+
} else if (args.hypervisor == "KVM") {
801+
items.push({
802+
id: 'QCOW2',
803+
description: 'QCOW2'
804+
});
805+
items.push({
806+
id: 'RAW',
807+
description: 'RAW'
808+
});
809+
items.push({
810+
id: 'VHD',
811+
description: 'VHD'
812+
});
813+
/*
814+
items.push({
815+
id: 'VMDK',
816+
description: 'VMDK'
817+
});
818+
*/
819+
} else if (args.hypervisor == "BareMetal") {
820+
/*
821+
items.push({
822+
id: 'BareMetal',
823+
description: 'BareMetal'
824+
});
825+
*/
826+
} else if (args.hypervisor == "Ovm") {
827+
items.push({
828+
id: 'RAW',
829+
description: 'RAW'
830+
});
831+
} else if (args.hypervisor == "LXC") {
832+
/*
833+
items.push({
834+
id: 'TAR',
835+
description: 'TAR'
836+
});
837+
*/
838+
} else if (args.hypervisor == "Hyperv") {
839+
items.push({
840+
id: 'VHD',
841+
description: 'VHD'
842+
});
843+
/*
844+
items.push({
845+
id: 'VHDX',
846+
description: 'VHDX'
847+
});
848+
*/
849+
}
799850
args.response.success({
800851
data: items
801852
});
802853
}
803-
},
854+
},
804855

805856
osTypeId: {
806857
label: 'label.os.type',

0 commit comments

Comments
 (0)