mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
meta admin (#2836)
This commit is contained in:
@@ -59,6 +59,13 @@ export function instanceLog(id, nodeId) {
|
||||
})
|
||||
}
|
||||
|
||||
export function instanceMeta(id, nodeId) {
|
||||
return request({
|
||||
url: '/canal/instance/meta/' + id + '/' + nodeId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function instanceStatus(id, option) {
|
||||
return request({
|
||||
url: '/canal/instance/status/' + id + '?option=' + option,
|
||||
|
||||
@@ -128,6 +128,13 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/canalServer/CanalInstanceLogDetail'),
|
||||
meta: { title: 'Instance 日志' },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'canalInstance/meta',
|
||||
name: 'Instance meta',
|
||||
component: () => import('@/views/canalServer/CanalInstanceMetaDetail'),
|
||||
meta: { title: 'Instance Meta' },
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
<el-dropdown-item @click.native="handleStart(scope.row)">启动</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="handleStop(scope.row)">停止</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="handleLog(scope.row)">日志</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="handleMeta(scope.row)">meta</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
@@ -117,6 +118,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.listQuery.name = this.$route.query.name
|
||||
getClustersAndServers().then((res) => {
|
||||
this.options = res.data
|
||||
})
|
||||
@@ -222,6 +224,13 @@ export default {
|
||||
return
|
||||
}
|
||||
this.$router.push('canalInstance/log?id=' + row.id + '&nodeId=' + row.nodeServer.id)
|
||||
},
|
||||
handleMeta(row) {
|
||||
if (row.nodeId === null) {
|
||||
this.$message({ message: '当前Instance不是启动状态,无法查看meta', type: 'warning' })
|
||||
return
|
||||
}
|
||||
this.$router.push('canalInstance/meta?id=' + row.id + '&nodeId=' + row.nodeServer.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :model="form">
|
||||
<div style="padding-left: 10px;padding-right: 10px;padding-top: 20px;">
|
||||
<el-form-item>
|
||||
{{ form.instance }}.meta
|
||||
<el-button type="primary" @click="onRefresh">刷新</el-button>
|
||||
<el-button type="info" @click="onBack(form.instance)">返回</el-button>
|
||||
</el-form-item>
|
||||
<el-input v-model="form.desc" :rows="35" :readonly="'readonly'" type="textarea" />
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { instanceMeta } from '@/api/canalInstance'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
instance: '',
|
||||
desc: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
instanceMeta(this.$route.query.id, this.$route.query.nodeId).then(res => {
|
||||
this.form.instance = res.data.instance
|
||||
this.form.desc = res.data.meta
|
||||
})
|
||||
},
|
||||
onRefresh() {
|
||||
this.fetchData()
|
||||
},
|
||||
onBack(instance) {
|
||||
this.$router.push('/canalServer/canalInstances?name=' + instance)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.line{
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user