Limit changing network to systems that have that support (#6711)

This commit is contained in:
Joakim Sørensen 2020-08-26 17:41:02 +02:00 committed by GitHub
parent 2403743701
commit 90f12eea5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,9 @@ class HassioHostInfo extends LitElement {
@internalProperty() public _networkInfo?: NetworkInfo; @internalProperty() public _networkInfo?: NetworkInfo;
public render(): TemplateResult | void { public render(): TemplateResult | void {
const primaryIpAddress = this._primaryIpAddress(this._networkInfo!); const primaryIpAddress = this.hostInfo.features.includes("network")
? this._primaryIpAddress(this._networkInfo!)
: "";
return html` return html`
<ha-card header="Host System"> <ha-card header="Host System">
<div class="card-content"> <div class="card-content">
@ -79,20 +81,23 @@ class HassioHostInfo extends LitElement {
</mwc-button> </mwc-button>
</ha-settings-row>` </ha-settings-row>`
: ""} : ""}
<ha-settings-row> ${this.hostInfo.features.includes("network")
<span slot="heading"> ? html` <ha-settings-row>
IP address <span slot="heading">
</span> IP address
<span slot="description"> </span>
${primaryIpAddress} <span slot="description">
</span> ${primaryIpAddress}
<mwc-button </span>
title="Change the network" <mwc-button
label="Change" title="Change the network"
@click=${this._changeNetworkClicked} label="Change"
> @click=${this._changeNetworkClicked}
</mwc-button> >
</ha-settings-row> </mwc-button>
</ha-settings-row>`
: ""}
<ha-settings-row> <ha-settings-row>
<span slot="heading"> <span slot="heading">
Operating system Operating system