Przeglądaj źródła

Remove trailing duplicate scripts from log.html

SybexXx 12 godzin temu
rodzic
commit
607c92b2e1
1 zmienionych plików z 0 dodań i 59 usunięć
  1. 0 59
      sd-card/html/log.html

+ 0 - 59
sd-card/html/log.html

@@ -116,63 +116,4 @@
     
         </script>
 </body>
-
-    <script>  
-        function reload() {
-          //  document.getElementById('log').innerHTML += "<br><b>Reloading...<b><br><br>";
-            document.getElementById('log').innerHTML += "<b>Reloading...</b>";
-            window.scrollBy(0,document.body.scrollHeight);
-            funcRequest(getDomainname() + '/log');
-        } 
-
-
-        function processLogLine(line, index, arr) {
-            /* Make sure the whitespaces in the uptime field get persevered */
-            uptimePart = line.slice(0, line.indexOf("]")).replace(/ /g, "&nbsp;");
-            line = uptimePart + line.slice(line.indexOf("]"))
-
-            if (line.includes("&lt;WRN&gt;")) {
-                arr[index] = "<span style=\"color:#e83c00\">" + line + "</span>";
-            }
-            else if (line.includes("&lt;ERR&gt;")) {
-                arr[index] = "<span style=\"color:red\"><b>" + line + "</b></span>";
-            }
-            else if (line.includes("&lt;DBG&gt;")) {
-                arr[index] = "<span style=\"color:gray\">" + line + "</span>";
-            }
-            else {
-                arr[index] = line;
-            }
-
-            arr[index] += "<br>";
-        }
-
-        async function funcRequest(url){
-            await fetch(url)
-            .then((res) => {
-                if (!res.ok) {
-                    document.getElementById("log").innerHTML = "HTTP error " + res.status;
-                }
-
-                return res.text();
-            })
-            .then((log) => {
-                log = log.replace(/</g, "&lt;");
-                log = log.replace(/>/g, "&gt;");
-                logArr = log.split("\n");
-                logArr.forEach(processLogLine);
-
-                document.getElementById('log').innerHTML = "<br>" + logArr.join("\n") + "&nbsp;";
-
-                window.scrollBy(0,document.body.scrollHeight);
-
-            })
-            .catch((err) => {
-                document.getElementById("log").innerHTML = err;
-            });
-        }
-
-        funcRequest(getDomainname() + '/log');
-
-    </script>
 </html>