Skip to content

Commit

Permalink
fix(systemLoads): fix temp output when no temp sensor was found in kl…
Browse files Browse the repository at this point in the history
…ipper (#1907)

Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Jun 14, 2024
1 parent f6fba3f commit 39e1057
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/panels/Machine/SystemPanelHost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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,
Expand All @@ -74,6 +75,7 @@
</v-tooltip>
</template>
<span v-else>
,
{{
$t('Machine.SystemPanel.Values.Temp', {
temp: hostStats.tempSensor.temperature,
Expand Down
2 changes: 1 addition & 1 deletion src/store/server/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 39e1057

Please sign in to comment.