info.html 7.9 KB

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