mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 02:06:42 +00:00
Remove handling of the supervisor panel from the sidebar (#10773)
This commit is contained in:
parent
da4942aca3
commit
2100603cdc
@ -8,7 +8,6 @@ import {
|
|||||||
mdiCog,
|
mdiCog,
|
||||||
mdiFormatListBulletedType,
|
mdiFormatListBulletedType,
|
||||||
mdiHammer,
|
mdiHammer,
|
||||||
mdiHomeAssistant,
|
|
||||||
mdiLightningBolt,
|
mdiLightningBolt,
|
||||||
mdiMenu,
|
mdiMenu,
|
||||||
mdiMenuOpen,
|
mdiMenuOpen,
|
||||||
@ -53,7 +52,7 @@ import "./ha-menu-button";
|
|||||||
import "./ha-svg-icon";
|
import "./ha-svg-icon";
|
||||||
import "./user/ha-user-badge";
|
import "./user/ha-user-badge";
|
||||||
|
|
||||||
const SHOW_AFTER_SPACER = ["config", "developer-tools", "hassio"];
|
const SHOW_AFTER_SPACER = ["config", "developer-tools"];
|
||||||
|
|
||||||
const SUPPORT_SCROLL_IF_NEEDED = "scrollIntoViewIfNeeded" in document.body;
|
const SUPPORT_SCROLL_IF_NEEDED = "scrollIntoViewIfNeeded" in document.body;
|
||||||
|
|
||||||
@ -63,7 +62,6 @@ const SORT_VALUE_URL_PATHS = {
|
|||||||
logbook: 3,
|
logbook: 3,
|
||||||
history: 4,
|
history: 4,
|
||||||
"developer-tools": 9,
|
"developer-tools": 9,
|
||||||
hassio: 10,
|
|
||||||
config: 11,
|
config: 11,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -72,7 +70,6 @@ const PANEL_ICONS = {
|
|||||||
config: mdiCog,
|
config: mdiCog,
|
||||||
"developer-tools": mdiHammer,
|
"developer-tools": mdiHammer,
|
||||||
energy: mdiLightningBolt,
|
energy: mdiLightningBolt,
|
||||||
hassio: mdiHomeAssistant,
|
|
||||||
history: mdiChartBox,
|
history: mdiChartBox,
|
||||||
logbook: mdiFormatListBulletedType,
|
logbook: mdiFormatListBulletedType,
|
||||||
lovelace: mdiViewDashboard,
|
lovelace: mdiViewDashboard,
|
||||||
@ -340,10 +337,8 @@ class HaSidebar extends LitElement {
|
|||||||
this._hiddenPanels
|
this._hiddenPanels
|
||||||
);
|
);
|
||||||
|
|
||||||
// Show the update-available as beeing part of configuration
|
// Show the supervisor as beeing part of configuration
|
||||||
const selectedPanel = this.route.path?.startsWith(
|
const selectedPanel = this.route.path?.startsWith("/hassio/")
|
||||||
"/hassio/update-available"
|
|
||||||
)
|
|
||||||
? "config"
|
? "config"
|
||||||
: this.hass.panelUrl;
|
: this.hass.panelUrl;
|
||||||
|
|
||||||
@ -393,11 +388,7 @@ class HaSidebar extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<a
|
<a
|
||||||
aria-role="option"
|
aria-role="option"
|
||||||
href=${`/${
|
href=${`/${urlPath}`}
|
||||||
urlPath === "hassio"
|
|
||||||
? "config/dashboard/?focusedPath=hassio"
|
|
||||||
: urlPath
|
|
||||||
}`}
|
|
||||||
data-panel=${urlPath}
|
data-panel=${urlPath}
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
@mouseenter=${this._itemMouseEnter}
|
@mouseenter=${this._itemMouseEnter}
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
} from "lit";
|
} from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
||||||
import { extractSearchParam } from "../../../common/url/search-params";
|
|
||||||
import "../../../components/ha-card";
|
import "../../../components/ha-card";
|
||||||
import "../../../components/ha-icon-next";
|
import "../../../components/ha-icon-next";
|
||||||
import "../../../components/ha-menu-button";
|
import "../../../components/ha-menu-button";
|
||||||
@ -136,7 +135,6 @@ class HaConfigDashboard extends LitElement {
|
|||||||
.narrow=${this.narrow}
|
.narrow=${this.narrow}
|
||||||
.showAdvanced=${this.showAdvanced}
|
.showAdvanced=${this.showAdvanced}
|
||||||
.pages=${configSections.dashboard}
|
.pages=${configSections.dashboard}
|
||||||
.focusedPath=${extractSearchParam("focusedPath")}
|
|
||||||
></ha-config-navigation>
|
></ha-config-navigation>
|
||||||
</ha-card>`}
|
</ha-card>`}
|
||||||
</ha-config-section>
|
</ha-config-section>
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
import "@polymer/paper-item/paper-icon-item";
|
import "@polymer/paper-item/paper-icon-item";
|
||||||
import "@polymer/paper-item/paper-item-body";
|
import "@polymer/paper-item/paper-item-body";
|
||||||
import {
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
css,
|
|
||||||
CSSResultGroup,
|
|
||||||
html,
|
|
||||||
LitElement,
|
|
||||||
PropertyValues,
|
|
||||||
TemplateResult,
|
|
||||||
} from "lit";
|
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { canShowPage } from "../../../common/config/can_show_page";
|
import { canShowPage } from "../../../common/config/can_show_page";
|
||||||
import "../../../components/ha-card";
|
import "../../../components/ha-card";
|
||||||
@ -26,21 +19,6 @@ class HaConfigNavigation extends LitElement {
|
|||||||
|
|
||||||
@property() public pages!: PageNavigation[];
|
@property() public pages!: PageNavigation[];
|
||||||
|
|
||||||
@property() public focusedPath?: string | null;
|
|
||||||
|
|
||||||
protected updated(changedProps: PropertyValues) {
|
|
||||||
super.firstUpdated(changedProps);
|
|
||||||
if (!this.focusedPath) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (const a of this.shadowRoot!.querySelectorAll("a")) {
|
|
||||||
if (a.href.endsWith(this.focusedPath)) {
|
|
||||||
a.querySelector("paper-icon-item")?.focus();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
${this.pages.map((page) =>
|
${this.pages.map((page) =>
|
||||||
|
@ -72,9 +72,9 @@ export const configSections: { [name: string]: PageNavigation[] } = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/hassio",
|
path: "/hassio",
|
||||||
name: "Add-ons & Backups",
|
name: "Add-ons & Backups (Supervisor)",
|
||||||
description: "Create backups, check logs or reboot your system",
|
description: "Create backups, check logs or reboot your system",
|
||||||
iconPath: mdiPuzzle,
|
iconPath: mdiHomeAssistant,
|
||||||
iconColor: "#4084CD",
|
iconColor: "#4084CD",
|
||||||
component: "hassio",
|
component: "hassio",
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user