Hide supervisor only config, fix backup config page (#12401)

This commit is contained in:
Bram Kragten 2022-04-25 14:09:23 +02:00 committed by GitHub
parent 6b67546daf
commit 94953ddf6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View File

@ -130,7 +130,7 @@ export class HaTabsSubpageDataTable extends LitElement {
* Array of tabs to show on the page.
* @type {Array}
*/
@property() public tabs!: PageNavigation[];
@property() public tabs: PageNavigation[] = [];
/**
* Force hides the filter menu.

View File

@ -1,5 +1,6 @@
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { customElement, property } from "lit/decorators";
import { canShowPage } from "../../../common/config/can_show_page";
import "../../../components/ha-card";
import "../../../components/ha-navigation-list";
import { CloudStatus } from "../../../data/cloud";
@ -23,12 +24,14 @@ class HaConfigSystemNavigation extends LitElement {
@property({ type: Boolean }) public showAdvanced!: boolean;
protected render(): TemplateResult {
const pages = configSections.general.map((page) => ({
...page,
name: page.translationKey
? this.hass.localize(page.translationKey)
: page.name,
}));
const pages = configSections.general
.filter((page) => canShowPage(this.hass, page))
.map((page) => ({
...page,
name: page.translationKey
? this.hass.localize(page.translationKey)
: page.name,
}));
return html`
<hass-subpage

View File

@ -306,12 +306,14 @@ export const configSections: { [name: string]: PageNavigation[] } = {
translationKey: "ui.panel.config.storage.caption",
iconPath: mdiServer,
iconColor: "#518C43",
component: "hassio",
},
{
path: "/config/hardware",
translationKey: "ui.panel.config.hardware.caption",
iconPath: mdiCpu32Bit,
iconColor: "#301A8E",
component: "hassio",
},
],
about: [