Merge branch 'master' of ssh://git.cloud.com/var/lib/git/cloudstack-oss

This commit is contained in:
David Nalley 2012-04-06 22:51:41 -04:00
commit fbf007ea0e

View File

@ -3698,7 +3698,67 @@
poll: pollAsyncJobResult
}
},
changeService: {
label: 'label.change.service.offering',
createForm: {
title: 'label.change.service.offering',
desc: '',
fields: {
serviceOfferingId: {
label: 'label.compute.offering',
select: function(args) {
var apiCmd = "listServiceOfferings&issystem=true";
if(args.context.systemVMs[0].systemvmtype == "secondarystoragevm")
apiCmd += "&systemvmtype=secondarystoragevm";
else if(args.context.systemVMs[0].systemvmtype == "consoleproxy")
apiCmd += "&systemvmtype=consoleproxy";
$.ajax({
url: createURL(apiCmd),
dataType: "json",
async: true,
success: function(json) {
var serviceofferings = json.listserviceofferingsresponse.serviceoffering;
var items = [];
$(serviceofferings).each(function() {
if(this.id != args.context.systemVMs[0].serviceofferingid) {
items.push({id: this.id, description: this.displaytext});
}
});
args.response.success({data: items});
}
});
}
}
}
},
messages: {
notification: function(args) {
return 'label.change.service.offering';
}
},
action: function(args) {
$.ajax({
url: createURL("changeServiceForSystemVm&id=" + args.context.systemVMs[0].id + "&serviceofferingid=" + args.data.serviceOfferingId),
dataType: "json",
async: true,
success: function(json) {
var jsonObj = json.changeserviceforsystemvmresponse.systemvm;
args.response.success({data: jsonObj});
},
error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
args.response.error(errorMsg);
}
});
},
notification: {
poll: function(args) {
args.complete();
}
}
},
remove: {
label: 'label.action.destroy.systemvm',
messages: {
@ -7448,13 +7508,14 @@
if (jsonObj.state == 'Running') {
allowedActions.push("stop");
allowedActions.push("restart");
allowedActions.push("remove");
allowedActions.push("remove");
allowedActions.push("viewConsole");
if (isAdmin())
allowedActions.push("migrate");
}
else if (jsonObj.state == 'Stopped') {
allowedActions.push("start");
allowedActions.push("changeService");
allowedActions.push("remove");
}
else if (jsonObj.state == 'Error') {