|
|
|
@ -2,18 +2,18 @@ |
|
|
|
<div class="dashboard"> |
|
|
|
|
|
|
|
<!-- 服务器列表 可循环 --> |
|
|
|
<div class="ds_list"> |
|
|
|
<span class="dstit">122.22.33.45 服务器概况</span> |
|
|
|
<div class="ds_list" v-for="(item,index) in sysdata" :key="index"> |
|
|
|
<span class="dstit">{{index+1}} 服务器概况</span> |
|
|
|
<div class="dsinfo"> |
|
|
|
<a href="" class="dsbtn green">文件同步</a> |
|
|
|
<a href="" class="dsbtn green">代码对比</a> |
|
|
|
</div> |
|
|
|
<div class="dscon"> |
|
|
|
<p>磁盘使用:{{sysdata.hdstat}}</p> |
|
|
|
<p>系统进程:{{ sysdata.procout }}</p> |
|
|
|
<p>CPU占用:{{ sysdata.cpustat }}</p> |
|
|
|
<p>内存占用:{{ sysdata.memstat }}</p> |
|
|
|
<p>网络流量:{{ sysdata.netstat }}</p> |
|
|
|
<p>磁盘使用:{{item.hdstat}}</p> |
|
|
|
<p>系统进程:{{ item.procout }}</p> |
|
|
|
<p>CPU占用:{{ item.cpustat }}</p> |
|
|
|
<p>内存占用:{{ item.memstat }}</p> |
|
|
|
<p>网络流量:{{ item.netstat }}</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -39,7 +39,14 @@ |
|
|
|
color: #fff; |
|
|
|
border-radius: 22px; |
|
|
|
} |
|
|
|
.ds_list{ |
|
|
|
margin-top: 20px; |
|
|
|
} |
|
|
|
.ds_list:hover{ |
|
|
|
background-color: #f5f5f5; |
|
|
|
box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.1); |
|
|
|
|
|
|
|
} |
|
|
|
.ds_list .dscon { |
|
|
|
height: 70px; |
|
|
|
padding: 12px; |
|
|
|
@ -79,20 +86,35 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getSysinfo() |
|
|
|
this.mutSys() |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
getSysinfo() { |
|
|
|
SysApi.Sysinfo('http://127.0.0.1:9099').then(res => { |
|
|
|
// 获取服务器系统信息 |
|
|
|
getSysinfo(host) { |
|
|
|
SysApi.Sysinfo(host).then(res => { |
|
|
|
// 将base64转为二进制 |
|
|
|
let afbin= base64ToUint8Array(res.data) |
|
|
|
// 将二进制解析 |
|
|
|
let data = scinfo.decodeHdinfo(afbin) |
|
|
|
// 绑定到对象中 |
|
|
|
this.sysdata = data |
|
|
|
//this.sysdata = data |
|
|
|
this.sysdata.push(data) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// |
|
|
|
mutSys(){ |
|
|
|
let chost=['http://127.0.0.1:9099','http://192.168.66.92:9099'] |
|
|
|
// |
|
|
|
for(let i=0;i<chost.length;i++){ |
|
|
|
this.getSysinfo(chost[i]) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|