* Mon May 12 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme

- Adding SM2 panel [SME: 13004]
- Upgrade to phpsysinfo 3.4.4
- Add code to delete inline styles and add css to make it look better.
- version saved / built uses the static version, which means no drops downs and choices.
This commit is contained in:
2025-05-14 16:14:01 +01:00
parent 80b1da5fa5
commit c8ce77259d
952 changed files with 51341 additions and 28699 deletions

View File

@@ -1,6 +1,6 @@
<?php
/**
* healthd sensor class
* healthd sensor class, getting information from healthd
*
* PHP version 5
*
@@ -8,18 +8,7 @@
* @package PSI_Sensor
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @version SVN: $Id: class.healthd.inc.php 661 2012-08-27 11:26:39Z namiltd $
* @link http://phpsysinfo.sourceforge.net
*/
/**
* getting information from healthd
*
* @category PHP
* @package PSI_Sensor
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version Release: 3.0
* @link http://phpsysinfo.sourceforge.net
*/
@@ -30,28 +19,33 @@ class Healthd extends Sensors
*
* @var array
*/
private $_lines = array();
private $_values = array();
/**
* fill the private content var through tcp or file access
* fill the private content var through command or data access
*/
public function __construct()
{
parent::__construct();
switch (strtolower(PSI_SENSOR_ACCESS)) {
if (PSI_OS == 'FreeBSD') switch (defined('PSI_SENSOR_HEALTHD_ACCESS')?strtolower(PSI_SENSOR_HEALTHD_ACCESS):'command') {
case 'command':
$lines = "";
CommonFunctions::executeProgram('healthdc', '-t', $lines);
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
if (CommonFunctions::executeProgram('healthdc', '-t', $lines)) {
$lines0 = preg_split("/\n/", $lines, 1, PREG_SPLIT_NO_EMPTY);
if (count($lines0) == 1) {
$this->_values = preg_split("/\t+/", $lines0[0]);
}
}
break;
case 'file':
if (CommonFunctions::rfts(APP_ROOT.'/data/healthd.txt', $lines)) {
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
case 'data':
if (!defined('PSI_EMU_PORT') && CommonFunctions::rftsdata('healthd.tmp', $lines)) {
$lines0 = preg_split("/\n/", $lines, 1, PREG_SPLIT_NO_EMPTY);
if (count($lines0) == 1) {
$this->_values = preg_split("/\t+/", $lines0[0]);
}
}
break;
default:
$this->error->addConfigError('__construct()', 'PSI_SENSOR_ACCESS');
break;
$this->error->addConfigError('__construct()', '[sensor_healthd] ACCESS');
}
}
@@ -62,22 +56,23 @@ class Healthd extends Sensors
*/
private function _temperature()
{
$ar_buf = preg_split("/\t+/", $this->_lines);
$dev1 = new SensorDevice();
$dev1->setName('temp1');
$dev1->setValue($ar_buf[1]);
$dev1->setMax(70);
$this->mbinfo->setMbTemp($dev1);
$dev2 = new SensorDevice();
$dev2->setName('temp1');
$dev2->setValue($ar_buf[2]);
$dev2->setMax(70);
$this->mbinfo->setMbTemp($dev2);
$dev3 = new SensorDevice();
$dev3->setName('temp1');
$dev3->setValue($ar_buf[3]);
$dev3->setMax(70);
$this->mbinfo->setMbTemp($dev3);
if (count($this->_values) == 14) {
$dev1 = new SensorDevice();
$dev1->setName('temp1');
$dev1->setValue($this->_values[1]);
// $dev1->setMax(70);
$this->mbinfo->setMbTemp($dev1);
$dev2 = new SensorDevice();
$dev2->setName('temp1');
$dev2->setValue($this->_values[2]);
// $dev2->setMax(70);
$this->mbinfo->setMbTemp($dev2);
$dev3 = new SensorDevice();
$dev3->setName('temp1');
$dev3->setValue($this->_values[3]);
// $dev3->setMax(70);
$this->mbinfo->setMbTemp($dev3);
}
}
/**
@@ -87,60 +82,62 @@ class Healthd extends Sensors
*/
private function _fans()
{
$ar_buf = preg_split("/\t+/", $this->_lines);
$dev1 = new SensorDevice();
$dev1->setName('fan1');
$dev1->setValue($ar_buf[4]);
$dev1->setMin(3000);
$this->mbinfo->setMbFan($dev1);
$dev2 = new SensorDevice();
$dev2->setName('fan2');
$dev2->setValue($ar_buf[5]);
$dev2->setMin(3000);
$this->mbinfo->setMbFan($dev2);
$dev3 = new SensorDevice();
$dev3->setName('fan3');
$dev3->setValue($ar_buf[6]);
$dev3->setMin(3000);
$this->mbinfo->setMbFan($dev3);
if (count($this->_values) == 14) {
$dev1 = new SensorDevice();
$dev1->setName('fan1');
$dev1->setValue($this->_values[4]);
// $dev1->setMin(3000);
$this->mbinfo->setMbFan($dev1);
$dev2 = new SensorDevice();
$dev2->setName('fan2');
$dev2->setValue($this->_values[5]);
// $dev2->setMin(3000);
$this->mbinfo->setMbFan($dev2);
$dev3 = new SensorDevice();
$dev3->setName('fan3');
$dev3->setValue($this->_values[6]);
// $dev3->setMin(3000);
$this->mbinfo->setMbFan($dev3);
}
}
/**
* get voltage information
*
* @return array voltage in array with lable
* @return void
*/
private function _voltage()
{
$ar_buf = preg_split("/\t+/", $this->_lines);
$dev1 = new SensorDevice();
$dev1->setName('Vcore1');
$dev1->setValue($ar_buf[7]);
$this->mbinfo->setMbVolt($dev1);
$dev2 = new SensorDevice();
$dev2->setName('Vcore2');
$dev2->setValue($ar_buf[8]);
$this->mbinfo->setMbVolt($dev2);
$dev3 = new SensorDevice();
$dev3->setName('3volt');
$dev3->setValue($ar_buf[9]);
$this->mbinfo->setMbVolt($dev3);
$dev4 = new SensorDevice();
$dev4->setName('+5Volt');
$dev4->setValue($ar_buf[10]);
$this->mbinfo->setMbVolt($dev4);
$dev5 = new SensorDevice();
$dev5->setName('+12Volt');
$dev5->setValue($ar_buf[11]);
$this->mbinfo->setMbVolt($dev5);
$dev6 = new SensorDevice();
$dev6->setName('-12Volt');
$dev6->setValue($ar_buf[12]);
$this->mbinfo->setMbVolt($dev6);
$dev7 = new SensorDevice();
$dev7->setName('-5Volt');
$dev7->setValue($ar_buf[13]);
$this->mbinfo->setMbVolt($dev7);
if (count($this->_values) == 14) {
$dev1 = new SensorDevice();
$dev1->setName('Vcore1');
$dev1->setValue($this->_values[7]);
$this->mbinfo->setMbVolt($dev1);
$dev2 = new SensorDevice();
$dev2->setName('Vcore2');
$dev2->setValue($this->_values[8]);
$this->mbinfo->setMbVolt($dev2);
$dev3 = new SensorDevice();
$dev3->setName('3volt');
$dev3->setValue($this->_values[9]);
$this->mbinfo->setMbVolt($dev3);
$dev4 = new SensorDevice();
$dev4->setName('+5Volt');
$dev4->setValue($this->_values[10]);
$this->mbinfo->setMbVolt($dev4);
$dev5 = new SensorDevice();
$dev5->setName('+12Volt');
$dev5->setValue($this->_values[11]);
$this->mbinfo->setMbVolt($dev5);
$dev6 = new SensorDevice();
$dev6->setName('-12Volt');
$dev6->setValue($this->_values[12]);
$this->mbinfo->setMbVolt($dev6);
$dev7 = new SensorDevice();
$dev7->setName('-5Volt');
$dev7->setValue($this->_values[13]);
$this->mbinfo->setMbVolt($dev7);
}
}
/**
@@ -148,7 +145,7 @@ class Healthd extends Sensors
*
* @see PSI_Interface_Sensor::build()
*
* @return Void
* @return void
*/
public function build()
{