Merge remote-tracking branch 'gt/main'
This commit is contained in:
commit
f967fc09b6
@ -159,7 +159,7 @@ class SystemInfoHelper
|
||||
$this->ram = FileSizeHelper::formatBytes($computer->TotalPhysicalMemory);
|
||||
}
|
||||
} else {
|
||||
$this->ram = FileSizeHelper::formatBytes(intval(shell_exec("grep MemTotal /proc/meminfo | awk '{print $2}'")));
|
||||
$this->ram = FileSizeHelper::formatBytes(intval(shell_exec("grep MemTotal /proc/meminfo | awk '{print $2}'"))*1024);
|
||||
}
|
||||
if ($this->EnableTimeRecords) {
|
||||
$this->timeRecords['detectRam'] = microtime(true) - $start;
|
||||
@ -239,7 +239,7 @@ class SystemInfoHelper
|
||||
if ($this->EnableTimeRecords) {
|
||||
$start = microtime(true);
|
||||
}
|
||||
$this->load = sys_getloadavg()[0];
|
||||
$this->load = round(sys_getloadavg()[0],2);
|
||||
if ($this->EnableTimeRecords) {
|
||||
$this->timeRecords['detectLoad'] = microtime(true) - $start;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
/* @var $this yii\web\View */
|
||||
|
||||
/* @var $systemInfo SystemInfoHelper */
|
||||
@ -57,7 +57,7 @@ $this->title = '系统信息';
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<?php if ($systemInfo->osType === 2): ?>
|
||||
<?php if ($systemInfo->osType === 1): ?>
|
||||
<div class="col-xxl-6">
|
||||
<h2>
|
||||
<i class="fa-solid fa-bars-progress"></i>
|
||||
@ -323,8 +323,8 @@ if(needLoadGraph !== null){
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 100
|
||||
min: 0
|
||||
// max: 100
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@ -333,7 +333,7 @@ if(needLoadGraph !== null){
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
formatter: '{c}%'
|
||||
formatter: '{c}'
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
|
@ -1,5 +1,5 @@
|
||||
//dynamic fetch of system information & display
|
||||
//every 5 seconds ajax request to fetch system information
|
||||
//every * seconds ajax request to fetch system information
|
||||
//backport: admin/get-sysinfo
|
||||
//return json object with system information
|
||||
|
||||
@ -8,7 +8,7 @@ var sysinfo = {
|
||||
setInterval(sysinfo.fetch, 2000);
|
||||
// WARNING
|
||||
// For Windows users, the interval should be equal or greater than 1500ms, because the system information gathering process is slow. (Please dynamically adjust the interval based on system performance.)
|
||||
// For Linux users, the interval can be set to below 1000ms.
|
||||
// For Linux users, the interval can be set to 500ms (Recommend: 1000ms)
|
||||
},
|
||||
fetch: function () {
|
||||
$.ajax({
|
||||
|
Loading…
Reference in New Issue
Block a user