<template>
|
<div class="s-system-monitor">
|
<el-tabs id="systemMonitor" v-model="activeName">
|
<el-tab-pane label="单元" name="proc">
|
<div class="form-title">
|
<b>算法单元</b>(正在进行5个算法单元)
|
</div>
|
<el-divider></el-divider>
|
|
<div class="form-title">
|
<b>应用单元</b>(正在进行5个应用单元)
|
</div>
|
<el-divider></el-divider>
|
</el-tab-pane>
|
|
<el-tab-pane label="性能" name="top">
|
<div class="column-left" ref="left">
|
<div class="resize-bar">
|
<div class="ax_default">
|
<div class="ax_default_pic"></div>
|
<div>CPU</div>
|
<div>100%</div>
|
</div>
|
|
<div class="ax_default">
|
<div class="ax_default_pic"></div>
|
<div>内存</div>
|
<div>100%</div>
|
</div>
|
|
<div class="ax_default">
|
<div class="ax_default_pic"></div>
|
<div>磁盘</div>
|
<div>100%</div>
|
</div>
|
|
<div class="ax_default">
|
<div class="ax_default_pic"></div>
|
<div>算力</div>
|
<div>100%</div>
|
</div>
|
|
<div class="ax_default">
|
<div class="ax_default_pic"></div>
|
<div>网络</div>
|
<div>100%</div>
|
</div>
|
</div>
|
|
<div class="resize-line"></div>
|
</div>
|
<div class="column-right">
|
<div ref="graphs" class="graphs-chart"></div>
|
</div>
|
</el-tab-pane>
|
|
<el-tab-pane label="服务" name="service">
|
<el-table height="93%" :data="services" border :cell-style="cellStyle">
|
<el-table-column label="名称" align="center" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<span>{{ scope.row.name}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="状态" prop="status" align="center" width="130px"></el-table-column>
|
<el-table-column label="描述" prop="text" align="center"></el-table-column>
|
</el-table>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</template>
|
|
<script>
|
import echarts from "echarts";
|
import { showSystemStates } from "../api/api"
|
|
export default {
|
components: {
|
|
|
},
|
data() {
|
return {
|
activeName: "proc",
|
eChartsObj: {},
|
eChartsBaseOpt: {
|
animation: false,
|
xAxis: {
|
type: "category",
|
boundaryGap: false,
|
data: Array.from({ length: 100 }, () => 0),
|
axisLabel: {
|
show: false
|
},
|
axisTick: {
|
show: false
|
}
|
},
|
yAxis: {
|
type: 'value',
|
axisLabel: {
|
show: false
|
},
|
axisTick: {
|
show: false
|
}
|
},
|
series: [
|
{
|
type: 'line',
|
symbol: 'none',
|
data: Array.from({ length: 100 }, () => 0),
|
// smooth: true,
|
areaStyle: {}
|
}
|
]
|
},
|
services: [
|
{
|
name: "系统配置服务",
|
status: "已启动",
|
text: "实现系统的通用功能配置"
|
|
}
|
]
|
};
|
},
|
mounted() {
|
this.initChart();
|
if (!this.isShow('vindicate:device')) {
|
this.activeName = "dbvdc"
|
}
|
},
|
computed: {
|
isAdmin() {
|
if (
|
sessionStorage.getItem('userInfo') &&
|
sessionStorage.getItem('userInfo') !== ''
|
) {
|
let loginName = JSON.parse(sessionStorage.getItem('userInfo')).username
|
return (
|
loginName === 'superadmin' || loginName === 'basic'
|
)
|
}
|
return false;
|
}
|
},
|
methods: {
|
isShow(authority) {
|
if (this.isAdmin) {
|
return true
|
} else if (
|
this.buttonAuthority.indexOf(',' + authority + ',') > -1
|
) {
|
return true
|
} else {
|
return false
|
}
|
},
|
format(array) {
|
return [
|
this.$moment(array[0]).format("YYYY-MM-DD"),
|
this.$moment(array[1]).format("YYYY-MM-DD")
|
];
|
},
|
initChart() {
|
this.eChartsObj = echarts.init(this.$refs.graphs);
|
this.eChartsObj.setOption(this.eChartsBaseOpt);
|
this.cpuMonitor()
|
},
|
cpuMonitor() {
|
let rate = Math.floor(Math.random() * 100);
|
let data = this.eChartsBaseOpt.series[0].data.slice(1);
|
data.push(rate)
|
this.eChartsBaseOpt.series[0].data = data;
|
this.eChartsObj.setOption(this.eChartsBaseOpt);
|
setTimeout(() => {
|
this.cpuMonitor()
|
}, 1000)
|
}
|
|
}
|
};
|
</script>
|
<style lang="scss">
|
.s-system-monitor {
|
width: 100% !important;
|
min-width: 759px;
|
box-sizing: border-box;
|
padding: 10px;
|
// background-color: #e9ebf2;
|
background-color: #fff;
|
.form-title {
|
text-align: left;
|
font-size: 14px;
|
}
|
|
.graphs-chart {
|
height: 380px;
|
width: 450px;
|
// border: 1px solid rgb(69, 69, 172);
|
}
|
.column-left {
|
background-color: #fff;
|
position: relative;
|
float: left;
|
}
|
.column-right {
|
//overflow: hidden;
|
overflow-y: hidden;
|
overflow-x: auto;
|
}
|
.resize-bar {
|
width: 200px;
|
height: 400px;
|
}
|
/* 拖拽线 */
|
.resize-line {
|
position: absolute;
|
right: 0;
|
top: 0;
|
bottom: 0;
|
border-right: 1px solid #efefef;
|
border-left: 1px solid #e0e0e0;
|
pointer-events: none;
|
}
|
|
.ax_default {
|
font-family: "Arial Normal", "Arial";
|
font-weight: 400;
|
font-style: normal;
|
font-size: 13px;
|
text-align: center;
|
line-height: normal;
|
width: 200px;
|
height: 50px;
|
font-size: 16px;
|
cursor: pointer;
|
margin-bottom: 15px;
|
}
|
|
.ax_default_pic {
|
position: absolute;
|
border-width: 0px;
|
width: 65px;
|
height: 45px;
|
background: inherit;
|
background-color: rgba(255, 255, 255, 0);
|
box-sizing: border-box;
|
border-width: 1px;
|
border-style: solid;
|
border-color: rgba(255, 153, 0, 1);
|
border-radius: 0px;
|
-moz-box-shadow: none;
|
-webkit-box-shadow: none;
|
box-shadow: none;
|
}
|
|
.s-system-monitor-breadcrumb {
|
height: 5%;
|
box-sizing: border-box;
|
border: 1px solid #e4e7ed;
|
box-shadow: #e4e7ed 0px 0px 9px inset;
|
box-shadow: #e4e7ed 0px 0px 9px inset;
|
border-radius: 5px;
|
}
|
|
.el-tabs--border-card {
|
border: 0px solid #dcdfe6;
|
-webkit-box-shadow: none;
|
box-shadow: none;
|
.el-tabs__header {
|
border: 0px solid #dcdfe6;
|
.el-tabs__item {
|
padding: 5px 50px;
|
height: 50px;
|
font-family: PingFangSC-Regular;
|
font-size: 15px;
|
color: #222222;
|
text-align: center;
|
border: 0px solid transparent;
|
}
|
.el-tabs__item:nth-child(2) {
|
padding-left: 50px !important;
|
}
|
.el-tabs__item:last-child {
|
padding-right: 50px !important;
|
}
|
.el-tabs__item.is-active {
|
color: #3d68e1;
|
font-weight: bold;
|
// border-right-color: #fff;
|
// border-left-color: #fff;
|
}
|
.el-tabs__item:not(.is-disabled):hover {
|
color: #3d68e1;
|
}
|
}
|
}
|
.el-tabs__content {
|
height: calc(100% - 64px);
|
width: calc(100% - 20px);
|
box-sizing: border-box;
|
overflow-y: auto;
|
padding: 10px 40px !important;
|
.el-tab-pane {
|
width: 100%;
|
.s-title {
|
text-align: left;
|
padding: 15px 0px;
|
font-size: 16px;
|
}
|
}
|
}
|
|
.s-table {
|
border: 1px solid #e8e8e9;
|
margin-top: 40px;
|
}
|
|
.ui-top-title {
|
padding-bottom: 10px;
|
/* border-bottom: 1px solid #ebebeb; */
|
position: relative;
|
text-align: left;
|
padding-left: 15px;
|
font-size: 16px;
|
font-weight: bold;
|
}
|
|
.ui-top-title:before {
|
content: " ";
|
border-left: 4px solid #f53d3d;
|
display: inline-block;
|
height: 16px;
|
position: absolute;
|
top: 50%;
|
left: 0;
|
margin-top: -13px;
|
}
|
|
.el-button--text {
|
color: #3d68e1;
|
text-decoration: underline;
|
}
|
}
|
|
#systemMonitor {
|
.el-tabs__header {
|
border: 0px solid #dcdfe6;
|
.el-tabs__item {
|
padding: 5px 50px;
|
height: 50px;
|
font-family: PingFangSC-Regular;
|
font-size: 14px;
|
color: #222222;
|
text-align: center;
|
border: 0px solid transparent;
|
}
|
.el-tabs__item:nth-child(2) {
|
padding-left: 50px;
|
}
|
.el-tabs__item:last-child {
|
padding-right: 50px;
|
}
|
.el-tabs__item.is-active {
|
color: #ff7733;
|
font-weight: bold;
|
// border-right-color: #fff;
|
// border-left-color: #fff;
|
}
|
.el-tabs__item:not(.is-disabled):hover {
|
color: #ff7733;
|
}
|
}
|
.el-tabs__active-bar {
|
background-color: #ff7733;
|
}
|
.el-tabs__content {
|
padding-left: 15px !important;
|
}
|
}
|
</style>
|