Skip to content

Commit

Permalink
Port page Issue
Browse files Browse the repository at this point in the history
Fat flow schema change is done(was expecting an empty array).
Ordering/Formatting UX of Mirroring in port is done

The port getting created was not there in the list.
because the 2nd call was not getting sent as expected.
- Fixed it.
Closes-Bug: #1539950

If we refresh the port page and open the edit popup the SG was getting vanished
- Fixed it
Closes-Bug: #1539639

Routing policy page was not showing the collection in the popup.
- Fixed it.

Change-Id: Ibe31455a6a9f7b81e31c7291df98f221b81269ba
  • Loading branch information
balamurugang committed Feb 2, 2016
1 parent f12056a commit 2b31774
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 89 deletions.
3 changes: 2 additions & 1 deletion webroot/config/networking/port/ui/js/models/fatFlowModel.js
Expand Up @@ -35,7 +35,8 @@ define([
},
'port': function(value, attr, finalObj) {
if(finalObj.protocol != "icmp") {
if(value.trim() == "") {
value = String(value).trim();
if(value == "") {
return "Enter valid port between 1 to 65535 for Fat Flow Record";
}
if (!isNumber(value)) {
Expand Down
1 change: 1 addition & 0 deletions webroot/config/networking/port/ui/js/models/portModel.js
Expand Up @@ -833,6 +833,7 @@ define([
var fatFlowCollection =
newPortData["fatFlowCollection"].toJSON();
newPortData.virtual_machine_interface_fat_flow_protocols = {};
newPortData.virtual_machine_interface_fat_flow_protocols.fat_flow_protocol = [];
if (fatFlowCollection && fatFlowCollection.length > 0) {
var fatFlowLocal = [];
for(i = 0 ; i< fatFlowCollection.length ; i++){
Expand Down
138 changes: 69 additions & 69 deletions webroot/config/networking/port/ui/js/views/portEditView.js
Expand Up @@ -676,7 +676,65 @@ define([
}]
}
}]
},{
},
this.deviceOwner(isDisable, selectedProjectVal)
, {
columns: [{
elementId: 'is_sub_interface',
name: "Sub Interface",
view: "FormCheckboxView",
viewConfig: {
path: 'is_sub_interface',
label: "Sub Interface",
dataBindValue: 'is_sub_interface',
class: "span6"
}
}]
}, {
columns: [{
elementId: 'sub_interface_vlan_tag',
name: "VLAN",
view: "FormInputView",
viewConfig: {
visible: "is_sub_interface",
placeholder: 'Specify VLAN',
path: 'virtual_machine_interface_properties.sub_interface_vlan_tag',
dataBindValue: 'virtual_machine_interface_properties().sub_interface_vlan_tag',
class: "span6",
label: 'VLAN'
}
}]
}, {
columns: [{
elementId: 'subInterfaceVMIValue',
name: "Primary Interface",
view: "FormDropdownView",
viewConfig: {
path: 'subInterfaceVMIValue',
visible: "is_sub_interface",
placeholder: 'Primary Interface',
disabled: "disable_sub_interface()",
label: "Primary Interface",
dataBindValue: 'subInterfaceVMIValue',
elementConfig:{
dataTextField: "text",
dataValueField: "value",
//defaultValueId : 0,
dataSource : {
type: 'remote',
url:"/api/tenants/config/get-virtual-machines-ips?uuid="
+selectedProjectVal,
parse: function(result) {
return portFormatter.subInterfaceFormatter(
result,
isDisable,
self);
}
}
}
}
}]
}, {
columns: [{
elementId: 'portBindingCollection',
view: 'FormEditableGridView',
Expand Down Expand Up @@ -741,72 +799,14 @@ define([
}]
}
}]
},
this.deviceOwner(isDisable, selectedProjectVal)
, {
columns: [{
elementId: 'is_sub_interface',
name: "Sub Interface",
view: "FormCheckboxView",
viewConfig: {
path: 'is_sub_interface',
label: "Sub Interface",
dataBindValue: 'is_sub_interface',
class: "span6"
}
}]
}, {
columns: [{
elementId: 'sub_interface_vlan_tag',
name: "VLAN",
view: "FormInputView",
viewConfig: {
visible: "is_sub_interface",
placeholder: 'Specify VLAN',
path: 'virtual_machine_interface_properties.sub_interface_vlan_tag',
dataBindValue: 'virtual_machine_interface_properties().sub_interface_vlan_tag',
class: "span6",
label: 'VLAN'
}
}]
}, {
columns: [{
elementId: 'subInterfaceVMIValue',
name: "Primary Interface",
view: "FormDropdownView",
viewConfig: {
path: 'subInterfaceVMIValue',
visible: "is_sub_interface",
placeholder: 'Primary Interface',
disabled: "disable_sub_interface()",
label: "Primary Interface",
dataBindValue: 'subInterfaceVMIValue',
elementConfig:{
dataTextField: "text",
dataValueField: "value",
//defaultValueId : 0,
dataSource : {
type: 'remote',
url:"/api/tenants/config/get-virtual-machines-ips?uuid="
+selectedProjectVal,
parse: function(result) {
return portFormatter.subInterfaceFormatter(
result,
isDisable,
self);
}
}
}
}
}]
} , {
columns: [{
elementId: 'is_mirror',
name: "Mirror To",
name: "Enable Port Mirroring",
view: "FormCheckboxView",
viewConfig: {
path: 'is_mirror',
label: "Mirror To",
label: "Enable Port Mirroring",
dataBindValue: 'is_mirror',
class: "span6"
}
Expand All @@ -818,7 +818,7 @@ define([
viewConfig : [{
visible : 'is_mirror',
elementId: 'mirror',
title: 'Mirror To',
title: 'Port Mirroring',
view: "SectionView",
viewConfig : {
rows : [{
Expand All @@ -845,13 +845,13 @@ define([
}, {
columns: [{
elementId: 'mirrorToAnalyzerName',
name: "Analyzer",
name: "Analyzer Name",
view: "FormInputView",
viewConfig: {
path: 'mirrorToAnalyzerName',
dataBindValue: 'mirrorToAnalyzerName',
placeholder: 'Analyzer',
label: 'Analyzer',
placeholder: 'Analyzer Name',
label: 'Analyzer Name',
}
}]
}, {
Expand All @@ -860,25 +860,25 @@ define([
name: "Analyzer IP Address",
view: "FormInputView",
viewConfig: {
class: "span6",
path: 'mirrorToAnalyzerIpAddress',
placeholder: 'xxx.xxx.xxx.xxx',
dataBindValue: 'mirrorToAnalyzerIpAddress',
label: 'Analyzer IP Address'
}
}]
}, {
columns: [{
}, {
elementId: 'mirrorToUdpPort',
name: "UDP Port",
view: "FormInputView",
viewConfig: {
class: "span6",
path: 'mirrorToUdpPort',
placeholder: '1 to 65535',
dataBindValue: 'mirrorToUdpPort',
label: 'UDP Port'
}
}]
}, {
},{
columns: [{
elementId: 'mirrorToRoutingInstance',
name: "Routing Instance",
Expand Down
18 changes: 4 additions & 14 deletions webroot/config/networking/port/ui/js/views/portFormatters.js
Expand Up @@ -359,10 +359,10 @@ define([
mirror += this.addTableRow(["Analyzer Name", " : ", temp]);

temp = getValueByJsonPath(mirrorObj, "analyzer_ip_address", "-");
mirror += this.addTableRow(["Analyzer IP Address", " : ", temp]);
var temp1 = getValueByJsonPath(mirrorObj, "udp_port", "-");

temp = getValueByJsonPath(mirrorObj, "udp_port", "-");
mirror += this.addTableRow(["UDP port", " : ", temp]);
mirror += this.addTableRow(["Analyzer IP Address", " : ",
temp + ", UDP port : " + temp1]);

temp = getValueByJsonPath(mirrorObj, "routing_instance", "-");
if (temp != "") {
Expand Down Expand Up @@ -507,11 +507,10 @@ define([
/*
Create / Edit Security Group drop down data formatter
*/
this.sgDDFormatter = function(response, edit, portModel) {
this.sgDDFormatter = function(response, edit, portEditView) {
var sgList = [];
var sg = response["security-groups"];
var responseLen = sg.length;
var defaultSelectedVal = [];
var sgResponseVal = "";
for(var i = 0; i < responseLen; i++) {
var sgResponse = getValueByJsonPath(sg[i], 'fq_name', '');
Expand All @@ -520,18 +519,9 @@ define([
var objArr = sgResponse;
var text = "";
text = ctwu.formatCurrentFQName(sgResponse)
if(text == "default") {
defaultSelectedVal.push(sgResponseVal);
}
sgList.push({value: sgResponseVal, text: text});
}
}
portModel.sgDefaultValue = defaultSelectedVal
if(!edit) {
//portModel.model.is_sec_grp = true;//KO stops working if we put this
//portModel.model.is_sec_grp_disabled = false;
portModel.model.securityGroupValue(defaultSelectedVal);
}
return sgList;
};
/*
Expand Down
13 changes: 10 additions & 3 deletions webroot/config/networking/port/ui/js/views/portGridView.js
Expand Up @@ -85,6 +85,8 @@ define([
dataItem.virtual_machine_interface_refs = virtualMachineInterfaceRefs;
dataItem.is_sub_interface = true;
dataItem.disable_sub_interface = true;
dataItem.securityGroupValue = portFormatters.getProjectFqn()+":default";
dataItem.is_sec_grp = true;
dataItem.virtual_machine_interface_properties = {};
dataItem.virtual_machine_interface_properties.sub_interface_vlan_tag
= 'addSubInterface';
Expand Down Expand Up @@ -282,8 +284,10 @@ define([
"title": ctwl.TITLE_ADD_PORT,
"iconClass": "icon-plus",
"onClick": function () {

var portModel = new PortModel();
var dataItem = {};
dataItem.securityGroupValue = portFormatters.getProjectFqn()+":default";
dataItem.is_sec_grp = true;
var portModel = new PortModel(dataItem);
portEditView.model = portModel;
showHideModelAttrs(portModel);
portEditView.renderPortPopup({
Expand All @@ -303,7 +307,10 @@ define([
function showHideModelAttrs(portModel) {
portModel.is_sec_grp_disabled = ko.computed((function() {
if(this.is_sec_grp() == true) {
this.securityGroupValue(portEditView.sgDefaultValue);
if (this.securityGroupValue() == "") {
var sgDefaultVal = [portFormatters.getProjectFqn()+":default"];
this.securityGroupValue(sgDefaultVal);
}
return false;
} else {
this.securityGroupValue([]);
Expand Down
2 changes: 1 addition & 1 deletion webroot/config/networking/port/ui/js/views/portListView.js
Expand Up @@ -68,10 +68,10 @@ define([
return;
}
self.appendNewData(result);
self.portGetChunkCnt = 200;
cbparam.allUUID = cbparam.allUUID.slice(
self.portGetChunkCnt,
cbparam.allUUID.length);
self.portGetChunkCnt = 200;
if(cbparam.allUUID.length > 0) {
//$("#"+ctwl.PORT_GRID_ID).data("contrailGrid").showGridMessage("loading");
self.fetchPortChunk(cbparam.allUUID, cbparam.cbparam);
Expand Down
Expand Up @@ -165,7 +165,7 @@ define([
label:"Terms",
path: "termCollection",
validation: 'termValidation',
templateId: cowc.TMPL_COLLECTION_VIEW,
templateId: cowc.TMPL_EDITABLE_GRID_VIEW,
collection: "termCollection",
columns: [{
elementId: 'fromValue',
Expand Down

0 comments on commit 2b31774

Please sign in to comment.