Skip to content

Commit

Permalink
Merge pull request floodlight#8 from QingWang0909/master
Browse files Browse the repository at this point in the history
Fix Floodligut WebGUI switchDetail.html throwing error on OpenFlow 1.4
  • Loading branch information
rizard authored May 23, 2018
2 parents 9097767 + 593762d commit 6836c32
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 27 deletions.
Binary file added .DS_Store
Binary file not shown.
88 changes: 61 additions & 27 deletions pages/switchDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -553,33 +553,67 @@ <h4 class="modal-title" id="myModalLabel2">Bandwitdh Consumption</h4>
success: function (dat) {
console.log(dat["port_reply"][0].port);
//
$('#portTable').DataTable({
aaData: dat["port_reply"],
"columnDefs": [
{
// The `data` parameter refers to the data for the cell (defined by the
// `data` option, which defaults to the column being worked with, in
// this case `data: 0`.
"render": function (data, type, row) {
return "<a id='btnStatistic' class='btn btn-sm btn-default' onclick='getStatistic(" + data + ")' >" + data + "</<a>";
},
"targets": 0
}

],

"aoColumns": [
{"mData": 'port.0.port_number'},
{"mData": 'port.0.receive_packets'},
{"mData": 'port.0.transmit_packets'},
{"mData": 'port.0.receive_bytes'},
{"mData": 'port.0.transmit_bytes'},
{"mData": 'port.0.receive_dropped'},
{"mData": 'port.0.transmit_dropped'},
{"mData": 'port.0.collisions'},
{"mData": 'port.0.duration_sec'}
]
});

if (dat["port_reply"][0].version == "OF_14") {
$('#portTable').DataTable({
aaData: dat["port_reply"],
"columnDefs": [
{
// The `data` parameter refers to the data for the cell (defined by the
// `data` option, which defaults to the column being worked with, in
// this case `data: 0`.
"render": function (data, type, row) {
return "<a id='btnStatistic' class='btn btn-sm btn-default' onclick='getStatistic(" + data + ")' >" + data + "</<a>";
},
"targets": 0
}

],

"aoColumns": [
{"mData": 'port.0.port_number'},
{"mData": 'port.0.receive_packets'},
{"mData": 'port.0.transmit_packets'},
{"mData": 'port.0.receive_bytes'},
{"mData": 'port.0.transmit_bytes'},
{"mData": 'port.0.receive_dropped'},
{"mData": 'port.0.transmit_dropped'},
{"mData": 'port.0.properties.collisions'},
{"mData": 'port.0.duration_sec'}
]
});
}
else {
$('#portTable').DataTable({
aaData: dat["port_reply"],
"columnDefs": [
{
// The `data` parameter refers to the data for the cell (defined by the
// `data` option, which defaults to the column being worked with, in
// this case `data: 0`.
"render": function (data, type, row) {
return "<a id='btnStatistic' class='btn btn-sm btn-default' onclick='getStatistic(" + data + ")' >" + data + "</<a>";
},
"targets": 0
}

],

"aoColumns": [
{"mData": 'port.0.port_number'},
{"mData": 'port.0.receive_packets'},
{"mData": 'port.0.transmit_packets'},
{"mData": 'port.0.receive_bytes'},
{"mData": 'port.0.transmit_bytes'},
{"mData": 'port.0.receive_dropped'},
{"mData": 'port.0.transmit_dropped'},
{"mData": 'port.0.collisions'},
{"mData": 'port.0.duration_sec'}
]
});
}



console.log("DATATABLE");
console.log($("#portTable").DataTable().rows().data());
Expand Down

0 comments on commit 6836c32

Please sign in to comment.