cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [24/50] [abbrv] git commit: updated refs/heads/ui-restyle to 500c798
Date Thu, 24 Oct 2013 18:31:02 GMT
CLOUDSTACK-4649: UI > (1) Register Template dialog: add 'XenServer Tools Version 6.1+' checkbox.
(2) Template detailView: add 'XenServer Tools Version 6.1+' field.
(3) Instance detailView: add 'XenServer Tools Version 6.1+' field.


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

Branch: refs/heads/ui-restyle
Commit: c3ddd3bf00e58b1ea0de3c5d235d27e243e98e2a
Parents: c910196
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Oct 22 14:02:19 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed Oct 23 12:50:42 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js       | 27 ++++++++++++-
 ui/scripts/sharedFunctions.js |  1 +
 ui/scripts/templates.js       | 81 +++++++++++++++++++++++++++++++++++---
 3 files changed, 101 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3ddd3bf/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 84c3643..a791ec0 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1463,9 +1463,13 @@
                             if (isAdmin()) {
                                 hiddenFields = [];
                             } else {
-                                hiddenFields = ["hypervisor"];
+                                hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
                             }
-
+                            
+                            if ('instances' in args.context && args.context.instances[0].hypervisor
!= 'XenServer') {
+                          	  hiddenFields.push('xenserverToolsVersion61plus');
+                            }
+                            
                             if (!args.context.instances[0].publicip) {
                                 hiddenFields.push('publicip');
                             }
@@ -1547,6 +1551,18 @@
                                 label: 'label.hypervisor'
                             },
 
+                            xenserverToolsVersion61plus: {
+                                label: 'XenServer Tools Version 6.1+',
+                                isBoolean: true,
+                                isEditable: function () {
+                                    if (isAdmin())
+                                        return true;
+                                    else
+                                        return false;
+                                },
+                                converter: cloudStack.converters.toBooleanText
+                            },
+                            
                             /*
 								isoid: {
                   label: 'label.attached.iso',
@@ -1622,6 +1638,13 @@
                                             state: "Destroyed"
                                         }); //after a regular user destroys a VM, listVirtualMachines
API will no longer returns this destroyed VM to the regular user.
 
+                                    if ('details' in jsonObj && 'hypervisortoolsversion'
in jsonObj.details) {
+                                        if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
+                                            jsonObj.xenserverToolsVersion61plus = true;
+                                        else
+                                            jsonObj.xenserverToolsVersion61plus = false;
+                                    }
+                                    
                                     args.response.success({
                                         actionFilter: vmActionfilter,
                                         data: jsonObj

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3ddd3bf/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index d2c776c..fb07d37 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -855,6 +855,7 @@ cloudStack.preFilter = {
                 args.$form.find('.form-item[rel=isPublic]').hide();
             }
             args.$form.find('.form-item[rel=isFeatured]').hide();
+            args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
         }
     },
     addLoadBalancerDevice: function(args) { //add netscaler device OR add F5 device

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3ddd3bf/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index ccb83c2..d5228c3 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -214,10 +214,21 @@
                                                     $form.find('.form-item[rel=rootDiskControllerType]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=nicAdapterType]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=keyboardType]').css('display',
'inline-block');
+                                                    
+                                                    $form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
+                                                } else if ($(this).val() == "XenServer")
{
+                                                	$form.find('.form-item[rel=rootDiskControllerType]').hide();
+                                                    $form.find('.form-item[rel=nicAdapterType]').hide();
+                                                    $form.find('.form-item[rel=keyboardType]').hide();

+                                                    
+                                                    if (isAdmin())
+                                                        $form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display',
'inline-block');    
                                                 } else {
                                                     $form.find('.form-item[rel=rootDiskControllerType]').hide();
                                                     $form.find('.form-item[rel=nicAdapterType]').hide();
                                                     $form.find('.form-item[rel=keyboardType]').hide();
+                                                    
+                                                    $form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
                                                 }
                                             });
 
@@ -225,6 +236,30 @@
                                         }
                                     },
 
+                                    xenserverToolsVersion61plus: {
+                                        label: 'XenServer Tools Version 6.1+',
+                                        isBoolean: true,
+                                        isChecked: function (args) {
+                                            var b = false;
+                                            if (isAdmin()) {
+                                                $.ajax({
+                                                    url: createURL('listConfigurations'),
+                                                    data: {
+                                                        name: 'xen.pvdriver.version'
+                                                    },
+                                                    async: false,
+                                                    success: function (json) {
+                                                        if (json.listconfigurationsresponse.configuration
!= null && json.listconfigurationsresponse.configuration[0].value == 'xenserver61')
{
+                                                            b = true;
+                                                        }
+                                                    }
+                                                });
+                                            }
+                                            return b;
+                                        },
+                                        isHidden: true
+                                    },
+                                    
                                     //fields for hypervisor == "VMware" (starts here)
                                     rootDiskControllerType: {
                                         label: 'label.root.disk.controller',
@@ -439,6 +474,16 @@
                                     });
                                 }
 
+                                
+                                //XenServer only (starts here)                  
+                                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)
+                                
+                                
                                 //VMware only (starts here)
                                 if (args.$form.find('.form-item[rel=rootDiskControllerType]').css("display")
!= "none" && args.data.rootDiskControllerType != "") {
                                     $.extend(data, {
@@ -800,8 +845,13 @@
                                     if (isAdmin()) {
                                         hiddenFields = [];
                                     } else {
-                                        hiddenFields = ["hypervisor"];
+                                        hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
                                     }
+                                    
+                                    if ('templates' in args.context && args.context.templates[0].hypervisor
!= 'XenServer') {
+                                        hiddenFields.push('xenserverToolsVersion61plus');
+                                    }
+                                    
                                     return hiddenFields;
                                 },
 
@@ -833,6 +883,17 @@
                                     hypervisor: {
                                         label: 'label.hypervisor'
                                     },
+                                    xenserverToolsVersion61plus: {
+                                        label: 'XenServer Tools Version 6.1+',
+                                        isBoolean: true,
+                                        isEditable: function () {
+                                            if (isAdmin())
+                                                return true;
+                                            else
+                                                return false;
+                                        },
+                                        converter: cloudStack.converters.toBooleanText
+                                    },
                                     templatetype: {
                                         label: 'label.type'
                                     },
@@ -959,13 +1020,21 @@
                                         url: createURL(apiCmd),
                                         dataType: "json",
                                         success: function(json) {
-                                            args.response.success({
-                                                actionFilter: templateActionfilter,
-                                                data: json.listtemplatesresponse.template[0]
-                                            });
+                                        	var jsonObj = json.listtemplatesresponse.template[0];
+
+                                        	if ('details' in jsonObj && 'hypervisortoolsversion'
in jsonObj.details) {
+                                        	    if (jsonObj.details.hypervisortoolsversion ==
'xenserver61')
+                                        	        jsonObj.xenserverToolsVersion61plus = true;
+                                        	    else
+                                        	        jsonObj.xenserverToolsVersion61plus = false;
+                                        	}
+
+                                        	args.response.success({
+                                        	    actionFilter: templateActionfilter,
+                                        	    data: jsonObj
+                                        	});
                                         }
                                     });
-
                                 }
                             }
                         }


Mime
View raw message