Skip to content

Commit

Permalink
Merge "Related-Bug:#1532814 Did the following changes in underlay pag…
Browse files Browse the repository at this point in the history
…e, 1)Added the vRouter IP in the tooltip 2)Changed the UUID to name in VM tooltip title 3)When the map/trace flow response is empty nodes and links, model change event is not triggered because the default values are empty arrays hence we are triggering manually when the response is empty array of nodes and links. 4)Showing the appropriate message and resetting the earlier path when the trace/map flow response is empty. 5)Changes the Tab title from search flow to Map flow. 6)Removing the tabs related to node while showing the trace flow/map flow response. 7)Changed the grid title from Trace Flows to Flows in trace flow results. 8)Fixed the issue, tough the query returns the response we are not showing in the grid in trace flow VM case this is happening since the last commit. 9)Fixed the issue, loading icon is not hiding in case when we are not issuing the ajax call for the trace/map flow. Change-Id: Icbcb8904b60e850909d7376eed0f80ef5b095879"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jan 14, 2016
2 parents a342ea1 + 1c76165 commit f6ec159
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 19 deletions.
2 changes: 1 addition & 1 deletion webroot/common/ui/js/controller.labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ define([
this.UNDERLAY_TRACEFLOW_TITLE = 'Trace Flows';
this.UNDERLAY_PROUTER_INTERFACES_TITLE = 'Interfaces';
this.UNDERLAY_PROUTER_DETAILS = 'Physical Router Details';
this.UNDERLAY_SEARCHFLOW_TITLE = 'Search Flows';
this.UNDERLAY_SEARCHFLOW_TITLE = 'Map Flows';
this.UNDERLAY_TRAFFIC_STATISTICS = 'Traffic Statistics';
this.UNDERLAY_SEARCHFLOW_WIDGET_TITLE = 'Query Flow Records';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2730,6 +2730,9 @@ define([
}
if(currentPage == 'mon_infra_underlay' &&
!graphModel.checkIPInVrouterList(params)) {
if(deferredObj != null) {
deferredObj.resolve(true);
}
showInfoWindow(
"Cannot Map the path for the selected flow", "Info");
return;
Expand All @@ -2756,16 +2759,22 @@ define([
return;
}
graphModel.underlayPathReqObj = params;
graphModel.flowPath.set('links', response['links']);
graphModel.flowPath.set('nodes', response['nodes']);
graphModel.flowPath.set({
'nodes': ifNull(response['nodes'], []),
'links': ifNull(response['links'], [])
});
if (ifNull(response['nodes'], []).length == 0 ||
ifNull(response['links'], []).length == 0) {
graphModel.flowPath.trigger('change:nodes');
}
$('html,body').animate({scrollTop:0}, 500);
}).fail (function () {
if(params['startAt'] != null &&
graphModel.lastInteracted > params['startAt']) {
if (deferredObj != null) {
deferredObj.resolve(false);
}
return;
graphModel.lastInteracted > params['startAt']) {
if (deferredObj != null) {
deferredObj.resolve(false);
}
return;
}
showInfoWindow('Error in fetching details','Error');
}).always (function (ajaxObj, state, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ define([
url: '/api/admin/reports/query',
data: ajaxData,
dataParser: function (response) {
monitorInfraParsers.parseUnderlayFlowRecords(response, vRouters);
return monitorInfraParsers.parseUnderlayFlowRecords(
response, vRouters);
}
};
traceFlowGridColumns =
Expand Down Expand Up @@ -159,7 +160,7 @@ define([
var gridElementConfig = {
header: {
title: {
text: ctwl.UNDERLAY_TRACEFLOW_TITLE,
text: 'Flows',
},
customControls: customControls,
defaultControls: {
Expand Down Expand Up @@ -328,6 +329,9 @@ define([
}
if(postData['nodeIP'] == null ||
graphModel.checkIPInVrouterList(postData['nodeIP'])) {
if(deferredObj != null) {
deferredObj.resolve(true);
}
showInfoWindow("Cannot Trace route for the selected flow", "Info");
return;
}
Expand Down Expand Up @@ -415,6 +419,9 @@ define([
}
}
if(graphModel.checkIPInVrouterList(postData['nodeIP'])) {
if(deferredObj != null) {
deferredObj.resolve(true);
}
showInfoWindow("Cannot Trace route for the selected flow", "Info");
return;
}
Expand Down Expand Up @@ -500,8 +507,14 @@ define([
}
if (graphModel != null) {
graphModel.underlayPathReqObj = postData;
graphModel.flowPath.set('links',ifNull(response['links'], []));
graphModel.flowPath.set('nodes',ifNull(response['nodes'], []));
graphModel.flowPath.set({
'nodes': ifNull(response['nodes'], []),
'links': ifNull(response['links'], [])
});
if (ifNull(response['nodes'], []).length == 0 ||
ifNull(response['links'], []).length == 0) {
graphModel.flowPath.trigger('change:nodes');
}
}
if(typeof response != 'string')
$('html,body').animate({scrollTop:0}, 500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,16 @@ define([

// Drawing the underlay path and trace flow for a given flow
graphModel.flowPath.on('change:nodes', function () {
self.removeUnderlayPathIds();
var nodes = graphModel.flowPath.get('nodes');
var links = graphModel.flowPath.get('links');
if(nodes.length <=0 || links.length <= 0){
showInfoWindow("Cannot Map the path for selected flow", "Info");
showInfoWindow("Cannot find the underlay path for selected flow", "Info");
return false;
} else {
self.resetTopology({
resetBelowTabs: false,
resetBelowTabs: true,
model: graphModel
});
return false;
}
var elementMap = graphModel['elementMap'];
var adjList = graphModel.prepareData("virtual-router");
Expand Down Expand Up @@ -1217,9 +1217,15 @@ define([
});
},
content: function(nodeDetails) {
var actions = [], instances = graphModel.VMs;
var actions = [], instances = graphModel.VMs,
ip = monitorInfraConstants.noDataStr;
var vms = 0,
name = getValueByJsonPath(nodeDetails, 'name', '-');
var ipArr = getValueByJsonPath(nodeDetails,
'more_attributes;VrouterAgent;self_ip_list', []);
if (ipArr.length > 0) {
ip = ipArr.join(',');
}
for (var i = 0; i < instances.length; i++) {
if (instances[i]['more_attributes']['vrouter'] ===
name) {
Expand All @@ -1235,6 +1241,9 @@ define([
var tooltipContent = [{
label: 'Name',
value: name
},{
label: 'IP',
value: ip
}, {
label: "Number of VMs",
value: vms
Expand Down Expand Up @@ -1271,7 +1280,7 @@ define([
VirtualMachine: {
title: function(nodeDetails) {
var virtualMachineName = getValueByJsonPath(nodeDetails,
'name', '-');
'more_attributes;vm_name', '-');
return tooltipTitleTmpl({
name: virtualMachineName,
type: ctwl.TITLE_GRAPH_ELEMENT_VIRTUAL_MACHINE
Expand Down Expand Up @@ -1323,6 +1332,10 @@ define([
label: label,
value: instanceName
}];
tooltipLblValues.push({
label: 'UUID',
value: instanceUUID
});
if (vmIp !== "") {
tooltipLblValues.push({
label: "IP",
Expand Down Expand Up @@ -1427,7 +1440,8 @@ define([
this.addElementsToGraph(childElementsArray, underlayGraphModel);
this.markErrorNodes();
if (options['resetBelowTabs'] == true) {
monitorInfraUtils.removeUnderlayTabs();
monitorInfraUtils.removeUnderlayTabs(
this.rootView.viewMap[ctwc.UNDERLAY_TABS_VIEW_ID]);
}
},

Expand Down

0 comments on commit f6ec159

Please sign in to comment.