cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to a696947
Date Tue, 27 Jan 2015 00:36:49 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 8aa34d048 -> a696947ea


CLOUDSTACK-8182: UI > volumes > upload volume from URL > add Custom Disk Offering
field which is optional.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a696947e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a696947e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a696947e

Branch: refs/heads/master
Commit: a696947eaf00f37f44b3b52d7fc01e77dcc2def3
Parents: 8aa34d0
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Jan 26 14:50:34 2015 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Jan 26 16:36:26 2015 -0800

----------------------------------------------------------------------
 ui/scripts/storage.js | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a696947e/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 57f8640..30698f4 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


Mime
View raw message