Repository: cloudstack Updated Branches: refs/heads/volume-upload 7a3c2304a -> 68789b76d
volume-upload: tempalates > upload template from local > format dropdown > show different options upon selected hypervisor. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/68789b76 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/68789b76 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/68789b76 Branch: refs/heads/volume-upload Commit: 68789b76d3bbb9a5f4ad0316b4f789dfeb1998ca Parents: 7a3c230 Author: Jessica Wang <jessicaw...@apache.org> Authored: Tue Jan 20 14:36:06 2015 -0800 Committer: Jessica Wang <jessicaw...@apache.org> Committed: Tue Jan 20 14:36:06 2015 -0800 ---------------------------------------------------------------------- ui/scripts/templates.js | 81 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/68789b76/ui/scripts/templates.js ---------------------------------------------------------------------- diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 4c6c8f5..5c2f495 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -778,29 +778,80 @@ }); } }, - + format: { label: 'label.format', docID: 'helpRegisterTemplateFormat', + dependsOn: 'hypervisor', select: function(args) { - var items = []; - items.push({ - id: 'VHD', - description: 'VHD' - }); - items.push({ - id: 'RAW', - description: 'RAW' - }); - items.push({ - id: 'QCOW2', - description: 'QCOW2' - }); + var items = []; + if (args.hypervisor == "XenServer") { + items.push({ + id: 'VHD', + description: 'VHD' + }); + } else if (args.hypervisor == "VMware") { + /* + items.push({ + id: 'OVA', + description: 'OVA' + }); + */ + } else if (args.hypervisor == "KVM") { + items.push({ + id: 'QCOW2', + description: 'QCOW2' + }); + items.push({ + id: 'RAW', + description: 'RAW' + }); + items.push({ + id: 'VHD', + description: 'VHD' + }); + /* + items.push({ + id: 'VMDK', + description: 'VMDK' + }); + */ + } else if (args.hypervisor == "BareMetal") { + /* + items.push({ + id: 'BareMetal', + description: 'BareMetal' + }); + */ + } else if (args.hypervisor == "Ovm") { + items.push({ + id: 'RAW', + description: 'RAW' + }); + } else if (args.hypervisor == "LXC") { + /* + items.push({ + id: 'TAR', + description: 'TAR' + }); + */ + } else if (args.hypervisor == "Hyperv") { + items.push({ + id: 'VHD', + description: 'VHD' + }); + /* + items.push({ + id: 'VHDX', + description: 'VHDX' + }); + */ + } args.response.success({ data: items }); } - }, + }, osTypeId: { label: 'label.os.type',