init
This commit is contained in:
commit
fadf7b15c5
34 changed files with 9642 additions and 0 deletions
54
templates/index.html
Normal file
54
templates/index.html
Normal file
|
@ -0,0 +1,54 @@
|
|||
<!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>
|
Loading…
Add table
Add a link
Reference in a new issue