UI/UX: Fixes logging pane scrolling. Adds auto scroll on output.

This commit is contained in:
Himadri Bhattacharjee
2023-03-24 14:58:24 +05:30
parent 38b371caa2
commit 3def1f28ab
2 changed files with 5 additions and 1 deletions

View File

@@ -36,6 +36,8 @@ body {
height: calc(30vh - 2rem);
background: #000;
padding: 1rem;
overflow: scroll;
scroll-behavior: smooth;
}
.files {
@@ -93,6 +95,7 @@ body {
.editor {
background: #222;
border: none;
resize: none;
min-width: max-content;
height: calc(70vh - 3rem);
padding: 0.5rem;

View File

@@ -34,7 +34,8 @@ editor.addEventListener('keyup', (_) => {
function reload_logs() {
doApi({'action':'logs'}).then(r => r.json()).then(body => {
body.map(entry => {
logs.innerHTML += entry + '<br />'
logs.innerText += entry + '\n'
logs.scrollTo(0, logs.scrollHeight)
})
})
}