mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-2038: cloudstack UI - mixed zone management - template menu - copy template action - populate zone dropdown upon selected zone type on top menu.
This commit is contained in:
parent
9e392d25ba
commit
6c2f2d3a9d
@ -547,13 +547,29 @@
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var zoneObjs = json.listzonesresponse.zone;
|
||||
var items = [];
|
||||
$(zoneObjs).each(function() {
|
||||
if(this.id != args.context.templates[0].zoneid)
|
||||
items.push({id: this.id, description: this.name});
|
||||
});
|
||||
args.response.success({data: items});
|
||||
var zoneObjs = [];
|
||||
var items = json.listzonesresponse.zone;
|
||||
if(args.context.zoneType == null || args.context.zoneType == '') { //all types
|
||||
if(items != null) {
|
||||
for(var i = 0; i < items.length; i++) {
|
||||
if(items[i].id != args.context.templates[0].zoneid) { //destination zone must be different from source zone
|
||||
zoneObjs.push({id: items[i].id, description: items[i].name});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else { //Basic type or Advanced type
|
||||
if(items != null) {
|
||||
for(var i = 0; i < items.length; i++) {
|
||||
if(items[i].networktype == args.context.zoneType) { //type must be matched
|
||||
if(items[i].id != args.context.templates[0].zoneid) { //destination zone must be different from source zone
|
||||
zoneObjs.push({id: items[i].id, description: items[i].name});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
args.response.success({data: zoneObjs});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user