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