From 927bb0df77a5f4acb0b7ad724040529346d8ae6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=96=8C?= Date: Wed, 16 May 2018 21:29:25 +0800 Subject: [PATCH] modified the mptcp graph into no downline of download graph and upload graph. --- .../luasrc/view/mptcp/multipath.htm | 41 ++----------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/luci-app-mptcp/luasrc/view/mptcp/multipath.htm b/luci-app-mptcp/luasrc/view/mptcp/multipath.htm index cc3c75c86..7a4a335c6 100644 --- a/luci-app-mptcp/luasrc/view/mptcp/multipath.htm +++ b/luci-app-mptcp/luasrc/view/mptcp/multipath.htm @@ -367,19 +367,15 @@ var el = Gdn.getElementById('rx').parentNode; - // intialize upline and downline datas for download and upload + // intialize upline datas for download and upload,the downline should be zero. var uplineDnl = { }; - var downlineDnl = { }; var uplineUpl = { }; - var downlineUpl = { }; // fetch upline and downline datas var toadditf = [ ]; for (var itf in data) { uplineDnl[itf] = [ ]; - downlineDnl[itf]= [ ]; uplineUpl[itf] = [ ]; - downlineUpl[itf]= [ ]; // build point sets var data_tx_avg; var data_rx_avg; @@ -395,10 +391,10 @@ tx_bot += updata[toadditf[j]][i]; } // set upline of the interface - uplineDnl[itf][i] = dndata[itf][i] + rx_bot; + uplineDnl[itf][i] = dndata[itf][i]; data_rx_peak = Math.max(data_rx_peak, dndata[itf][i]); data_max_dnl = Math.max(data_max_dnl, uplineDnl[itf][i]); - uplineUpl[itf][i] = updata[itf][i] + tx_bot; + uplineUpl[itf][i] = updata[itf][i]; data_tx_peak = Math.max(data_tx_peak, updata[itf][i]); data_max_upl = Math.max(data_max_upl, uplineUpl[itf][i]); @@ -412,12 +408,6 @@ data_rx_avg = dndata[itf][i]; data_tx_avg = updata[itf][i]; } - - if(toadditf.length) - { - downlineDnl[itf][i] = uplineDnl[toadditf[toadditf.length-1]][i]; - downlineUpl[itf][i] = uplineUpl[toadditf[toadditf.length-1]][i]; - } } toadditf.push(itf); // Update stats labels @@ -480,31 +470,6 @@ pt_tx += ' ' + width + ',' + y_tx; pt_tx += ' ' + width + ',' + height; - for (var i = downlineDnl[itf].length - 1; i >= 0; i--) - { - var x = i * step; - - y_rx = height - Math.floor((downlineDnl[itf][i] - 10) * data_scale_dnl); - y_tx = height - Math.floor((downlineUpl[itf][i] - 10) * data_scale_upl); - // recreate tangant point in bottom line graph - if(i == downlineDnl[itf].length - 1) - { - pt_rx += ' ' + width + ',' + height; - pt_rx += ' ' + width + ',' + y_rx; - - pt_tx += ' ' + width + ',' + height; - pt_tx += ' ' + width + ',' + y_tx; - } - - pt_rx += ' ' + x + ',' + y_rx; - pt_tx += ' ' + x + ',' + y_tx; - } - // go back to right bottom corner to correctly fill polyline - pt_tx += ' ' + 0 + ',' + height; - pt_tx += ' ' + width + ',' + height; - pt_rx += ' ' + 0 + ',' + height; - pt_rx += ' ' + width + ',' + height; - // Draw polygon dnPolygons[itf].setAttribute('points', pt_rx); upPolygons[itf].setAttribute('points', pt_tx);