修复系统信息页面的夜间模式显示问题

This commit is contained in:
Chenx221 2024-04-16 14:37:11 +08:00
parent 9d890f6b02
commit 4811b708b0
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021
2 changed files with 14 additions and 6 deletions

View File

@ -259,9 +259,20 @@ $this->title = '系统信息';
$dataTime = substr($systemInfo->serverTime, 11, 8);
$mp_free = round(100 - $systemInfo->mp_usage, 2);
$script = <<< JS
var myChart = echarts.init(document.getElementById('cpu-graph'));
var myChart2 = echarts.init(document.getElementById('memory-graph'));
var myChart3 = echarts.init(document.getElementById('disk-chart'));
var myChart;
var myChart2;
var myChart3;
// detect dark mode
if ((window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches)|| document.documentElement.getAttribute('data-bs-theme')==='dark') {
myChart = echarts.init(document.getElementById('cpu-graph'),'dark');
myChart2 = echarts.init(document.getElementById('memory-graph'),'dark');
myChart3 = echarts.init(document.getElementById('disk-chart'),'dark');
}else {
myChart = echarts.init(document.getElementById('cpu-graph'));
myChart2 = echarts.init(document.getElementById('memory-graph'));
myChart3 = echarts.init(document.getElementById('disk-chart'));
}
// check load-graph is exist
var needLoadGraph = document.getElementById('load-graph');
// var

View File

@ -10,9 +10,6 @@
border-radius:10px;
padding: 16px;
}
.system-info .group-content span{
color: #6b6b6b;
}
#load-graph,#cpu-graph,#memory-graph{
padding-top: 35px;