info.html 8.4 KB

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