info.html 12 KB

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