From a696947eaf00f37f44b3b52d7fc01e77dcc2def3 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 26 Jan 2015 14:50:34 -0800 Subject: [PATCH] CLOUDSTACK-8182: UI > volumes > upload volume from URL > add Custom Disk Offering field which is optional. --- ui/scripts/storage.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 57f8640ee0b..30698f4b326 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -321,6 +321,7 @@ data: items }); } + }, url: { label: 'label.url', @@ -328,7 +329,37 @@ validation: { required: true } - }, + }, + diskOffering: { + label: 'Custom Disk Offering', + docID: 'helpVolumeDiskOffering', + select: function(args) { + var diskofferingObjs; + $.ajax({ + url: createURL("listDiskOfferings"), + dataType: "json", + async: false, + success: function(json) { + diskofferingObjs = json.listdiskofferingsresponse.diskoffering; + var items = [{ + id: '', + description: '' + }]; + $(diskofferingObjs).each(function() { + if (this.iscustomized == true) { + items.push({ + id: this.id, + description: this.displaytext + }); + } + }); + args.response.success({ + data: items + }); + } + }); + } + }, checksum: { docID: 'helpUploadVolumeChecksum', label: 'label.md5.checksum' @@ -344,6 +375,12 @@ url: args.data.url }; + if (args.data.diskOffering != '' && args.data.diskOffering.length > 0) { + $.extend(data, { + diskofferingid: args.data.diskOffering + }); + } + if (args.data.checksum != null && args.data.checksum.length > 0) { $.extend(data, { checksum: args.data.checksum