This commit is contained in:
Ludeeus 2021-06-02 15:10:18 +00:00
parent fe5f9576c6
commit f7d0736731
2 changed files with 28 additions and 10 deletions

View File

@ -5,6 +5,7 @@ import "../../../src/layouts/hass-tabs-subpage";
import { haStyle } from "../../../src/resources/styles"; import { haStyle } from "../../../src/resources/styles";
import { HomeAssistant, Route } from "../../../src/types"; import { HomeAssistant, Route } from "../../../src/types";
import { supervisorTabs } from "../hassio-tabs"; import { supervisorTabs } from "../hassio-tabs";
import { hassioStyle } from "../resources/hassio-style";
import "./hassio-addons"; import "./hassio-addons";
import "./hassio-update"; import "./hassio-update";
@ -32,6 +33,7 @@ class HassioDashboard extends LitElement {
<span slot="header"> <span slot="header">
${this.supervisor.localize("panel.dashboard")} ${this.supervisor.localize("panel.dashboard")}
</span> </span>
<div class="content"> <div class="content">
<hassio-update <hassio-update
.hass=${this.hass} .hass=${this.hass}
@ -49,9 +51,15 @@ class HassioDashboard extends LitElement {
static get styles(): CSSResultGroup { static get styles(): CSSResultGroup {
return [ return [
haStyle, haStyle,
hassioStyle,
css` css`
.content { .content {
margin: 0 auto; display: flex;
max-width: 1500px;
}
.content > * {
display: block;
min-width: 400px;
} }
`, `,
]; ];

View File

@ -46,7 +46,8 @@ export class HassioUpdate extends LitElement {
(supervisor: Supervisor): number => (supervisor: Supervisor): number =>
Object.keys(supervisor).filter( Object.keys(supervisor).filter(
(value) => supervisor[value].update_available (value) => supervisor[value].update_available
).length ).length +
supervisor.addon.addons.filter((addon) => addon.update_available).length
); );
protected render(): TemplateResult { protected render(): TemplateResult {
@ -60,15 +61,24 @@ export class HassioUpdate extends LitElement {
} }
return html` return html`
<ha-card
.header="${this.supervisor.localize(
"common.update_available",
"count",
updatesAvailable
)}
🎉"
>
<ha-settings-row two-lines>
<span slot="prefix">
<ha-svg-icon .path=${mdiHomeAssistant}></ha-svg-icon>
</span>
<span slot="heading"> Home Assistant Core </span>
<span slot="description"> Version XXX is available </span>
</ha-settings-row>
</ha-card>
<div class="content"> <div class="content">
<h1> <h1></h1>
${this.supervisor.localize(
"common.update_available",
"count",
updatesAvailable
)}
🎉
</h1>
<div class="card-group"> <div class="card-group">
${this._renderUpdateCard( ${this._renderUpdateCard(
"Home Assistant Core", "Home Assistant Core",