Skip to content

Commit a696947

Browse files
author
Jessica Wang
committed
CLOUDSTACK-8182: UI > volumes > upload volume from URL > add Custom Disk Offering field which is optional.
1 parent 8aa34d0 commit a696947

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

‎ui/scripts/storage.js‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,45 @@
321321
data: items
322322
});
323323
}
324+
324325
},
325326
url: {
326327
label: 'label.url',
327328
docID: 'helpUploadVolumeURL',
328329
validation: {
329330
required: true
330331
}
331-
},
332+
},
333+
diskOffering: {
334+
label: 'Custom Disk Offering',
335+
docID: 'helpVolumeDiskOffering',
336+
select: function(args) {
337+
var diskofferingObjs;
338+
$.ajax({
339+
url: createURL("listDiskOfferings"),
340+
dataType: "json",
341+
async: false,
342+
success: function(json) {
343+
diskofferingObjs = json.listdiskofferingsresponse.diskoffering;
344+
var items = [{
345+
id: '',
346+
description: ''
347+
}];
348+
$(diskofferingObjs).each(function() {
349+
if (this.iscustomized == true) {
350+
items.push({
351+
id: this.id,
352+
description: this.displaytext
353+
});
354+
}
355+
});
356+
args.response.success({
357+
data: items
358+
});
359+
}
360+
});
361+
}
362+
},
332363
checksum: {
333364
docID: 'helpUploadVolumeChecksum',
334365
label: 'label.md5.checksum'
@@ -344,6 +375,12 @@
344375
url: args.data.url
345376
};
346377

378+
if (args.data.diskOffering != '' && args.data.diskOffering.length > 0) {
379+
$.extend(data, {
380+
diskofferingid: args.data.diskOffering
381+
});
382+
}
383+
347384
if (args.data.checksum != null && args.data.checksum.length > 0) {
348385
$.extend(data, {
349386
checksum: args.data.checksum

0 commit comments

Comments
 (0)