mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 02:22:52 +01:00
CLOUDSTACK-2038: cloudstack UI - mixed zone management - template menu - register template action - populate zone dropdown upon selected zone type on top menu.
This commit is contained in:
parent
ba7e49f11c
commit
2431c814a8
@ -115,16 +115,32 @@
|
|||||||
url: createURL("listZones&available=true"),
|
url: createURL("listZones&available=true"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var zoneObjs = json.listzonesresponse.zone;
|
var zoneObjs;
|
||||||
var items = [];
|
if(args.context.zoneType == null || args.context.zoneType == '') { //all types
|
||||||
if (isAdmin() && !(cloudStack.context.projects &&
|
zoneObjs = [];
|
||||||
cloudStack.context.projects[0]))
|
var items = json.listzonesresponse.zone;
|
||||||
items.push({id: -1, description: "All Zones"});
|
if(items != null) {
|
||||||
$(zoneObjs).each(function() {
|
for(var i = 0; i < items.length; i++) {
|
||||||
items.push({id: this.id, description: this.name});
|
zoneObjs.push({id: items[i].id, description: items[i].name});
|
||||||
});
|
}
|
||||||
args.response.success({data: items});
|
}
|
||||||
|
}
|
||||||
|
else { //Basic type or Advanced type
|
||||||
|
zoneObjs = [];
|
||||||
|
var items = json.listzonesresponse.zone;
|
||||||
|
if(items != null) {
|
||||||
|
for(var i = 0; i < items.length; i++) {
|
||||||
|
if(items[i].networktype == args.context.zoneType) {
|
||||||
|
zoneObjs.push({id: items[i].id, description: items[i].name});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isAdmin() && !(cloudStack.context.projects && cloudStack.context.projects[0])){
|
||||||
|
zoneObjs.unshift({id: -1, description: "All Zones"});
|
||||||
|
}
|
||||||
|
args.response.success({data: zoneObjs});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user