webapp: Simplify line class detection in console view

This commit is contained in:
Thomas Basler
2025-08-26 17:27:03 +02:00
parent 3307f4a893
commit c005c33bd7

View File

@@ -212,12 +212,8 @@ export default defineComponent({
};
},
getLineClass(line: string): string {
for (const tag in this.levelMap) {
if (line.includes(tag)) {
return this.levelMap[tag];
}
}
return 'default';
const found = Object.entries(this.levelMap).find(([tag]) => line.includes(tag));
return found ? found[1] : 'default';
},
handleScroll() {
const el = this.$refs.logRef as HTMLDivElement;