ÿØÿà JFIF ` ` ÿþ
|
Server : Apache System : Linux cloud.heroica.com.br 4.18.0-553.36.1.el8_10.x86_64 #1 SMP Wed Jan 22 03:07:54 EST 2025 x86_64 User : farolpborg ( 1053) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /lib/python3.6/site-packages/glances/outputs/static/js/components/ |
Upload File : |
<template>
<section class="plugin" id="sensors">
<div class="table-row" v-if="sensors.length > 0">
<div class="table-cell text-left title">SENSORS</div>
</div>
<div class="table-row" v-for="(sensor, sensorId) in sensors" :key="sensorId">
<div class="table-cell text-left">{{ sensor.label }}</div>
<div class="table-cell">{{ sensor.unit }}</div>
<div class="table-cell" :class="getAlert(sensor)">
{{ sensor.value }}
</div>
</div>
</section>
</template>
<script>
import { GlancesHelper } from '../services.js';
import { store } from '../store.js';
export default {
props: {
data: {
type: Object
}
},
data() {
return {
store
};
},
computed: {
args() {
return this.store.args || {};
},
stats() {
return this.data.stats['sensors'];
},
sensors() {
return this.stats
.filter((sensor) => {
// prettier-ignore
const isEmpty = (Array.isArray(sensor.value) && sensor.value.length === 0) || sensor.value === 0;
return !isEmpty;
})
.map((sensor) => {
if (
this.args.fahrenheit &&
sensor.type != 'battery' &&
sensor.type != 'fan_speed'
) {
// prettier-ignore
sensor.value = parseFloat(sensor.value * 1.8 + 32).toFixed(1);
sensor.unit = 'F';
}
return sensor;
});
}
},
methods: {
getAlert(sensor) {
const current = sensor.type == 'battery' ? 100 - sensor.value : sensor.value;
return GlancesHelper.getAlert('sensors', 'sensors_' + sensor.type + '_', current);
}
}
};
</script>