|
@@ -47,14 +47,16 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button size="mini" type="text" icon="el-icon-tickets" @click="handelConfig(scope.row.id)">配置
|
|
<el-button size="mini" type="text" icon="el-icon-tickets" @click="handelConfig(scope.row.id)">配置
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button size="mini" type="text" icon="el-icon-s-order" style="color: #b1b1b1;" @click="handelLog(scope.row.id)">日志
|
|
|
|
- </el-button>
|
|
|
|
|
|
+<!-- <el-button size="mini" type="text" icon="el-icon-s-order" style="color: #b1b1b1;" @click="handelLog(scope.row.id)">日志-->
|
|
|
|
+<!-- </el-button>-->
|
|
<!-- <el-button size="mini" type="text" icon="el-icon-refresh" @click="refreshConfig(scope.row.id)">刷新配置-->
|
|
<!-- <el-button size="mini" type="text" icon="el-icon-refresh" @click="refreshConfig(scope.row.id)">刷新配置-->
|
|
<!-- </el-button>-->
|
|
<!-- </el-button>-->
|
|
<el-button v-if="!scope.row.runStatus || scope.row.runStatus === 0" :disabled="scope.row.onLine !== 1" size="mini" type="text" icon="el-icon-video-play" style="color: #67c23a;" @click="handelStart(scope.row.id)">启动
|
|
<el-button v-if="!scope.row.runStatus || scope.row.runStatus === 0" :disabled="scope.row.onLine !== 1" size="mini" type="text" icon="el-icon-video-play" style="color: #67c23a;" @click="handelStart(scope.row.id)">启动
|
|
</el-button>
|
|
</el-button>
|
|
<el-button v-if="scope.row.runStatus === 1" :disabled="scope.row.onLine !== 1" size="mini" type="text" icon="el-icon-video-pause" style="color: #f56c6c;" @click="handelStop(scope.row.id)">停止
|
|
<el-button v-if="scope.row.runStatus === 1" :disabled="scope.row.onLine !== 1" size="mini" type="text" icon="el-icon-video-pause" style="color: #f56c6c;" @click="handelStop(scope.row.id)">停止
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" style="color: #f56c6c;" @click="deleteCollector(scope.row)">删除
|
|
|
|
+ </el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -262,7 +264,8 @@ import {
|
|
saveCollector,
|
|
saveCollector,
|
|
saveConfigInfo,
|
|
saveConfigInfo,
|
|
startClient,
|
|
startClient,
|
|
- stopClient
|
|
|
|
|
|
+ stopClient,
|
|
|
|
+ deleteCollectorApi
|
|
} from "@/api/collector";
|
|
} from "@/api/collector";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -717,6 +720,31 @@ export default {
|
|
this.itemTableData = this.itemTableData.filter(item => {
|
|
this.itemTableData = this.itemTableData.filter(item => {
|
|
return row.itemGroupId !== item.itemGroupId
|
|
return row.itemGroupId !== item.itemGroupId
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ deleteCollector(row) {
|
|
|
|
+ if (row.runStatus === 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '采集器已启动,请先停止采集器再删除',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$confirm('是否删除该采集器?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.deleteCollectorApi(row.id).then(json => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: json.code === 200 ? 'success' : 'warning',
|
|
|
|
+ message: json.code === 200 ? '删除成功!' : json.msg
|
|
|
|
+ });
|
|
|
|
+ this.getCollectorList()
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }).catch(() => {
|
|
|
|
+
|
|
|
|
+ });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|