log: show the end of the log and make it scrollable

Show the latest lines of the log first as they contain the
information relevant to the latest operations.

Show the logs inside an scrollable widget.
master
Alejandro Sirgo Rica 2024-11-12 10:23:02 +01:00
parent 9c7a687d56
commit 92ab31650c
1 changed files with 15 additions and 1 deletions

View File

@ -20,6 +20,20 @@
}
</style>
<pre>{{ log }}</pre>
<div class="container-fluid d-flex flex-column" style="height: 90vh;">
<div class="border p-3 overflow-auto flex-grow-1" id="logContainer">
<pre>{{ log }}</pre>
</div>
</div>
<script>
function scrollToBottom() {
const logContainer = document.getElementById('logContainer');
logContainer.scrollTo({ top: logContainer.scrollHeight, behavior: 'instant' });
}
document.addEventListener("DOMContentLoaded", scrollToBottom);
</script>
{% endblock %}