mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 22:06:34 +00:00
Show config if options or schema (#8487)
This commit is contained in:
parent
f7a3d2705c
commit
f43af9c0a5
@ -26,16 +26,15 @@ 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 =
|
const hasConfiguration =
|
||||||
this.addon.options && Object.keys(this.addon.options).length;
|
(this.addon.options && Object.keys(this.addon.options).length) ||
|
||||||
const hasSchema =
|
(this.addon.schema && Object.keys(this.addon.schema).length);
|
||||||
hasOptions && this.addon.schema && Object.keys(this.addon.schema).length;
|
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
${hasOptions || hasSchema || this.addon.network || this.addon.audio
|
${hasConfiguration || this.addon.network || this.addon.audio
|
||||||
? html`
|
? html`
|
||||||
${hasOptions || hasSchema
|
${hasConfiguration
|
||||||
? html`
|
? html`
|
||||||
<hassio-addon-config
|
<hassio-addon-config
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
|
@ -145,12 +145,10 @@ class HassioAddonConfig extends LitElement {
|
|||||||
|
|
||||||
protected firstUpdated(changedProps) {
|
protected firstUpdated(changedProps) {
|
||||||
super.firstUpdated(changedProps);
|
super.firstUpdated(changedProps);
|
||||||
this._canShowSchema =
|
this._canShowSchema = !this.addon.schema!.find(
|
||||||
Object.keys(this.addon.options).length !== 0 &&
|
// @ts-ignore
|
||||||
!this.addon.schema!.find(
|
(entry) => !SUPPORTED_UI_TYPES.includes(entry.type) || entry.multiple
|
||||||
// @ts-ignore
|
);
|
||||||
(entry) => !SUPPORTED_UI_TYPES.includes(entry.type) || entry.multiple
|
|
||||||
);
|
|
||||||
this._yamlMode = !this._canShowSchema;
|
this._yamlMode = !this._canShowSchema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user