diff --git a/src/components/ha-ansi-to-html.ts b/src/components/ha-ansi-to-html.ts index ed0b3773e3..5956303ab4 100644 --- a/src/components/ha-ansi-to-html.ts +++ b/src/components/ha-ansi-to-html.ts @@ -12,6 +12,7 @@ import { query, state as litState, } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; interface State { bold: boolean; @@ -26,12 +27,15 @@ interface State { export class HaAnsiToHtml extends LitElement { @property() public content!: string; + @property({ type: Boolean, attribute: "wrap-disabled" }) public wrapDisabled = + false; + @query("pre") private _pre?: HTMLPreElement; @litState() private _filter = ""; protected render(): TemplateResult | void { - return html`
`; + return html``; } protected firstUpdated(_changedProperties: PropertyValues): void { @@ -47,9 +51,11 @@ export class HaAnsiToHtml extends LitElement { return css` pre { overflow-x: auto; + margin: 0; + } + pre.wrap { white-space: pre-wrap; overflow-wrap: break-word; - margin: 0; } .bold { font-weight: bold; diff --git a/src/panels/config/logs/error-log-card.ts b/src/panels/config/logs/error-log-card.ts index d7d2bc430e..b89288d720 100644 --- a/src/panels/config/logs/error-log-card.ts +++ b/src/panels/config/logs/error-log-card.ts @@ -1,10 +1,16 @@ import "@material/mwc-list/mwc-list-item"; +import type { ActionDetail } from "@material/mwc-list"; + import { mdiArrowCollapseDown, + mdiDotsVertical, mdiCircle, mdiDownload, + mdiFormatListNumbered, mdiMenuDown, mdiRefresh, + mdiWrap, + mdiWrapDisabled, } from "@mdi/js"; import { css, @@ -32,6 +38,8 @@ import "../../../components/chips/ha-assist-chip"; import "../../../components/ha-menu"; import "../../../components/ha-md-menu-item"; import "../../../components/ha-md-divider"; +import "../../../components/ha-button-menu"; +import "../../../components/ha-list-item"; import { getSignedPath } from "../../../data/auth"; @@ -114,6 +122,10 @@ class ErrorLogCard extends LitElement { @state() private _boots?: number[]; + @state() private _showBootsSelect = false; + + @state() private _wrapLines = true; + @state() private _downloadSupported; @state() private _logsFileLink; @@ -123,7 +135,7 @@ class ErrorLogCard extends LitElement {