* 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:
@@ -8,7 +8,7 @@
|
||||
* @package PSI DragonFly OS class
|
||||
* @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 SVN: $Id: class.DragonFly.inc.php 287 2009-06-26 12:11:59Z bigmichi1 $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
@@ -20,7 +20,7 @@
|
||||
* @package PSI DragonFly OS class
|
||||
* @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
|
||||
*/
|
||||
@@ -29,33 +29,20 @@ class DragonFly extends BSDCommon
|
||||
/**
|
||||
* define the regexp for log parser
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($blockname = false)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->setCPURegExp1("^cpu(.*)\, (.*) MHz");
|
||||
$this->setCPURegExp2("^(.*) at scsibus.*: <(.*)> .*");
|
||||
$this->setSCSIRegExp2("^(da[0-9]): (.*)MB ");
|
||||
$this->setPCIRegExp1("/(.*): <(.*)>(.*) (pci|legacypci)[0-9]$/");
|
||||
parent::__construct($blockname);
|
||||
$this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/\n/^CPU: (.*) \((.*)-MHz (.*)\)/"); // multiple regexp separated by \n
|
||||
$this->setCPURegExp2("/^(.*) at scsibus.*: <(.*)> .*/");
|
||||
$this->setSCSIRegExp2("/^(da[0-9]+): (.*)MB /");
|
||||
$this->setPCIRegExp1("/(.*): <(.*)>(.*) (pci|legacypci)[0-9]+$/");
|
||||
$this->setPCIRegExp2("/(.*): <(.*)>.* at [0-9\.]+$/");
|
||||
}
|
||||
|
||||
/**
|
||||
* UpTime
|
||||
* time the system is running
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _uptime()
|
||||
{
|
||||
$a = $this->grab_key('kern.boottime');
|
||||
preg_match("/sec = ([0-9]+)/", $a, $buf);
|
||||
$this->sys->setUptime(time() - $buf[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* get network information
|
||||
*
|
||||
* @return array
|
||||
* @return void
|
||||
*/
|
||||
private function _network()
|
||||
{
|
||||
@@ -66,7 +53,7 @@ class DragonFly extends BSDCommon
|
||||
for ($i = 0, $max = sizeof($lines_b); $i < $max; $i++) {
|
||||
$ar_buf_b = preg_split("/\s+/", $lines_b[$i]);
|
||||
$ar_buf_n = preg_split("/\s+/", $lines_n[$i]);
|
||||
if (! empty($ar_buf_b[0]) && ! empty($ar_buf_n[3])) {
|
||||
if (!empty($ar_buf_b[0]) && (!empty($ar_buf_n[5]) || ($ar_buf_n[5] === "0"))) {
|
||||
$dev = new NetDevice();
|
||||
$dev->setName($ar_buf_b[0]);
|
||||
$dev->setTxBytes($ar_buf_b[8]);
|
||||
@@ -81,16 +68,16 @@ class DragonFly extends BSDCommon
|
||||
/**
|
||||
* get the ide information
|
||||
*
|
||||
* @return array
|
||||
* @return void
|
||||
*/
|
||||
protected function ide()
|
||||
{
|
||||
foreach ($this->readdmesg() as $line) {
|
||||
if (preg_match('/^(.*): (.*) <(.*)> at (ata[0-9]\-(.*)) (.*)/', $line, $ar_buf)) {
|
||||
if (preg_match('/^(.*): (.*) <(.*)> at (ata[0-9]+\-(.*)) (.*)/', $line, $ar_buf)) {
|
||||
$dev = new HWDevice();
|
||||
$dev->setName($ar_buf[1]);
|
||||
if (!preg_match("/^acd[0-9](.*)/", $ar_buf[1])) {
|
||||
$dev->setCapacity($ar_buf[2] * 1024);
|
||||
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && !preg_match("/^acd[0-9]+(.*)/", $ar_buf[1])) {
|
||||
$dev->setCapacity($ar_buf[2] * 1024 * 1024);
|
||||
}
|
||||
$this->sys->setIdeDevices($dev);
|
||||
}
|
||||
@@ -140,14 +127,17 @@ class DragonFly extends BSDCommon
|
||||
*
|
||||
* @see BSDCommon::build()
|
||||
*
|
||||
* @return Void
|
||||
* @return void
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
parent::build();
|
||||
$this->_distroicon();
|
||||
$this->_network();
|
||||
$this->_uptime();
|
||||
$this->_processes();
|
||||
if (!$this->blockname || $this->blockname==='vitals') {
|
||||
$this->_distroicon();
|
||||
$this->_processes();
|
||||
}
|
||||
if (!$this->blockname || $this->blockname==='network') {
|
||||
$this->_network();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user