info.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <!DOCTYPE html>
  2. <html lang="en" xml:lang="en">
  3. <head>
  4. <meta charset="UTF-8"/>
  5. <title>Info</title>
  6. <style>
  7. h1 {font-size: 2em;}
  8. h2 {font-size: 1.5em;}
  9. h3 {font-size: 1.2em;}
  10. p {font-size: 1em;}
  11. th, td {
  12. padding: 5px 5px 5px 5px;
  13. border-width: 1px;
  14. border-style: solid;
  15. border-color: rgb(240, 240, 240);
  16. }
  17. output {
  18. padding-left:5px;
  19. }
  20. table {
  21. width: 660px;
  22. padding: 5px;
  23. border-collapse:collapse;
  24. }
  25. </style>
  26. <script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
  27. <script type="text/javascript">var domainname = getDomainname();</script>
  28. </head>
  29. <body style="font-family: arial; padding: 0px 10px;">
  30. <table>
  31. <colgroup>
  32. <col span="1" style="width: 35%;">
  33. <col span="1" style="width: 65%;">
  34. </colgroup>
  35. <tr>
  36. <h3>Runtime Information</h3>
  37. </tr>
  38. <tr>
  39. <td>Start time:</td>
  40. <td><output id="starttime"></output></td>
  41. </tr>
  42. <tr>
  43. <td>Uptime:</td>
  44. <td><output id="uptime"></output></td>
  45. </tr>
  46. </table>
  47. <table>
  48. <colgroup>
  49. <col span="1" style="width: 35%;">
  50. <col span="1" style="width: 65%;">
  51. </colgroup>
  52. <tr>
  53. <h3>Build Info</h3>
  54. </tr>
  55. <tr>
  56. <td>Firmware version:</td>
  57. <td>
  58. <output id="firmware"></output>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td>Firmware build time:</td>
  63. <td>
  64. <output id="build-time"></output>
  65. </td>
  66. </tr>
  67. <tr>
  68. <td>Web interface version:</td>
  69. <td>
  70. <output id="web-ui"></output>
  71. </td>
  72. </tr>
  73. </table>
  74. <table>
  75. <colgroup>
  76. <col span="1" style="width: 35%;">
  77. <col span="1" style="width: 65%;">
  78. </colgroup>
  79. <tr>
  80. <h3>Device Info</h3>
  81. </tr>
  82. <tr>
  83. <td>Chip Cores:</td>
  84. <td>
  85. <output id="chip-cores"></output>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td>Chip Revision:</td>
  90. <td>
  91. <output id="chip-revision"></output>
  92. </td>
  93. </tr>
  94. <tr>
  95. <td>Chip Features:</td>
  96. <td>
  97. <output id="chip-features"></output>
  98. </td>
  99. </tr>
  100. </table>
  101. <table>
  102. <colgroup>
  103. <col span="1" style="width: 35%;">
  104. <col span="1" style="width: 65%;">
  105. </colgroup>
  106. <tr>
  107. <h3>Host Info</h3>
  108. </tr>
  109. <tr>
  110. <td>Hostname:</td>
  111. <td>
  112. <output id="hostname"></output>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td>IP Address:</td>
  117. <td>
  118. <output id="IP-address"></output>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td>WLAN SSID:</td>
  123. <td>
  124. <output id="wlan-ssid"></output>
  125. </td>
  126. </tr>
  127. </table>
  128. <table>
  129. <colgroup>
  130. <col span="1" style="width: 35%;">
  131. <col span="1" style="width: 65%;">
  132. </colgroup>
  133. <tr>
  134. <h3>SD Card Info</h3>
  135. </tr>
  136. <tr>
  137. <td>SD card manufacturer:</td>
  138. <td>
  139. <output id="SDCardManufacturer"></output>
  140. </td>
  141. </tr>
  142. <tr>
  143. <td>SD card name:</td>
  144. <td>
  145. <output id="SDCardName"></output>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td>SD card size:</td>
  150. <td>
  151. <output id="SDCardCapacity"></output>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td>SD card sector size:</td>
  156. <td>
  157. <output id="SDCardSectorSize"></output>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td>Partition size:</td>
  162. <td>
  163. <output id="SDCardPartitionSize"></output>
  164. </td>
  165. </tr>
  166. <tr>
  167. <td>Partition free space:</td>
  168. <td>
  169. <output id="SDCardFreePartitionSpace"></output>
  170. </td>
  171. </tr>
  172. <tr>
  173. <td>Partition allocation size:</td>
  174. <td>
  175. <output id="SDCardPartitionAllocationSize"></output>
  176. </td>
  177. </tr>
  178. </table>
  179. <table>
  180. <colgroup>
  181. <col span="1" style="width: 35%;">
  182. <col span="1" style="width: 65%;">
  183. </colgroup>
  184. <tr>
  185. <h3>Memory Info</h3>
  186. </tr>
  187. <tr>
  188. <td>Total Free (Int + Ext):</td>
  189. <td>
  190. <output id="RAMTotalFree"></output>
  191. </td>
  192. </tr>
  193. <tr>
  194. <td>Ext. RAM - Free:</td>
  195. <td>
  196. <output id="ExtRAMFree"></output>
  197. </td>
  198. </tr>
  199. <tr>
  200. <td>Ext. RAM - Largest Free Block:</td>
  201. <td>
  202. <output id="ExtRAMLargestFree"></output>
  203. </td>
  204. </tr>
  205. <tr>
  206. <td>Ext. RAM - Min Free:</td>
  207. <td>
  208. <output id="ExtRAMMinFree"></output>
  209. </td>
  210. </tr>
  211. <tr>
  212. <td>Int. RAM - Free:</td>
  213. <td>
  214. <output id="IntRAMFree"></output>
  215. </td>
  216. </tr>
  217. <tr>
  218. <td>Int. RAM - Largest Free Block:</td>
  219. <td>
  220. <output id="IntRAMLargestFree"></output>
  221. </td>
  222. </tr>
  223. <tr>
  224. <td>Int. RAM - Min Free:</td>
  225. <td>
  226. <output id="IntRAMMinFree"></output>
  227. </td>
  228. </tr>
  229. </table>
  230. <h3>Copyright</h3>
  231. Copyright &copy; 2020 - 2024 by <a href="https://github.com/jomjol/AI-on-the-edge-device" target=_blank>Jomjol</a> and others.
  232. <script type="text/javascript">
  233. function loadLastRestart()
  234. {
  235. var url = domainname + '/starttime';
  236. var xhttp = new XMLHttpRequest();
  237. xhttp.onreadystatechange = function() {
  238. if (this.readyState == 4 && this.status == 200) {
  239. //Input format: 19700101-010019
  240. var timestamp = xhttp.response.substr(6,2) + "." +
  241. xhttp.response.substr(4,2) + "." +
  242. xhttp.response.substr(0,4) + " " +
  243. xhttp.response.substr(9,2) + ":" +
  244. xhttp.response.substr(11,2) + ":" +
  245. xhttp.response.substr(13,2);
  246. document.getElementById("starttime").value = timestamp;
  247. }
  248. }
  249. xhttp.open("GET", url, true);
  250. xhttp.send();
  251. }
  252. function loadUptime()
  253. {
  254. var url = domainname + '/uptime';
  255. var xhttp = new XMLHttpRequest();
  256. xhttp.onreadystatechange = function() {
  257. if (this.readyState == 4 && this.status == 200) {
  258. document.getElementById("uptime").value = xhttp.response;
  259. }
  260. }
  261. xhttp.open("GET", url, true);
  262. xhttp.send();
  263. }
  264. function loadFWVersion()
  265. {
  266. var url = domainname + '/info?type=FirmwareVersion';
  267. var xhttp = new XMLHttpRequest();
  268. xhttp.onreadystatechange = function() {
  269. if (this.readyState == 4 && this.status == 200) {
  270. document.getElementById("firmware").value = xhttp.response;
  271. }
  272. }
  273. xhttp.open("GET", url, true);
  274. xhttp.send();
  275. }
  276. function loadFWBuildTime()
  277. {
  278. var url = domainname + '/info?type=BuildTime';
  279. var xhttp = new XMLHttpRequest();
  280. xhttp.onreadystatechange = function() {
  281. if (this.readyState == 4 && this.status == 200) {
  282. // Input format: 2023-04-02 10:56
  283. var timestamp = xhttp.response.substr(8,2) + "." +
  284. xhttp.response.substr(5,2) + "." +
  285. xhttp.response.substr(0,4) + " " +
  286. xhttp.response.substr(11,2) + ":" +
  287. xhttp.response.substr(14,2);
  288. document.getElementById("build-time").value = timestamp;
  289. }
  290. }
  291. xhttp.open("GET", url, true);
  292. xhttp.send();
  293. }
  294. function loadHTMLVersion()
  295. {
  296. var url = domainname + '/info?type=HTMLVersion';
  297. var xhttp = new XMLHttpRequest();
  298. xhttp.onreadystatechange = function() {
  299. if (this.readyState == 4 && this.status == 200) {
  300. document.getElementById("web-ui").value = xhttp.response;
  301. }
  302. }
  303. xhttp.open("GET", url, true);
  304. xhttp.send();
  305. }
  306. function loadHostname()
  307. {
  308. var url = domainname + '/info?type=Hostname';
  309. var xhttp = new XMLHttpRequest();
  310. xhttp.onreadystatechange = function() {
  311. if (this.readyState == 4 && this.status == 200) {
  312. document.getElementById("hostname").value = xhttp.response;
  313. }
  314. }
  315. xhttp.open("GET", url, true);
  316. xhttp.send();
  317. }
  318. function loadIPAddress()
  319. {
  320. var url = domainname + '/info?type=IP';
  321. var xhttp = new XMLHttpRequest();
  322. xhttp.onreadystatechange = function() {
  323. if (this.readyState == 4 && this.status == 200) {
  324. document.getElementById("IP-address").value = xhttp.response;
  325. }
  326. }
  327. xhttp.open("GET", url, true);
  328. xhttp.send();
  329. }
  330. function loadWLANSSID()
  331. {
  332. var url = domainname + '/info?type=SSID';
  333. var xhttp = new XMLHttpRequest();
  334. xhttp.onreadystatechange = function() {
  335. if (this.readyState == 4 && this.status == 200) {
  336. document.getElementById("wlan-ssid").value = xhttp.response;
  337. }
  338. }
  339. xhttp.open("GET", url, true);
  340. xhttp.send();
  341. }
  342. function loadSDCardManufacturer()
  343. {
  344. var url = domainname + '/info?type=SDCardManufacturer';
  345. var xhttp = new XMLHttpRequest();
  346. xhttp.onreadystatechange = function() {
  347. if (this.readyState == 4 && this.status == 200) {
  348. document.getElementById("SDCardManufacturer").value = xhttp.response;
  349. }
  350. }
  351. xhttp.open("GET", url, true);
  352. xhttp.send();
  353. }
  354. function loadSDCardName()
  355. {
  356. var url = domainname + '/info?type=SDCardName';
  357. var xhttp = new XMLHttpRequest();
  358. xhttp.onreadystatechange = function() {
  359. if (this.readyState == 4 && this.status == 200) {
  360. document.getElementById("SDCardName").value = xhttp.response;
  361. }
  362. }
  363. xhttp.open("GET", url, true);
  364. xhttp.send();
  365. }
  366. function loadSDCardCapacity()
  367. {
  368. var url = domainname + '/info?type=SDCardCapacity';
  369. var xhttp = new XMLHttpRequest();
  370. xhttp.onreadystatechange = function() {
  371. if (this.readyState == 4 && this.status == 200) {
  372. document.getElementById("SDCardCapacity").value = xhttp.response + " MB";
  373. }
  374. }
  375. xhttp.open("GET", url, true);
  376. xhttp.send();
  377. }
  378. function loadSDCardSectorSize()
  379. {
  380. var url = domainname + '/info?type=SDCardSectorSize';
  381. var xhttp = new XMLHttpRequest();
  382. xhttp.onreadystatechange = function() {
  383. if (this.readyState == 4 && this.status == 200) {
  384. document.getElementById("SDCardSectorSize").value = xhttp.response + " byte";
  385. }
  386. }
  387. xhttp.open("GET", url, true);
  388. xhttp.send();
  389. }
  390. function loadSDCardPartitionSize()
  391. {
  392. var url = domainname + '/info?type=SDCardPartitionSize';
  393. var xhttp = new XMLHttpRequest();
  394. xhttp.onreadystatechange = function() {
  395. if (this.readyState == 4 && this.status == 200) {
  396. document.getElementById("SDCardPartitionSize").value = xhttp.response + " MB";
  397. }
  398. }
  399. xhttp.open("GET", url, true);
  400. xhttp.send();
  401. }
  402. function loadSDCardFreePartitionSpace()
  403. {
  404. var url = domainname + '/info?type=SDCardFreePartitionSpace';
  405. var xhttp = new XMLHttpRequest();
  406. xhttp.onreadystatechange = function() {
  407. if (this.readyState == 4 && this.status == 200) {
  408. document.getElementById("SDCardFreePartitionSpace").value = xhttp.response + " MB";
  409. }
  410. }
  411. xhttp.open("GET", url, true);
  412. xhttp.send();
  413. }
  414. function loadSDCardPartitionAllocationSize()
  415. {
  416. var url = domainname + '/info?type=SDCardPartitionAllocationSize';
  417. var xhttp = new XMLHttpRequest();
  418. xhttp.onreadystatechange = function() {
  419. if (this.readyState == 4 && this.status == 200) {
  420. document.getElementById("SDCardPartitionAllocationSize").value = xhttp.response + " byte";
  421. }
  422. }
  423. xhttp.open("GET", url, true);
  424. xhttp.send();
  425. }
  426. function loadMemoryInfo()
  427. {
  428. var url = domainname + '/heap';
  429. var xhttp = new XMLHttpRequest();
  430. xhttp.onreadystatechange = function() {
  431. if (this.readyState == 4 && this.status == 200) {
  432. data = xhttp.response.split("|");
  433. document.getElementById("RAMTotalFree").value = data[0].split("l: ")[1] + " byte";
  434. document.getElementById("IntRAMFree").value = data[4].split(":")[1] + " byte";
  435. document.getElementById("IntRAMLargestFree").value = data[5].split(":")[1] + " byte";
  436. document.getElementById("IntRAMMinFree").value = data[6].split(":")[1] + " byte";
  437. document.getElementById("ExtRAMFree").value = data[1].split(":")[1] + " byte";
  438. document.getElementById("ExtRAMLargestFree").value = data[2].split(":")[1] + " byte";
  439. document.getElementById("ExtRAMMinFree").value = data[3].split(":")[1] + " byte";
  440. }
  441. }
  442. xhttp.open("GET", url, true);
  443. xhttp.send();
  444. }
  445. function loadChipCores()
  446. {
  447. var url = domainname + '/info?type=ChipCores';
  448. var xhttp = new XMLHttpRequest();
  449. xhttp.onreadystatechange = function() {
  450. if (this.readyState == 4 && this.status == 200) {
  451. document.getElementById("chip-cores").value = xhttp.response;
  452. }
  453. }
  454. xhttp.open("GET", url, true);
  455. xhttp.send();
  456. }
  457. function loadChipRevision()
  458. {
  459. var url = domainname + '/info?type=ChipRevision';
  460. var xhttp = new XMLHttpRequest();
  461. xhttp.onreadystatechange = function() {
  462. if (this.readyState == 4 && this.status == 200) {
  463. document.getElementById("chip-revision").value = xhttp.response;
  464. }
  465. }
  466. xhttp.open("GET", url, true);
  467. xhttp.send();
  468. }
  469. function loadChipFeatures()
  470. {
  471. var url = domainname + '/info?type=ChipFeatures';
  472. var xhttp = new XMLHttpRequest();
  473. xhttp.onreadystatechange = function() {
  474. if (this.readyState == 4 && this.status == 200) {
  475. document.getElementById("chip-features").value = xhttp.response;
  476. }
  477. }
  478. xhttp.open("GET", url, true);
  479. xhttp.send();
  480. }
  481. function init()
  482. {
  483. loadMemoryInfo();
  484. loadLastRestart();
  485. loadUptime();
  486. loadFWVersion();
  487. loadFWBuildTime();
  488. loadHTMLVersion();
  489. loadHostname();
  490. loadIPAddress();
  491. loadWLANSSID();
  492. loadSDCardManufacturer();
  493. loadSDCardName();
  494. loadSDCardCapacity();
  495. loadSDCardSectorSize();
  496. loadSDCardPartitionSize();
  497. loadSDCardFreePartitionSpace();
  498. loadSDCardPartitionAllocationSize();
  499. loadChipCores();
  500. loadChipRevision();
  501. loadChipFeatures();
  502. }
  503. init();
  504. </script>
  505. </body>
  506. </html>