File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
rootfs/usr/share/www/static Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,10 @@ function testAvailable() {
70
70
} , scheduleTry ) ;
71
71
}
72
72
73
- var errorCheck = / ^ [ \d - : ] + E R R O R ( .* ) / gm
73
+ var errorCheck = / ^ [ \d - : ] + ( E R R O R | C R I T I C A L ) ( .* ) / gm
74
+
75
+ const regexRemoveTimestamp = / ^ [ \[ \d \- : . \] ] * / gm
76
+ const regexColorLines = / ^ ( D E B U G | I N F O | W A R N I N G | E R R O R | C R I T I C A L ) \s \( \w + \) \s ( .* ) \n / gm
74
77
75
78
function fetchLogs ( ) {
76
79
fetch ( "/observer/logs" ) . then ( function ( res ) {
@@ -87,8 +90,8 @@ function fetchLogs() {
87
90
}
88
91
var scrolledDown = logElement . scrollTop + logElement . clientHeight === logElement . scrollHeight ;
89
92
logElement . innerHTML = text
90
- . replace ( / ^ [ \[ \d \- : . \] ] * / gm , "" )
91
- . replace ( / ^ ( I N F O | W A R N I N G | E R R O R ) \s \( \w + \) \s ( . * ) \n / gm , "<span class='$1'>$2</span>\n" )
93
+ . replace ( regexRemoveTimestamp , "" )
94
+ . replace ( regexColorLines , "<span class='$1'>$2</span>\n" )
92
95
if ( scrolledDown ) {
93
96
// Scroll content down if it was already scrolled down
94
97
logElement . scrollTop = logElement . scrollHeight ;
Original file line number Diff line number Diff line change @@ -348,11 +348,15 @@ pre:empty {
348
348
display : none;
349
349
}
350
350
351
- pre .INFO {
351
+ pre .DEBUG {
352
352
color : # 039be5 ;
353
353
}
354
354
355
- pre .ERROR {
355
+ pre .INFO {
356
+ color : # 43a047 ;
357
+ }
358
+
359
+ pre .ERROR , pre .CRITICAL {
356
360
color : # db4437 ;
357
361
}
358
362
You can’t perform that action at this time.
0 commit comments