Skip to content

Commit 8b8900a

Browse files
committed
Fetch and display hardware and system info
1 parent 7146cfd commit 8b8900a

6 files changed

Lines changed: 642 additions & 13 deletions

File tree

meta/M50S_overview.html

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>WhatsMiner_057c - Overview - LuCI</title>
6+
<!--[if lt IE 9]><script src="/luci-static/bootstrap/html5.js?v=git-16.336.70424-1fd43b4"></script><![endif]-->
7+
<meta name="viewport" content="initial-scale=1.0">
8+
<link rel="stylesheet" href="/luci-static/bootstrap/cascade.css?v=git-16.336.70424-1fd43b4">
9+
<link rel="stylesheet" media="only screen and (max-device-width: 854px)" href="/luci-static/bootstrap/mobile.css?v=git-16.336.70424-1fd43b4" type="text/css" />
10+
<link rel="shortcut icon" href="/luci-static/bootstrap/favicon.ico">
11+
<script src="/luci-static/resources/xhr.js?v=git-16.336.70424-1fd43b4"></script>
12+
</head>
13+
14+
<body class="lang_enOverview">
15+
<header>
16+
<div class="fill">
17+
<div class="container">
18+
<a class="brand" href="#">WhatsMiner_057c</a>
19+
<ul class="nav"><li class="dropdown"><a class="menu" href="#">Status</a><ul class="dropdown-menu"><li><a href="/cgi-bin/luci/admin/status/btminerstatus">Miner Status</a></li><li><a href="/cgi-bin/luci/admin/status/btminerapi">Miner API Log</a></li><li><a href="/cgi-bin/luci/admin/status/syslog">System Log</a></li><li><a href="/cgi-bin/luci/admin/status/minerlog">Miner Log</a></li><li><a href="/cgi-bin/luci/admin/status/processes">Processes</a></li><li><a href="/cgi-bin/luci/admin/status/overview">Overview</a></li></ul></li><li class="dropdown"><a class="menu" href="#">System</a><ul class="dropdown-menu"><li><a href="/cgi-bin/luci/admin/system/system">System</a></li><li><a href="/cgi-bin/luci/admin/system/admin">Administration</a></li><li><a href="/cgi-bin/luci/admin/system/reboot">Reboot</a></li></ul></li><li class="dropdown"><a class="menu" href="#">Configuration</a><ul class="dropdown-menu"><li><a href="/cgi-bin/luci/admin/network/network">Interfaces</a></li><li><a href="/cgi-bin/luci/admin/network/btminer">Miner Configuration</a></li></ul></li><li><a href="/cgi-bin/luci/admin/logout">Logout</a></li></ul>
20+
<div class="pull-right">
21+
22+
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
23+
<span class="label success" id="xhr_poll_status_on">Auto Refresh on</span>
24+
<span class="label" id="xhr_poll_status_off" style="display:none">Auto Refresh off</span>
25+
</span>
26+
</div>
27+
</div>
28+
</div>
29+
</header><div id="maincontent" class="container">
30+
31+
32+
33+
34+
<script type="text/javascript" src="/luci-static/resources/cbi.js?v=git-16.336.70424-1fd43b4"></script>
35+
<script type="text/javascript">//<![CDATA[
36+
function progressbar(v, m)
37+
{
38+
var vn = parseInt(v) || 0;
39+
var mn = parseInt(m) || 100;
40+
var pc = Math.floor((100 / mn) * vn);
41+
42+
return String.format(
43+
'<div style="width:200px; position:relative; border:1px solid #999999">' +
44+
'<div style="background-color:#CCCCCC; width:%d%%; height:15px">' +
45+
'<div style="position:absolute; left:0; top:0; text-align:center; width:100%%; color:#000000">' +
46+
'<small>%s / %s (%d%%)</small>' +
47+
'</div>' +
48+
'</div>' +
49+
'</div>', pc, v, m, pc
50+
);
51+
}
52+
53+
function wifirate(bss, rx) {
54+
var p = rx ? 'rx_' : 'tx_',
55+
s = '%.1f Mbit/s, %dMHz'
56+
.format(bss[p+'rate'] / 1000, bss[p+'mhz']),
57+
ht = bss[p+'ht'], vht = bss[p+'vht'],
58+
mhz = bss[p+'mhz'], nss = bss[p+'nss'],
59+
mcs = bss[p+'mcs'], sgi = bss[p+'short_gi'];
60+
61+
if (ht || vht) {
62+
if (vht) s += ', VHT-MCS %d'.format(mcs);
63+
if (nss) s += ', VHT-NSS %d'.format(nss);
64+
if (ht) s += ', MCS %s'.format(mcs);
65+
if (sgi) s += ', Short GI';
66+
}
67+
68+
return s;
69+
}
70+
71+
function duid2mac(duid) {
72+
// DUID-LLT / Ethernet
73+
if (duid.length === 28 && duid.substr(0, 8) === '00010001')
74+
return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase();
75+
76+
// DUID-LL / Ethernet
77+
if (duid.length === 24 && duid.substr(0, 8) === '00030001')
78+
return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase();
79+
80+
return null;
81+
}
82+
83+
var npoll = 1;
84+
var hosts = {"28:70:4E:47:60:CF":{"ipv4":"192.7.1.254"},"CC:07:18:00:05:7C":{"ipv4":"192.7.1.193"}};
85+
86+
function updateHosts() {
87+
XHR.get('/cgi-bin/luci/admin/status/overview', { hosts: 1 }, function(x, data) {
88+
hosts = data;
89+
});
90+
}
91+
92+
XHR.poll(5, '/cgi-bin/luci/admin/status/overview', { status: 1 },
93+
function(x, info)
94+
{
95+
if (!(npoll++ % 5))
96+
updateHosts();
97+
98+
var si = document.getElementById('wan4_i');
99+
var ss = document.getElementById('wan4_s');
100+
var ifc = info.wan;
101+
102+
if (ifc && ifc.ifname && ifc.proto != 'none')
103+
{
104+
var s = String.format(
105+
'<strong>Type: </strong>%s<br />' +
106+
'<strong>Address: </strong>%s<br />' +
107+
'<strong>Netmask: </strong>%s<br />' +
108+
'<strong>Gateway: </strong>%s<br />',
109+
ifc.proto,
110+
(ifc.ipaddr) ? ifc.ipaddr : '0.0.0.0',
111+
(ifc.netmask && ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255',
112+
(ifc.gwaddr) ? ifc.gwaddr : '0.0.0.0'
113+
);
114+
115+
for (var i = 0; i < ifc.dns.length; i++)
116+
{
117+
s += String.format(
118+
'<strong>DNS %d: </strong>%s<br />',
119+
i + 1, ifc.dns[i]
120+
);
121+
}
122+
123+
if (ifc.expires > -1)
124+
{
125+
s += String.format(
126+
'<strong>Expires: </strong>%t<br />',
127+
ifc.expires
128+
);
129+
}
130+
131+
if (ifc.uptime > 0)
132+
{
133+
s += String.format(
134+
'<strong>Connected: </strong>%t<br />',
135+
ifc.uptime
136+
);
137+
}
138+
139+
ss.innerHTML = String.format('<small>%s</small>', s);
140+
si.innerHTML = String.format(
141+
'<img src="/luci-static/resources/icons/ethernet.png" />' +
142+
'<br /><small><a href="%s">%s</a></small>',
143+
ifc.link, ifc.ifname
144+
);
145+
}
146+
else
147+
{
148+
si.innerHTML = '<img src="/luci-static/resources/icons/ethernet_disabled.png" /><br /><small>?</small>';
149+
ss.innerHTML = '<em>Not connected</em>';
150+
}
151+
152+
153+
154+
155+
156+
157+
158+
159+
160+
var e;
161+
162+
if (e = document.getElementById('localtime'))
163+
e.innerHTML = info.localtime;
164+
165+
if (e = document.getElementById('uptime'))
166+
e.innerHTML = String.format('%t', info.uptime);
167+
168+
if (e = document.getElementById('loadavg'))
169+
e.innerHTML = String.format(
170+
'%.02f, %.02f, %.02f',
171+
info.loadavg[0] / 65535.0,
172+
info.loadavg[1] / 65535.0,
173+
info.loadavg[2] / 65535.0
174+
);
175+
176+
if (e = document.getElementById('memtotal'))
177+
e.innerHTML = progressbar(
178+
((info.memory.free + info.memory.buffered) / 1024) + " kB",
179+
(info.memory.total / 1024) + " kB"
180+
);
181+
182+
if (e = document.getElementById('memfree'))
183+
e.innerHTML = progressbar(
184+
(info.memory.free / 1024) + " kB",
185+
(info.memory.total / 1024) + " kB"
186+
);
187+
188+
if (e = document.getElementById('membuff'))
189+
e.innerHTML = progressbar(
190+
(info.memory.buffered / 1024) + " kB",
191+
(info.memory.total / 1024) + " kB"
192+
);
193+
194+
if (e = document.getElementById('swaptotal'))
195+
e.innerHTML = progressbar(
196+
(info.swap.free / 1024) + " kB",
197+
(info.swap.total / 1024) + " kB"
198+
);
199+
200+
if (e = document.getElementById('swapfree'))
201+
e.innerHTML = progressbar(
202+
(info.swap.free / 1024) + " kB",
203+
(info.swap.total / 1024) + " kB"
204+
);
205+
206+
if (e = document.getElementById('conns'))
207+
e.innerHTML = progressbar(info.conncount, info.connmax);
208+
209+
}
210+
);
211+
//]]></script>
212+
213+
<h2 name="content">Status</h2>
214+
215+
<fieldset class="cbi-section">
216+
<legend>System</legend>
217+
218+
<table width="100%" cellspacing="10">
219+
<tr><td width="33%">Model</td><td>WhatsMiner M50S_VH55</td></tr>
220+
<tr><td width="33%">Hardware Info</td><td>M50S_VH55.H616-CB6V10.P222B-VE2-196803B</td></tr>
221+
<tr><td width="33%">Firmware Version</td><td>20251016.14.Rel2</td></tr>
222+
<tr><td width="33%">Kernel Version</td><td>#1525 SMP PREEMPT Thu Oct 16 14:13:50 CST 2025</td></tr>
223+
<tr><td width="33%">Local Time</td><td id="localtime">-</td></tr>
224+
<tr><td width="33%">Uptime</td><td id="uptime">-</td></tr>
225+
<tr><td width="33%">Load Average</td><td id="loadavg">-</td></tr>
226+
</table>
227+
</fieldset>
228+
229+
<fieldset class="cbi-section">
230+
<legend>Memory</legend>
231+
232+
<table width="100%" cellspacing="10">
233+
<tr><td width="33%">Total Available</td><td id="memtotal">-</td></tr>
234+
<tr><td width="33%">Free</td><td id="memfree">-</td></tr>
235+
<tr><td width="33%">Buffered</td><td id="membuff">-</td></tr>
236+
</table>
237+
</fieldset>
238+
239+
240+
241+
<fieldset class="cbi-section">
242+
<legend>Network</legend>
243+
244+
<table width="100%" cellspacing="10">
245+
<tr><td width="33%" style="vertical-align:top">IPv4 WAN Status</td><td>
246+
<table><tr>
247+
<td id="wan4_i" style="width:16px; text-align:center; padding:3px"><img src="/luci-static/resources/icons/ethernet_disabled.png" /><br /><small>?</small></td>
248+
<td id="wan4_s" style="vertical-align:middle; padding: 3px"><em>Collecting data...</em></td>
249+
</tr></table>
250+
</td></tr>
251+
252+
<tr><td width="33%">Active Connections</td><td id="conns">-</td></tr>
253+
</table>
254+
</fieldset>
255+
256+
257+
258+
259+
260+
261+
<footer>
262+
<a>Copyright (C) 2020 Microbt.com. All Rights Reserved.</a>
263+
</footer>
264+
</div>
265+
</div>
266+
</body>
267+
</html>

0 commit comments

Comments
 (0)