pull/18/head
icret 2022-01-18 13:17:26 +08:00
parent b9a84fe182
commit 1fd6e88fea
2 changed files with 12 additions and 12 deletions

View File

@ -16,12 +16,12 @@ if (isset($_POST['del_total'])) {
@deldir($_POST['del_total']); @deldir($_POST['del_total']);
echo ' echo '
<script> <script>
new $.zui.Messager("重新统计成功", {type: "success" // 定义颜色主题 new $.zui.Messager("重新统计成功!", {type: "success" // 定义颜色主题
}).show(); }).show();
</script> </script>
'; ';
// 延时1s刷新 // 延时1s刷新
Header("refresh:1;url=counts.php"); Header("refresh:1;url=chart.php");
} }
// 统计图表 // 统计图表
// array_reverse($arr,true) 倒叙数组并保持键值关系 // array_reverse($arr,true) 倒叙数组并保持键值关系
@ -64,8 +64,8 @@ if (is_array($char_data)) {
<div class="row"> <div class="row">
<div class="clo-md-12"> <div class="clo-md-12">
<div class="alert alert-warning"> <div class="alert alert-warning">
<form action="counts.php" method="post"> <form action="chart.php" method="post">
<span>统计时间<?php echo $char_data['total_time']; ?></span> <span>统计时间:<?php echo $char_data['total_time']; ?></span>
<input type="hidden" name="del_total" value="<?php echo APP_ROOT . '/admin/logs/counts/'; ?>"> <input type="hidden" name="del_total" value="<?php echo APP_ROOT . '/admin/logs/counts/'; ?>">
<button class="btn btn-mini btn-primary"><i class="icon icon-spin icon-refresh"></i>重新统计</button> <button class="btn btn-mini btn-primary"><i class="icon icon-spin icon-refresh"></i>重新统计</button>
</form> </form>
@ -146,7 +146,7 @@ if (is_array($char_data)) {
formatter: '{value}%' formatter: '{value}%'
}, },
data: [{ data: [{
value: <?php echo ceil((disk_total_space('.') - disk_free_space('.')) / disk_total_space('.') * 100); ?>, value: <?php echo round((disk_total_space('.') - disk_free_space('.')) / disk_total_space('.') * 100,2); ?>,
name: '已使用' name: '已使用'
}] }]
}] }]
@ -240,7 +240,7 @@ if (is_array($char_data)) {
myPieChart = { myPieChart = {
color: ['#38B03F', '#353535'], color: ['#38B03F', '#353535'],
title: { title: {
// text: '硬盘使用统计GB', // text: '硬盘使用统计:GB',
left: 'center' left: 'center'
}, },
tooltip: { tooltip: {
@ -253,7 +253,7 @@ if (is_array($char_data)) {
data: ['剩余空间', '已用空间'] data: ['剩余空间', '已用空间']
}, },
series: [{ series: [{
name: '硬盘使用', name: '硬盘使用:',
type: 'pie', type: 'pie',
radius: '55%', radius: '55%',
center: ['50%', '60%'], center: ['50%', '60%'],

View File

@ -16,12 +16,12 @@ if (isset($_POST['del_total'])) {
@deldir($_POST['del_total']); @deldir($_POST['del_total']);
echo ' echo '
<script> <script>
new $.zui.Messager("重新统计成功", {type: "success" // 定义颜色主题 new $.zui.Messager("重新统计成功!", {type: "success" // 定义颜色主题
}).show(); }).show();
</script> </script>
'; ';
// 延时1s刷新 // 延时1s刷新
Header("refresh:1;url=counts.php"); Header("refresh:1;url=chart.php");
} }
// 统计图表 // 统计图表
// array_reverse($arr,true) 倒叙数组并保持键值关系 // array_reverse($arr,true) 倒叙数组并保持键值关系
@ -58,8 +58,8 @@ if (is_array($char_data)) {
<div class="row"> <div class="row">
<div class="clo-md-12 col-xs-12"> <div class="clo-md-12 col-xs-12">
<div class="alert alert-warning"> <div class="alert alert-warning">
<form action="counts.php" method="post"> <form action="chart.php" method="post">
<span>统计时间<?php echo $char_data['total_time']; ?></span> <span>统计时间:<?php echo $char_data['total_time']; ?></span>
<input type="hidden" name="del_total" value="<?php echo APP_ROOT . '/admin/logs/counts/'; ?>"> <input type="hidden" name="del_total" value="<?php echo APP_ROOT . '/admin/logs/counts/'; ?>">
<button class="btn btn-mini btn-primary"><i class="icon icon-spin icon-refresh"></i>重新统计</button> <button class="btn btn-mini btn-primary"><i class="icon icon-spin icon-refresh"></i>重新统计</button>
</form> </form>
@ -114,7 +114,7 @@ if (is_array($char_data)) {
<canvas id="myBarChart" width="960" height="400"></canvas> <canvas id="myBarChart" width="960" height="400"></canvas>
</div> </div>
<div class="col-md-6 col-xs-12"> <div class="col-md-6 col-xs-12">
<h4 class=" col-md-offset-2">硬盘统计GB</h4> <h4 class=" col-md-offset-2">硬盘统计:GB</h4>
<canvas id="diskPieChart" width="960" height="400"></canvas> <canvas id="diskPieChart" width="960" height="400"></canvas>
</div> </div>
</div> </div>