mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-3950: UI > template/ISO page > registerTemplate/registerISO action > zone dropdown > include only one option "All Zones" when secondary storage is region-wide.
This commit is contained in:
parent
3905381680
commit
6de00cb1f2
|
|
@ -172,7 +172,12 @@
|
|||
$.cookie('KVMsnapshotenabled', g_KVMsnapshotenabled, {
|
||||
expires: 1
|
||||
});
|
||||
|
||||
|
||||
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
||||
$.cookie('regionsecondaryenabled', g_regionsecondaryenabled, {
|
||||
expires: 1
|
||||
});
|
||||
|
||||
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
||||
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
||||
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, {
|
||||
|
|
@ -342,6 +347,11 @@
|
|||
expires: 1
|
||||
});
|
||||
|
||||
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
||||
$.cookie('regionsecondaryenabled', g_regionsecondaryenabled, {
|
||||
expires: 1
|
||||
});
|
||||
|
||||
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
||||
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
||||
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, {
|
||||
|
|
@ -443,6 +453,7 @@
|
|||
g_timezone = null;
|
||||
g_supportELB = null;
|
||||
g_KVMsnapshotenabled = null;
|
||||
g_regionsecondaryenabled = null;
|
||||
g_loginCmdText = null;
|
||||
|
||||
$.cookie('JSESSIONID', null);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ var g_timezoneoffset = null;
|
|||
var g_timezone = null;
|
||||
var g_supportELB = null;
|
||||
var g_KVMsnapshotenabled = null;
|
||||
var g_regionsecondaryenabled = null;
|
||||
var g_userPublicTemplateEnabled = "true";
|
||||
var g_cloudstackversion = null;
|
||||
var g_queryAsyncJobResultInterval = 3000;
|
||||
|
|
|
|||
|
|
@ -134,33 +134,42 @@
|
|||
zone: {
|
||||
label: 'label.zone',
|
||||
docID: 'helpRegisterTemplateZone',
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("listZones&available=true"),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var zoneObjs = [];
|
||||
var items = json.listzonesresponse.zone;
|
||||
if (items != null) {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
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
|
||||
});
|
||||
}
|
||||
});
|
||||
select: function(args) {
|
||||
if(g_regionsecondaryenabled == true) {
|
||||
args.response.success({
|
||||
data: [{
|
||||
id: -1,
|
||||
description: "All Zones"
|
||||
}]
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
url: createURL("listZones&available=true"),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var zoneObjs = [];
|
||||
var items = json.listzonesresponse.zone;
|
||||
if (items != null) {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
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
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
hypervisor: {
|
||||
|
|
@ -1033,32 +1042,41 @@
|
|||
label: 'label.zone',
|
||||
docID: 'helpRegisterISOZone',
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("listZones&available=true"),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var zoneObjs = [];
|
||||
var items = json.listzonesresponse.zone;
|
||||
if (items != null) {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
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
|
||||
});
|
||||
}
|
||||
});
|
||||
if(g_regionsecondaryenabled == true) {
|
||||
args.response.success({
|
||||
data: [{
|
||||
id: -1,
|
||||
description: "All Zones"
|
||||
}]
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
url: createURL("listZones&available=true"),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var zoneObjs = [];
|
||||
var items = json.listzonesresponse.zone;
|
||||
if (items != null) {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
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…
Reference in New Issue