Skip to content

Commit 38071e6

Browse files
committed
CLOUDSTACK-2113:Router VM scale up UI support
1 parent 71a17e4 commit 38071e6

1 file changed

Lines changed: 78 additions & 3 deletions

File tree

ui/scripts/system.js

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6278,6 +6278,80 @@
62786278
}
62796279
},
62806280

6281+
scaleUp:{
6282+
label:'scaleUp Router VM',
6283+
createForm: {
6284+
title: 'label.change.service.offering',
6285+
desc: '',
6286+
fields: {
6287+
6288+
serviceOfferingId: {
6289+
label: 'label.compute.offering',
6290+
select: function(args) {
6291+
$.ajax({
6292+
url: createURL('listServiceOfferings'),
6293+
data: {
6294+
issystem: true,
6295+
systemvmtype: 'domainrouter'
6296+
},
6297+
success: function(json) {
6298+
var serviceofferings = json.listserviceofferingsresponse.serviceoffering;
6299+
var items = [];
6300+
$(serviceofferings).each(function() {
6301+
// if(this.id != args.context.routers[0].serviceofferingid) {
6302+
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.
6303+
6304+
});
6305+
args.response.success({data: items});
6306+
}
6307+
});
6308+
}
6309+
}
6310+
}
6311+
},
6312+
6313+
action: function(args) {
6314+
$.ajax({
6315+
url: createURL("scaleVirtualMachine&id=" + args.context.routers[0].id + "&serviceofferingid=" + args.data.serviceOfferingId),
6316+
dataType: "json",
6317+
async: true,
6318+
success: function(json) {
6319+
var jid = json.scalevirtualmachineresponse.jobid;
6320+
args.response.success(
6321+
{_custom:
6322+
{jobId: jid,
6323+
getUpdatedItem: function(json) {
6324+
return json.queryasyncjobresultresponse.jobresult.virtualmachine;
6325+
},
6326+
getActionFilter: function() {
6327+
return vmActionfilter;
6328+
}
6329+
}
6330+
}
6331+
);
6332+
},
6333+
error:function(json){
6334+
args.response.error(parseXMLHttpResponse(json));
6335+
}
6336+
6337+
});
6338+
},
6339+
messages: {
6340+
confirm: function(args) {
6341+
return 'Do you really want to scale up the Router VM ?';
6342+
},
6343+
notification: function(args) {
6344+
6345+
return 'Router VM Scaled Up';
6346+
}
6347+
},
6348+
notification: {
6349+
poll: pollAsyncJobResult
6350+
}
6351+
6352+
},
6353+
6354+
62816355
viewConsole: {
62826356
label: 'label.view.console',
62836357
action: {
@@ -11816,17 +11890,18 @@
1181611890

1181711891
if (jsonObj.state == 'Running') {
1181811892
allowedActions.push("stop");
11819-
11893+
allowedActions.push("scaleUp");
1182011894
// if(jsonObj.vpcid != null)
11821-
allowedActions.push("restart");
11895+
allowedActions.push("restart");
1182211896

1182311897
allowedActions.push("viewConsole");
1182411898
if (isAdmin())
1182511899
allowedActions.push("migrate");
1182611900
}
1182711901
else if (jsonObj.state == 'Stopped') {
1182811902
allowedActions.push("start");
11829-
allowedActions.push("remove");
11903+
allowedActions.push("scaleUp");
11904+
allowedActions.push("remove");
1183011905

1183111906
if(jsonObj.vpcid != null)
1183211907
allowedActions.push("changeService");

0 commit comments

Comments
 (0)