54 lines
1.4 KiB
HTML
54 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<script>
|
|
let termdiv;
|
|
|
|
function button() {
|
|
fetch("/term",{
|
|
method:"POST",
|
|
body: JSON.stringify("bla"),
|
|
headers: {"Content-type":"application/json; charset=UTF-8"}
|
|
});
|
|
};
|
|
|
|
function getterm() {
|
|
termdiv.innerHTML = "";
|
|
fetch("/term", { method: "GET" })
|
|
.then(response => response.json())
|
|
.then(termarray => {
|
|
console.log(termarray);
|
|
for (let line of termarray) {
|
|
termdiv.innerHTML += `
|
|
${line}<br>`;
|
|
}
|
|
});
|
|
}
|
|
|
|
function initstuff() {
|
|
termdiv = document.getElementById("terminal");
|
|
getterm();
|
|
setInterval(getterm,8000)
|
|
}
|
|
|
|
|
|
|
|
window.onload = initstuff;
|
|
</script>
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Terradash</title>
|
|
</head>
|
|
<body >
|
|
<h1>Dash</h1>
|
|
<div id="dash">
|
|
<div id="buttons">
|
|
<button class="button" onclick="button()">test</button>
|
|
</div>
|
|
<div id="terminal">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|