Closed Stamgastje closed 6 years ago
If the network usage was sortable, I could not implement the info tree. Temperatures and other sensors are often grouped and sorting can mixed them up.
And what about a fixed sorting (like in my hack above), to be enabled via a new parameter in phpsysinfo.ini?
Done https://github.com/phpsysinfo/phpsysinfo/commit/8367db64204ef17073bc4eab2ab058fcc62950a6. New options SORT_NETWORK_INTERFACES_LIST and SORT_SENSORS_LIST added. Check out the version from Github tree: https://codeload.github.com/phpsysinfo/phpsysinfo/zip/master.
Appreciated, thanks!
After the fix: https://github.com/phpsysinfo/phpsysinfo/commit/b6c73a44b2fcf5ea94eb5beff63db87b2a4fe3fb, the names are sorted naturally.
Is that commit really correct...?
Seems like a copy-paste error as all modified lines sort $this->_netDevices (instead of $this->_mbFan / $this->_mbTemp / $this->_mbVolt / $this->_mbPower / $this->_mbCurrent / $this->_mbOther).
Corrected: https://github.com/phpsysinfo/phpsysinfo/commit/23ec17eafe73afce6b84846f7a5fec1267829513. Thank You for the info.
Would it be possible to make the 'NETWORK USAGE' and 'TEMPERATURE' lists sortable? Currently, the lists are in a somewhat random order (e.g.: eth1 - lo - eth2 - eth0).
As a quick hack, I sorted the two arrays:
--- class.System.inc.php.orig 2018-02-25 17:14:00.191164441 +0100
+++ class.System.inc.php 2018-02-25 17:56:09.030072368 +0100
@@ -744,6 +744,7 @@
*/
public function getNetDevices()
{
+ asort($this->_netDevices);
return $this->_netDevices;
}
--- class.MBInfo.inc.php.orig 2018-02-12 20:18:15.000000000 +0100
+++ class.MBInfo.inc.php 2018-02-25 17:46:39.476520810 +0100
@@ -114,6 +114,7 @@
*/
public function getMbTemp()
{
+ asort($this->_mbTemp);
return $this->_mbTemp;
}
Better would be if the lists are sortable like some of the other lists (e.g. 'MOUNTED FILESYSTEMS').