Skip to content

Commit

Permalink
Closes-Bug:#1538584
Browse files Browse the repository at this point in the history
Issue is Instance tab timing out for TSN Nodes
	- Earlier Instances tab is displayed for all type of vRouters(TOR Agent, TOR Service Agent, Embedded), now changed to display only for Hypervisor type.
	- In Underlay page vRouter type is not there in response, so added the ContrailConfig in cflits.

Change-Id: Ie4b1f53c4f6279dd039ae1e23c6c342e712751cf
  • Loading branch information
vishnuvv committed Jan 28, 2016
1 parent c791d0c commit edf5a16
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 28 deletions.
48 changes: 26 additions & 22 deletions webroot/common/ui/js/controller.view.config.js
Expand Up @@ -518,7 +518,7 @@ define([
};

self.getVRouterDetailsPageTabs = function (viewConfig) {
return [
var tabViewConfig = [
{
elementId: 'vrouter_detail_tab_id',
title: 'Details',
Expand Down Expand Up @@ -678,24 +678,6 @@ define([
renderOnActivate: true
}
},{
elementId: 'vrouter_virtualmachines',
title: 'Instances',
view: "VRouterVirtualMachinesGridView",
viewPathPrefix:
ctwl.VROUTER_VIEWPATH_PREFIX,
app: cowc.APP_CONTRAIL_CONTROLLER,
viewConfig: viewConfig,
tabConfig: {
activate: function(event, ui) {
if ($('#' + ctwl.VROUTER_INSTANCE_GRID_ID).data('contrailGrid')) {
$('#' + ctwl.VROUTER_INSTANCE_GRID_ID).
data('contrailGrid').refreshView();
}
},
renderOnActivate: true
}
},
{
elementId: ctwl.VROUTER_CONSOLE_LOGS_VIEW_ID,
title: 'Console',
view: "NodeConsoleLogsView",
Expand All @@ -710,8 +692,7 @@ define([
},
renderOnActivate: true
}
},
{
},{
elementId:
ctwl.VROUTER_ALARMS_GRID_VIEW_ID,
title: 'Alarms',
Expand All @@ -730,7 +711,30 @@ define([
renderOnActivate: true
}
}
]
];
var vRouterType = viewConfig['vRouterType'];
if (vRouterType != null && vRouterType.indexOf('hypervisor') > -1 ) {
var instanceTabViewConfig = {
elementId: 'vrouter_virtualmachines',
title: 'Instances',
view: "VRouterVirtualMachinesGridView",
viewPathPrefix:
ctwl.VROUTER_VIEWPATH_PREFIX,
app: cowc.APP_CONTRAIL_CONTROLLER,
viewConfig: viewConfig,
tabConfig: {
activate: function(event, ui) {
if ($('#' + ctwl.VROUTER_INSTANCE_GRID_ID).data('contrailGrid')) {
$('#' + ctwl.VROUTER_INSTANCE_GRID_ID).
data('contrailGrid').refreshView();
}
},
renderOnActivate: true
}
};
tabViewConfig.splice(7,0,instanceTabViewConfig);
}
return tabViewConfig;
};
self.getDetailRowInstanceTemplateConfig = function () {
return {
Expand Down
Expand Up @@ -2635,16 +2635,24 @@ define([
};

self.getUnderlayVRouterParams = function (nodeDetails) {
return {
var vRouterType = JSON.parse(getValueByJsonPath(nodeDetails,
'more_attributes;ContrailConfig;elements;virtual_router_type',
[]));
//Default type is hypervisor, so we are inserting hypervisor
if (vRouterType.length == 0) {
vRouterType.push('hypervisor');
}
return {
hostname: nodeDetails['name'],
ip: getValueByJsonPath(nodeDetails,
'more_attributes;VrouterAgent;self_ip_list;0',
'-'),
introspectPort:
getValueByJsonPath(nodeDetails,
'more_attributes;VrouterAgent;sandesh_http_port',
ctwc.DEFAULT_INTROSPECTPORT)
};
ctwc.DEFAULT_INTROSPECTPORT),
vRouterType: vRouterType.toString()
};
};

self.getMarkersForUnderlay = function () {
Expand Down
Expand Up @@ -139,7 +139,10 @@ function buildvRouterVMTopology (nodeList, appData, callback)
opApiServer, null, appData);
url = '/analytics/uves/vrouter';
var vrPostData = {};
vrPostData['cfilt'] = ['VrouterAgent:self_ip_list','VrouterAgent:sandesh_http_port'];
// cfilts are not working for ContrailConfig object, so whole object is there.
// Once it start working need to pass virtual_router_type
vrPostData['cfilt'] = ['VrouterAgent:self_ip_list',
'VrouterAgent:sandesh_http_port', 'ContrailConfig:elements'];
commonUtils.createReqObj(dataObjArr, url, global.HTTP_REQUEST_POST, vrPostData,
opApiServer, null, appData);
var vmiUrl = '/analytics/uves/virtual-machine-interface';
Expand Down Expand Up @@ -228,7 +231,7 @@ function buildTopology (req, appData, callback)
for (var i = 0; i < vrCnt; i++) {
try {
tmpVRouterObjs[vrData[i]['name']] =
vrData[i]['value']['VrouterAgent'];
vrData[i]['value'];
} catch(e) {
continue;
}
Expand All @@ -239,7 +242,9 @@ function buildTopology (req, appData, callback)
phyTopo['nodes'][i]['node_type']) {
if (null != tmpVRouterObjs[phyTopo['nodes'][i]['name']]) {
phyTopo['nodes'][i]['more_attributes']['VrouterAgent']
= tmpVRouterObjs[phyTopo['nodes'][i]['name']];
= tmpVRouterObjs[phyTopo['nodes'][i]['name']]['VrouterAgent'];
phyTopo['nodes'][i]['more_attributes']['ContrailConfig']
= tmpVRouterObjs[phyTopo['nodes'][i]['name']]['ContrailConfig'];
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions webroot/monitor/networking/api/network.mon.api.js
Expand Up @@ -1453,6 +1453,9 @@ function getInstanceDetailsForVRouter (req, res, appData) {
return;
}
);
} else {
commonUtils.handleJSONResponse(null, res, resultJSON);
return;
}
});
}
Expand Down

0 comments on commit edf5a16

Please sign in to comment.