Commit 0980a11b authored by 智勇's avatar 智勇

增加mq差异

parent eb80e24a
...@@ -173,6 +173,15 @@ export function reloadMq(data) { ...@@ -173,6 +173,15 @@ export function reloadMq(data) {
data data
}) })
} }
export function mqDiff(data) {
return request({
url: '/docker/mqDiff',
method: 'post',
data
})
}
export function ingressHost(query) { export function ingressHost(query) {
return request({ return request({
url: '/k8s/ingress', url: '/k8s/ingress',
......
...@@ -43,7 +43,28 @@ ...@@ -43,7 +43,28 @@
<i v-if="scope.row.status == 'Normal'" class="el-icon-success" style="color: #67c23a"/> <i v-if="scope.row.status == 'Normal'" class="el-icon-success" style="color: #67c23a"/>
<i v-else class="el-icon-error" style="color: #f56c6c"/> <i v-else class="el-icon-error" style="color: #f56c6c"/>
<span v-if="scope.row.serviceName !== 'rabbitmq'">{{ scope.row.serviceName }}</span> <span v-if="scope.row.serviceName !== 'rabbitmq'">{{ scope.row.serviceName }}</span>
<span v-if="scope.row.serviceName === 'rabbitmq'" class="link-type" @click="openRabbitmq(scope.row)">{{ scope.row.serviceName }}</span> <span v-if="scope.row.serviceName === 'rabbitmq'" >
<span class="link-type" style="margin-right:10px" @click="openRabbitmq(scope.row)">
{{ scope.row.serviceName }}
</span>
<el-popover v-if="moreShow" placement="top-start" trigger="hover" title="本地比线上多出的配置">
<el-table :data="moreArray">
<el-table-column width="100" property="type" label="Type"/>
<el-table-column width="500" property="value" label="Value"/>
</el-table>
<i slot="reference" class="el-icon-sort-up" style="color: #67c23a"/>
</el-popover>
<el-popover v-if="lostShow" placement="top-start" trigger="hover" title="本地比线上缺少的配置">
<el-table :data="lostArray">
<el-table-column width="100" property="type" label="Type"/>
<el-table-column width="500" property="value" label="Value"/>
</el-table>
<i slot="reference" class="el-icon-sort-down" style="color: #f56c6c"/>
</el-popover>
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -135,7 +156,6 @@ ...@@ -135,7 +156,6 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="image" prop="image"
width="280"
label="镜像"> label="镜像">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.image | filterTag }} {{ scope.row.image | filterTag }}
...@@ -143,10 +163,12 @@ ...@@ -143,10 +163,12 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="createdAt" prop="createdAt"
width="120"
label="创建时间" label="创建时间"
/> />
<el-table-column <el-table-column
prop="status" prop="status"
width="100"
label="运行状态"> label="运行状态">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status | formatStatus }} {{ scope.row.status | formatStatus }}
...@@ -156,6 +178,7 @@ ...@@ -156,6 +178,7 @@
<el-table-column <el-table-column
v-if="item._id==='java'" v-if="item._id==='java'"
show-overflow-tooltip show-overflow-tooltip
width="90"
label="Mock"> label="Mock">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip v-show="scope.row.labels.mock==='1'" placement="top"> <el-tooltip v-show="scope.row.labels.mock==='1'" placement="top">
...@@ -167,6 +190,7 @@ ...@@ -167,6 +190,7 @@
<el-table-column <el-table-column
v-if="item._id==='java'" v-if="item._id==='java'"
width="140"
label="调试"> label="调试">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.serviceType==='NodePort'">{{ scope.row.lanIp }}:{{ scope.row.portMappings[1].nodePort }}</span> <span v-if="scope.row.serviceType==='NodePort'">{{ scope.row.lanIp }}:{{ scope.row.portMappings[1].nodePort }}</span>
...@@ -395,7 +419,8 @@ import { ...@@ -395,7 +419,8 @@ import {
redeployClusterService, redeployClusterService,
flushRedis, flushRedis,
modifyIngressHost, modifyIngressHost,
ingressHost ingressHost,
mqDiff
} from '@/api/docker' } from '@/api/docker'
import JsonEditor from '@/components/JsonEditor' import JsonEditor from '@/components/JsonEditor'
import permission from '@/directive/permission/index.js' // 权限判断指令 import permission from '@/directive/permission/index.js' // 权限判断指令
...@@ -450,7 +475,11 @@ export default { ...@@ -450,7 +475,11 @@ export default {
}, },
dialogHost: false, dialogHost: false,
timer: this.$store.getters.timer, timer: this.$store.getters.timer,
timerFunction: null timerFunction: null,
moreShow: false,
lostShow: false,
moreArray: [],
lostArray: []
} }
}, },
created() { created() {
...@@ -464,6 +493,7 @@ export default { ...@@ -464,6 +493,7 @@ export default {
this.refreshInterval(this.timer) this.refreshInterval(this.timer)
} else { } else {
this.getServicelist() this.getServicelist()
this.fetchRabbitmqDetails()
} }
}, },
destroyed() { destroyed() {
...@@ -581,6 +611,34 @@ export default { ...@@ -581,6 +611,34 @@ export default {
this.value = res.data this.value = res.data
}) })
}, },
fetchRabbitmqDetails() {
fetchServiceDetails({ namespace: this.namespace, serviceName: 'rabbitmq', type: 'base' })
.then(res => {
const data = res.data
for (const port of data.portMappings) {
if (port.port === 15672) {
mqDiff({ host: `${data.lanIp}:${port.nodePort}` }).then(res => {
const mqDiffData = res.data
this.moreShow = mqDiffData.more.show
this.lostShow = mqDiffData.lost.show
for (const i in mqDiffData.more) {
if (mqDiffData.more[i] instanceof Array) {
this.moreArray.push({ type: i, value: mqDiffData.more[i].join(' ') })
}
}
for (const i in mqDiffData.lost) {
if (mqDiffData.lost[i] instanceof Array) {
this.lostArray.push({ type: i, value: mqDiffData.lost[i].join(' ') })
}
}
})
}
}
})
},
submitHost(formName) { submitHost(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment