mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 22:07:20 +00:00
Move energy to Dashboards (#11386)
This commit is contained in:
parent
05d7e85aa3
commit
e51a819bfd
@ -73,7 +73,7 @@ class HaConfigEnergy extends LitElement {
|
|||||||
.narrow=${this.narrow}
|
.narrow=${this.narrow}
|
||||||
.backPath=${this._searchParms.has("historyBack")
|
.backPath=${this._searchParms.has("historyBack")
|
||||||
? undefined
|
? undefined
|
||||||
: "/config"}
|
: "/config/lovelace/dashboards"}
|
||||||
.header=${this.hass.localize("ui.panel.config.energy.caption")}
|
.header=${this.hass.localize("ui.panel.config.energy.caption")}
|
||||||
>
|
>
|
||||||
<ha-alert>
|
<ha-alert>
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
mdiDevices,
|
mdiDevices,
|
||||||
mdiHomeAssistant,
|
mdiHomeAssistant,
|
||||||
mdiInformation,
|
mdiInformation,
|
||||||
mdiLightningBolt,
|
|
||||||
mdiMapMarkerRadius,
|
mdiMapMarkerRadius,
|
||||||
mdiMathLog,
|
mdiMathLog,
|
||||||
mdiNfcVariant,
|
mdiNfcVariant,
|
||||||
@ -82,13 +81,6 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
iconColor: "#B1345C",
|
iconColor: "#B1345C",
|
||||||
component: "lovelace",
|
component: "lovelace",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "/config/energy",
|
|
||||||
translationKey: "energy",
|
|
||||||
iconPath: mdiLightningBolt,
|
|
||||||
iconColor: "#F1C447",
|
|
||||||
component: "energy",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "/config/tags",
|
path: "/config/tags",
|
||||||
translationKey: "tags",
|
translationKey: "tags",
|
||||||
@ -200,15 +192,6 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
iconColor: "#616161",
|
iconColor: "#616161",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
energy: [
|
|
||||||
{
|
|
||||||
component: "energy",
|
|
||||||
path: "/config/energy",
|
|
||||||
translationKey: "ui.panel.config.energy.caption",
|
|
||||||
iconPath: mdiLightningBolt,
|
|
||||||
iconColor: "#F1C447",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
lovelace: [
|
lovelace: [
|
||||||
{
|
{
|
||||||
component: "lovelace",
|
component: "lovelace",
|
||||||
|
@ -194,6 +194,12 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
|||||||
mode: defaultMode,
|
mode: defaultMode,
|
||||||
filename: defaultMode === "yaml" ? "ui-lovelace.yaml" : "",
|
filename: defaultMode === "yaml" ? "ui-lovelace.yaml" : "",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: "hass:lightning-bolt",
|
||||||
|
title: this.hass.localize(`ui.panel.config.dashboard.energy.title`),
|
||||||
|
url_path: "energy",
|
||||||
|
filename: "",
|
||||||
|
},
|
||||||
...dashboards.map((dashboard) => ({
|
...dashboards.map((dashboard) => ({
|
||||||
filename: "",
|
filename: "",
|
||||||
...dashboard,
|
...dashboard,
|
||||||
@ -255,6 +261,11 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
|||||||
|
|
||||||
private _editDashboard(ev: CustomEvent) {
|
private _editDashboard(ev: CustomEvent) {
|
||||||
const urlPath = (ev.detail as RowClickedEvent).id;
|
const urlPath = (ev.detail as RowClickedEvent).id;
|
||||||
|
|
||||||
|
if (urlPath === "energy") {
|
||||||
|
navigate("/config/energy");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const dashboard = this._dashboards.find((res) => res.url_path === urlPath);
|
const dashboard = this._dashboards.find((res) => res.url_path === urlPath);
|
||||||
this._openDialog(dashboard, urlPath);
|
this._openDialog(dashboard, urlPath);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user