CLOUDSTACK-4102: UI > User VM, System VM > remove "Change Service Offering" action since it has been replaced with new action "Scale Up VM".

This commit is contained in:
Jessica Wang 2013-08-07 16:02:10 -07:00
parent 8e395b2a89
commit c6368b8a2c
2 changed files with 3 additions and 271 deletions

View File

@ -1859,8 +1859,7 @@
allowedActions.push("stop");
allowedActions.push("restart");
allowedActions.push("snapshot");
allowedActions.push("destroy");
allowedActions.push("changeService");
allowedActions.push("destroy");
allowedActions.push("reset");
allowedActions.push("scaleUp");
@ -1896,8 +1895,7 @@
} else {
allowedActions.push("detachISO");
}
allowedActions.push("resetPassword");
allowedActions.push("changeService");
allowedActions.push("resetPassword");
if (jsonObj.hypervisor == "BareMetal") {
allowedActions.push("createTemplate");
}

View File

@ -3461,70 +3461,6 @@
}
},
changeService: {
label: 'label.change.service.offering',
createForm: {
title: 'label.change.service.offering',
desc: '',
fields: {
serviceOfferingId: {
label: 'label.compute.offering',
select: function(args) {
$.ajax({
url: createURL('listServiceOfferings'),
data: {
issystem: true,
systemvmtype: 'domainrouter'
},
success: function(json) {
var serviceofferings = json.listserviceofferingsresponse.serviceoffering;
var items = [];
$(serviceofferings).each(function() {
if (this.id != args.context.routers[0].serviceofferingid) {
items.push({
id: this.id,
description: this.name
}); //default one (i.e. "System Offering For Software Router") doesn't have displaytext property. So, got to use name property instead.
}
});
args.response.success({
data: items
});
}
});
}
}
}
},
messages: {
notification: function(args) {
return 'label.change.service.offering';
}
},
action: function(args) {
$.ajax({
url: createURL("changeServiceForRouter&id=" + args.context.routers[0].id + "&serviceofferingid=" + args.data.serviceOfferingId),
dataType: "json",
async: true,
success: function(json) {
var jsonObj = json.changeserviceforrouterresponse.domainrouter;
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.destroy.router',
messages: {
@ -6564,73 +6500,6 @@
}
},
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: {
@ -7635,70 +7504,6 @@
}
},
changeService: {
label: 'label.change.service.offering',
createForm: {
title: 'label.change.service.offering',
desc: '',
fields: {
serviceOfferingId: {
label: 'label.compute.offering',
select: function(args) {
$.ajax({
url: createURL('listServiceOfferings'),
data: {
issystem: true,
systemvmtype: 'domainrouter'
},
success: function(json) {
var serviceofferings = json.listserviceofferingsresponse.serviceoffering;
var items = [];
$(serviceofferings).each(function() {
if (this.id != args.context.routers[0].serviceofferingid) {
items.push({
id: this.id,
description: this.name
}); //default one (i.e. "System Offering For Software Router") doesn't have displaytext property. So, got to use name property instead.
}
});
args.response.success({
data: items
});
}
});
}
}
}
},
messages: {
notification: function(args) {
return 'label.change.service.offering';
}
},
action: function(args) {
$.ajax({
url: createURL("changeServiceForRouter&id=" + args.context.routers[0].id + "&serviceofferingid=" + args.data.serviceOfferingId),
dataType: "json",
async: true,
success: function(json) {
var jsonObj = json.changeserviceforrouterresponse.domainrouter;
args.response.success({
data: jsonObj
});
},
error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
args.response.error(errorMsg);
}
});
},
notification: {
poll: function(args) {
args.complete();
}
}
},
migrate: {
label: 'label.action.migrate.router',
createForm: {
@ -8211,73 +8016,6 @@
}
},
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: {
@ -16374,9 +16112,6 @@
allowedActions.push("start");
allowedActions.push("scaleUp");
allowedActions.push("remove");
if (jsonObj.vpcid != null)
allowedActions.push("changeService");
}
return allowedActions;
}
@ -16411,8 +16146,7 @@
allowedActions.push("migrate");
} else if (jsonObj.state == 'Stopped') {
allowedActions.push("start");
allowedActions.push("scaleUp");
allowedActions.push("changeService");
allowedActions.push("scaleUp");
allowedActions.push("remove");
} else if (jsonObj.state == 'Error') {
allowedActions.push("remove");