Skip to content

Commit

Permalink
Merge "Changed the count of fetching the data for the get for grid." …
Browse files Browse the repository at this point in the history
…into R2.20
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 28, 2015
2 parents 8dbfce0 + 23dc913 commit 29fee20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
17 changes: 6 additions & 11 deletions webroot/config/ports/ui/js/ports_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function portsConfigObj() {
var mac_address;
var ip_address;
var selectedParentVMIObject;
var getPortUUIDCallCount;

//Method definitions
this.load = load;
Expand Down Expand Up @@ -72,7 +71,6 @@ function portsConfigObj() {
this.allfloatingIP = allfloatingIP;
this.allNetworkData = allNetworkData;
this.currentVNSubnetDetail = currentVNSubnetDetail;
this.getPortUUIDCallCount = getPortUUIDCallCount;
this.mac_address = mac_address;
this.ip_address = ip_address;
this.selectedParentVMIObject = selectedParentVMIObject;
Expand Down Expand Up @@ -121,7 +119,6 @@ function groupBy( array , f )
}

function initComponents() {
getPortUUIDCallCount = 200;
var deletePortsDropdownTemplate = contrail.getTemplate4Id('delete-port-action-template');
var columnsToBeAddedDynamically = [];
var displayOwnerNameColumn = {
Expand Down Expand Up @@ -759,7 +756,7 @@ function initActions() {
}


console.log(JSON.stringify(portConfig));
//console.log(JSON.stringify(portConfig));
if (mode === "add") {
doAjaxCall("/api/tenants/config/ports", "POST", JSON.stringify(portConfig),
"createPortsSuccessCb", "createPortsFailureCb");
Expand Down Expand Up @@ -1177,10 +1174,10 @@ function successHandlerForAllPortUUIDGet(allUUID, cbparam)
var vmiUUIDObj = {};
var sendUUIDArr = [];
vmiUUIDObj.type = "virtual-machine-interface";
sendUUIDArr = allUUID.slice(0, getPortUUIDCallCount);
sendUUIDArr = allUUID.slice(0, 50);
vmiUUIDObj.uuidList = sendUUIDArr;
//vmiUUIDObj.fields = ["floating_ip_pools"];
allUUID = allUUID.slice(getPortUUIDCallCount, allUUID.length);
allUUID = allUUID.slice(50, allUUID.length);
var param = {};
param.allUUID = allUUID;
param.cbparam = cbparam;
Expand All @@ -1207,10 +1204,10 @@ function successHandlerForgridPorts(result , param) {
var vmiUUIDObj = {};
var sendUUIDArr = [];
vmiUUIDObj.type = "virtual-machine-interface";
sendUUIDArr = allUUID.slice(0, getPortUUIDCallCount);
sendUUIDArr = allUUID.slice(0, 200);
vmiUUIDObj.uuidList = sendUUIDArr;
//vmiUUIDObj.fields = ["floating_ip_pools"];
allUUID = allUUID.slice(getPortUUIDCallCount, allUUID.length);
allUUID = allUUID.slice(200, allUUID.length);
var param = {};
param.allUUID = allUUID;
param.cbparam = cbparam;
Expand Down Expand Up @@ -1948,8 +1945,7 @@ function showPortEditWindow(mode, rowIndex, enableSubInterfaceFlag) {
ip["virtual_network_refs"][0]["to"][2];

subInterfaceParentValObj.virtual_network_refs = ip["virtual_network_refs"][0]["to"];
var value = {"uuid":ip["uuid"],"to":ip["fq_name"]};
console.log("inc:"+JSON.stringify(value));
var value = {"uuid":ip["uuid"],"to":ip["fq_name"]};
subInterfaceParentDatas.push({"text":subInterfaceParentText, "value":JSON.stringify(value)});
/*if(ip["virtual_machine_interface_device_owner"] == "compute:nova"){
//take it from VMR
Expand All @@ -1964,7 +1960,6 @@ function showPortEditWindow(mode, rowIndex, enableSubInterfaceFlag) {
}
if(ip["uuid"] == selectedPortUUID && enableSubInterfaceFlag == "true"){
var value = {"uuid":ip["uuid"],"to":ip["fq_name"]};
console.log(JSON.stringify(value));
subnetValue = JSON.stringify(value);
}
}
Expand Down
20 changes: 10 additions & 10 deletions webroot/config/vn/ui/js/vn_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function VirtualNetworkConfig() {
var ajaxParam;
var dynamicID;
var selectedProuters;
var getUUIDCallCount;
var vxlan_identifier_mode;

//Method definitions
Expand Down Expand Up @@ -80,7 +79,6 @@ function VirtualNetworkConfig() {
this.getDNSStatus = getDNSStatus;
this.getAllDNSServer = getAllDNSServer;
this.dynamicID = dynamicID;
this.getUUIDCallCount = getUUIDCallCount;
this.vxlan_identifier_mode = vxlan_identifier_mode;
this.destroy = destroy;
}
Expand All @@ -107,7 +105,6 @@ function fetchData() {

function initComponents() {
dynamicID = 0;
getUUIDCallCount = 200;
vxlan_identifier_mode = "automatic";
$("#gridVN").contrailGrid({
header : {
Expand Down Expand Up @@ -1900,18 +1897,18 @@ function successHandlerForAllUUIDGet(allUUID, cbparam)
var vnUUIDObj = {};
var sendUUIDArr = [];
vnUUIDObj.type = "virtual-network";
sendUUIDArr = allUUID.slice(0, getUUIDCallCount);
sendUUIDArr = allUUID.slice(0, 50);
vnUUIDObj.uuidList = sendUUIDArr;
vnUUIDObj.fields = ["floating_ip_pools"];
allUUID = allUUID.slice(getUUIDCallCount, allUUID.length);
allUUID = allUUID.slice(50, allUUID.length);
var param = {};
param.cbparam = cbparam;
param.allUUID = allUUID;
doAjaxCall("/api/tenants/config/get-config-data-paged", "POST", JSON.stringify(vnUUIDObj),
"successHandlerForGridVNLoop", "successHandlerForGridVNLoop", null, param);
} else {
doAjaxCall("/api/tenants/config/shared-virtual-networks/",
"GET", null, "successHandlerForAppendShared", "failureHandlerForAppendShared", null, allUUID);
"GET", null, "successHandlerForAppendShared", "failureHandlerForAppendShared", null, cbparam);
}
}

Expand All @@ -1930,24 +1927,27 @@ function successHandlerForGridVNLoop(result, param){
var vnUUIDObj = {};
var sendUUIDArr = [];
vnUUIDObj.type = "virtual-network";
sendUUIDArr = allUUID.slice(0, getUUIDCallCount);
sendUUIDArr = allUUID.slice(0, 200);
vnUUIDObj.uuidList = sendUUIDArr;
vnUUIDObj.fields = ["floating_ip_pools"];
allUUID = allUUID.slice(getUUIDCallCount, allUUID.length);
allUUID = allUUID.slice(200, allUUID.length);
var param = {};
param.cbparam = cbparam;
param.allUUID = allUUID;
doAjaxCall("/api/tenants/config/get-config-data-paged", "POST", JSON.stringify(vnUUIDObj),
"successHandlerForGridVNLoop", "successHandlerForGridVNLoop", null, param);
} else {
doAjaxCall("/api/tenants/config/shared-virtual-networks/",
"GET", null, "successHandlerForAppendShared", "failureHandlerForAppendShared", null, allUUID);
"GET", null, "successHandlerForAppendShared", "failureHandlerForAppendShared", null, cbparam);
}
successHandlerForGridVNRow(result);
gridVN.showGridMessage('loading');
}

function successHandlerForAppendShared(result){
function successHandlerForAppendShared(result, param){
if(param != ajaxParam){
return;
}
var uniqueNetwork = [];
var vnData = $("#gridVN").data("contrailGrid")._dataView.getItems();
for(var i=0;i<result.length;i++){
Expand Down

0 comments on commit 29fee20

Please sign in to comment.