mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 10:26:35 +00:00
Add clear button to Assist debug page (#23774)
* Add clear button to Assist debug page * Move destructive to ha-button
This commit is contained in:
parent
8efaf2b031
commit
d67c463b98
@ -23,6 +23,9 @@ export class HaButton extends Button {
|
|||||||
.slot-container {
|
.slot-container {
|
||||||
overflow: var(--button-slot-container-overflow, visible);
|
overflow: var(--button-slot-container-overflow, visible);
|
||||||
}
|
}
|
||||||
|
:host([destructive]) {
|
||||||
|
--mdc-theme-primary: var(--error-color);
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { mdiDownload } from "@mdi/js";
|
import { mdiDownload, mdiTrashCan } from "@mdi/js";
|
||||||
import { dump } from "js-yaml";
|
import { dump } from "js-yaml";
|
||||||
import type { CSSResultGroup } from "lit";
|
import type { CSSResultGroup } from "lit";
|
||||||
import { LitElement, css, html, nothing } from "lit";
|
import { LitElement, css, html, nothing } from "lit";
|
||||||
@ -162,6 +162,10 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
${this._results.length
|
${this._results.length
|
||||||
? html`
|
? html`
|
||||||
<div class="result-toolbar">
|
<div class="result-toolbar">
|
||||||
|
<ha-button outlined @click=${this._clear} destructive>
|
||||||
|
<ha-svg-icon slot="icon" .path=${mdiTrashCan}></ha-svg-icon>
|
||||||
|
${this.hass.localize("ui.common.clear")}
|
||||||
|
</ha-button>
|
||||||
<ha-button outlined @click=${this._download}>
|
<ha-button outlined @click=${this._download}>
|
||||||
<ha-svg-icon slot="icon" .path=${mdiDownload}></ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiDownload}></ha-svg-icon>
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
@ -221,6 +225,10 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _clear() {
|
||||||
|
this._results = [];
|
||||||
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user