This commit is contained in:
qiangyanwen 2022-11-27 13:39:08 +08:00
parent a352073f39
commit 5f5a98f11d
1 changed files with 100 additions and 90 deletions

View File

@ -31,6 +31,7 @@
<script setup> <script setup>
import {onMounted, reactive, ref} from "vue"; import {onMounted, reactive, ref} from "vue";
import {Cpu, SysInfo, disk} from "@/api/monitor" import {Cpu, SysInfo, disk} from "@/api/monitor"
let sysparams = reactive({ let sysparams = reactive({
count: 0, count: 0,
name: "", name: "",
@ -108,6 +109,7 @@ onMounted(()=>{
QueryCpu(); QueryCpu();
}, 5000) }, 5000)
}) })
function QuerySys() { function QuerySys() {
SysInfo().then((response) => { SysInfo().then((response) => {
if (response.code === 200) { if (response.code === 200) {
@ -120,6 +122,7 @@ function QuerySys() {
} }
}) })
} }
const QueryCpu = () => { const QueryCpu = () => {
Cpu().then((rep) => { Cpu().then((rep) => {
let {cpu_percent} = rep.data let {cpu_percent} = rep.data
@ -161,6 +164,7 @@ const QueryDisk = ()=>{
height: 300px; height: 300px;
width: 300px; width: 300px;
} }
.echarts { .echarts {
width: 270px; width: 270px;
} }
@ -174,28 +178,34 @@ const QueryDisk = ()=>{
background-color: #42EBFF; background-color: #42EBFF;
overflow-x: scroll; overflow-x: scroll;
} }
p { p {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
#components-table-demo-size h4 { #components-table-demo-size h4 {
margin-bottom: 16px; margin-bottom: 16px;
} }
.disk { .disk {
border: 1px solid #f5f5f5; border: 1px solid #f5f5f5;
height: 100% height: 100%
} }
.memory { .memory {
border: 1px solid #f5f5f5; border: 1px solid #f5f5f5;
height: 100%; height: 100%;
} }
.sys { .sys {
border: 1px solid #f5f5f5; border: 1px solid #f5f5f5;
height: 100% height: 100%
} }
.cpu { .cpu {
border: 1px solid #f5f5f5; border: 1px solid #f5f5f5;
height: 100%; height: 100%;