<template>
|
<div class="event-list">
|
<div class="title">告警推送配置</div>
|
<div class="empty" v-if="eventList.length === 0">
|
<img src="/images/search/1.png" alt="" />
|
<div class="des">您还未添加添加告警事件推送任务</div>
|
<div class="button add" @click="showSettingBox = true">
|
立即添加
|
</div>
|
</div>
|
<div class="list scroll">
|
<el-table :data="eventList" style="width: 100%">
|
<el-table-column label="序号" width="180"> </el-table-column>
|
<el-table-column label="事件名称" width="180"> </el-table-column>
|
<el-table-column label="事件等级" width="180"> </el-table-column>
|
<el-table-column label="关联区域" width="180"> </el-table-column>
|
<el-table-column label="责任人" width="180"> </el-table-column>
|
<el-table-column label="推送方式" width="180"> </el-table-column>
|
<el-table-column label="操作">
|
<template slot-scope="scope">
|
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<!-- <div class="devItem" v-for="(item, index) in clusterList" :key="index">
|
<div class="mainInfo">
|
<img src="/images/hashrate/cluster.png" alt="" />
|
|
<div class="right">
|
<div class="name">{{ item.cluster_name }}</div>
|
<div class="ip">{{ item.virtual_ip }}</div>
|
<div class="number">设备总量:{{ item.nodeNum }}</div>
|
</div>
|
|
<div class="button set" @click="setting({ clusterId: item.cluster_id }, item.nodeList)">
|
配置
|
</div>
|
</div>
|
</div>
|
<div class="devItem" v-for="(item, index) in devList" :key="index + 'dev'">
|
<div class="mainInfo">
|
<img src="/images/hashrate/equipment.png" alt="" />
|
|
<div class="right">
|
<div class="name">{{ item.devName }}</div>
|
<div class="ip">{{ item.devIp }}</div>
|
</div>
|
|
<div class="button set" @click="setting({ devId: item.devId })">
|
配置
|
</div>
|
</div>
|
</div> -->
|
</div>
|
|
<SettingBox v-if="showSettingBox" @close="showSettingBox = false" :id="idObj" :nodeList="nodeList"></SettingBox>
|
</div>
|
</template>
|
|
<script>
|
import SettingBox from "@/views/report/components/SettingBox"
|
import { getClusterDevList } from "@/api/clusterManage"
|
|
export default {
|
components: {
|
SettingBox
|
},
|
created() {
|
this.getClusterDevList()
|
},
|
data() {
|
return {
|
eventList: [],
|
clusterList: [],
|
devList: [],
|
showSettingBox: false,
|
idObj: {},
|
nodeList: []
|
}
|
},
|
methods: {
|
async getClusterDevList() {
|
const res = await getClusterDevList()
|
if (res && res.success) {
|
this.clusterList = res.data.clusterList
|
this.devList = res.data.devList
|
}
|
},
|
setting(id, nodeList) {
|
this.idObj = id
|
this.nodeList = nodeList ? nodeList : []
|
this.showSettingBox = true
|
},
|
handleEdit(idx, row) {},
|
handleDelete(idx, row) {}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.event-list {
|
position: relative;
|
box-sizing: border-box;
|
padding: 20px;
|
width: 1280px;
|
height: 770px;
|
background-color: #fff;
|
margin: 0 auto;
|
|
.title {
|
margin-bottom: 20px;
|
height: 20px;
|
padding-left: 20px;
|
font-weight: 700;
|
font-size: 16px;
|
border-left: 4px solid #0065ff;
|
}
|
|
.empty {
|
text-align: center;
|
|
img {
|
width: 260px;
|
}
|
|
.des {
|
margin-bottom: 30px;
|
font-size: 14px;
|
}
|
|
.add {
|
margin: 0 auto;
|
width: 112px;
|
height: 40px;
|
text-align: center;
|
line-height: 40px;
|
color: #fff;
|
background-color: #0065ff;
|
}
|
}
|
|
.list {
|
display: flex;
|
flex-wrap: wrap;
|
overflow-y: auto;
|
height: 710px;
|
|
.devItem {
|
position: relative;
|
margin: 0 15px 20px 0;
|
width: 295px;
|
height: 150px;
|
border: 1px solid #c0c5cc;
|
border-radius: 5px;
|
|
.mainInfo {
|
display: flex;
|
padding: 20px;
|
|
img {
|
margin-right: 20px;
|
width: 88px;
|
}
|
}
|
|
.right {
|
.name {
|
margin-bottom: 6px;
|
font-size: 16px;
|
font-weight: 700;
|
}
|
|
.ip,
|
.number {
|
margin-bottom: 2px;
|
font-size: 12px;
|
color: #666;
|
}
|
}
|
|
.set {
|
position: absolute;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
height: 40px;
|
line-height: 40px;
|
text-align: center;
|
border: 1px solid #c0c5cc;
|
font-size: 16px;
|
color: #0065ff;
|
}
|
|
&:nth-child(4n) {
|
margin-right: 0;
|
}
|
|
&:hover {
|
box-shadow: 0px 2px 16px 0px rgba(0, 43, 106, 0.25);
|
|
.set {
|
color: #fff;
|
background-color: #0065ff;
|
border-color: #0065ff;
|
}
|
}
|
}
|
}
|
}
|
</style>
|