logging?
This commit is contained in:
parent
b822fb9c1c
commit
28ff965d41
@ -12,6 +12,11 @@
|
||||
<form id='in'>
|
||||
</form>
|
||||
</div>
|
||||
<div id='log'>
|
||||
<textarea id='logs'>
|
||||
|
||||
</textarea>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function generateInput(parameters){
|
||||
@ -52,6 +57,17 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
//async function initLog(){
|
||||
// socket = new WebSocket ( "/logs" );
|
||||
// socket.onmessage = function ( evt ) { document.getElementById('logs').innerHTML += evt.data; };
|
||||
//}
|
||||
|
||||
var sleep = time => new Promise(resolve => setTimeout(resolve, time))
|
||||
var poll = (promiseFn, time) => promiseFn().then(
|
||||
sleep(time).then(() => poll(promiseFn, time)))
|
||||
poll(() => new Promise(() => fetch("/apps/log").then(res => res.text().then(e => { document.getElementById('logs').innerHTML += e})) ), 1000)
|
||||
|
||||
let apps = fetch("/apps/list").then(res => res.json().then(generateInput));
|
||||
|
||||
//generateInput("[ \"bla\", \"foo\", \"baz\" ]");
|
||||
|
Loading…
Reference in New Issue
Block a user