mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-20 07:46:37 +00:00
Don't show tabs in supervisor (#12417)
This commit is contained in:
parent
a743e3bbba
commit
cff2f856b3
@ -10,6 +10,7 @@ import { HomeAssistant, Route } from "../../../src/types";
|
|||||||
import { supervisorTabs } from "../hassio-tabs";
|
import { supervisorTabs } from "../hassio-tabs";
|
||||||
import "./hassio-addons";
|
import "./hassio-addons";
|
||||||
import "./hassio-update";
|
import "./hassio-update";
|
||||||
|
import "../../../src/layouts/hass-subpage";
|
||||||
|
|
||||||
@customElement("hassio-dashboard")
|
@customElement("hassio-dashboard")
|
||||||
class HassioDashboard extends LitElement {
|
class HassioDashboard extends LitElement {
|
||||||
@ -22,6 +23,31 @@ class HassioDashboard extends LitElement {
|
|||||||
@property({ attribute: false }) public route!: Route;
|
@property({ attribute: false }) public route!: Route;
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
|
if (atLeastVersion(this.hass.config.version, 2022, 5)) {
|
||||||
|
return html`<hass-subpage
|
||||||
|
.hass=${this.hass}
|
||||||
|
.narrow=${this.narrow}
|
||||||
|
.route=${this.route}
|
||||||
|
.header=${this.supervisor.localize("panel.addons")}
|
||||||
|
>
|
||||||
|
<hassio-addons
|
||||||
|
.hass=${this.hass}
|
||||||
|
.supervisor=${this.supervisor}
|
||||||
|
></hassio-addons>
|
||||||
|
<a href="/hassio/store">
|
||||||
|
<ha-fab
|
||||||
|
.label=${this.supervisor.localize("panel.store")}
|
||||||
|
extended
|
||||||
|
class="non-tabs"
|
||||||
|
>
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="icon"
|
||||||
|
.path=${mdiStorePlus}
|
||||||
|
></ha-svg-icon> </ha-fab
|
||||||
|
></a>
|
||||||
|
</hass-subpage>`;
|
||||||
|
}
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<hass-tabs-subpage
|
<hass-tabs-subpage
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@ -74,6 +100,12 @@ class HassioDashboard extends LitElement {
|
|||||||
.content {
|
.content {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
ha-fab.non-tabs {
|
||||||
|
position: fixed;
|
||||||
|
right: calc(16px + env(safe-area-inset-right));
|
||||||
|
bottom: calc(16px + env(safe-area-inset-bottom));
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -8,24 +8,27 @@ import { atLeastVersion } from "../../src/common/config/version";
|
|||||||
import type { PageNavigation } from "../../src/layouts/hass-tabs-subpage";
|
import type { PageNavigation } from "../../src/layouts/hass-tabs-subpage";
|
||||||
import { HomeAssistant } from "../../src/types";
|
import { HomeAssistant } from "../../src/types";
|
||||||
|
|
||||||
export const supervisorTabs = (hass: HomeAssistant): PageNavigation[] => [
|
export const supervisorTabs = (hass: HomeAssistant): PageNavigation[] =>
|
||||||
{
|
atLeastVersion(hass.config.version, 2022, 5)
|
||||||
translationKey: atLeastVersion(hass.config.version, 2021, 12)
|
? []
|
||||||
? "panel.addons"
|
: [
|
||||||
: "panel.dashboard",
|
{
|
||||||
path: `/hassio/dashboard`,
|
translationKey: atLeastVersion(hass.config.version, 2021, 12)
|
||||||
iconPath: atLeastVersion(hass.config.version, 2021, 12)
|
? "panel.addons"
|
||||||
? mdiPuzzle
|
: "panel.dashboard",
|
||||||
: mdiViewDashboard,
|
path: `/hassio/dashboard`,
|
||||||
},
|
iconPath: atLeastVersion(hass.config.version, 2021, 12)
|
||||||
{
|
? mdiPuzzle
|
||||||
translationKey: "panel.backups",
|
: mdiViewDashboard,
|
||||||
path: `/hassio/backups`,
|
},
|
||||||
iconPath: mdiBackupRestore,
|
{
|
||||||
},
|
translationKey: "panel.backups",
|
||||||
{
|
path: `/hassio/backups`,
|
||||||
translationKey: "panel.system",
|
iconPath: mdiBackupRestore,
|
||||||
path: `/hassio/system`,
|
},
|
||||||
iconPath: mdiCogs,
|
{
|
||||||
},
|
translationKey: "panel.system",
|
||||||
];
|
path: `/hassio/system`,
|
||||||
|
iconPath: mdiCogs,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user