mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 09:56:36 +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 {
|
||||
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 type { CSSResultGroup } from "lit";
|
||||
import { LitElement, css, html, nothing } from "lit";
|
||||
@ -162,6 +162,10 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
${this._results.length
|
||||
? html`
|
||||
<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-svg-icon slot="icon" .path=${mdiDownload}></ha-svg-icon>
|
||||
${this.hass.localize(
|
||||
@ -221,6 +225,10 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
);
|
||||
}
|
||||
|
||||
private _clear() {
|
||||
this._results = [];
|
||||
}
|
||||
|
||||
static get styles(): CSSResultGroup {
|
||||
return [
|
||||
haStyle,
|
||||
|
Loading…
x
Reference in New Issue
Block a user