Updated Branches:
  refs/heads/master a5cff1dfd -> 5a9b4ee84

CLOUDSTACK-4793: UI > Virtual Routers > Select View > group by zone > 
detailView > add action "upgrade all routers in this zone to use newer 
template".


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

Branch: refs/heads/master
Commit: 5a9b4ee843bf44f4d954caaa655bd1d68e61de25
Parents: a5cff1d
Author: Jessica Wang <[email protected]>
Authored: Mon Nov 25 13:32:46 2013 -0800
Committer: Jessica Wang <[email protected]>
Committed: Mon Nov 25 13:33:55 2013 -0800

----------------------------------------------------------------------
 ui/scripts/system.js | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5a9b4ee8/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index d748b72..98b5454 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8737,7 +8737,41 @@
                                 });
                             },                                                 
      
                             detailView: {
-                               name: 'Virtual Routers group by zone',    
+                               name: 'Virtual Routers group by zone',          
                        
+                               actions: {                              
+                                       upgradeRouterToUseNewerTemplate: {
+                                        label: 'Upgrade Router to Use Newer 
Template',
+                                        messages: {
+                                            confirm: function(args) {
+                                                return 'Please confirm that 
you want to upgrade all routers in this zone to use newer template';
+                                            },
+                                            notification: function (args) {
+                                                return 'Upgrade Router to Use 
Newer Template';
+                                            }
+                                        },
+                                        action: function (args) {              
                                
+                                            $.ajax({
+                                                url: 
createURL('upgradeRouterTemplate'),
+                                                data: {
+                                                       zoneid: 
args.context.routerGroupByZone[0].id
+                                                },
+                                                success: function (json) {
+                                                    var jobs = 
json.upgraderoutertemplateresponse.asyncjobs;
+                                                    if (jobs != undefined) {
+                                                        args.response.success({
+                                                            _custom: {
+                                                                jobId: 
jobs[0].jobid
+                                                            }
+                                                        });
+                                                    }
+                                                }
+                                            });
+                                        },
+                                        notification: {
+                                            poll: pollAsyncJobResult
+                                        }
+                                    }                                  
+                                },   
                                tabs: {
                                        details: {
                                                title: 'Virtual Routers group 
by zone',                                                 

Reply via email to