CLOUDSTACK-2120: mixed zone management - UI - system.js - remove obsolete code that has been replaced with new change in global function createURL().

This commit is contained in:
Jessica Wang 2013-05-01 14:22:35 -07:00
parent 996d2f5a2b
commit 60a8e881c1

View File

@ -184,16 +184,9 @@
dashboard: { dashboard: {
dataProvider: function(args) { dataProvider: function(args) {
var dataFns = { var dataFns = {
zoneCount: function(data) { zoneCount: function(data) {
var data = {};
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data, {
networktype: cloudStack.context.zoneType
});
}
$.ajax({ $.ajax({
url: createURL('listZones'), url: createURL('listZones'),
data: data,
success: function(json) { success: function(json) {
dataFns.podCount($.extend(data, { dataFns.podCount($.extend(data, {
zoneCount: json.listzonesresponse.count ? zoneCount: json.listzonesresponse.count ?
@ -250,12 +243,7 @@
type: 'routing', type: 'routing',
page: 1, page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
}; };
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
$.ajax({ $.ajax({
url: createURL('listHosts'), url: createURL('listHosts'),
data: data2, data: data2,
@ -272,12 +260,7 @@
var data2 = { var data2 = {
page: 1, page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
}; };
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
$.ajax({ $.ajax({
url: createURL('listStoragePools'), url: createURL('listStoragePools'),
data: data2, data: data2,
@ -294,12 +277,7 @@
type: 'SecondaryStorage', type: 'SecondaryStorage',
page: 1, page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
}; };
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
$.ajax({ $.ajax({
url: createURL('listHosts'), url: createURL('listHosts'),
data: data2, data: data2,
@ -333,12 +311,7 @@
projectid: -1, projectid: -1,
page: 1, page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
}; };
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
$.ajax({ $.ajax({
url: createURL('listRouters'), url: createURL('listRouters'),
data: data2, data: data2,
@ -349,12 +322,7 @@
listAll: true, listAll: true,
page: 1, page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
}; };
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data3, {
zonetype: cloudStack.context.zoneType
});
}
$.ajax({ $.ajax({
url: createURL('listRouters'), url: createURL('listRouters'),
data: data3, data: data3,
@ -2332,12 +2300,7 @@
var data2 = { var data2 = {
forvpc: false forvpc: false
}; };
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
var routers = []; var routers = [];
$.ajax({ $.ajax({
url: createURL("listRouters&zoneid=" + selectedZoneObj.id + "&listAll=true&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), url: createURL("listRouters&zoneid=" + selectedZoneObj.id + "&listAll=true&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
@ -2817,12 +2780,7 @@
var data2 = { var data2 = {
forvpc: true forvpc: true
}; };
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
var routers = []; var routers = [];
$.ajax({ $.ajax({
url: createURL("listRouters&zoneid=" + selectedZoneObj.id + "&listAll=true&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), url: createURL("listRouters&zoneid=" + selectedZoneObj.id + "&listAll=true&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
@ -4708,12 +4666,7 @@
break; break;
} }
} }
} }
if(args.context.zoneType != null && args.context.zoneType.length > 0) { //Basic type or Advanced type
array1.push("&networktype=" + args.context.zoneType);
}
$.ajax({ $.ajax({
url: createURL("listZones&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), url: createURL("listZones&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
dataType: "json", dataType: "json",
@ -5660,12 +5613,12 @@
var searchByArgs = args.filterBy.search.value.length ? var searchByArgs = args.filterBy.search.value.length ?
'&name=' + args.filterBy.search.value : ''; '&name=' + args.filterBy.search.value : '';
var data = { page: args.page, pageSize: pageSize, type: 'routing', listAll: true }; var data = {
if(args.context.zoneType != null && args.context.zoneType.length > 0) { //Basic type or Advanced type page: args.page,
$.extend(data, { pageSize: pageSize,
zonetype: args.context.zoneType type: 'routing',
}); listAll: true
} };
$.ajax({ $.ajax({
url: createURL('listHosts' + searchByArgs), url: createURL('listHosts' + searchByArgs),
@ -5714,11 +5667,7 @@
pageSize: pageSize, pageSize: pageSize,
listAll: true listAll: true
}; };
if(args.context.zoneType != null && args.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data, {
zonetype: args.context.zoneType
});
}
$.ajax({ $.ajax({
url: createURL('listStoragePools' + searchByArgs), url: createURL('listStoragePools' + searchByArgs),
data: data, data: data,
@ -5761,12 +5710,12 @@
var searchByArgs = args.filterBy.search.value.length ? var searchByArgs = args.filterBy.search.value.length ?
'&name=' + args.filterBy.search.value : ''; '&name=' + args.filterBy.search.value : '';
var data = { type: 'SecondaryStorage', page: args.page, pageSize: pageSize, listAll: true }; var data = {
if(args.context.zoneType != null && args.context.zoneType.length > 0) { //Basic type or Advanced type type: 'SecondaryStorage',
$.extend(data, { page: args.page,
zonetype: args.context.zoneType pageSize: pageSize,
}); listAll: true
} };
$.ajax({ $.ajax({
url: createURL('listHosts' + searchByArgs), url: createURL('listHosts' + searchByArgs),
@ -5850,18 +5799,11 @@
var listView = $.extend(true, {}, cloudStack.sections.system.subsections.virtualRouters.listView, { var listView = $.extend(true, {}, cloudStack.sections.system.subsections.virtualRouters.listView, {
dataProvider: function (args) { dataProvider: function (args) {
var searchByArgs = args.filterBy.search.value.length ? var searchByArgs = args.filterBy.search.value.length ?
'&name=' + args.filterBy.search.value : ''; '&name=' + args.filterBy.search.value : '';
var data2 = {};
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
var routers = []; var routers = [];
$.ajax({ $.ajax({
url: createURL("listRouters&listAll=true&page=" + args.page + "&pagesize=" + pageSize + searchByArgs), url: createURL("listRouters&listAll=true&page=" + args.page + "&pagesize=" + pageSize + searchByArgs),
data: data2,
async: true, async: true,
success: function(json) { success: function(json) {
var items = json.listroutersresponse.router ? var items = json.listroutersresponse.router ?
@ -5873,8 +5815,7 @@
// Get project routers // Get project routers
$.ajax({ $.ajax({
url: createURL("listRouters&listAll=true&page=" + args.page + "&pagesize=" + pageSize + "&projectid=-1"), url: createURL("listRouters&listAll=true&page=" + args.page + "&pagesize=" + pageSize + "&projectid=-1"),
data: data2,
async: true, async: true,
success: function(json) { success: function(json) {
var items = json.listroutersresponse.router ? var items = json.listroutersresponse.router ?
@ -5961,11 +5902,7 @@
var data2 = { var data2 = {
forvpc: false forvpc: false
}; };
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
var routers = []; var routers = [];
$.ajax({ $.ajax({
url: createURL("listRouters&zoneid=" + selectedZoneObj.id + "&listAll=true&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), url: createURL("listRouters&zoneid=" + selectedZoneObj.id + "&listAll=true&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
@ -9209,11 +9146,7 @@
} else { } else {
array1.push("&hostid=" + args.context.instances[0].hostid); array1.push("&hostid=" + args.context.instances[0].hostid);
} }
if(args.context.zoneType != null && args.context.zoneType.length > 0) { //Basic type or Advanced type
array1.push("&zonetype=" + args.context.zoneType);
}
$.ajax({ $.ajax({
url: createURL("listHosts&type=Routing" + array1.join("") + "&page=" + args.page + "&pagesize=" + pageSize), url: createURL("listHosts&type=Routing" + array1.join("") + "&page=" + args.page + "&pagesize=" + pageSize),
dataType: "json", dataType: "json",
@ -10821,10 +10754,6 @@
} }
array1.push("&zoneid=" + args.context.zones[0].id); array1.push("&zoneid=" + args.context.zones[0].id);
if(args.context.zoneType != null && args.context.zoneType.length > 0) { //Basic type or Advanced type
array1.push("&zonetype=" + args.context.zoneType);
}
$.ajax({ $.ajax({
url: createURL("listHosts&type=SecondaryStorage&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), url: createURL("listHosts&type=SecondaryStorage&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
dataType: "json", dataType: "json",