Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update log.service.ts
Browse files Browse the repository at this point in the history
bwp91 committed Nov 11, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent cc6125b commit aebd335
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ui/src/app/core/log.service.ts
Original file line number Diff line number Diff line change
@@ -82,20 +82,22 @@ export class LogService {
this.io.socket.on('stdout', (data: string) => {
console.log(data);
if (this.pluginName) {
const lines = data.split('\n');
const lines = data.split('\r\n');
let includeNextLine = false;

lines.forEach((line) => {
this.term.write(line + '\r');
if (includeNextLine) {
if (line.match(/\\u001b\[39m\\u001b\[36m\[(.*?)]\\u001b\[39m/)) {
if (line.match(/ \u001b\[39m\u001b\[36m\[.*?]\u001b\[39m /)) {
includeNextLine = false;
} else {
this.term.write(line);
this.term.write(line + '\r');
return;
}
}

if (line.includes(` \u001b[39m\u001b[36m[${this.pluginName}]\u00b1[39m `)) {
// " \u001b[39m\u001b[36m[Govee]\u001b[39m "
if (line.includes(` \u001b[39m\u001b[36m[${this.pluginName}]\u001b[39m `)) {
this.term.write(line + '\r');
includeNextLine = true;
}

0 comments on commit aebd335

Please sign in to comment.