mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
template config load (#2123)
* template config load * compile vue frontend for product
This commit is contained in:
@@ -14,3 +14,10 @@ export function updateCanalConfig(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getTemplateConfig() {
|
||||
return request({
|
||||
url: '/canal/config/template',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -72,3 +72,10 @@ export function getActiveInstances(serverId) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getTemplateInstance() {
|
||||
return request({
|
||||
url: '/canal/instance/template',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
:total="total"
|
||||
v-bind="$attrs"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
{{ form.name }}
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button type="warning" @click="onCancel">重置</el-button>
|
||||
<el-button type="success" @click="onLoadTemplate">载入模板</el-button>
|
||||
<el-button type="info" @click="onBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
@@ -15,7 +16,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCanalConfig, updateCanalConfig } from '@/api/canalConfig'
|
||||
import { getCanalConfig, updateCanalConfig, getTemplateConfig } from '@/api/canalConfig'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -101,6 +102,11 @@ export default {
|
||||
},
|
||||
onBack() {
|
||||
history.go(-1)
|
||||
},
|
||||
onLoadTemplate() {
|
||||
getTemplateConfig().then(res => {
|
||||
this.form.content = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
<el-button class="filter-item" type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button class="filter-item" type="success" @click="onLoadTemplate">载入模板</el-button>
|
||||
<el-button class="filter-item" type="info" @click="onBack">返回</el-button>
|
||||
</div>
|
||||
<editor v-model="form.content" lang="properties" theme="chrome" width="100%" :height="800" @init="editorInit" />
|
||||
@@ -17,7 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addCanalInstance } from '@/api/canalInstance'
|
||||
import { addCanalInstance, getTemplateInstance } from '@/api/canalInstance'
|
||||
import { getClustersAndServers } from '@/api/canalCluster'
|
||||
|
||||
export default {
|
||||
@@ -99,6 +100,11 @@ export default {
|
||||
},
|
||||
onBack() {
|
||||
history.go(-1)
|
||||
},
|
||||
onLoadTemplate() {
|
||||
getTemplateInstance().then(res => {
|
||||
this.form.content = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,8 +311,8 @@ export default {
|
||||
},
|
||||
handleConfig(row) {
|
||||
if (row.canalCluster !== null) {
|
||||
this.$message({ message: '集群模式Server不允许单独变更配置,请在集群配置变更', type: 'error' })
|
||||
return
|
||||
this.$message({ message: '集群模式Server不允许单独变更配置,请在集群配置变更', type: 'error' })
|
||||
return
|
||||
}
|
||||
this.$router.push('/canalServer/nodeServer/config?serverId=' + row.id)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user