mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
system: fix display of multiple sources in thermal sensor widget
PR: https://www.reddit.com/r/opnsense/comments/1eb1mhj/comment/lg3ru1o/
This commit is contained in:
parent
6f10caef26
commit
af74aa42ab
@ -218,14 +218,18 @@ export default class ThermalSensors extends BaseWidget {
|
||||
const uniqueTemperatures = new Set(coreTemperatures);
|
||||
|
||||
let result = [];
|
||||
|
||||
if (uniqueTemperatures.size === 1) {
|
||||
// If all temperatures are the same, include only the first core
|
||||
result.push(data.find(item => item.type === 'core'));
|
||||
} else {
|
||||
// Include all cores with differing temperatures
|
||||
result = data.filter(item => item.type !== 'core' || coreTemperatures.filter(temp => temp !== parseFloat(item.temperature)).length > 0);
|
||||
result.push(...data.filter(item => item.type === 'core'));
|
||||
}
|
||||
|
||||
// Push all other sensors found in the system
|
||||
result.push(...data.filter(item => item.type !== 'core'));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user