|
自己重新装了it87.c驱动,目前风扇速度,主板温度都可以显示了,但是pve web界面读取主板温度位置不对,请问这个应该怎么改?
这个是
sensors -j 目前js是读的acpitz-acpi-0这里温度
- "acpitz-acpi-0":{
- "Adapter": "ACPI interface",
- "temp1":{
- "temp1_input": 16.800,
- "temp1_crit": 20.800
- },
- "temp2":{
- "temp2_input": 27.800,
- "temp2_crit": 105.000
- }
- },
复制代码 我想想js读gigabyte_wmi-virtual-0这里的温度
- "gigabyte_wmi-virtual-0":{
- "Adapter": "Virtual device",
- "temp1":{
- "temp1_input": 41.000
- },
- "temp2":{
- "temp2_input": 42.000
- },
- "temp3":{
- "temp3_input": 36.000
- },
- "temp5":{
- "temp5_input": 39.000
- }
复制代码 请问一下JS代码应该怎么修改,自己尝试了几次,都修改不成功
这个是js代码
- let acpitzs = value.matchAll(/^acpitz-acpi-(\d*)$\n.*?\n((?:temp)[\s\S]*?^\n)+/gm);
- for (const acpitz of acpitzs) {
- let acpitzNumber = parseInt(acpitz[1], 10);
- data[acpitzNumber] = {
- acpisensors: []
- };
- let acpisensors = acpitz[2].matchAll(/^temp\d+:\s*\+([^°C ]+).*$/gm);
- for (const acpisensor of acpisensors) {
- data[acpitzNumber]['acpisensors'].push(acpisensor[1]);
- }
- for (const [k, acpitz] of data.entries()) {
- if (acpitz.acpisensors.length > 0) {
- output += '主板: ';
- for (const acpiTemp of acpitz.acpisensors) {
- output += `${acpiTemp}°C, `;
- }
- output = output.slice(0, -2);
- output += ' | ';
- } else {
- output = output.slice(0, -2)
复制代码
|
|