From da9603cfe6b6604f72ac645b9a8d63e40ef07c9f Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 6 Aug 2012 16:28:23 -0700 Subject: [PATCH] cloudstack 3.0 UI - infrastructure - zone detail - network service providers - VPC Virtual Router - Instances tab - detailView - add Reboot action. --- ui/scripts/system.js | 49 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 55c97f5b50e..6376d815e07 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -2539,7 +2539,43 @@ notification: { poll: pollAsyncJobResult } - }, + }, + + restart: { + label: 'label.action.reboot.router', + messages: { + confirm: function(args) { + return 'message.action.reboot.router'; + }, + notification: function(args) { + return 'label.action.reboot.router'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('rebootRouter&id=' + args.context.routers[0].id), + dataType: 'json', + async: true, + success: function(json) { + var jid = json.rebootrouterresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.domainrouter; + }, + getActionFilter: function() { + return routerActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, changeService: { label: 'label.change.service.offering', @@ -4923,8 +4959,7 @@ poll: pollAsyncJobResult } }, - - //??? + changeService: { label: 'label.change.service.offering', createForm: { @@ -4980,8 +5015,7 @@ args.complete(); } } - }, - //??? + }, migrate: { label: 'label.action.migrate.router', @@ -9570,10 +9604,9 @@ if (jsonObj.state == 'Running') { allowedActions.push("stop"); - allowedActions.push("restart"); - + if(jsonObj.vpcid != null) - allowedActions.push("changeService"); + allowedActions.push("restart"); allowedActions.push("viewConsole"); if (isAdmin())