Merge remote-tracking branch 'gt/main'

This commit is contained in:
Chenx221 2024-04-16 16:47:14 +08:00
commit f967fc09b6
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021
3 changed files with 9 additions and 9 deletions

View File

@ -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;
}

View File

@ -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: {

View File

@ -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({