template config load (#2123)

* template config load

* compile vue frontend for product
This commit is contained in:
rewerma
2019-08-31 14:56:28 +08:00
committed by agapple
parent 3a388308d9
commit 1bcae9dc49
34 changed files with 205 additions and 17 deletions

View File

@@ -14,3 +14,10 @@ export function updateCanalConfig(data) {
data
})
}
export function getTemplateConfig() {
return request({
url: '/canal/config/template',
method: 'get'
})
}

View File

@@ -72,3 +72,10 @@ export function getActiveInstances(serverId) {
method: 'get'
})
}
export function getTemplateInstance() {
return request({
url: '/canal/instance/template',
method: 'get'
})
}

View File

@@ -9,7 +9,8 @@
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
@current-change="handleCurrentChange"
/>
</div>
</template>

View File

@@ -6,6 +6,7 @@
{{ form.name }}&nbsp;&nbsp;&nbsp;&nbsp;
<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
})
}
}
}

View File

@@ -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
})
}
}
}

View File

@@ -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)
},