added new script

This commit is contained in:
Gytis P. 2021-06-22 12:25:58 +03:00
parent 5dd60d0250
commit cc5056896c
2 changed files with 23 additions and 1 deletions

View File

@ -128,4 +128,4 @@ await HandleIncomingConnections(CancellationToken);
_listener.Close();
Context.LogInformation("Script done");
Context.LogInformation("Script done");

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>Script example</title>
</head>
<body>
<form method="post" action="shutdown">
<input type="submit" value="Shutdown">
</form>
<p></p>
<img id="img" src="" alt="Trulli" width="500" height="333">
<p id="eventDetails"></p>
<script>
setInterval(() => fetch('http://localhost:8000/doors')
.then(response => response.json())
.then(r => {
document.getElementById("img").src = r.Path;
document.getElementById("eventDetails").innerText = r.Name;
}), 1000)
</script>
</body>
</html>