mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Add iconColor to ha-config-navigation entries (#10658)
This commit is contained in:
parent
6335b13c5e
commit
a430142296
@ -28,6 +28,8 @@ export interface PageNavigation {
|
|||||||
core?: boolean;
|
core?: boolean;
|
||||||
advancedOnly?: boolean;
|
advancedOnly?: boolean;
|
||||||
iconPath?: string;
|
iconPath?: string;
|
||||||
|
description?: string;
|
||||||
|
iconColor?: string;
|
||||||
info?: any;
|
info?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ class HaConfigDashboard extends LitElement {
|
|||||||
name: "Home Assistant Cloud",
|
name: "Home Assistant Cloud",
|
||||||
info: this.cloudStatus,
|
info: this.cloudStatus,
|
||||||
iconPath: mdiCloudLock,
|
iconPath: mdiCloudLock,
|
||||||
|
iconColor: "#174B62",
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
></ha-config-navigation>
|
></ha-config-navigation>
|
||||||
|
@ -24,10 +24,13 @@ class HaConfigNavigation extends LitElement {
|
|||||||
? html`
|
? html`
|
||||||
<a href=${page.path} aria-role="option" tabindex="-1">
|
<a href=${page.path} aria-role="option" tabindex="-1">
|
||||||
<paper-icon-item>
|
<paper-icon-item>
|
||||||
<ha-svg-icon
|
<div
|
||||||
.path=${page.iconPath}
|
class=${page.iconColor ? "icon-background" : ""}
|
||||||
slot="item-icon"
|
slot="item-icon"
|
||||||
></ha-svg-icon>
|
.style="background-color: ${page.iconColor || "undefined"}"
|
||||||
|
>
|
||||||
|
<ha-svg-icon .path=${page.iconPath}></ha-svg-icon>
|
||||||
|
</div>
|
||||||
<paper-item-body two-line>
|
<paper-item-body two-line>
|
||||||
${page.name ||
|
${page.name ||
|
||||||
this.hass.localize(
|
this.hass.localize(
|
||||||
@ -54,7 +57,8 @@ class HaConfigNavigation extends LitElement {
|
|||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
<div secondary>
|
<div secondary>
|
||||||
${this.hass.localize(
|
${page.description ||
|
||||||
|
this.hass.localize(
|
||||||
`ui.panel.config.${page.component}.description`
|
`ui.panel.config.${page.component}.description`
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -81,6 +85,11 @@ class HaConfigNavigation extends LitElement {
|
|||||||
ha-svg-icon,
|
ha-svg-icon,
|
||||||
ha-icon-next {
|
ha-icon-next {
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
|
height: 24px;
|
||||||
|
width: 24px;
|
||||||
|
}
|
||||||
|
ha-svg-icon {
|
||||||
|
padding: 8px;
|
||||||
}
|
}
|
||||||
.iron-selected paper-item::before,
|
.iron-selected paper-item::before,
|
||||||
a:not(.iron-selected):focus::before {
|
a:not(.iron-selected):focus::before {
|
||||||
@ -102,6 +111,12 @@ class HaConfigNavigation extends LitElement {
|
|||||||
.iron-selected:focus paper-item::before {
|
.iron-selected:focus paper-item::before {
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
}
|
}
|
||||||
|
.icon-background {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.icon-background ha-svg-icon {
|
||||||
|
color: var(--card-background-color);
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/integrations",
|
path: "/config/integrations",
|
||||||
translationKey: "ui.panel.config.integrations.caption",
|
translationKey: "ui.panel.config.integrations.caption",
|
||||||
iconPath: mdiPuzzle,
|
iconPath: mdiPuzzle,
|
||||||
|
iconColor: "#004E98",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -53,6 +54,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/devices",
|
path: "/config/devices",
|
||||||
translationKey: "ui.panel.config.devices.caption",
|
translationKey: "ui.panel.config.devices.caption",
|
||||||
iconPath: mdiDevices,
|
iconPath: mdiDevices,
|
||||||
|
iconColor: "#004E98",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -60,6 +62,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/entities",
|
path: "/config/entities",
|
||||||
translationKey: "ui.panel.config.entities.caption",
|
translationKey: "ui.panel.config.entities.caption",
|
||||||
iconPath: mdiShape,
|
iconPath: mdiShape,
|
||||||
|
iconColor: "#004E98",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -67,6 +70,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/areas",
|
path: "/config/areas",
|
||||||
translationKey: "ui.panel.config.areas.caption",
|
translationKey: "ui.panel.config.areas.caption",
|
||||||
iconPath: mdiSofa,
|
iconPath: mdiSofa,
|
||||||
|
iconColor: "#004E98",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -76,24 +80,28 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/blueprint",
|
path: "/config/blueprint",
|
||||||
translationKey: "ui.panel.config.blueprint.caption",
|
translationKey: "ui.panel.config.blueprint.caption",
|
||||||
iconPath: mdiPaletteSwatch,
|
iconPath: mdiPaletteSwatch,
|
||||||
|
iconColor: "#2A850E",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: "automation",
|
component: "automation",
|
||||||
path: "/config/automation",
|
path: "/config/automation",
|
||||||
translationKey: "ui.panel.config.automation.caption",
|
translationKey: "ui.panel.config.automation.caption",
|
||||||
iconPath: mdiRobot,
|
iconPath: mdiRobot,
|
||||||
|
iconColor: "#2A850E",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: "scene",
|
component: "scene",
|
||||||
path: "/config/scene",
|
path: "/config/scene",
|
||||||
translationKey: "ui.panel.config.scene.caption",
|
translationKey: "ui.panel.config.scene.caption",
|
||||||
iconPath: mdiPalette,
|
iconPath: mdiPalette,
|
||||||
|
iconColor: "#2A850E",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: "script",
|
component: "script",
|
||||||
path: "/config/script",
|
path: "/config/script",
|
||||||
translationKey: "ui.panel.config.script.caption",
|
translationKey: "ui.panel.config.script.caption",
|
||||||
iconPath: mdiScriptText,
|
iconPath: mdiScriptText,
|
||||||
|
iconColor: "#2A850E",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
helpers: [
|
helpers: [
|
||||||
@ -102,6 +110,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/helpers",
|
path: "/config/helpers",
|
||||||
translationKey: "ui.panel.config.helpers.caption",
|
translationKey: "ui.panel.config.helpers.caption",
|
||||||
iconPath: mdiTools,
|
iconPath: mdiTools,
|
||||||
|
iconColor: "#7209EB",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -111,12 +120,14 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/tags",
|
path: "/config/tags",
|
||||||
translationKey: "ui.panel.config.tag.caption",
|
translationKey: "ui.panel.config.tag.caption",
|
||||||
iconPath: mdiNfcVariant,
|
iconPath: mdiNfcVariant,
|
||||||
|
iconColor: "#DF8E44",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: "energy",
|
component: "energy",
|
||||||
path: "/config/energy",
|
path: "/config/energy",
|
||||||
translationKey: "ui.panel.config.energy.caption",
|
translationKey: "ui.panel.config.energy.caption",
|
||||||
iconPath: mdiLightningBolt,
|
iconPath: mdiLightningBolt,
|
||||||
|
iconColor: "#578681",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
lovelace: [
|
lovelace: [
|
||||||
@ -125,6 +136,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/lovelace/dashboards",
|
path: "/config/lovelace/dashboards",
|
||||||
translationKey: "ui.panel.config.lovelace.caption",
|
translationKey: "ui.panel.config.lovelace.caption",
|
||||||
iconPath: mdiViewDashboard,
|
iconPath: mdiViewDashboard,
|
||||||
|
iconColor: "#D81159",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
persons: [
|
persons: [
|
||||||
@ -133,18 +145,21 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/person",
|
path: "/config/person",
|
||||||
translationKey: "ui.panel.config.person.caption",
|
translationKey: "ui.panel.config.person.caption",
|
||||||
iconPath: mdiAccount,
|
iconPath: mdiAccount,
|
||||||
|
iconColor: "#0A4BF0",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: "zone",
|
component: "zone",
|
||||||
path: "/config/zone",
|
path: "/config/zone",
|
||||||
translationKey: "ui.panel.config.zone.caption",
|
translationKey: "ui.panel.config.zone.caption",
|
||||||
iconPath: mdiMapMarkerRadius,
|
iconPath: mdiMapMarkerRadius,
|
||||||
|
iconColor: "#0A4BF0",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: "users",
|
component: "users",
|
||||||
path: "/config/users",
|
path: "/config/users",
|
||||||
translationKey: "ui.panel.config.users.caption",
|
translationKey: "ui.panel.config.users.caption",
|
||||||
iconPath: mdiBadgeAccountHorizontal,
|
iconPath: mdiBadgeAccountHorizontal,
|
||||||
|
iconColor: "#0A4BF0",
|
||||||
core: true,
|
core: true,
|
||||||
advancedOnly: true,
|
advancedOnly: true,
|
||||||
},
|
},
|
||||||
@ -155,6 +170,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/core",
|
path: "/config/core",
|
||||||
translationKey: "ui.panel.config.core.caption",
|
translationKey: "ui.panel.config.core.caption",
|
||||||
iconPath: mdiHomeAssistant,
|
iconPath: mdiHomeAssistant,
|
||||||
|
iconColor: "#8F2D56",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -162,6 +178,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/server_control",
|
path: "/config/server_control",
|
||||||
translationKey: "ui.panel.config.server_control.caption",
|
translationKey: "ui.panel.config.server_control.caption",
|
||||||
iconPath: mdiServer,
|
iconPath: mdiServer,
|
||||||
|
iconColor: "#8F2D56",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -169,6 +186,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/logs",
|
path: "/config/logs",
|
||||||
translationKey: "ui.panel.config.logs.caption",
|
translationKey: "ui.panel.config.logs.caption",
|
||||||
iconPath: mdiMathLog,
|
iconPath: mdiMathLog,
|
||||||
|
iconColor: "#8F2D56",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -176,6 +194,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
path: "/config/info",
|
path: "/config/info",
|
||||||
translationKey: "ui.panel.config.info.caption",
|
translationKey: "ui.panel.config.info.caption",
|
||||||
iconPath: mdiInformation,
|
iconPath: mdiInformation,
|
||||||
|
iconColor: "#8F2D56",
|
||||||
core: true,
|
core: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user