cloudstack 3.0 new UI - instance page - change service - check if instance state is Stopped before proceeding to action.

This commit is contained in:
Jessica Wang 2011-12-20 17:08:16 -08:00
parent fd86c25bc0
commit 39f03cf7c6

View File

@ -1105,6 +1105,7 @@
cloudStack.dialog.notice({ message: 'Your instance must be stopped before attempting to change its current password' });
return false;
}
return true;
},
action: function(args) {
@ -1174,6 +1175,16 @@
}
}
},
preAction: function(args) {
var jsonObj = args.context.instances[0];
if (jsonObj.state != 'Stopped') {
cloudStack.dialog.notice({ message: 'Your instance must be stopped before attempting to change its current service offering.' });
return false;
}
return true;
},
action: function(args) {
$.ajax({
url: createURL("changeServiceForVirtualMachine&id=" + args.context.instances[0].id + "&serviceOfferingId=" + args.data.serviceOffering),