Skip to content

Commit

Permalink
Update docker configs
Browse files Browse the repository at this point in the history
  • Loading branch information
haiibo committed Jul 29, 2023
1 parent db75e8d commit 6f2408f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 102 deletions.
4 changes: 2 additions & 2 deletions docker/patches/99-custom.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ net.core.netdev_budget = 600
net.core.dev_weight = 128

# default value: 65535
net.netfilter.nf_conntrack_max = 65535
net.netfilter.nf_conntrack_max = 327680

# default value: 16384
net.netfilter.nf_conntrack_buckets = 32768
net.netfilter.nf_conntrack_buckets = 81920

#
#######################################################
Expand Down
8 changes: 4 additions & 4 deletions docker/patches/cpustat
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ sub get_eth_temperature {
sub get_ethlist() {
my $board = &get_boardinfo;
if($board eq "FastRhino R66S") {
return reverse sort (</sys/class/net/e[tn]*>);
return reverse sort (</sys/class/net/e[tn]*>);
} elsif($board eq "HINLINK OPC-H68K Board") {
return reverse sort (</sys/class/net/e[tn]*>);
} elsif($board eq "Radxa E25") {
return reverse sort (</sys/class/net/e[tn]*>);
return reverse sort (</sys/class/net/e[tn]*>);
} elsif($board eq "HINLINK OWL H88K-V3 Board") {
return reverse sort (</sys/class/net/e[tn]*>);
} else {
return sort (</sys/class/net/e[tn]*>);
}
Expand Down
53 changes: 5 additions & 48 deletions docker/patches/index.html.patches/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
local user_info = luci.sys.exec("cat /proc/net/arp | grep -E 'br-lan|eth0' | grep '0x2' | wc -l")

local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "6") .. "%"
local cpu_stat = luci.sys.exec("/usr/bin/cpustat") or { }
local eth_info = luci.sys.exec("/usr/bin/cpustat -e")
local eth_cnt = luci.sys.exec("/usr/bin/cpustat -ec")
local cpu_stat = luci.sys.exec("/usr/bin/cpustat 2>/dev/null") or { }
local eth_info = luci.sys.exec("/usr/bin/cpustat -e 2>/dev/null")
local eth_cnt = luci.sys.exec("/usr/bin/cpustat -ec 2>/dev/null")

local rv = {
cpuusage = cpu_usage,
Expand Down Expand Up @@ -128,7 +128,7 @@

<%+header%>

<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-22.270.62759-d376b9d"></script>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-23.104.57901-bf5e9ad"></script>
<script type="text/javascript">//<![CDATA[
function progressbar(v, m)
{
Expand Down Expand Up @@ -406,48 +406,6 @@
var tr = ls.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);

tr.insertCell(-1).innerHTML = (function(devmac) {
var devmac = info.leases[i].macaddr.substring(0,8);
if (devmac == "10:3f:44" || devmac == "2c:d0:66" || devmac == "58:20:59" || devmac == "64:cc:2e" || devmac == "98:f6:21" || devmac == "a4:50:46" || devmac == "ec:41:18" || devmac == "e8:ca:c8" || devmac == "f4:f5:db")
return String.format('<img src="<%=resource%>/icons/devices/mi.png" />')
else if (devmac == "00:5b:94" || devmac == "34:a8:eb" | devmac == "64:20:0c" | devmac == "7a:51:e7" || devmac == "80:be:05" || devmac == "ae:0b:09" || devmac == "b8:c1:11" || devmac == "dc:a9:04")
return String.format('<img src="<%=resource%>/icons/devices/apple.png" />')
else if (devmac == "02:5f:84" || devmac == "02:f8:ea" || devmac == "12:65:e3" || devmac == "18:3c:b7" || devmac == "30:a2:c2" || devmac == "32:bc:0e" || devmac == "3c:cd:5d" || devmac == "7c:a1:77" || devmac == "82:51:80" || devmac == "82:a0:d3" || devmac == "82:a5:6b" || devmac == "90:2b:d2" || devmac == "96:c9:cb" || devmac == "9c:b2:b2" || devmac == "a8:e5:44" || devmac == "b2:3d:8c" || devmac == "c2:56:e7" || devmac == "c2:d0:55" || devmac == "d2:7e:7b" || devmac == "f2:49:84")
return String.format('<img src="<%=resource%>/icons/devices/huawei.png" />')
else if (devmac == "e4:a7:c5")
return String.format('<img src="<%=resource%>/icons/devices/honor.png" />')
else if (devmac == "b4:20:5b" || devmac == "08:4a:cf")
return String.format('<img src="<%=resource%>/icons/devices/oppo.png" />')
else if (devmac == "d0:5a:fd")
return String.format('<img src="<%=resource%>/icons/devices/realme.png" />')
else if (devmac == "2a:da:93")
return String.format('<img src="<%=resource%>/icons/devices/vivo.png" />')
else if (devmac == "02:81:eb")
return String.format('<img src="<%=resource%>/icons/devices/orangepi.png" />')
else if (devmac == "00:22:5f")
return String.format('<img src="<%=resource%>/icons/devices/dell.png" />')
else if (devmac == "3e:54:f7" || devmac == "8e:a3:3b")
return String.format('<img src="<%=resource%>/icons/devices/iqoo.png" />')
else if (devmac == "64:90:c1" || devmac == "5c:e5:0c" || devmac == "44:23:7c")
return String.format('<img src="<%=resource%>/icons/devices/mijia.png" />')
else if (devmac == "84:44:af" || devmac == "8c:6d:50" || devmac == "78:da:07")
return String.format('<img src="<%=resource%>/icons/devices/tmall.png" />')
else if (devmac == "e0:76:d0")
return String.format('<img src="<%=resource%>/icons/devices/xiaotiancai.png" />')
else if (devmac == "04:5f:a7" || devmac == "20:76:93" || devmac == "38:83:45" || devmac == "78:a3:51" || devmac == "78:d3:8d" || devmac == "cc:08:fb" || devmac == "d4:ee:07" || devmac == "dc:d8:7c")
return String.format('<img src="<%=resource%>/icons/devices/router.png" />')
else if (devmac == "9c:ae:d3")
return String.format('<img src="<%=resource%>/icons/devices/printer.png" />')
else if (devmac == "00:07:63" || devmac == "00:ac:1f" || devmac == "04:95:73" || devmac == "0c:56:5c" || devmac == "30:50:fd" || devmac == "74:c9:a3" || devmac == "74:ff:4c" || devmac == "90:d8:f3" || devmac == "ac:00:d0" || devmac == "c8:64:c7" || devmac == "f4:4c:70")
return String.format('<img src="<%=resource%>/icons/devices/iptv.png" />')
else if (devmac == "00:11:32")
return String.format('<img src="<%=resource%>/icons/devices/nas.png" />')
else if (devmac == "f0:c9:d1")
return String.format('<img src="<%=resource%>/icons/devices/midea.png" />')
else
return String.format('<img src="<%=resource%>/icons/devices/pc.png" />')
end
})();
tr.insertCell(-1).innerHTML = info.leases[i].hostname ? info.leases[i].hostname : '?';
tr.insertCell(-1).innerHTML = info.leases[i].ipaddr;
tr.insertCell(-1).innerHTML = info.leases[i].macaddr;
Expand Down Expand Up @@ -776,7 +734,7 @@ <h2 name="content"><%:Status%></h2>
<table width="100%" cellspacing="10">
<tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr>
<tr><td width="33%"><%:Model%></td><td><%=pcdata(boardinfo.model or "?")%> <%=luci.sys.exec("cat /etc/bench.log") or " "%></td></tr>
<tr><td width="33%"><%:Architecture%></td><td><%=luci.sys.exec("/usr/bin/cpustat -a")%></td></tr>
<tr><td width="33%"><%:Architecture%></td><td><%=luci.sys.exec("/usr/bin/cpustat -a 2>/dev/null")%></td></tr>
<tr><td width="33%"><%:Firmware Version%></td><td>
<%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> /
<%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>)
Expand Down Expand Up @@ -848,7 +806,6 @@ <h2 name="content"><%:Status%></h2>

<table class="cbi-section-table" id="lease_status_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Logo%></th>
<th class="cbi-section-table-cell"><%:Hostname%></th>
<th class="cbi-section-table-cell"><%:IPv4-Address%></th>
<th class="cbi-section-table-cell"><%:MAC-Address%></th>
Expand Down
45 changes: 1 addition & 44 deletions docker/patches/index.html.patches/index.htm.orig
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

<%+header%>

<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-22.270.62759-d376b9d"></script>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-23.104.57901-bf5e9ad"></script>
<script type="text/javascript">//<![CDATA[
function progressbar(v, m)
{
Expand Down Expand Up @@ -393,48 +393,6 @@
var tr = ls.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);

tr.insertCell(-1).innerHTML = (function(devmac) {
var devmac = info.leases[i].macaddr.substring(0,8);
if (devmac == "10:3f:44" || devmac == "2c:d0:66" || devmac == "58:20:59" || devmac == "64:cc:2e" || devmac == "98:f6:21" || devmac == "a4:50:46" || devmac == "ec:41:18" || devmac == "e8:ca:c8" || devmac == "f4:f5:db")
return String.format('<img src="<%=resource%>/icons/devices/mi.png" />')
else if (devmac == "00:5b:94" || devmac == "34:a8:eb" | devmac == "64:20:0c" | devmac == "7a:51:e7" || devmac == "80:be:05" || devmac == "ae:0b:09" || devmac == "b8:c1:11" || devmac == "dc:a9:04")
return String.format('<img src="<%=resource%>/icons/devices/apple.png" />')
else if (devmac == "02:5f:84" || devmac == "02:f8:ea" || devmac == "12:65:e3" || devmac == "18:3c:b7" || devmac == "30:a2:c2" || devmac == "32:bc:0e" || devmac == "3c:cd:5d" || devmac == "7c:a1:77" || devmac == "82:51:80" || devmac == "82:a0:d3" || devmac == "82:a5:6b" || devmac == "90:2b:d2" || devmac == "96:c9:cb" || devmac == "9c:b2:b2" || devmac == "a8:e5:44" || devmac == "b2:3d:8c" || devmac == "c2:56:e7" || devmac == "c2:d0:55" || devmac == "d2:7e:7b" || devmac == "f2:49:84")
return String.format('<img src="<%=resource%>/icons/devices/huawei.png" />')
else if (devmac == "e4:a7:c5")
return String.format('<img src="<%=resource%>/icons/devices/honor.png" />')
else if (devmac == "b4:20:5b" || devmac == "08:4a:cf")
return String.format('<img src="<%=resource%>/icons/devices/oppo.png" />')
else if (devmac == "d0:5a:fd")
return String.format('<img src="<%=resource%>/icons/devices/realme.png" />')
else if (devmac == "2a:da:93")
return String.format('<img src="<%=resource%>/icons/devices/vivo.png" />')
else if (devmac == "02:81:eb")
return String.format('<img src="<%=resource%>/icons/devices/orangepi.png" />')
else if (devmac == "00:22:5f")
return String.format('<img src="<%=resource%>/icons/devices/dell.png" />')
else if (devmac == "3e:54:f7" || devmac == "8e:a3:3b")
return String.format('<img src="<%=resource%>/icons/devices/iqoo.png" />')
else if (devmac == "64:90:c1" || devmac == "5c:e5:0c" || devmac == "44:23:7c")
return String.format('<img src="<%=resource%>/icons/devices/mijia.png" />')
else if (devmac == "84:44:af" || devmac == "8c:6d:50" || devmac == "78:da:07")
return String.format('<img src="<%=resource%>/icons/devices/tmall.png" />')
else if (devmac == "e0:76:d0")
return String.format('<img src="<%=resource%>/icons/devices/xiaotiancai.png" />')
else if (devmac == "04:5f:a7" || devmac == "20:76:93" || devmac == "38:83:45" || devmac == "78:a3:51" || devmac == "78:d3:8d" || devmac == "cc:08:fb" || devmac == "d4:ee:07" || devmac == "dc:d8:7c")
return String.format('<img src="<%=resource%>/icons/devices/router.png" />')
else if (devmac == "9c:ae:d3")
return String.format('<img src="<%=resource%>/icons/devices/printer.png" />')
else if (devmac == "00:07:63" || devmac == "00:ac:1f" || devmac == "04:95:73" || devmac == "0c:56:5c" || devmac == "30:50:fd" || devmac == "74:c9:a3" || devmac == "74:ff:4c" || devmac == "90:d8:f3" || devmac == "ac:00:d0" || devmac == "c8:64:c7" || devmac == "f4:4c:70")
return String.format('<img src="<%=resource%>/icons/devices/iptv.png" />')
else if (devmac == "00:11:32")
return String.format('<img src="<%=resource%>/icons/devices/nas.png" />')
else if (devmac == "f0:c9:d1")
return String.format('<img src="<%=resource%>/icons/devices/midea.png" />')
else
return String.format('<img src="<%=resource%>/icons/devices/pc.png" />')
end
})();
tr.insertCell(-1).innerHTML = info.leases[i].hostname ? info.leases[i].hostname : '?';
tr.insertCell(-1).innerHTML = info.leases[i].ipaddr;
tr.insertCell(-1).innerHTML = info.leases[i].macaddr;
Expand Down Expand Up @@ -804,7 +762,6 @@

<table class="cbi-section-table" id="lease_status_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Logo%></th>
<th class="cbi-section-table-cell"><%:Hostname%></th>
<th class="cbi-section-table-cell"><%:IPv4-Address%></th>
<th class="cbi-section-table-cell"><%:MAC-Address%></th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

if wan then
@@ -683,9 +696,30 @@
@@ -641,9 +654,30 @@

var e;

Expand Down Expand Up @@ -84,7 +84,7 @@
if (e = document.getElementById('uptime'))
e.innerHTML = String.format('%t', info.uptime);

@@ -742,7 +776,7 @@
@@ -700,7 +734,7 @@
<table width="100%" cellspacing="10">
<tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr>
<tr><td width="33%"><%:Model%></td><td><%=pcdata(boardinfo.model or "?")%> <%=luci.sys.exec("cat /etc/bench.log") or " "%></td></tr>
Expand All @@ -93,15 +93,15 @@
<tr><td width="33%"><%:Firmware Version%></td><td>
<%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> /
<%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>)
@@ -750,6 +784,7 @@
@@ -708,6 +742,7 @@
<tr><td width="33%"><%:Kernel Version%></td><td><%=unameinfo.release or "?"%></td></tr>
<tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr>
<tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr>
+ <tr><td width="33%"><%:CPU状态%></td><td id="cpustat">-</td></tr>
<tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr>
<tr><td width="33%"><%:CPU usage (%)%></td><td id="cpuusage">-</td></tr>
</table>
@@ -774,6 +809,15 @@
@@ -732,6 +767,15 @@
</table>
</fieldset>
<% end %>
Expand Down

0 comments on commit 6f2408f

Please sign in to comment.