1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add quota support and small others changes

This commit is contained in:
Ycarus 2018-03-06 15:09:20 +01:00
parent 6fe07f493b
commit b549503be7
23 changed files with 397 additions and 59 deletions

View file

@ -9,6 +9,7 @@
local fs = require "nixio.fs"
local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6")
local has_traceroute6 = fs.access("/usr/bin/traceroute6")
local has_speedtest = fs.access("/usr/sbin/speedtestc")
local dns_host = luci.config.diag and luci.config.diag.dns or "dev.openwrt.org"
local ping_host = luci.config.diag and luci.config.diag.ping or "dev.openwrt.org"
@ -66,7 +67,7 @@ local route_host = luci.config.diag and luci.config.diag.route or "dev.openwrt.o
<br />
<div style="width:30%; float:left">
<div style="width:26%; float:left">
<input style="margin: 5px 0" type="text" value="<%=ping_host%>" name="ping" /><br />
<% if has_ping6 then %>
<select name="ping_proto" style="width:auto">
@ -79,7 +80,7 @@ local route_host = luci.config.diag and luci.config.diag.route or "dev.openwrt.o
<% end %>
</div>
<div style="width:33%; float:left">
<div style="width:26%; float:left">
<input style="margin: 5px 0" type="text" value="<%=route_host%>" name="traceroute" /><br />
<% if has_traceroute6 then %>
<select name="traceroute_proto" style="width:auto">
@ -96,11 +97,18 @@ local route_host = luci.config.diag and luci.config.diag.route or "dev.openwrt.o
<% end %>
</div>
<div style="width:33%; float:left;">
<div style="width:26%; float:left;">
<input style="margin: 5px 0" type="text" value="<%=dns_host%>" name="nslookup" /><br />
<input type="button" value="<%:Nslookup%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.nslookup)" />
</div>
<% if has_speedtest then %>
<div style="width:10%; float:left;">
<input style="margin: 5px 0" type="text" value="" name="speedtest" placeholder="alternate server" /><br />
<input type="button" value="<%:Speedtest%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.speedtest)" />
</div>
<% end %>
<br style="clear:both" /><br />
</fieldset>

View file

@ -5,7 +5,7 @@
return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase();
// DUID-LL / Ethernet
if (duid.length === 24 && duid.substr(0, 8) === '00030001')
if (duid.length === 20 && duid.substr(0, 8) === '00030001')
return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase();
return null;

View file

@ -151,7 +151,7 @@
return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase();
// DUID-LL / Ethernet
if (duid.length === 24 && duid.substr(0, 8) === '00030001')
if (duid.length === 20 && duid.substr(0, 8) === '00030001')
return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase();
return null;