mirror of https://github.com/apache/cloudstack.git
ui: display drop down list for VPN customer gateway selection (#3805)
Display drop-down list for VPN customer gateway selection in UI so that it can be searched according to domains
This commit is contained in:
parent
f78cbf4efc
commit
c6e67c482c
|
|
@ -5792,6 +5792,66 @@
|
|||
}
|
||||
},
|
||||
|
||||
advSearchFields: {
|
||||
keyword: {
|
||||
label: 'label.name'
|
||||
},
|
||||
domainid: {
|
||||
label: 'label.domain',
|
||||
select: function(args) {
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL('listDomains'),
|
||||
data: {
|
||||
listAll: true,
|
||||
details: 'min'
|
||||
},
|
||||
success: function(json) {
|
||||
var array1 = [{
|
||||
id: '',
|
||||
description: ''
|
||||
}];
|
||||
var domains = json.listdomainsresponse.domain;
|
||||
if (domains != null && domains.length > 0) {
|
||||
for (var i = 0; i < domains.length; i++) {
|
||||
array1.push({
|
||||
id: domains[i].id,
|
||||
description: domains[i].path
|
||||
});
|
||||
}
|
||||
}
|
||||
array1.sort(function(a, b) {
|
||||
return a.description.localeCompare(b.description);
|
||||
});
|
||||
args.response.success({
|
||||
data: array1
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.response.success({
|
||||
data: null
|
||||
});
|
||||
}
|
||||
},
|
||||
isHidden: function(args) {
|
||||
if (isAdmin() || isDomainAdmin())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
},
|
||||
account: {
|
||||
label: 'Account',
|
||||
isHidden: function(args) {
|
||||
if (isAdmin() || isDomainAdmin())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
dataProvider: function(args) {
|
||||
var data = {};
|
||||
listViewDataProvider(args, data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue