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 7b6f496
Date Wed, 19 Nov 2014 20:04:59 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master b11380eeb -> 7b6f49617


CLOUDSTACK-7943: UI > storage > volume > create template action > add "XenServer
Tools Version 6.1+" checkbox. Default it as its VM's "XenServer Tools Version 6.1+" property.


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

Branch: refs/heads/master
Commit: 7b6f49617d35ccbb237a8ba36424e987b5b23a3b
Parents: b11380e
Author: Jessica Wang <jessicawang@apache.org>
Authored: Wed Nov 19 12:01:43 2014 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed Nov 19 12:04:46 2014 -0800

----------------------------------------------------------------------
 ui/scripts/storage.js | 64 ++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 62 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b6f4961/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index d18b211..e628c61 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -1063,6 +1063,13 @@
                                     title: 'label.create.template',
                                     preFilter: cloudStack.preFilter.createTemplate,
                                     desc: '',
+                                    preFilter: function(args) {                         
          	
+                                    	if (args.context.volumes[0].hypervisor == "XenServer")
{     
+	                                    	if (isAdmin()) {                                  
         
+	                                            args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display',
'inline-block');
+	                                        } 
+                                    	}                                    	
+                                    },
                                     fields: {
                                         name: {
                                             label: 'label.name',
@@ -1075,7 +1082,50 @@
                                             validation: {
                                                 required: true
                                             }
-                                        },
+                                        },                                        
+                                        xenserverToolsVersion61plus: {
+                                            label: 'label.xenserver.tools.version.61.plus',
+                                            isBoolean: true,
+                                            isChecked: function (args) {                
                           	
+                                            	var b = false;
+                                            	var vmObj;                                 
          	                                        	
+                                            	$.ajax({
+                                            		url: createURL("listVirtualMachines"),
+                                            		data: {
+                                            			id: args.context.volumes[0].virtualmachineid
+                                            		},
+                                            		async: false,
+                                            		success: function(json) {                 
                          			
+                                            			vmObj = json.listvirtualmachinesresponse.virtualmachine[0];
+                                            		}                                         
  		
+                                            	});                                        
   	
+                                            	if (vmObj == undefined) { //e.g. VM has failed
over                                            		
+                                            		if (isAdmin()) {
+                                                        $.ajax({
+                                                            url: createURL('listConfigurations'),
+                                                            data: {
+                                                                name: 'xenserver.pvdriver.version'
+                                                            },
+                                                            async: false,
+                                                            success: function (json) {
+                                                                if (json.listconfigurationsresponse.configuration
!= null && json.listconfigurationsresponse.configuration[0].value == 'xenserver61')
{
+                                                                    b = true;
+                                                                }
+                                                            }
+                                                        });
+                                                    }
+                                            	} else {                                   
        		
+                                            		 if ('details' in vmObj && 'hypervisortoolsversion'
in vmObj.details) {
+                                                         if (vmObj.details.hypervisortoolsversion
== 'xenserver61')
+                                                             b = true;
+                                                         else
+                                                             b = false;
+                                                     }
+                                            	}                                         	
                                 
+                                                return b;
+                                            },
+                                            isHidden: true
+                                        },                                       
                                         osTypeId: {
                                             label: 'label.os.type',
                                             select: function(args) {
@@ -1134,7 +1184,17 @@
                                             isfeatured: (args.data.isFeatured == "on")
                                         });
                                     }
-
+                                                                        
+                                    //XenServer only (starts here)                      
             
+                                    if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').length
> 0) {
+	                                    if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css("display")
!= "none") {
+	                                        $.extend(data, {
+	                                            'details[0].hypervisortoolsversion': (args.data.xenserverToolsVersion61plus
== "on") ? "xenserver61" : "xenserver56"
+	                                        });
+	                                    }
+                                    }                                    
+                                    //XenServer only (ends here)     
+                                                                        
                                     $.ajax({
                                         url: createURL('createTemplate'),
                                         data: data,


Mime
View raw message