mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Hide configuration card if the add-on does not expose options or schema (#8131)
This commit is contained in:
parent
96f0ceeb8c
commit
edcb7e87bb
@ -26,28 +26,41 @@ class HassioAddonConfigDashboard extends LitElement {
|
|||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress active></ha-circular-progress>`;
|
return html`<ha-circular-progress active></ha-circular-progress>`;
|
||||||
}
|
}
|
||||||
|
const hasOptions =
|
||||||
|
this.addon.options && Object.keys(this.addon.options).length;
|
||||||
|
const hasSchema =
|
||||||
|
this.addon.schema && Object.keys(this.addon.schema).length;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<hassio-addon-config
|
${hasOptions || hasSchema || this.addon.network || this.addon.audio
|
||||||
.hass=${this.hass}
|
|
||||||
.addon=${this.addon}
|
|
||||||
></hassio-addon-config>
|
|
||||||
${this.addon.network
|
|
||||||
? html`
|
? html`
|
||||||
<hassio-addon-network
|
${hasOptions || hasSchema
|
||||||
.hass=${this.hass}
|
? html`
|
||||||
.addon=${this.addon}
|
<hassio-addon-config
|
||||||
></hassio-addon-network>
|
.hass=${this.hass}
|
||||||
|
.addon=${this.addon}
|
||||||
|
></hassio-addon-config>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
|
${this.addon.network
|
||||||
|
? html`
|
||||||
|
<hassio-addon-network
|
||||||
|
.hass=${this.hass}
|
||||||
|
.addon=${this.addon}
|
||||||
|
></hassio-addon-network>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
|
${this.addon.audio
|
||||||
|
? html`
|
||||||
|
<hassio-addon-audio
|
||||||
|
.hass=${this.hass}
|
||||||
|
.addon=${this.addon}
|
||||||
|
></hassio-addon-audio>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
`
|
`
|
||||||
: ""}
|
: "This add-on does not expose configuration for you to mess with.... 👋"}
|
||||||
${this.addon.audio
|
|
||||||
? html`
|
|
||||||
<hassio-addon-audio
|
|
||||||
.hass=${this.hass}
|
|
||||||
.addon=${this.addon}
|
|
||||||
></hassio-addon-audio>
|
|
||||||
`
|
|
||||||
: ""}
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ export interface HassioAddonDetails extends HassioAddonInfo {
|
|||||||
privileged: any;
|
privileged: any;
|
||||||
protected: boolean;
|
protected: boolean;
|
||||||
rating: "1-6";
|
rating: "1-6";
|
||||||
|
schema: Record<string, any>;
|
||||||
services_role: string[];
|
services_role: string[];
|
||||||
slug: string;
|
slug: string;
|
||||||
startup: "initialize" | "system" | "services" | "application" | "once";
|
startup: "initialize" | "system" | "services" | "application" | "once";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user