30 lines
927 B
HTML
30 lines
927 B
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
|
|
<h2>Live Log</h2>
|
|
|
|
<div id="log-box" class="border p-3 bg-light" style="height:500px; overflow:auto; white-space: pre-wrap; font-family: monospace;"></div>
|
|
|
|
<script>
|
|
const intervalMinutes = {{ interval | int }};
|
|
const intervalMilliseconds = intervalMinutes * 60 * 1000;
|
|
function fetchLog() {
|
|
fetch("{{ url_for('get_log') }}")
|
|
.then(response => response.text())
|
|
.then(data => {
|
|
const box = document.getElementById("log-box");
|
|
const filteredLines = data
|
|
.split("\n")
|
|
.filter(line => !line.includes("ist erreichbar!"))
|
|
.join("\n");
|
|
box.innerText = filteredLines;
|
|
box.scrollTop = box.scrollHeight;
|
|
})
|
|
.catch(err => console.error("Fehler beim Laden der Logs:", err));
|
|
}
|
|
fetchLog();
|
|
setInterval(fetchLog, intervalMilliseconds);
|
|
</script>
|
|
|
|
{% endblock %}
|