mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
only show cpu and mem when available (#13589)
This commit is contained in:
@@ -284,14 +284,16 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
||||
</ha-card>
|
||||
`
|
||||
: ""}
|
||||
|
||||
<ha-card outlined>
|
||||
${this._systemStatusData
|
||||
? html` <ha-card outlined>
|
||||
<div class="header">
|
||||
<div class="title">
|
||||
${this.hass.localize("ui.panel.config.hardware.processor")}
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.hardware.processor"
|
||||
)}
|
||||
</div>
|
||||
<div class="value">
|
||||
${this._systemStatusData?.cpu_percent || "-"}%
|
||||
${this._systemStatusData.cpu_percent || "-"}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
@@ -314,8 +316,6 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
||||
${this.hass.localize("ui.panel.config.hardware.memory")}
|
||||
</div>
|
||||
<div class="value">
|
||||
${this._systemStatusData
|
||||
? html`
|
||||
${round(this._systemStatusData.memory_used_mb / 1024, 1)}
|
||||
GB /
|
||||
${round(
|
||||
@@ -325,8 +325,6 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
||||
0
|
||||
)}
|
||||
GB
|
||||
`
|
||||
: "- GB / - GB"}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
@@ -342,7 +340,8 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
||||
.options=${this._chartOptions}
|
||||
></ha-chart-base>
|
||||
</div>
|
||||
</ha-card>
|
||||
</ha-card>`
|
||||
: ""}
|
||||
</div>
|
||||
</hass-subpage>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user