Show script traces in logbook (#12643)

This commit is contained in:
J. Nick Koston 2022-05-10 16:32:09 -05:00 committed by GitHub
parent d89e4337f2
commit 5ec7193e5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,13 +217,20 @@ class HaLogbook extends LitElement {
.datetime=${item.when} .datetime=${item.when}
capitalize capitalize
></ha-relative-time> ></ha-relative-time>
${item.domain === "automation" && ${["script", "automation"].includes(item.domain!) &&
item.context_id! in this.traceContexts item.context_id! in this.traceContexts
? html` ? html`
- -
<a <a
href=${`/config/automation/trace/${ href=${`/config/${
this.traceContexts[item.context_id!].item_id this.traceContexts[item.context_id!].domain
}/trace/${
this.traceContexts[item.context_id!].domain ===
"script"
? `script.${
this.traceContexts[item.context_id!].item_id
}`
: this.traceContexts[item.context_id!].item_id
}?run_id=${ }?run_id=${
this.traceContexts[item.context_id!].run_id this.traceContexts[item.context_id!].run_id
}`} }`}