From 746844dfc85469a18acee8bc399877add86d23b0 Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Tue, 11 Aug 2020 12:15:08 +0000 Subject: [PATCH 1/3] Only show diagnostics if healthy --- hassio/src/system/hassio-supervisor-info.ts | 38 +++++++++++---------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts index 0452bd5188..71b21423e0 100644 --- a/hassio/src/system/hassio-supervisor-info.ts +++ b/hassio/src/system/hassio-supervisor-info.ts @@ -61,24 +61,26 @@ class HassioSupervisorInfo extends LitElement {
- - - Share Diagnostics - -
- Share crash reports and diagnostic information. - -
- -
+ ${this.supervisorInfo?.healthy + ? html` + + Share Diagnostics + +
+ Share crash reports and diagnostic information. + +
+ +
` + : ""}
${this._errors ? html`
Error: ${this._errors}
` From 2bb64e9e2fd5092f4d31f7308e1264d0577c69a4 Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Tue, 11 Aug 2020 12:28:35 +0000 Subject: [PATCH 2/3] Use supported instead --- hassio/src/system/hassio-supervisor-info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts index 71b21423e0..189738ea09 100644 --- a/hassio/src/system/hassio-supervisor-info.ts +++ b/hassio/src/system/hassio-supervisor-info.ts @@ -61,7 +61,7 @@ class HassioSupervisorInfo extends LitElement {
- ${this.supervisorInfo?.healthy + ${this.supervisorInfo?.supported ? html` Share Diagnostics From 96986164a43e06924a82669f5734a913379393a2 Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Tue, 11 Aug 2020 14:12:38 +0000 Subject: [PATCH 3/3] Show error if not supported --- hassio/src/system/hassio-supervisor-info.ts | 23 +++++++++++++++------ hassio/src/system/hassio-system.ts | 1 + 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts index 189738ea09..b76f791c4d 100644 --- a/hassio/src/system/hassio-supervisor-info.ts +++ b/hassio/src/system/hassio-supervisor-info.ts @@ -12,6 +12,7 @@ import { import { fireEvent } from "../../../src/common/dom/fire_event"; import "../../../src/components/buttons/ha-call-api-button"; import "../../../src/components/ha-card"; +import { HassioHostInfo as HassioHostInfoType } from "../../../src/data/hassio/host"; import { HassioSupervisorInfo as HassioSupervisorInfoType, setSupervisorOption, @@ -33,6 +34,8 @@ class HassioSupervisorInfo extends LitElement { @property() public supervisorInfo!: HassioSupervisorInfoType; + @property() public hostInfo!: HassioHostInfoType; + @internalProperty() private _errors?: string; public render(): TemplateResult | void { @@ -80,10 +83,22 @@ class HassioSupervisorInfo extends LitElement { @change=${this._toggleDiagnostics} > ` - : ""} + : html`
+ You are running an unsupported installation. + Learn More +
`}
${this._errors - ? html`
Error: ${this._errors}
` + ? html`
Error: ${this._errors}
` : ""}
@@ -145,10 +160,6 @@ class HassioSupervisorInfo extends LitElement { .info td:nth-child(2) { text-align: right; } - .errors { - color: var(--error-color); - margin-top: 16px; - } ha-settings-row { padding: 0; } diff --git a/hassio/src/system/hassio-system.ts b/hassio/src/system/hassio-system.ts index 00a304ed03..3a52347a08 100644 --- a/hassio/src/system/hassio-system.ts +++ b/hassio/src/system/hassio-system.ts @@ -56,6 +56,7 @@ class HassioSystem extends LitElement {