Skip to content

Commit

Permalink
Completely match the new Supervisor log timestamp format (#110)
Browse files Browse the repository at this point in the history
With the recent change which added milliseconds to the timestamp the
timestamp removal regex used in the landing page frontend did not
completely remove the timestamp anymore. This also lead to log level not
match correctly, and hence loss of log coloring.

Correctly match the log timestamp.

See also: home-assistant/supervisor#4954
  • Loading branch information
agners authored Apr 4, 2024
1 parent a52a25f commit 496ff9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rootfs/usr/share/www/static/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function fetchLogs() {
}
var scrolledDown = logElement.scrollTop + logElement.clientHeight === logElement.scrollHeight;
logElement.innerHTML = text
.replace(/^[\[\d \-:\]]*/gm, "")
.replace(/^[\[\d \-:.\]]*/gm, "")
.replace(/^(INFO|WARNING|ERROR)\s\(\w+\)\s(.*)\n/gm, "<span class='$1'>$2</span>\n")
if (scrolledDown) {
// Scroll content down if it was already scrolled down
Expand Down

0 comments on commit 496ff9a

Please sign in to comment.