CLOUDSTACK-3337: Fix replace ACL drop-down for private gateway

This commit is contained in:
Brian Federle 2013-07-29 14:42:11 -07:00
parent 42da3efbc3
commit a917cbefc9
2 changed files with 38 additions and 4 deletions

View File

@ -11940,14 +11940,16 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
.downloadVolume .icon,
.downloadTemplate .icon,
.downloadISO .icon,
.replaceacllist .icon {
.replaceacllist .icon,
.replaceACL .icon {
background-position: -35px -125px;
}
.downloadVolume:hover .icon,
.downloadTemplate:hover .icon,
.downloadISO:hover .icon,
.replaceacllist:hover .icon {
.replaceacllist:hover .icon,
.replaceACL:hover .icon {
background-position: -35px -707px;
}

View File

@ -2256,6 +2256,9 @@
select: function(args) {
$.ajax({
url: createURL('listNetworkACLLists'),
data: {
vpcid: args.context.vpc[0].id
},
dataType: 'json',
async: true,
success: function(json) {
@ -2263,11 +2266,18 @@
var items = [];
$(objs).each(function() {
if (this.id == args.context.vpcGateways[0].aclid) {
return true;
}
items.push({
id: this.id,
description: this.name
});
return true;
});
args.response.success({
data: items
});
@ -2292,7 +2302,7 @@
getUpdatedItem: function(json) {
var item = json.queryasyncjobresultresponse.jobresult.aclid;
return {
data: item
aclid: args.data.aclid
};
}
}
@ -2360,8 +2370,11 @@
return str ? 'Yes' : 'No';
}
},
aclName: {
label: 'ACL Name'
},
aclid: {
label: 'ACL id'
label: 'ACL ID'
}
@ -2375,6 +2388,25 @@
},
success: function(json) {
var item = json.listprivategatewaysresponse.privategateway[0];
// Get ACL name
$.ajax({
url: createURL('listNetworkACLLists'),
async: false,
data: {
vpcid: args.context.vpc[0].id
},
success: function(json) {
var objs = json.listnetworkacllistsresponse.networkacllist;
var acl = $.grep(objs, function(obj) {
return obj.id === args.context.vpcGateways[0].aclid;
});
item.aclName = acl[0] ? acl[0].name : 'None';
}
});
args.response.success({
data: item,
actionFilter: function(args) {