项目初始化

This commit is contained in:
2026-03-26 18:13:38 +08:00
parent 2d131c9d70
commit 4d7b887136
2 changed files with 23 additions and 5 deletions

View File

@@ -21,8 +21,7 @@ public class SysAnalysisController {
public List<ChartInfo> getHostInfo() {
List<ChartInfo> chartInfoList = new ArrayList<>();
CpuInfo cpuInfo = OshiUtil.getCpuInfo();
long uptimeMs = OshiUtil.getOs().getSystemUptime();
String runTime = DateUtil.formatBetween(uptimeMs);
String runTime = DateUtil.formatBetween(OshiUtil.getOs().getSystemUptime() * 1000);
// 系统使用率(红色)
chartInfoList.add(new ChartInfo("sys", "系统使用率", cpuInfo.getSys(), KeyUtil.getColor(), runTime));
// 用户使用率(蓝色)
@@ -34,7 +33,7 @@ public class SysAnalysisController {
// CPU总使用率粉色
chartInfoList.add(new ChartInfo("used", "CPU总使用率", cpuInfo.getUsed(), KeyUtil.getColor(), runTime));
// 系统运行时间(紫色)
chartInfoList.add(new ChartInfo("time", "系统运行时", 0, KeyUtil.getColor(), runTime));
chartInfoList.add(new ChartInfo("time", "服务器运行时", 0, KeyUtil.getColor(), runTime));
return chartInfoList;
}
}

View File

@@ -7,9 +7,19 @@
<el-icon class="card-title__tips"><QuestionFilled /></el-icon>
</el-tooltip>
</div>
<el-tooltip content="刷新" placement="top" :show-after="200">
<el-button
class="card-title__refresh"
link
type="primary"
:icon="RefreshRight"
:loading="loading"
@click="getList"
/>
</el-tooltip>
</div>
<div class="card-content">
<div v-loading="loading" class="host-overview">
<div class="host-overview">
<div class="host-gauge-panel">
<div ref="chartRef" class="gauge-chart"></div>
</div>
@@ -28,7 +38,7 @@
<script setup lang="ts">
import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue';
import * as echarts from 'echarts';
import { QuestionFilled } from '@element-plus/icons-vue';
import { QuestionFilled, RefreshRight } from '@element-plus/icons-vue';
import { ChartInfo, HostInfoData } from '@jeesite/biz/api/biz/myAnalysis';
const hostCardRef = ref<HTMLElement>();
@@ -302,6 +312,11 @@
&__tips:hover {
color: rgb(59 130 246);
}
&__refresh {
padding: 0;
font-size: 16px;
}
}
.card-content {
@@ -405,6 +420,10 @@
&__tips:hover {
color: rgb(147 197 253);
}
&__refresh:deep(.el-icon) {
color: rgb(147 197 253);
}
}
.host-gauge-panel,