Skip to content

Commit b79977d

Browse files
committed
CLOUDSTACK-3337: Fix replace ACL drop-down for private gateway
1 parent 57099c8 commit b79977d

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

‎ui/css/cloudstack3.css‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11940,14 +11940,16 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
1194011940
.downloadVolume .icon,
1194111941
.downloadTemplate .icon,
1194211942
.downloadISO .icon,
11943-
.replaceacllist .icon {
11943+
.replaceacllist .icon,
11944+
.replaceACL .icon {
1194411945
background-position: -35px -125px;
1194511946
}
1194611947

1194711948
.downloadVolume:hover .icon,
1194811949
.downloadTemplate:hover .icon,
1194911950
.downloadISO:hover .icon,
11950-
.replaceacllist:hover .icon {
11951+
.replaceacllist:hover .icon,
11952+
.replaceACL:hover .icon {
1195111953
background-position: -35px -707px;
1195211954
}
1195311955

‎ui/scripts/vpc.js‎

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,18 +2256,28 @@
22562256
select: function(args) {
22572257
$.ajax({
22582258
url: createURL('listNetworkACLLists'),
2259+
data: {
2260+
vpcid: args.context.vpc[0].id
2261+
},
22592262
dataType: 'json',
22602263
async: true,
22612264
success: function(json) {
22622265
var objs = json.listnetworkacllistsresponse.networkacllist;
22632266
var items = [];
22642267

22652268
$(objs).each(function() {
2269+
if (this.id == args.context.vpcGateways[0].aclid) {
2270+
return true;
2271+
}
2272+
22662273
items.push({
22672274
id: this.id,
22682275
description: this.name
22692276
});
2277+
2278+
return true;
22702279
});
2280+
22712281
args.response.success({
22722282
data: items
22732283
});
@@ -2292,7 +2302,7 @@
22922302
getUpdatedItem: function(json) {
22932303
var item = json.queryasyncjobresultresponse.jobresult.aclid;
22942304
return {
2295-
data: item
2305+
aclid: args.data.aclid
22962306
};
22972307
}
22982308
}
@@ -2360,8 +2370,11 @@
23602370
return str ? 'Yes' : 'No';
23612371
}
23622372
},
2373+
aclName: {
2374+
label: 'ACL Name'
2375+
},
23632376
aclid: {
2364-
label: 'ACL id'
2377+
label: 'ACL ID'
23652378
}
23662379

23672380

@@ -2375,6 +2388,25 @@
23752388
},
23762389
success: function(json) {
23772390
var item = json.listprivategatewaysresponse.privategateway[0];
2391+
2392+
2393+
// Get ACL name
2394+
$.ajax({
2395+
url: createURL('listNetworkACLLists'),
2396+
async: false,
2397+
data: {
2398+
vpcid: args.context.vpc[0].id
2399+
},
2400+
success: function(json) {
2401+
var objs = json.listnetworkacllistsresponse.networkacllist;
2402+
var acl = $.grep(objs, function(obj) {
2403+
return obj.id === args.context.vpcGateways[0].aclid;
2404+
});
2405+
2406+
item.aclName = acl[0] ? acl[0].name : 'None';
2407+
}
2408+
});
2409+
23782410
args.response.success({
23792411
data: item,
23802412
actionFilter: function(args) {

0 commit comments

Comments
 (0)