<template>
|
<div class="all" ref="curPage">
|
<div class="general-set">
|
<div class="general-right">
|
<div class="lang" >
|
<div class="general-title">
|
<img class="info-img" src="/images/settings/信息.png"/>
|
<span class="general-info">设备信息</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">设备ID:</span>
|
<span class="desc">{{ deviceInfo.server_id }}</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">设备型号:</span>
|
<span class="desc">{{ deviceInfo.deviceModel }}</span>
|
</div>
|
<div class="info-bar">
|
<span class="name">设备类型:</span>
|
<span class="desc">{{ deviceInfo.deviceDesc }}</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">通道个数:</span>
|
<span class="desc">{{ deviceInfo.channelCount }}</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">主控版本:</span>
|
<span class="desc">{{ deviceInfo.masterVersion }}</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">web版本:</span>
|
<span class="desc">{{ deviceInfo.webVersion }}</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">硬盘信息:</span>
|
<span class="desc">{{ deviceInfo.disks }}</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">CPU:</span>
|
<span class="desc">{{ deviceInfo.cpu }}</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">内存:</span>
|
<span class="desc">{{ deviceInfo.memory }}</span>
|
</div>
|
<div class=" info-bar">
|
<span class="name">运行时间:</span>
|
<span class="desc">{{ deviceInfo.runningTime }}</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { getDevInfo } from "@/api/system";
|
import { uploadSound, getSoundList, deleteSound } from "@/api/event";
|
|
export default {
|
data() {
|
return {
|
min_len: 0,
|
max_len: 0,
|
info:"\ue6e8",
|
fakeObj: {
|
min: 0,
|
max: 0,
|
},
|
deviceInfo: {
|
cpu: "",
|
runningTime: "",
|
server_id: "",
|
deviceModel: "",
|
deviceDesc: "",
|
masterVersion: "",
|
channelCount: "",
|
webVersion: "",
|
disks: "",
|
memory: "",
|
activeBg: 0,
|
},
|
};
|
},
|
mounted() {
|
this.getDeviceInfo();
|
},
|
methods: {
|
getDeviceInfo() {
|
getDevInfo().then((res) => {
|
let info = res.data.deviceInfo;
|
let basic = res.data;
|
this.deviceInfo.cpu = info.cpu[0].modelName;
|
this.deviceInfo.runningTime = this.secondsFormat(info.host.uptime);
|
this.deviceInfo.server_id = basic.server_id;
|
this.deviceInfo.deviceModel = basic.deviceModel;
|
this.deviceInfo.deviceDesc = basic.deviceDesc;
|
this.deviceInfo.masterVersion = basic.masterVersion;
|
this.deviceInfo.channelCount = basic.channelCount;
|
this.deviceInfo.webVersion = "V2.0.0";
|
this.deviceInfo.disks = "( " + info.disk + ") ";
|
this.deviceInfo.memory =
|
(info.mem.total / 1024 / 1024 / 1024).toFixed(2) + "GB";
|
this.fakeObj.min = basic.min_video_len / 1.2;
|
this.fakeObj.max = basic.max_video_len / 1.2;
|
});
|
},
|
secondsFormat(s) {
|
var day = (s / (24 * 3600)) | 0;
|
var hour = ((s - day * 24 * 3600) / 3600) | 0;
|
var minute = ((s - day * 24 * 3600 - hour * 3600) / 60) | 0;
|
var second = s - day * 24 * 3600 - hour * 3600 - minute * 60;
|
return day + "天 " + hour + "小时 " + minute + "分 " + second + "秒";
|
},
|
},
|
};
|
</script>
|
<style lang="scss">
|
.all {
|
width: 100%;
|
}
|
|
.general-set {
|
height: 100%;
|
display: flex;
|
flex-direction: row;
|
flex: 1;
|
flex-basis: auto;
|
box-sizing: border-box;
|
background-color: #F2F2F7;
|
|
.info-img {
|
width: 40px;
|
}
|
|
/* .general-center {
|
height: 100%;
|
width: 280px;
|
overflow: auto;
|
box-sizing: border-box;
|
flex-shrink: 0;
|
padding: 10px;
|
border-right: 5px solid #f8f8f8;
|
|
.menu-item {
|
background-color: #f8f8f8;
|
height: 50px;
|
margin-bottom: 10px;
|
border-radius: 10px;
|
line-height: 50px;
|
box-sizing: border-box;
|
font-size: 14px;
|
padding: 0 20px;
|
cursor: pointer;
|
display: flex;
|
.iconfont {
|
margin-right: 8px;
|
}
|
.title {
|
font-size: 15px;
|
}
|
}
|
.menu-item-active {
|
background-color: #3d68e1;
|
color: white;
|
}
|
.menu-item:hover {
|
background-color: #3d68e1;
|
color: white;
|
}
|
} */
|
.general-title {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
margin-bottom:10px ;
|
height: 110px;
|
background-color: #fff;
|
.general-info {
|
margin-left: 10px;
|
font-size: 16px;
|
color:#333 ;
|
font-weight: 700;
|
}
|
.iconfont {
|
margin-right: 10px;
|
font-size: 40px;
|
}
|
}
|
|
.general-right .lang .info-bar {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-bottom:10px ;
|
padding: 0 40px;
|
height: 45px;
|
color: #4F4F4F;
|
font-size: 16px !important;
|
font-weight: 700;
|
background-color: #fff;
|
.desc {
|
color: #4F4F4F;
|
font-size: 16px;
|
font-weight: 700;
|
}
|
&:hover {
|
background-color: #F8F8FF;
|
}
|
}
|
|
.general-right {
|
flex: 1;
|
flex-basis: auto;
|
overflow: auto;
|
box-sizing: border-box;
|
padding: 10px 15px !important;
|
}
|
|
.info-bar {
|
border-radius: 8px;
|
}
|
|
.info-bar .name {
|
color: #4F4F4F;
|
}
|
}
|
</style>
|