Commit 5a1cbbec authored by kewei.jia's avatar kewei.jia

Merge remote-tracking branch 'origin/master'

parents 0f352cf0 5aeb9a71
......@@ -173,6 +173,15 @@ export function reloadMq(data) {
data
})
}
export function mqDiff(data) {
return request({
url: '/docker/mqDiff',
method: 'post',
data
})
}
export function ingressHost(query) {
return request({
url: '/k8s/ingress',
......
......@@ -43,17 +43,38 @@
<i v-if="scope.row.status == 'Normal'" class="el-icon-success" style="color: #67c23a"/>
<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'" 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:5px" @click="openRabbitmq(scope.row)">
{{ scope.row.serviceName }}
</span>
<el-popover v-if="moreShow" placement="top-start" trigger="hover" title="本地比线上多出的配置">
<el-table :data="moreArray" max-height="500">
<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" max-height="500">
<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>
</el-table-column>
<el-table-column
prop="lanIp"
label="ip地址"
width="100"
label="IP地址"
/>
<el-table-column
prop="portMappings"
label="服务端口"
width="300px">
label="服务端口">
<template slot-scope="scope">
<el-tooltip v-show="scope.row.serviceName === 'redis-sentinel'" placement="top">
<div slot="content">四个端口分别为一主二从一哨兵<br>哨兵名称:qsmaster,没有密码</div>
......@@ -71,10 +92,12 @@
</el-table-column>
<el-table-column
prop="createdAt"
width="120"
label="创建时间"
/>
<el-table-column
prop="status"
width="100"
label="运行状态">
<template slot-scope="scope">
{{ scope.row.status | formatStatus }}
......@@ -135,7 +158,6 @@
</el-table-column>
<el-table-column
prop="image"
width="280"
label="镜像">
<template slot-scope="scope">
{{ scope.row.image | filterTag }}
......@@ -143,10 +165,12 @@
</el-table-column>
<el-table-column
prop="createdAt"
width="120"
label="创建时间"
/>
<el-table-column
prop="status"
width="100"
label="运行状态">
<template slot-scope="scope">
{{ scope.row.status | formatStatus }}
......@@ -156,6 +180,7 @@
<el-table-column
v-if="item._id==='java'"
show-overflow-tooltip
width="90"
label="Mock">
<template slot-scope="scope">
<el-tooltip v-show="scope.row.labels.mock==='1'" placement="top">
......@@ -167,6 +192,7 @@
<el-table-column
v-if="item._id==='java'"
width="140"
label="调试">
<template slot-scope="scope">
<span v-if="scope.row.serviceType==='NodePort'">{{ scope.row.lanIp }}:{{ scope.row.portMappings[1].nodePort }}</span>
......@@ -178,7 +204,7 @@
width="170">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="控制台" placement="top">
<el-button type="primary" icon="el-icon-tickets" circle @click="linkShell(scope.row)"/>
<el-button type="primary" icon="el-icon-time" circle @click="linkShell(scope.row)"/>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="日志" placement="top">
<el-button type="success" icon="el-icon-time" circle @click="linkLog(scope.row)"/>
......@@ -395,7 +421,8 @@ import {
redeployClusterService,
flushRedis,
modifyIngressHost,
ingressHost
ingressHost,
mqDiff
} from '@/api/docker'
import JsonEditor from '@/components/JsonEditor'
import permission from '@/directive/permission/index.js' // 权限判断指令
......@@ -450,7 +477,11 @@ export default {
},
dialogHost: false,
timer: this.$store.getters.timer,
timerFunction: null
timerFunction: null,
moreShow: false,
lostShow: false,
moreArray: [],
lostArray: []
}
},
created() {
......@@ -464,6 +495,7 @@ export default {
this.refreshInterval(this.timer)
} else {
this.getServicelist()
this.fetchRabbitmqDetails()
}
},
destroyed() {
......@@ -581,6 +613,34 @@ export default {
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) {
this.$refs[formName].validate((valid) => {
if (valid) {
......
......@@ -10,7 +10,7 @@
:header-cell-style="{background:'#F3F4F7',color:'#555'}"
size="medium"
align="center"
style="width: 100%">
style="width: 100%;margin-bottom: 30px;">
<el-table-column
:index="indexMethod"
type="index"/>
......
......@@ -10,7 +10,7 @@
:header-cell-style="{background:'#F3F4F7',color:'#555'}"
size="medium"
align="center"
style="width: 100%">
style="width: 100%;margin-bottom: 30px;">
<el-table-column
:index="indexMethod"
type="index"/>
......
......@@ -50,6 +50,7 @@
<span>{{ scope.row.auth }}</span>
</template>
</el-table-column>
<el-table-column label="状态" width="90px" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.is_active | statusFilter">{{ scope.row.is_active | activeFileter }}</el-tag>
......@@ -68,7 +69,7 @@
width="80px">
<template slot-scope="scope">
<el-tooltip :content="scope.row.api" class="item" effect="dark" placement="top">
<el-button v-show="scope.row.api" type="primary" icon="el-icon-tickets" circle @click="openUrl(scope.row.api)"/>
<el-button v-if="scope.row.api" type="primary" icon="el-icon-time" circle @click="openUrl(scope.row.api)"/>
</el-tooltip>
</template>
</el-table-column>
......@@ -79,7 +80,7 @@
align="center">
<template slot-scope="scope">
<el-tooltip :content="scope.row.ddl" class="item" effect="dark" placement="top">
<el-button v-show="scope.row.ddl" type="success" icon="el-icon-time" circle @click="openUrl(scope.row.ddl)"/>
<el-button v-if="scope.row.ddl" type="success" icon="el-icon-time" circle @click="openUrl(scope.row.ddl)"/>
</el-tooltip>
</template>
</el-table-column>
......@@ -90,7 +91,7 @@
align="center">
<template slot-scope="scope">
<el-tooltip :content="scope.row.wiki" class="item" effect="dark" placement="top">
<el-button v-show="scope.row.wiki" type="warning" icon="el-icon-time" circle @click="openUrl(scope.row.wiki)"/>
<el-button v-if="scope.row.wiki" type="warning" icon="el-icon-time" circle @click="openUrl(scope.row.wiki)"/>
</el-tooltip>
</template>
</el-table-column>
......@@ -101,7 +102,7 @@
align="center">
<template slot-scope="scope">
<el-tooltip :content="scope.row.git_path" class="item" effect="dark" placement="top">
<el-button v-show="scope.row.git_path" type="info" icon="el-icon-time" circle />
<el-button v-if="scope.row.git_path" type="info" icon="el-icon-tickets" circle />
</el-tooltip>
</template>
</el-table-column>
......
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