mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
only show cpu and mem when available (#13589)
This commit is contained in:
parent
310df387e7
commit
02d608b704
@ -284,38 +284,38 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
|||||||
</ha-card>
|
</ha-card>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
|
${this._systemStatusData
|
||||||
<ha-card outlined>
|
? html` <ha-card outlined>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
${this.hass.localize("ui.panel.config.hardware.processor")}
|
${this.hass.localize(
|
||||||
</div>
|
"ui.panel.config.hardware.processor"
|
||||||
<div class="value">
|
)}
|
||||||
${this._systemStatusData?.cpu_percent || "-"}%
|
</div>
|
||||||
</div>
|
<div class="value">
|
||||||
</div>
|
${this._systemStatusData.cpu_percent || "-"}%
|
||||||
<div class="card-content">
|
</div>
|
||||||
<ha-chart-base
|
</div>
|
||||||
.data=${{
|
<div class="card-content">
|
||||||
datasets: [
|
<ha-chart-base
|
||||||
{
|
.data=${{
|
||||||
...DATA_SET_CONFIG,
|
datasets: [
|
||||||
data: this._cpuEntries,
|
{
|
||||||
},
|
...DATA_SET_CONFIG,
|
||||||
],
|
data: this._cpuEntries,
|
||||||
}}
|
},
|
||||||
.options=${this._chartOptions}
|
],
|
||||||
></ha-chart-base>
|
}}
|
||||||
</div>
|
.options=${this._chartOptions}
|
||||||
</ha-card>
|
></ha-chart-base>
|
||||||
<ha-card outlined>
|
</div>
|
||||||
<div class="header">
|
</ha-card>
|
||||||
<div class="title">
|
<ha-card outlined>
|
||||||
${this.hass.localize("ui.panel.config.hardware.memory")}
|
<div class="header">
|
||||||
</div>
|
<div class="title">
|
||||||
<div class="value">
|
${this.hass.localize("ui.panel.config.hardware.memory")}
|
||||||
${this._systemStatusData
|
</div>
|
||||||
? html`
|
<div class="value">
|
||||||
${round(this._systemStatusData.memory_used_mb / 1024, 1)}
|
${round(this._systemStatusData.memory_used_mb / 1024, 1)}
|
||||||
GB /
|
GB /
|
||||||
${round(
|
${round(
|
||||||
@ -325,24 +325,23 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
|||||||
0
|
0
|
||||||
)}
|
)}
|
||||||
GB
|
GB
|
||||||
`
|
</div>
|
||||||
: "- GB / - GB"}
|
</div>
|
||||||
</div>
|
<div class="card-content">
|
||||||
</div>
|
<ha-chart-base
|
||||||
<div class="card-content">
|
.data=${{
|
||||||
<ha-chart-base
|
datasets: [
|
||||||
.data=${{
|
{
|
||||||
datasets: [
|
...DATA_SET_CONFIG,
|
||||||
{
|
data: this._memoryEntries,
|
||||||
...DATA_SET_CONFIG,
|
},
|
||||||
data: this._memoryEntries,
|
],
|
||||||
},
|
}}
|
||||||
],
|
.options=${this._chartOptions}
|
||||||
}}
|
></ha-chart-base>
|
||||||
.options=${this._chartOptions}
|
</div>
|
||||||
></ha-chart-base>
|
</ha-card>`
|
||||||
</div>
|
: ""}
|
||||||
</ha-card>
|
|
||||||
</div>
|
</div>
|
||||||
</hass-subpage>
|
</hass-subpage>
|
||||||
`;
|
`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user