Use ha-alert to warn about logs from custom integrations (#10396)

This commit is contained in:
Joakim Sørensen 2021-10-26 12:11:27 +02:00 committed by GitHub
parent 398d777681
commit 5d6bacb0bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,10 @@
import { mdiClose, mdiContentCopy, mdiPackageVariant } from "@mdi/js"; import { mdiClose, mdiContentCopy } from "@mdi/js";
import "@polymer/paper-tooltip/paper-tooltip"; import "@polymer/paper-tooltip/paper-tooltip";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { property, state } from "lit/decorators"; import { property, state } from "lit/decorators";
import { fireEvent } from "../../../common/dom/fire_event"; import { fireEvent } from "../../../common/dom/fire_event";
import { copyToClipboard } from "../../../common/util/copy-clipboard"; import { copyToClipboard } from "../../../common/util/copy-clipboard";
import "../../../components/ha-alert";
import "../../../components/ha-dialog"; import "../../../components/ha-dialog";
import "../../../components/ha-header-bar"; import "../../../components/ha-header-bar";
import "../../../components/ha-icon-button"; import "../../../components/ha-icon-button";
@ -96,12 +97,11 @@ class DialogSystemLogDetail extends LitElement {
></ha-icon-button> ></ha-icon-button>
</ha-header-bar> </ha-header-bar>
${this.isCustomIntegration ${this.isCustomIntegration
? html`<div class="custom"> ? html`<ha-alert alert-type="warning">
<ha-svg-icon .path=${mdiPackageVariant}></ha-svg-icon>
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.logs.error_from_custom_integration" "ui.panel.config.logs.error_from_custom_integration"
)} )}
</div>` </ha-alert>`
: ""} : ""}
<div class="contents"> <div class="contents">
<p> <p>
@ -215,9 +215,9 @@ class DialogSystemLogDetail extends LitElement {
margin-bottom: 0; margin-bottom: 0;
font-family: var(--code-font-family, monospace); font-family: var(--code-font-family, monospace);
} }
.custom { ha-alert {
padding: 8px 16px; display: block;
background-color: var(--warning-color); margin: -4px 0;
} }
.contents { .contents {
padding: 16px; padding: 16px;