Skip to content

Commit 2d4e879

Browse files
author
Jessica Wang
committed
CLOUDSTACK-7773: UI > Infrastructure > SystemVMs, Routers > Change Service Offering > service offerings dropdown > populate only service offerings that the VM is allowed to change to. i.e. exclude service offerings that the VM is not allowed to change to.
1 parent e87bb20 commit 2d4e879

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

ui/scripts/system.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9798,7 +9798,7 @@
97989798
}
97999799
},
98009800

9801-
scaleUp: {
9801+
scaleUp: { //*** Infrastructure > Virtual Routers > change service offering ***
98029802
label: 'label.change.service.offering',
98039803
createForm: {
98049804
title: 'label.change.service.offering',
@@ -9819,7 +9819,8 @@
98199819
url: createURL('listServiceOfferings'),
98209820
data: {
98219821
issystem: true,
9822-
systemvmtype: 'domainrouter'
9822+
systemvmtype: 'domainrouter',
9823+
virtualmachineid: args.context.routers[0].id
98239824
},
98249825
success: function (json) {
98259826
var serviceofferings = json.listserviceofferingsresponse.serviceoffering;
@@ -11039,7 +11040,7 @@
1103911040
}
1104011041
},
1104111042

11042-
scaleUp: {
11043+
scaleUp: { //*** Infrastructure > System VMs (consoleProxy or SSVM) > change service offering ***
1104311044
label: 'label.change.service.offering',
1104411045
createForm: {
1104511046
title: 'label.change.service.offering',
@@ -11056,14 +11057,23 @@
1105611057
serviceOfferingId: {
1105711058
label: 'label.compute.offering',
1105811059
select: function (args) {
11059-
var apiCmd = "listServiceOfferings&issystem=true";
11060-
if (args.context.systemVMs[0].systemvmtype == "secondarystoragevm")
11061-
apiCmd += "&systemvmtype=secondarystoragevm"; else if (args.context.systemVMs[0].systemvmtype == "consoleproxy")
11062-
apiCmd += "&systemvmtype=consoleproxy";
11060+
var data1 = {
11061+
issystem: 'true',
11062+
virtualmachineid: args.context.systemVMs[0].id
11063+
};
11064+
if (args.context.systemVMs[0].systemvmtype == "secondarystoragevm") {
11065+
$.extend(data1, {
11066+
systemvmtype: 'secondarystoragevm'
11067+
});
11068+
}
11069+
else if (args.context.systemVMs[0].systemvmtype == "consoleproxy") {
11070+
$.extend(data1, {
11071+
systemvmtype: 'consoleproxy'
11072+
});
11073+
}
1106311074
$.ajax({
11064-
url: createURL(apiCmd),
11065-
dataType: "json",
11066-
async: true,
11075+
url: createURL('listServiceOfferings'),
11076+
data: data1,
1106711077
success: function (json) {
1106811078
var serviceofferings = json.listserviceofferingsresponse.serviceoffering;
1106911079
var items =[];

0 commit comments

Comments
 (0)