mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-27 14:57:20 +00:00
parent
cce0a02ebb
commit
792a736e48
@ -102,7 +102,7 @@ class PanelDeveloperTools extends LitElement {
|
|||||||
}
|
}
|
||||||
developer-tools-router {
|
developer-tools-router {
|
||||||
display: block;
|
display: block;
|
||||||
height: calc(100vh - 112px);
|
height: calc(100vh - 104px);
|
||||||
}
|
}
|
||||||
ha-tabs {
|
ha-tabs {
|
||||||
margin-left: max(env(safe-area-inset-left), 24px);
|
margin-left: max(env(safe-area-inset-left), 24px);
|
||||||
|
@ -2,6 +2,7 @@ import "@material/mwc-button/mwc-button";
|
|||||||
import { HassEntity } from "home-assistant-js-websocket";
|
import { HassEntity } from "home-assistant-js-websocket";
|
||||||
import { css, CSSResultGroup, html, LitElement } from "lit";
|
import { css, CSSResultGroup, html, LitElement } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
|
import memoizeOne from "memoize-one";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { computeStateName } from "../../../common/entity/compute_state_name";
|
import { computeStateName } from "../../../common/entity/compute_state_name";
|
||||||
import "../../../components/data-table/ha-data-table";
|
import "../../../components/data-table/ha-data-table";
|
||||||
@ -32,7 +33,9 @@ class HaPanelDevStatistics extends LitElement {
|
|||||||
this._validateStatistics();
|
this._validateStatistics();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _columns: DataTableColumnContainer = {
|
/* eslint-disable lit/no-template-arrow */
|
||||||
|
private _columns = memoizeOne(
|
||||||
|
(localize): DataTableColumnContainer => ({
|
||||||
state: {
|
state: {
|
||||||
title: "Entity",
|
title: "Entity",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
@ -66,7 +69,7 @@ class HaPanelDevStatistics extends LitElement {
|
|||||||
html`${issues
|
html`${issues
|
||||||
? issues.map(
|
? issues.map(
|
||||||
(issue) =>
|
(issue) =>
|
||||||
this.hass.localize(
|
localize(
|
||||||
`ui.panel.developer-tools.tabs.statistics.issues.${issue.type}`,
|
`ui.panel.developer-tools.tabs.statistics.issues.${issue.type}`,
|
||||||
issue.data
|
issue.data
|
||||||
) || issue.type
|
) || issue.type
|
||||||
@ -77,18 +80,23 @@ class HaPanelDevStatistics extends LitElement {
|
|||||||
title: "",
|
title: "",
|
||||||
template: (_, data: any) =>
|
template: (_, data: any) =>
|
||||||
html`${data.issues
|
html`${data.issues
|
||||||
? html`<mwc-button @click=${this._fixIssue} .data=${data.issues}
|
? html`<mwc-button
|
||||||
>Fix issue</mwc-button
|
@click=${(ev) => this._fixIssue(ev)}
|
||||||
>`
|
.data=${data.issues}
|
||||||
|
>
|
||||||
|
Fix issue
|
||||||
|
</mwc-button>`
|
||||||
: ""}`,
|
: ""}`,
|
||||||
width: "113px",
|
width: "113px",
|
||||||
},
|
},
|
||||||
};
|
})
|
||||||
|
);
|
||||||
|
/* eslint-enable lit/no-template-arrow */
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
return html`
|
return html`
|
||||||
<ha-data-table
|
<ha-data-table
|
||||||
.columns=${this._columns}
|
.columns=${this._columns(this.hass.localize)}
|
||||||
.data=${this._data}
|
.data=${this._data}
|
||||||
noDataText="No issues found!"
|
noDataText="No issues found!"
|
||||||
id="statistic_id"
|
id="statistic_id"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user