2022-08-13 16:21:39 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<d2-container>
|
|
|
|
|
|
<el-card class="box-card" v-for="(item, index) in serverData" :key="index">
|
|
|
|
|
|
<div slot="header" class="device-header">
|
2022-08-14 18:32:10 +08:00
|
|
|
|
<span>前置服务 {{ item.server_name }} ({{ item.url }} )</span>
|
2022-08-13 16:21:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<el-row :gutter="12">
|
2022-08-14 18:32:10 +08:00
|
|
|
|
<el-col :span="6" v-for="i in item.devices" :key="i">
|
2022-08-13 16:21:39 +08:00
|
|
|
|
<el-popover placement="top" trigger="click">
|
|
|
|
|
|
|
|
|
|
|
|
<el-menu @select="(index) => setServeStatus(i.id, index)" :style="{ 'borderRight': 'none' }">
|
|
|
|
|
|
<el-menu-item index="0">
|
|
|
|
|
|
<span slot="title">暂停</span>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
<el-menu-item index="1">
|
|
|
|
|
|
<span slot="title">重启</span>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
<el-menu-item index="2">
|
|
|
|
|
|
<span slot="title">关闭</span>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
</el-menu>
|
|
|
|
|
|
<el-card slot="reference"
|
2022-08-14 18:32:10 +08:00
|
|
|
|
:class="{ 'box-card': true, 'online': i.device_status === 1, 'offline': i.device_status !== 1 }">
|
2022-08-13 16:21:39 +08:00
|
|
|
|
<div slot="header" class="header-title">
|
2022-08-14 18:32:10 +08:00
|
|
|
|
<span>{{ i.device_name }}</span>
|
2022-08-13 16:21:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
|
|
|
|
|
<span>设备类型</span>
|
|
|
|
|
|
</el-col>
|
2022-08-14 18:32:10 +08:00
|
|
|
|
<el-col :span="14" style="padding-left:0px;">:{{ i.device_type }}</el-col>
|
2022-08-13 16:21:39 +08:00
|
|
|
|
</el-row>
|
2022-08-14 18:32:10 +08:00
|
|
|
|
<!-- <el-row :gutter="24">
|
2022-08-13 16:21:39 +08:00
|
|
|
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
|
|
|
|
|
<span>IP/端口</span>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="14" style="padding-left:0px;">:{{ i.ip + ':' + i.port }}</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
|
|
|
|
|
<span>活动时间</span>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="14" style="padding-left:0px;">:{{ i.time }}</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
|
|
|
|
|
<span>采集耗时</span>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="14" style="padding-left:0px;">:{{ i.hs }}</el-col>
|
2022-08-14 18:32:10 +08:00
|
|
|
|
</el-row> -->
|
2022-08-13 16:21:39 +08:00
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
|
|
|
|
|
<span>成功次数</span>
|
|
|
|
|
|
</el-col>
|
2022-08-14 18:32:10 +08:00
|
|
|
|
<el-col :span="14" style="padding-left:0px;">:{{ i.success_count }}</el-col>
|
2022-08-13 16:21:39 +08:00
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
|
|
|
|
|
<span>失败次数</span>
|
|
|
|
|
|
</el-col>
|
2022-08-14 18:32:10 +08:00
|
|
|
|
<el-col :span="14" style="padding-left:0px;">:{{ i.fail_count }}</el-col>
|
2022-08-13 16:21:39 +08:00
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-alert v-if="i.error_mesage" :title="i.error_mesage" type="error" :closable="false">
|
|
|
|
|
|
</el-alert>
|
|
|
|
|
|
<div v-else style="height:35px;"></div>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
</d2-container>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
2022-08-14 18:32:10 +08:00
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
serverData: []
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
async getServe () {
|
|
|
|
|
|
try {
|
|
|
|
|
|
this.serverData = await this.$api.GET_SERVE_MONITORING()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.log(e)
|
|
|
|
|
|
}
|
2022-08-13 16:21:39 +08:00
|
|
|
|
},
|
2022-08-14 18:32:10 +08:00
|
|
|
|
async setServeStatus (id, status) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
// const data = { id: id, status: status }
|
|
|
|
|
|
// await this.$api.SET_SERVE_STATUS(data)
|
|
|
|
|
|
this.$message({
|
|
|
|
|
|
message: '操作成功',
|
|
|
|
|
|
type: 'success'
|
|
|
|
|
|
})
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.log(e)
|
|
|
|
|
|
}
|
|
|
|
|
|
this.getServe()
|
2022-08-13 16:21:39 +08:00
|
|
|
|
}
|
2022-08-14 18:32:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
mounted () {
|
|
|
|
|
|
this.getServe()
|
|
|
|
|
|
}
|
2022-08-13 16:21:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.box-card {
|
|
|
|
|
|
margin: 5px 0px;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.device-header {
|
|
|
|
|
|
color: #000;
|
|
|
|
|
|
font-weight: bold;
|
2022-08-14 18:32:10 +08:00
|
|
|
|
font-size: 18px;
|
2022-08-13 16:21:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.online {
|
|
|
|
|
|
background-color: #67c23a;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.offline {
|
|
|
|
|
|
background-color: #666;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.text {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.item {
|
|
|
|
|
|
margin-bottom: 18px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-title {
|
|
|
|
|
|
|
2022-08-14 18:32:10 +08:00
|
|
|
|
font-size: 18px;
|
2022-08-13 16:21:39 +08:00
|
|
|
|
}
|
2022-08-14 18:32:10 +08:00
|
|
|
|
</style>
|