Skip to content

Commit

Permalink
Release v0.2 - Make it compatible with earlier versions of luci
Browse files Browse the repository at this point in the history
Make sure `wrtbwmon.htm` file is `XHTML` valid and add another endpoint for usage_data as a workaround

Closes #4
  • Loading branch information
Kiougar committed Feb 22, 2017
1 parent 8e2d902 commit 1f282c2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ For the above commands to work the only *requirement* is that the `wrtbwmon` pac

## Install

##### Step 1 - install the `wrtbwmon` package (if you have it installed skip to Step 2):
##### Step 1 - install the `wrtbwmon` package:

* Download the latest `.ipk` file from [wrtbwmon releases](https://github.com/pyrovski/wrtbwmon/releases)
* Copy the file to your router `/tmp` directory
Expand All @@ -47,8 +47,6 @@ For the above commands to work the only *requirement* is that the `wrtbwmon` pac

##### Step 2 - setup* the `wrtbwmon` package:

* If you have `wrtbwmon` version `0.35` the init script uses `wrtbwmon.sh` where it was renamed to `wrtbwmon`
* to fix: `sed -i 's/wrtbwmon\.sh/wrtbwmon/g' /etc/init.d/wrtbwmon`
* Schedule it to run on startup `/etc/init.d/wrtbwmon enable`
* Manually start it now `/etc/init.d/wrtbwmon start`

Expand Down
1 change: 1 addition & 0 deletions luci-wrtbwmon/luasrc/controller/wrtbwmon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module("luci.controller.wrtbwmon", package.seeall)

function index()
entry({"admin", "network", "usage"}, template("wrtbwmon"), "Usage").dependent=true
entry({"admin", "network", "usage", "usage_data"}, call("usage_data")).dependent=true
entry({"admin", "network", "usage_data"}, call("usage_data")).dependent=true
end

Expand Down
6 changes: 4 additions & 2 deletions luci-wrtbwmon/luasrc/view/wrtbwmon.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1>Network Usage:</h1>
<small>Auto update every</small>
<select id="intervalSelect" style="width:90px;height:20px;font-size:11px;">
<option value="-1">Disabled</option>
<option value="5" selected>5 seconds</option>
<option value="5" selected="selected">5 seconds</option>
<option value="10">10 seconds</option>
<option value="20">20 seconds</option>
<option value="30">30 seconds</option>
Expand All @@ -26,6 +26,7 @@ <h1>Network Usage:</h1>
<tbody id="tableBody"><tr><td>Loading...</td></tr></tbody>
</table>
<script>
//<![CDATA[
// interval in seconds
var scheduleTimeout, updateTimeout, isScheduled = true, interval = 5;

Expand Down Expand Up @@ -145,7 +146,7 @@ <h1>Network Usage:</h1>

// create displayData
var displayData = [
'<td title="' + data[1] + '">' + data[0] + '<br>' + data[2] + '</td>',
'<td title="' + data[1] + '">' + data[0] + '<br />' + data[2] + '</td>',
'<td align="right">' + getSize(dlSpeed) + '/s</td>',
'<td align="right">' + getSize(upSpeed) + '/s</td>',
'<td align="right">' + getSize(data[3]) + '</td>',
Expand Down Expand Up @@ -238,5 +239,6 @@ <h1>Network Usage:</h1>

receiveData();
})();
//]]>
</script>
<%+footer%>
2 changes: 1 addition & 1 deletion package/CONTROL/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: luci-wrtbwmon
Version: 0.1
Version: 0.2
Architecture: all
Maintainer: Georgios Tzourmpakis <[email protected]>
Section: net
Expand Down

0 comments on commit 1f282c2

Please sign in to comment.