fix(systemLoads): fix temp output when no temp sensor was found in klipper (#1907)

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej
2024-06-14 23:22:34 +02:00
committed by GitHub
parent f6fba3f21b
commit 39e10579b1
2 changed files with 4 additions and 2 deletions

View File

@@ -39,7 +39,7 @@
{{ $t('Machine.SystemPanel.Values.Load', { load: hostStats.load }) }},
</span>
<span v-if="hostStats.memoryFormat" class="d-inline-block text-no-wrap">
{{ $t('Machine.SystemPanel.Values.Memory', { memory: hostStats.memoryFormat }) }},
{{ $t('Machine.SystemPanel.Values.Memory', { memory: hostStats.memoryFormat }) }}
</span>
<span class="text-no-wrap">
<template v-if="hostStats.tempSensor">
@@ -51,6 +51,7 @@
<v-tooltip top>
<template #activator="{ on, attrs }">
<span v-bind="attrs" v-on="on">
,
{{
$t('Machine.SystemPanel.Values.Temp', {
temp: hostStats.tempSensor.temperature,
@@ -74,6 +75,7 @@
</v-tooltip>
</template>
<span v-else>
,
{{
$t('Machine.SystemPanel.Values.Temp', {
temp: hostStats.tempSensor.temperature,

View File

@@ -112,7 +112,7 @@ export const getters: GetterTree<ServerState, any> = {
else if (memUsage && memUsage > 80) memUsageColor = 'warning'
let tempSensor = rootGetters['printer/getHostTempSensor']
if (tempSensor === null) {
if (tempSensor === null && state.cpu_temp !== null) {
tempSensor = {
temperature: state.cpu_temp?.toFixed(0),
measured_min_temp: null,