Skip to content

Commit

Permalink
Merge "Closes-Bug: #1548295 - Using the tags in Edits of Interface ro…
Browse files Browse the repository at this point in the history
…utes table and service instance page. - Changed the label from SR-IOV to Provider Network in VN config page. - Moved the Network Route Tables, Interface Route Tables, Routing policies, Route Aggregates as tabs under new menu item Routing. - Fixed the grid load issues in Route Tables on clicking the tabs. - Changed the order of next-hop-type and next-hop in Network Route Tables."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 23, 2016
2 parents 5c2fc69 + 6f2f835 commit 8832f4a
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 93 deletions.
8 changes: 8 additions & 0 deletions webroot/common/ui/js/controller.constants.js
Expand Up @@ -667,6 +667,14 @@ define([
this.ROUTE_AGGREGATE_PREFIX_ID = "route_aggregate";
this.URL_CREATE_ROUTE_AGGREGATE = "/api/tenants/config/route-aggregates";
this.URL_UPDATE_ROUTE_AGGREGATE = "/api/tenants/config/route-aggregate/";

this.DEFAULT_COMMUNITIES = [
{text:"no-export",id:"no-export"},
{text:"accept-own",id:"accept-own"},
{text:"no-advertise",id:"no-advertise"},
{text:"no-export-subconfed",id:"no-export-subconfed"},
{text:"no-reoriginate",id:"no-reoriginate"}
];
};

//str will be [0-9]+(m|h|s|d)
Expand Down
Expand Up @@ -779,7 +779,7 @@ define([
elementId: 'user_created_sriov_enabled',
view: 'FormCheckboxView',
viewConfig: {
label: 'SR-IOV',
label: 'Provider Network',
path: 'user_created_sriov_enabled',
class: 'span2',
dataBindValue: 'user_created_sriov_enabled',
Expand Down
Expand Up @@ -372,7 +372,7 @@ define([
}
},
{
label: 'SR-IOV',
label: 'Provider Network',
key: 'uuid',
templateGenerator: 'TextGenerator',
templateGeneratorConfig: {
Expand Down
Expand Up @@ -132,7 +132,6 @@ define([
viewConfig: {
path: "routes",
collection: "routes",
label: 'Route Aggregate',
templateId: cowc.TMP_EDITABLE_GRID_ACTION_VIEW,
columns: [{
elementId: "route",
Expand Down
Expand Up @@ -108,7 +108,7 @@ define([
formatter: routeAggregateFormatter.nextHopFormatter
}, {
field: "aggregate-route-entries.route",
name: "Routes",
name: "Route Aggregate Prefixes",
sortable: true,
formatter: routeAggregateFormatter.routesFormatter
}]
Expand Down Expand Up @@ -246,7 +246,7 @@ define([
},{
key: "aggregate_route_entries.route",
templateGenerator: "TextGenerator",
label: "Routes",
label: "Route Aggregate Prefixes",
templateGeneratorConfig: {
formatter: "RoutesFormatter"
}
Expand Down
Expand Up @@ -149,16 +149,21 @@ define([

viewConfigCommunityAttr = {
elementId: 'community_attr',
view: 'FormTextAreaView',
view: 'FormMultiselectView',
class: "",
name: 'Communities',
viewConfig: {
width: 400,
placeHolder: 'Communities separated by ' +
'comma or press enter',
templateId: cowc.TMPL_EDITABLE_GRID_TEXTAREA_VIEW,
templateId: cowc.TMPL_EDITABLE_GRID_MULTISELECT_VIEW,
path: 'community_attr',
dataBindValue: 'community_attr()'
dataBindValue: 'community_attr()',
elementConfig: {
placeholder: 'Select or Enter Communities',
dataTextField: "text",
dataValueField: "id",
data : ctwc.DEFAULT_COMMUNITIES,
tags: true
}
}
};

Expand Down Expand Up @@ -207,7 +212,6 @@ define([
elementId: 'routes',
view: 'FormEditableGridView',
viewConfig: {
label: 'Route(s)',
path: 'routes',
collection: 'routes',
validation: 'rtTableRoutesValidation',
Expand Down
50 changes: 26 additions & 24 deletions webroot/config/networking/routetable/ui/js/views/RtTableGridView.js
Expand Up @@ -91,7 +91,7 @@ define([
}
},
columnHeader: {
columns: rtTableColumns
columns: rtTableColumns(tabId)
},
footer: {
}
Expand Down Expand Up @@ -185,7 +185,7 @@ define([
var rtTableModel = new RtTableModel(dataItem);
rtTableEditView.model = rtTableModel;
rtTableEditView.renderConfigureRtTable({
"title": 'Create ' + getRtTableDisplayName() +
"title": 'Edit ' + getRtTableDisplayName() +
' (' + dataItem['display_name'] +
')',
rowIndex: rowIndex,
Expand Down Expand Up @@ -240,16 +240,16 @@ define([
dispStr += 'prefix ';
dispStr += '<span class="gridLabel">' + v[i]['prefix'] + '</span>';
}
if (null != v[i]['next_hop']) {
dispStr += 'next-hop ';
dispStr += '<span class="gridLabel">' + v[i]['next_hop'] +
'</span>';
}
if (null != v[i]['next_hop_type']) {
dispStr += 'next-hop-type ';
dispStr += '<span class="gridLabel">' +
v[i]['next_hop_type'] + '</span>';
}
if (null != v[i]['next_hop']) {
dispStr += 'next-hop ';
dispStr += '<span class="gridLabel">' + v[i]['next_hop'] +
'</span>';
}
var commAttr =
getValueByJsonPath(v[i],
'community_attributes;community_attribute',
Expand All @@ -268,24 +268,26 @@ define([
return dispStr;
}

var rtTableColumns = [
{
id: 'display_name',
field: 'display_name',
width: 20,
name: 'Route Table',
},
{
id: "route",
field: "route",
width: 80,
name: "Routes",
formatter: rtTablesFormatter,
sortable: {
sortBy: 'formattedValue'
var rtTableColumns = function(tabId) {
return [
{
id: 'display_name',
field: 'display_name',
width: 20,
name: 'Route Table',
},
{
id: "route",
field: "route",
width: 80,
name: (tabId == 0) ? 'Network Routes' : 'Interface Routes',
formatter: rtTablesFormatter,
sortable: {
sortBy: 'formattedValue'
}
}
}
];
];
}

function getHeaderActionConfig(tabText) {
var rtTableName = getRtTableDisplayName();
Expand Down
62 changes: 53 additions & 9 deletions webroot/config/networking/routetable/ui/js/views/RtTableView.js
Expand Up @@ -17,6 +17,17 @@ define([

var getRtTableTabViewConfig = function(viewConfig) {
return function (projectSelectedValueData) {
var domain = {
'name':projectSelectedValueData.parentSelectedValueData.name,
'uuid':projectSelectedValueData.parentSelectedValueData.value,
}
var project = {
'name':projectSelectedValueData.name,
'uuid':projectSelectedValueData.value,
}
//Store the domain and project along with uuid to be used later.
ctwu.setGlobalVariable("domain", domain);
ctwu.setGlobalVariable("project", project);
var newViewConfig =
$.extend(true, {}, viewConfig,
{projectSelectedValueData: projectSelectedValueData})
Expand All @@ -37,41 +48,74 @@ define([

function getRtTableTabView (viewConfig) {
return {
theme: 'classic',
theme: 'default',
active: 0,
tabs: [{
elementId: 'network_route_table',
title: 'Network Route Table',
title: 'Network Route Tables',
view: "RtTableListView",
viewPathPrefix: "config/networking/routetable/ui/js/views/",
viewConfig: viewConfig,
tabConfig: {
activate: function(event, ui) {
var tabId = $('#rt-table-tab').tabs('option', 'active');
var tabText = 'Tab' + tabId.toString();
if ($('#' +
ctwl.NETWORK_ROUTE_TABLE_ID).data('contrailGrid')) {
ctwl.RT_TABLE_GRID_ID + tabText).data('contrailGrid')) {
$('#' +
ctwl.NETWORK_ROUTE_TABLE_ID).data('contrailGrid').refreshView();
ctwl.RT_TABLE_GRID_ID + tabText).data('contrailGrid').refreshView();
}
}
}
},
{
elementId: 'interface_route_table',
title: 'Interface Route Table',
title: 'Interface Route Tables',
view: "RtTableInterfaceListView",
viewPathPrefix: "config/networking/routetable/ui/js/views/",
viewConfig: viewConfig,
tabConfig: {
activate: function(event, ui) {
if ($('#' +
ctwl.INTERFACE_ROUTE_TABLE_ID).data('contrailGrid')) {
var tabId = $('#rt-table-tab').tabs('option', 'active');
var tabText = 'Tab' + tabId.toString();
if ($('#' + ctwl.RT_TABLE_GRID_ID + tabText).data('contrailGrid')) {
$('#' +
ctwl.INTERFACE_ROUTE_TABLE_ID).data('contrailGrid').refreshView();
ctwl.RT_TABLE_GRID_ID + tabText).data('contrailGrid').refreshView();
}
},
renderOnActivate: true
}
}]
},
{
elementId: 'routing_policy_tab',
title: 'Routing Policies',
view: "routingPolicyListView",
viewPathPrefix: "config/networking/routingpolicy/ui/js/views/",
viewConfig: viewConfig,
tabConfig: {
activate: function(event, ui) {
if ($('#' + ctwl.ROUTING_POLICY_GRID_ID).data('contrailGrid')) {
$('#' + ctwl.ROUTING_POLICY_GRID_ID).data('contrailGrid').refreshView();
}
},
renderOnActivate: true
}
},
{
elementId: 'route_aggregates_tab',
title: 'Route Aggregates',
view: "routeAggregateListView",
viewPathPrefix: "config/networking/routeaggregate/ui/js/views/",
viewConfig: viewConfig,
tabConfig: {
activate: function(event, ui) {
if ($('#' + ctwc.ROUTE_AGGREGATE_GRID_ID).data('contrailGrid')) {
$('#' + ctwc.ROUTE_AGGREGATE_GRID_ID).data('contrailGrid').refreshView();
}
},
renderOnActivate: true
}
}]
}
}
function getRtTableConfig (viewConfig) {
Expand Down
15 changes: 10 additions & 5 deletions webroot/config/services/instances/ui/js/svcInst.utils.js
Expand Up @@ -374,16 +374,21 @@ define([
},
{
elementId: 'community_attributes',
view: 'FormTextAreaView',
view: 'FormMultiselectView',
width:161,
viewConfig: {
label: 'Community',
width: 161,
placeHolder: 'Attributes seperated by ' +
'comma or press enter',
templateId: cowc.TMPL_EDITABLE_GRID_TEXTAREA_VIEW,
templateId: cowc.TMPL_EDITABLE_GRID_MULTISELECT_VIEW,
path: 'community_attributes',
dataBindValue: 'community_attributes()'
dataBindValue: 'community_attributes()',
elementConfig: {
placeholder: 'Select or Enter Communities',
dataTextField: "text",
dataValueField: "id",
data : ctwc.DEFAULT_COMMUNITIES,
tags: true
}
}
}]
}]
Expand Down
12 changes: 6 additions & 6 deletions webroot/menu.xml
Expand Up @@ -629,7 +629,7 @@ and need to add the iconClass tag wherever we need to show some icons
</resources>
<searchStrings>Floating IPs, Floating IP, FIP</searchStrings>
</item>
<item>
<!-- <item>
<label>Routing Policies</label>
<hash>config_net_rpolicies</hash>
<resources>
Expand All @@ -644,10 +644,10 @@ and need to add the iconClass tag wherever we need to show some icons
</resource>
</resources>
<searchStrings>Routing Policies</searchStrings>
</item>
</item> -->
<item>
<label>Route Tables</label>
<hash>config_net_rttable</hash>
<label>Routing</label>
<hash>config_net_routing</hash>
<resources>
<resource>
<rootDir>/common/ui</rootDir>
Expand All @@ -661,7 +661,7 @@ and need to add the iconClass tag wherever we need to show some icons
</resources>
<searchStrings>Route Table</searchStrings>
</item>
<item>
<!-- <item>
<label>Route Aggregates</label>
<hash>config_net_rtaggregates</hash>
<resources>
Expand All @@ -676,7 +676,7 @@ and need to add the iconClass tag wherever we need to show some icons
</resource>
</resources>
<searchStrings>Route Aggregates</searchStrings>
</item>
</item> -->
</items>
</item>
<item>
Expand Down

0 comments on commit 8832f4a

Please sign in to comment.