Fix log lines missing

This commit is contained in:
Nicolas Mowen 2024-04-03 10:38:42 -06:00
parent 892f45ce35
commit df2332b4e2
2 changed files with 16 additions and 3 deletions

View File

@ -446,10 +446,12 @@ def logs(service: str):
newKey = cleanLine[0:keyLength] newKey = cleanLine[0:keyLength]
if newKey == currentKey: if newKey == currentKey:
currentLine += f"{cleanLine[dateEnd:].strip()}\n" currentLine += f"\n{cleanLine[dateEnd:].strip()}"
continue continue
else: else:
logLines.append(currentLine) if len(currentLine) > 0:
logLines.append(currentLine)
currentKey = newKey currentKey = newKey
currentLine = cleanLine currentLine = cleanLine

View File

@ -90,6 +90,17 @@ function Logs() {
const match = frigateDateStamp.exec(line); const match = frigateDateStamp.exec(line);
if (!match) { if (!match) {
const infoIndex = line.indexOf("[INFO]");
if (infoIndex != -1) {
return {
dateStamp: line.substring(0, 19),
severity: "info",
section: "starutp",
content: line.substring(infoIndex + 6).trim(),
};
}
return null; return null;
} }
@ -340,7 +351,7 @@ function Logs() {
</div> </div>
</div> </div>
{logLines.length > 0 && {logLines.length > 0 &&
[...Array(logRange.end - 1).keys()].map((idx) => { [...Array(logRange.end).keys()].map((idx) => {
const logLine = const logLine =
idx >= logRange.start idx >= logRange.start
? logLines[idx - logRange.start] ? logLines[idx - logRange.start]