Skip to content

Commit

Permalink
Changing existing underlay code to suit VisNodeModel, VisEdgeModel, V…
Browse files Browse the repository at this point in the history
…isTooltipModel, ContrailVisView.

Parse response to categorize the nodes.
Create VisNodeModels, VisEdgeModels, VisTooltipModels
Form Node/Edges collection based on models specified above, in UnderlayGraphModels.
Use Image instead of ICONs to represent node.
Create proper view tree.

Change-Id: Iac15282fc4d07dee1453d35016550554f3229037
Partial-Bug:#1575591
Closes-Bug: #1557441
Closes-Bug: #1557869
Closes-Bug: #1554501
Closes-Bug: #1554495
Closes-Bug: #1550407
Closes-Bug: #1550255
Closes-Bug: #1546052
  • Loading branch information
Balaji Kumar AS committed Apr 28, 2016
1 parent 0fa0815 commit 76c0174
Show file tree
Hide file tree
Showing 19 changed files with 2,714 additions and 2,368 deletions.
1 change: 1 addition & 0 deletions webroot/common/ui/js/controller.labels.js
Expand Up @@ -332,6 +332,7 @@ define([
this.TITLE_GRAPH_ELEMENT_CONNECTED_NETWORK = 'link';

//Underlay labels
this.UNDERLAY_TOPOLOGY_PAGE_ID = 'underlay-topology-page';
this.UNDERLAY_TOPOLOGY_ID = 'underlay-topology';
this.UNDERLAY_GRAPH_ID = "underlay-graph";
this.URL_UNDERLAY_TOPOLOGY = '/api/tenant/networking/underlay-topology';
Expand Down
6 changes: 6 additions & 0 deletions webroot/common/ui/js/controller.view.config.js
Expand Up @@ -392,6 +392,9 @@ define([
viewPathPrefix: ctwl.UNDERLAY_VIEWPATH_PREFIX,
app: cowc.APP_CONTRAIL_CONTROLLER,
viewConfig: {
viewConfig: {
model: viewConfig.model
},
widgetConfig: {
elementId: ctwc.UNDERLAY_SEARCHFLOW_TAB_ID + '-widget',
view: "WidgetView",
Expand All @@ -417,6 +420,9 @@ define([
ctwl.UNDERLAY_VIEWPATH_PREFIX,
app: cowc.APP_CONTRAIL_CONTROLLER,
viewConfig: {
viewConfig: {
model: viewConfig.model
},
widgetConfig: {
elementId: ctwc.UNDERLAY_TRACEFLOW_TAB_ID + '-widget',
view: "WidgetView",
Expand Down
Expand Up @@ -1838,54 +1838,6 @@ define(
return x;
}
};
this.parseUnderlayFlowRecords = function (response, vRouters) {
vRouters = ifNull(vRouters,[]);
$.each(ifNull(response['data'],[]),function (idx,obj) {
var formattedVrouter,formattedOtherVrouter,
formattedSrcVN,formattedDestVN;
var vRouterIp =
validateIPAddress(cowu.handleNull4Grid(obj['vrouter_ip'])) == true ?
cowu.handleNull4Grid(obj['vrouter_ip']) : noDataStr,
formattedVrouter = vRouterIp;
var vrouter = ifNull(obj['vrouter'],noDataStr);
if(vRouterIp != noDataStr || vrouter != noDataStr)
formattedVrouter =
contrail.format('{0} ({1})',vrouter, vRouterIp);
var othervRouterIp =
validateIPAddress(cowu.handleNull4Grid(obj['other_vrouter_ip'])) == true ?
cowu.handleNull4Grid(obj['other_vrouter_ip']) : noDataStr,
formattedOtherVrouter = othervRouterIp;
if(othervRouterIp != noDataStr) {
$.each(vRouters,function(idx,obj){
var ipList = getValueByJsonPath(obj,
'more_attributes;VrouterAgent;self_ip_list',[]);
if(ipList.indexOf(othervRouterIp) > -1)
formattedOtherVrouter = contrail.format('{0} ({1})',
ifNull(obj['name'],noDataStr), othervRouterIp);
});
}
var formattedSrcVN = cowu.handleNull4Grid(obj['sourcevn']);
formattedSrcVN = formatVN(formattedSrcVN);
var formattedDestVN = cowu.handleNull4Grid(obj['destvn']);
formattedDestVN = formatVN(formattedSrcVN);
obj['formattedVrouter'] = formattedVrouter;
obj['formattedOtherVrouter'] = formattedOtherVrouter;
obj['formattedSrcVN'] = formattedSrcVN[0];
obj['formattedDestVN'] = formattedDestVN[0];
});
response['data'].sort(function(dataItem1,dataItem2){
if((dataItem1['vrouter_ip'] != null && dataItem1['other_vrouter_ip']!= null)
&& (dataItem2['vrouter_ip'] == null || dataItem2['other_vrouter_ip'] == null)) {
return -1;
} else if ((dataItem2['vrouter_ip'] != null && dataItem2['other_vrouter_ip']!= null)
&& (dataItem1['vrouter_ip'] == null || dataItem1['other_vrouter_ip'] == null)) {
return 1;
} else {
return 0;
}
});
return response['data'];
}

self.getCores = function (data) {
var fileList=[];
Expand Down

0 comments on commit 76c0174

Please sign in to comment.