Skip to content

Commit

Permalink
fixes Missing CSS classes for date in tables #25
Browse files Browse the repository at this point in the history
  • Loading branch information
ciddi89 committed Aug 14, 2023
1 parent 57645c3 commit f2ed39d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,22 @@ class LogParser extends utils.Adapter {
counter++;
const lpLogObject = lpLogObjects[i];
this.g_allLogs[lpFilterName][i].date = await this.tsToDateString(lpLogObject.ts, this.dateFormat, this.config.txtToday, this.config.txtYesterday);
if (this.config.cssDate) this.g_allLogs[lpFilterName][i].date = `<span class='logInfo logDate'>${this.g_allLogs[lpFilterName][i].date}</span>`;
if (this.config.cssDate) {
const severityType = this.g_allLogs[lpFilterName][i].severity;
let severityTypeString;
if (severityType.includes('warn')) {
severityTypeString = 'Warn';
} else if (severityType.includes('info')) {
severityTypeString = 'Info';
} else if (severityType.includes('error')) {
severityTypeString = 'Error';
} else if (severityType.includes('silly')) {
severityTypeString = 'Silly';
} else if (severityType.includes('debug')) {
severityTypeString = 'Debug';
}
this.g_allLogs[lpFilterName][i].date = `<span class='log${severityTypeString} logDate'>${this.g_allLogs[lpFilterName][i].date}</span>`;
}
}

// Second: Update all JSON States
Expand Down

0 comments on commit f2ed39d

Please sign in to comment.