overview.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
  5. <title>Overview</title>
  6. <meta charset="utf-8">
  7. <style>
  8. .tg {border-collapse:collapse;border-spacing:0;width:100%;color: darkslategray;border: inset;height:585px;}
  9. .tg td{font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
  10. .tg th{height: 50px;font-size:24px;font-weight:bold;text-align:left;padding:0px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color:#f0f0f0}
  11. .tg .tg-1{width:700px;font-size:20px;font-family:Arial, Helvetica, sans-serif !important;border: inset;}
  12. .tg .tg-2{font-size:20px;font-family:Arial, Helvetica, sans-serif !important;border: inset;}
  13. .tg .tg-3{height: 15px;font-size:14px;font-family:Arial, Helvetica, sans-serif !important;border: inset;}
  14. </style>
  15. </head>
  16. <body style="font-family: arial">
  17. <table class="tg">
  18. <tr>
  19. <td class="tg-1" rowspan="9" style="vertical-align: top"><div id="img"></div></td>
  20. <th class="th">Value:</th>
  21. </tr>
  22. <tr>
  23. <td class="tg-2">
  24. <div id="value"></div>
  25. </td>
  26. </tr>
  27. <tr>
  28. <th class="th">Previous Value:</th>
  29. </tr>
  30. <tr>
  31. <td class="tg-2">
  32. <div id="prevalue"></div>
  33. </td>
  34. </tr>
  35. <tr>
  36. <th class="th">Raw Value:</th>
  37. </tr>
  38. <tr>
  39. <td class="tg-2">
  40. <div id="raw"></div>
  41. </td>
  42. </tr>
  43. <tr>
  44. <th class="th">Status:</th>
  45. </tr>
  46. <tr>
  47. <td class="tg-2">
  48. <div id="error"></div>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td class="tg-3">
  53. <div id="timestamp" ></div>
  54. <div id="statusflow" ></div>
  55. <div id="cputemp" ></div>
  56. <div id="rssi" ></div>
  57. <div>
  58. <span id="uptime" ></span>
  59. <span id="round" ></span>
  60. </div>
  61. </td>
  62. </tr>
  63. </table>
  64. <script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
  65. <script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
  66. <script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
  67. <script type="text/javascript">
  68. function addZero(i) {
  69. if (i < 10) {
  70. i = "0" + i;
  71. }
  72. return i;
  73. }
  74. $(document).ready(function() {
  75. LoadData();
  76. LoadROIImage();
  77. });
  78. function LoadData(){
  79. loadValue("value", "value");
  80. loadValue("raw", "raw");
  81. loadValue("prevalue", "prevalue");
  82. loadValue("error", "error", "font-size:8px");
  83. loadStatus();
  84. loadCPUTemp();
  85. loadRSSI();
  86. loadUptime();
  87. loadRoundCounter();
  88. }
  89. function LoadROIImage(){
  90. var d = new Date();
  91. var timestamp = d.getTime();
  92. var h = addZero(d.getHours());
  93. var m = addZero(d.getMinutes());
  94. var s = addZero(d.getSeconds());
  95. $('#img').html('<img src=' + getDomainname() + '/img_tmp/alg_roi.jpg?timestamp='+ timestamp +'" max-height:555px; display:block; margin-left:auto; margin-right:auto;"></img>');
  96. $('#timestamp').html("Last Page Refresh:" + (h + ":" + m + ":" + s));
  97. }
  98. function Refresh() {
  99. setTimeout (function() {
  100. LoadData();
  101. LoadROIImage();
  102. Refresh();
  103. }, 300000);
  104. }
  105. function loadStatus() {
  106. url = domainname + '/statusflow';
  107. var xhttp = new XMLHttpRequest();
  108. xhttp.onreadystatechange = function() {
  109. if (this.readyState == 4 && this.status == 200) {
  110. var _rsp = xhttp.responseText;
  111. $('#statusflow').html("Status: " + _rsp);
  112. }
  113. }
  114. xhttp.open("GET", url, true);
  115. xhttp.send();
  116. }
  117. function loadCPUTemp() {
  118. url = domainname + '/cpu_temperature';
  119. var xhttp = new XMLHttpRequest();
  120. xhttp.onreadystatechange = function() {
  121. if (this.readyState == 4 && this.status == 200) {
  122. var _rsp = xhttp.responseText;
  123. $('#cputemp').html("CPU Temperature: " +_rsp);
  124. }
  125. }
  126. xhttp.open("GET", url, true);
  127. xhttp.send();
  128. }
  129. function loadRSSI() {
  130. url = domainname + '/rssi';
  131. var xhttp = new XMLHttpRequest();
  132. xhttp.onreadystatechange = function() {
  133. if (this.readyState == 4 && this.status == 200) {
  134. var _rsp = xhttp.responseText;
  135. $('#rssi').html("RSSI: " + _rsp);
  136. }
  137. }
  138. xhttp.open("GET", url, true);
  139. xhttp.send();
  140. }
  141. function loadUptime() {
  142. url = domainname + '/uptime';
  143. var xhttp = new XMLHttpRequest();
  144. xhttp.onreadystatechange = function() {
  145. if (this.readyState == 4 && this.status == 200) {
  146. var _rsp = xhttp.responseText;
  147. $('#uptime').html("Uptime: " + _rsp);
  148. }
  149. }
  150. xhttp.open("GET", url, true);
  151. xhttp.send();
  152. }
  153. function loadRoundCounter() {
  154. url = domainname + '/info?type=Round';
  155. var xhttp = new XMLHttpRequest();
  156. xhttp.onreadystatechange = function() {
  157. if (this.readyState == 4 && this.status == 200) {
  158. var _rsp = xhttp.responseText;
  159. $('#round').html("(Round: " + _rsp + ")");
  160. }
  161. }
  162. xhttp.open("GET", url, true);
  163. xhttp.send();
  164. }
  165. function loadValue(_type, _div, _style) {
  166. url = domainname + '/value?all=true&type=' + _type;
  167. var xhttp = new XMLHttpRequest();
  168. xhttp.onreadystatechange = function() {
  169. if (this.readyState == 4 && this.status == 200) {
  170. var _rsp = xhttp.responseText;
  171. var _split = _rsp.split("\r");
  172. if (typeof _style == undefined)
  173. out = "<table>";
  174. else
  175. out = "<table style=\"" + _style + "\">";
  176. if (_split.length == 1)
  177. {
  178. var _zer = ZerlegeZeile(_split[0], "\t")
  179. if (_zer.length > 1)
  180. out = _zer[1];
  181. else
  182. out = "";
  183. }
  184. else
  185. {
  186. for (var j = 0; j < _split.length; ++j)
  187. {
  188. var _zer = ZerlegeZeile(_split[j], "\t")
  189. if (_zer.length == 1)
  190. out = out + "<tr><td>" + _zer[0] + "</td><td> </td></tr>";
  191. else
  192. out = out + "<tr><td>" + _zer[0] + "</td><td>" + _zer[1] + "</td></tr>";
  193. }
  194. out = out + "</table>"
  195. }
  196. document.getElementById(_div).innerHTML = out;
  197. }
  198. };
  199. xhttp.open("GET", url, true);
  200. xhttp.send();
  201. }
  202. function init(){
  203. domainname = getDomainname();
  204. Refresh();
  205. }
  206. init();
  207. </script>
  208. </body>
  209. </html>