CLOUDSTACK-9534: Allow VR to be destroy in UI when in running state

This allows admins/users to destroy a VR that is in running state from the UI.
This action is possible via cloudmonkey/APIs.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2016-10-05 18:21:51 +05:30
parent 9eb8b2e90b
commit 65eb3202c2
1 changed files with 22 additions and 1 deletions

View File

@ -2585,6 +2585,11 @@
label: 'label.destroy.router',
messages: {
confirm: function (args) {
if (args && args.context && args.context.routers[0]) {
if (args.context.routers[0].state == 'Running') {
return dictionary['message.action.stop.router'] + ' ' + dictionary['message.confirm.destroy.router'];
}
}
return 'message.confirm.destroy.router';
},
notification: function (args) {
@ -3752,6 +3757,11 @@
label: 'label.destroy.router',
messages: {
confirm: function (args) {
if (args && args.context && args.context.routers[0]) {
if (args.context.routers[0].state == 'Running') {
return dictionary['message.action.stop.router'] + ' ' + dictionary['message.confirm.destroy.router'];
}
}
return 'message.confirm.destroy.router';
},
notification: function (args) {
@ -6674,6 +6684,11 @@
label: 'label.destroy.router',
messages: {
confirm: function (args) {
if (args && args.context && args.context.routers[0]) {
if (args.context.routers[0].state == 'Running') {
return dictionary['message.action.stop.router'] + ' ' + dictionary['message.confirm.destroy.router'];
}
}
return 'message.confirm.destroy.router';
},
notification: function (args) {
@ -9830,6 +9845,11 @@
label: 'label.destroy.router',
messages: {
confirm: function (args) {
if (args && args.context && args.context.routers[0]) {
if (args.context.routers[0].state == 'Running') {
return dictionary['message.action.stop.router'] + ' ' + dictionary['message.confirm.destroy.router'];
}
}
return 'message.confirm.destroy.router';
},
notification: function (args) {
@ -20986,8 +21006,9 @@
}
allowedActions.push("restart");
allowedActions.push("remove");
allowedActions.push("viewConsole");
if (isAdmin())
allowedActions.push("migrate");
} else if (jsonObj.state == 'Stopped') {