mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 12:46:35 +00:00
Support grouped system log messages (#5030)
* Support grouped system log messages * Format source
This commit is contained in:
parent
aa2e632df3
commit
54739c7ccd
@ -2,9 +2,9 @@ import { HomeAssistant } from "../types";
|
||||
|
||||
export interface LoggedError {
|
||||
name: string;
|
||||
message: string;
|
||||
message: [string];
|
||||
level: string;
|
||||
source: string;
|
||||
source: [string, number];
|
||||
// unix timestamp in seconds
|
||||
timestamp: number;
|
||||
exception: string;
|
||||
|
@ -54,7 +54,8 @@ class DialogSystemLogDetail extends LitElement {
|
||||
</h2>
|
||||
<paper-dialog-scrollable>
|
||||
<p>
|
||||
Logger: ${item.name}
|
||||
Logger: ${item.name}<br />
|
||||
Source: ${item.source.join(":")}
|
||||
${integration
|
||||
? html`
|
||||
<br />
|
||||
@ -81,11 +82,18 @@ class DialogSystemLogDetail extends LitElement {
|
||||
Last logged:
|
||||
${formatSystemLogTime(item.timestamp, this.hass!.language)}
|
||||
</p>
|
||||
${item.message
|
||||
${item.message.length > 1
|
||||
? html`
|
||||
<pre>${item.message}</pre>
|
||||
<ul>
|
||||
${item.message.map(
|
||||
(msg) =>
|
||||
html`
|
||||
<li>${msg}</li>
|
||||
`
|
||||
)}
|
||||
</ul>
|
||||
`
|
||||
: html``}
|
||||
: item.message[0]}
|
||||
${item.exception
|
||||
? html`
|
||||
<pre>${item.exception}</pre>
|
||||
|
@ -62,7 +62,7 @@ export class SystemLogCard extends LitElement {
|
||||
<paper-item @click=${this._openLog} .logItem=${item}>
|
||||
<paper-item-body two-line>
|
||||
<div class="row">
|
||||
${item.message}
|
||||
${item.message[0]}
|
||||
</div>
|
||||
<div secondary>
|
||||
${formatSystemLogTime(
|
||||
@ -75,7 +75,7 @@ export class SystemLogCard extends LitElement {
|
||||
this.hass!.localize,
|
||||
integrations[idx]!
|
||||
)
|
||||
: item.source}
|
||||
: item.source[0]}
|
||||
(${item.level})
|
||||
${item.count > 1
|
||||
? html`
|
||||
|
Loading…
x
Reference in New Issue
Block a user