Updated Branches:
  refs/heads/4.2 c212574b1 -> 3e962f8d2

CLOUDSTACK-4649: UI > (1) detailView widget: pass $detailView property in 
action.action({}).
(2) Edit Template action: make 'XenServer Tools Version 6.1+' field editable 
and use addResourceDetail API to update it.
(3) Edit Instance action: make 'XenServer Tools Version 6.1+' field editable 
and use addResourceDetail API to update it.


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

Branch: refs/heads/4.2
Commit: 3e962f8d290820fb65d5fcd537cccb2d92c64fc6
Parents: c212574
Author: Jessica Wang <[email protected]>
Authored: Tue Oct 22 16:14:07 2013 -0700
Committer: Jessica Wang <[email protected]>
Committed: Tue Oct 22 16:14:07 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js             | 22 ++++++++++++++++++++--
 ui/scripts/templates.js             | 19 +++++++++++++++++++
 ui/scripts/ui/widgets/detailView.js |  1 +
 3 files changed, 40 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e962f8d/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index bc7c587..d8b997a 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -796,13 +796,11 @@
                                 isdynamicallyscalable: 
(args.data.isdynamicallyscalable == "on"),
                                 ostypeid: args.data.guestosid
                             };
-
                             if (args.data.displayname != 
args.context.instances[0].displayname) {
                                 $.extend(data, {
                                     displayName: args.data.displayname
                                 });
                             }
-
                             $.ajax({
                                 url: createURL('updateVirtualMachine'),
                                 data: data,
@@ -813,6 +811,26 @@
                                     });
                                 }
                             });
+                            
+                            
+                            //***** addResourceDetail *****
+                            //XenServer only (starts here)                     
          
+                                       
if(args.$detailView.find('form').find('div 
.detail-group').find('.xenserverToolsVersion61plus').length > 0) {              
                                                     
+                                               $.ajax({
+                                                       url: 
createURL('addResourceDetail'),
+                                                       data: {
+                                                               resourceType: 
'uservm',
+                                                               resourceId: 3,
+                                                               
'details[0].key': 'hypervisortoolsversion',
+                                                               
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 
'xenserver61' : 'xenserver56'
+                                                       },
+                                                       success: function(json) 
{
+                                                               //do nothing    
                                                                        
+                                                       }
+                                               });                             
                                                                                
                       
+                                                   }                           
      
+                                               //XenServer only (ends here)    
+                            
                         }
                     },
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e962f8d/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 152381e..891d0b1 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -657,6 +657,25 @@
                                         }
                                     });
 
+                                    
+                                    //***** addResourceDetail *****
+                                    //XenServer only (starts here)             
                          
+                                                       
if(args.$detailView.find('form').find('div 
.detail-group').find('.xenserverToolsVersion61plus').length > 0) {              
                                                     
+                                                               $.ajax({
+                                                                       url: 
createURL('addResourceDetail'),
+                                                                       data: {
+                                                                               
resourceType: 'template',
+                                                                               
resourceId: 1,
+                                                                               
'details[0].key': 'hypervisortoolsversion',
+                                                                               
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 
'xenserver61' : 'xenserver56'
+                                                                       },
+                                                                       
success: function(json) {
+                                                                               
//do nothing                                                                    
        
+                                                                       }
+                                                               });             
                                                                                
                                       
+                                                                   }           
                      
+                                                               //XenServer 
only (ends here)    
+                                    
 
                                     //***** listTemplates *****
                                     //So, we call listTemplates API to get a 
complete template object

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e962f8d/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js 
b/ui/scripts/ui/widgets/detailView.js
index 0e975e4..6801288 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -490,6 +490,7 @@
                     action.action({
                         data: data,
                         _custom: $detailView.data('_custom'),
+                        $detailView: $detailView,
                         context: $detailView.data('view-args').context,
                         response: {
                             success: function(args) {

Reply via email to