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); $this->ram = FileSizeHelper::formatBytes($computer->TotalPhysicalMemory);
} }
} else { } 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) { if ($this->EnableTimeRecords) {
$this->timeRecords['detectRam'] = microtime(true) - $start; $this->timeRecords['detectRam'] = microtime(true) - $start;
@ -239,7 +239,7 @@ class SystemInfoHelper
if ($this->EnableTimeRecords) { if ($this->EnableTimeRecords) {
$start = microtime(true); $start = microtime(true);
} }
$this->load = sys_getloadavg()[0]; $this->load = round(sys_getloadavg()[0],2);
if ($this->EnableTimeRecords) { if ($this->EnableTimeRecords) {
$this->timeRecords['detectLoad'] = microtime(true) - $start; $this->timeRecords['detectLoad'] = microtime(true) - $start;
} }

View File

@ -57,7 +57,7 @@ $this->title = '系统信息';
</div> </div>
<hr> <hr>
<div class="row"> <div class="row">
<?php if ($systemInfo->osType === 2): ?> <?php if ($systemInfo->osType === 1): ?>
<div class="col-xxl-6"> <div class="col-xxl-6">
<h2> <h2>
<i class="fa-solid fa-bars-progress"></i> <i class="fa-solid fa-bars-progress"></i>
@ -323,8 +323,8 @@ if(needLoadGraph !== null){
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
min: 0, min: 0
max: 100 // max: 100
}, },
series: [ series: [
{ {
@ -333,7 +333,7 @@ if(needLoadGraph !== null){
label: { label: {
show: true, show: true,
position: 'top', position: 'top',
formatter: '{c}%' formatter: '{c}'
}, },
emphasis: { emphasis: {
label: { label: {

View File

@ -1,5 +1,5 @@
//dynamic fetch of system information & display //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 //backport: admin/get-sysinfo
//return json object with system information //return json object with system information
@ -8,7 +8,7 @@ var sysinfo = {
setInterval(sysinfo.fetch, 2000); setInterval(sysinfo.fetch, 2000);
// WARNING // 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 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 () { fetch: function () {
$.ajax({ $.ajax({