// Use the code font
font-family: dv.$family-code;
- // Break loglines like a terminal would
- overflow-wrap: break-word;
+ // This thing has to be some fixed height and I have no idea how to make it
+ // fill its entire space and still allow the scroll events to happen.
+ height: 40rem;
- height: 100vh;
+ // Scroll whenever we have reached the maximum height
overflow-y: auto;
+ overflow-x: hidden;
- // Keep any whitespace
- white-space: pre;
+ // Break loglines like a terminal would
+ white-space: pre-wrap;
+ word-wrap: break-word;
.DEBUG {
- background-color: iv.$grey;
- color: bulmaFindColorInvert(iv.$grey);
+ color: iv.$grey;
}
.INFO {
}
.WARNING {
- background-color: dv.$warning;
- color: bulmaFindColorInvert(dv.$warning);
+ color: dv.$warning;
}
.ERROR {
- background-color: dv.$danger;
- color: bulmaFindColorInvert(dv.$danger);
+ color: dv.$danger;
}
&.is-small {
// Try to connect to the stream
const stream = new WebSocket(url);
+ // Lines
+ const lines = document.createElement("ul");
+ log.appendChild(lines);
+
stream.addEventListener("message", (event) => {
// Parse message as JSON
const data = JSON.parse(event.data);
line.textContent = data.message;
// Append it to the log window
- log.appendChild(line);
+ lines.appendChild(line);
// Scroll to the bottom
if (autoscroll) {