info.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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. caption {
  26. text-align: right;
  27. }
  28. caption h3 {
  29. margin: 0;
  30. }
  31. </style>
  32. <script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
  33. </head>
  34. <body style="font-family: arial; padding: 0px 10px;">
  35. <table>
  36. <caption><h3>Runtime Information</h3></caption>
  37. <colgroup>
  38. <col span="1" style="width: 35%;">
  39. <col span="1" style="width: 65%;">
  40. </colgroup>
  41. <tr>
  42. <td>Start time:</td>
  43. <td><output id="starttime"></output></td>
  44. </tr>
  45. <tr>
  46. <td>Uptime:</td>
  47. <td><output id="uptime"></output></td>
  48. </tr>
  49. </table>
  50. <table>
  51. <caption><h3>Build Info</h3></caption>
  52. <colgroup>
  53. <col span="1" style="width: 35%;">
  54. <col span="1" style="width: 65%;">
  55. </colgroup>
  56. <tr>
  57. <td>Firmware version:</td>
  58. <td>
  59. <output id="firmware"></output>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td>Firmware build time:</td>
  64. <td>
  65. <output id="build-time"></output>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td>Web interface version:</td>
  70. <td>
  71. <output id="web-ui"></output>
  72. </td>
  73. </tr>
  74. </table>
  75. <table>
  76. <caption><h3>Device Info</h3></caption>
  77. <colgroup>
  78. <col span="1" style="width: 35%;">
  79. <col span="1" style="width: 65%;">
  80. </colgroup>
  81. <tr>
  82. <td>Chip Cores:</td>
  83. <td>
  84. <output id="chip-cores"></output>
  85. </td>
  86. </tr>
  87. <tr>
  88. <td>Chip Revision:</td>
  89. <td>
  90. <output id="chip-revision"></output>
  91. </td>
  92. </tr>
  93. <tr>
  94. <td>Chip Features:</td>
  95. <td>
  96. <output id="chip-features"></output>
  97. </td>
  98. </tr>
  99. </table>
  100. <table>
  101. <caption><h3>Host Info</h3></caption>
  102. <colgroup>
  103. <col span="1" style="width: 35%;">
  104. <col span="1" style="width: 65%;">
  105. </colgroup>
  106. <tr>
  107. <td>Hostname:</td>
  108. <td>
  109. <output id="hostname"></output>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td>IP Address:</td>
  114. <td>
  115. <output id="IP-address"></output>
  116. </td>
  117. </tr>
  118. <tr>
  119. <td>WLAN SSID:</td>
  120. <td>
  121. <output id="wlan-ssid"></output>
  122. </td>
  123. </tr>
  124. </table>
  125. <table>
  126. <caption><h3>SD Card Info</h3></caption>
  127. <colgroup>
  128. <col span="1" style="width: 35%;">
  129. <col span="1" style="width: 65%;">
  130. </colgroup>
  131. <tr>
  132. <td>SD card manufacturer:</td>
  133. <td>
  134. <output id="SDCardManufacturer"></output>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td>SD card name:</td>
  139. <td>
  140. <output id="SDCardName"></output>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td>SD card size:</td>
  145. <td>
  146. <output id="SDCardCapacity"></output>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td>SD card sector size:</td>
  151. <td>
  152. <output id="SDCardSectorSize"></output>
  153. </td>
  154. </tr>
  155. <tr>
  156. <td>Partition size:</td>
  157. <td>
  158. <output id="SDCardPartitionSize"></output>
  159. </td>
  160. </tr>
  161. <tr>
  162. <td>Partition free space:</td>
  163. <td>
  164. <output id="SDCardFreePartitionSpace"></output>
  165. </td>
  166. </tr>
  167. <tr>
  168. <td>Partition allocation size:</td>
  169. <td>
  170. <output id="SDCardPartitionAllocationSize"></output>
  171. </td>
  172. </tr>
  173. </table>
  174. <table>
  175. <caption><h3>Memory Info</h3></caption>
  176. <colgroup>
  177. <col span="1" style="width: 35%;">
  178. <col span="1" style="width: 65%;">
  179. </colgroup>
  180. <tr>
  181. <td>Total Free (Int + Ext):</td>
  182. <td>
  183. <output id="RAMTotalFree"></output>
  184. </td>
  185. </tr>
  186. <tr>
  187. <td>Ext. RAM - Free:</td>
  188. <td>
  189. <output id="ExtRAMFree"></output>
  190. </td>
  191. </tr>
  192. <tr>
  193. <td>Ext. RAM - Largest Free Block:</td>
  194. <td>
  195. <output id="ExtRAMLargestFree"></output>
  196. </td>
  197. </tr>
  198. <tr>
  199. <td>Ext. RAM - Min Free:</td>
  200. <td>
  201. <output id="ExtRAMMinFree"></output>
  202. </td>
  203. </tr>
  204. <tr>
  205. <td>Int. RAM - Free:</td>
  206. <td>
  207. <output id="IntRAMFree"></output>
  208. </td>
  209. </tr>
  210. <tr>
  211. <td>Int. RAM - Largest Free Block:</td>
  212. <td>
  213. <output id="IntRAMLargestFree"></output>
  214. </td>
  215. </tr>
  216. <tr>
  217. <td>Int. RAM - Min Free:</td>
  218. <td>
  219. <output id="IntRAMMinFree"></output>
  220. </td>
  221. </tr>
  222. </table>
  223. <h3>Copyright</h3>
  224. Copyright &copy; 2020 - 2024 by <a href="https://github.com/jomjol/AI-on-the-edge-device" target=_blank>Jomjol</a> and others.
  225. <script type="text/javascript">
  226. function setOutput(id, value, suffix)
  227. {
  228. var field = document.getElementById(id);
  229. if (!field) {
  230. return;
  231. }
  232. if (value === undefined || value === null || value === "") {
  233. field.value = "N/A";
  234. } else {
  235. field.value = String(value) + (suffix || "");
  236. }
  237. }
  238. function formatStartTime(value)
  239. {
  240. if (!value || value.length < 15) {
  241. return value || "";
  242. }
  243. // Input format: YYYYMMDD-HHMMSS
  244. return value.substr(6, 2) + "." +
  245. value.substr(4, 2) + "." +
  246. value.substr(0, 4) + " " +
  247. value.substr(9, 2) + ":" +
  248. value.substr(11, 2) + ":" +
  249. value.substr(13, 2);
  250. }
  251. function formatBuildTime(value)
  252. {
  253. if (!value || value.length < 16) {
  254. return value || "";
  255. }
  256. // Input format: YYYY-MM-DD HH:MM
  257. return value.substr(8, 2) + "." +
  258. value.substr(5, 2) + "." +
  259. value.substr(0, 4) + " " +
  260. value.substr(11, 2) + ":" +
  261. value.substr(14, 2);
  262. }
  263. function loadSystemInfo()
  264. {
  265. var request = new XMLHttpRequest();
  266. request.onreadystatechange = function() {
  267. if (this.readyState !== 4) {
  268. return;
  269. }
  270. if (this.status !== 200) {
  271. console.error("Could not load system information:", this.status);
  272. return;
  273. }
  274. try {
  275. var response = JSON.parse(this.responseText);
  276. var info = Array.isArray(response) ? response[0] : response;
  277. if (!info || typeof info !== "object") {
  278. throw new Error("Invalid system information response");
  279. }
  280. setOutput("starttime", formatStartTime(info.starttime));
  281. setOutput("uptime", info.uptime);
  282. setOutput("firmware", info.firmware);
  283. setOutput("build-time", formatBuildTime(info.buildtime));
  284. setOutput("web-ui", info.html);
  285. setOutput("chip-cores", info.chipCores);
  286. setOutput("chip-revision", info.chipRevision);
  287. setOutput("chip-features", info.chipFeatures);
  288. setOutput("hostname", info.hostname);
  289. setOutput("IP-address", info.IPv4);
  290. setOutput("wlan-ssid", info.SSID);
  291. setOutput("SDCardManufacturer", info.sdCardManufacturer);
  292. setOutput("SDCardName", info.sdCardName);
  293. setOutput("SDCardCapacity", info.sdCardCapacity, " MB");
  294. setOutput("SDCardSectorSize", info.sdCardSectorSize, " byte");
  295. setOutput("SDCardPartitionSize", info.sdCardPartitionSize, " MB");
  296. setOutput("SDCardFreePartitionSpace", info.sdCardFreePartitionSpace, " MB");
  297. setOutput("SDCardPartitionAllocationSize", info.sdCardPartitionAllocationSize, " byte");
  298. setOutput("RAMTotalFree", info.RAMTotalFree, " byte");
  299. setOutput("ExtRAMFree", info.ExtRAMFree, " byte");
  300. setOutput("ExtRAMLargestFree", info.ExtRAMLargestFree, " byte");
  301. setOutput("ExtRAMMinFree", info.ExtRAMMinFree, " byte");
  302. setOutput("IntRAMFree", info.IntRAMFree, " byte");
  303. setOutput("IntRAMLargestFree", info.IntRAMLargestFree, " byte");
  304. setOutput("IntRAMMinFree", info.IntRAMMinFree, " byte");
  305. } catch (error) {
  306. console.error("Could not parse system information:", error);
  307. }
  308. };
  309. request.open("GET", getDomainname() + "/sysinfo", true);
  310. request.send();
  311. }
  312. loadSystemInfo();
  313. </script>
  314. </body>
  315. </html>