mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Show message when there are no add-ons (#7101)
This commit is contained in:
parent
e7e7912519
commit
6d5c6e2fbc
@ -10,6 +10,7 @@ import {
|
|||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { atLeastVersion } from "../../../src/common/config/version";
|
import { atLeastVersion } from "../../../src/common/config/version";
|
||||||
import { navigate } from "../../../src/common/navigate";
|
import { navigate } from "../../../src/common/navigate";
|
||||||
|
import { compare } from "../../../src/common/string/compare";
|
||||||
import "../../../src/components/ha-card";
|
import "../../../src/components/ha-card";
|
||||||
import { HassioAddonInfo } from "../../../src/data/hassio/addon";
|
import { HassioAddonInfo } from "../../../src/data/hassio/addon";
|
||||||
import { haStyle } from "../../../src/resources/styles";
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
@ -21,25 +22,27 @@ import { hassioStyle } from "../resources/hassio-style";
|
|||||||
class HassioAddons extends LitElement {
|
class HassioAddons extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
@property() public addons?: HassioAddonInfo[];
|
@property({ attribute: false }) public addons?: HassioAddonInfo[];
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>Add-ons</h1>
|
<h1>Add-ons</h1>
|
||||||
<div class="card-group">
|
<div class="card-group">
|
||||||
${!this.addons
|
${!this.addons?.length
|
||||||
? html`
|
? html`
|
||||||
<ha-card>
|
<ha-card>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
You don't have any add-ons installed yet. Head over to
|
You don't have any add-ons installed yet. Head over to
|
||||||
<a href="#" @click=${this._openStore}>the add-on store</a>
|
<button class="link" @click=${this._openStore}>
|
||||||
|
the add-on store
|
||||||
|
</button>
|
||||||
to get started!
|
to get started!
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
`
|
`
|
||||||
: this.addons
|
: this.addons
|
||||||
.sort((a, b) => (a.name > b.name ? 1 : -1))
|
.sort((a, b) => compare(a.name, b.name))
|
||||||
.map(
|
.map(
|
||||||
(addon) => html`
|
(addon) => html`
|
||||||
<ha-card .addon=${addon} @click=${this._addonTapped}>
|
<ha-card .addon=${addon} @click=${this._addonTapped}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user