Commit 077b7acb authored by 智勇's avatar 智勇

mock

parent e93c1299
......@@ -228,6 +228,18 @@
</el-select>
</el-col>
</el-row>
<div v-show="is_mock">
<p class="title-sub">是否使用mock</p>
<el-row :gutter="20">
<el-col :span="14">
<el-select v-model="mock.key" filterable clearable class="elSelect" placeholder="请选择是否使用mock">
<el-option v-for="item in debugOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
</el-col>
</el-row>
</div>
<div v-permission="['admin']" v-show="is_show">
<p class="title-sub">服务名称<span style="font-size: 12px">(创建多个mysql时需要填写此字段)</span></p>
<el-row :gutter="20">
......@@ -236,6 +248,7 @@
</el-col>
</el-row>
</div>
<p class="title-sub">选择镜像</p>
<el-row :gutter="20">
<el-col :span="14">
......@@ -357,6 +370,7 @@ export default {
{ key: '"0"', display_name: '' }
],
debug: {},
mock: {},
centerDialogVisible: false,
namespace: null,
tableData: [],
......@@ -365,6 +379,7 @@ export default {
FormatTabledata: {},
reponame: '',
is_show: false,
is_mock: false,
mysqlName: '',
typeList: [],
tagName: '',
......@@ -442,7 +457,10 @@ export default {
this.tagName = ''
this.options = []
this.tagOptions = []
this.is_show = false
this.is_mock = false
this.debug = { key: '"0"', display_name: '' }
this.mock = { key: '"0"', display_name: '' }
fetchUserrepository({ 'namespace': 'qa-' + label }).then(res => {
this.options = res.data.repoInfo
this.server = res.data.server
......@@ -450,7 +468,9 @@ export default {
this.dialogVisible = true
},
getTag() {
this.is_show = this.reponame.split('/')[1] === 'mysql'
const realName = this.reponame.split('/')[1]
this.is_show = realName === 'mysql'
this.is_mock = realName === 'gu-bei' || realName === 'clotho'
getHostName({ project_name: this.reponame.split('/')[1] }).then(res => {
if (res.data) {
this.domain = res.data.host_name
......@@ -478,7 +498,8 @@ export default {
label: this.label,
type: this.type,
domain: this.domain.split('.')[0],
debug: this.debug.key
debug: this.debug.key,
mock: this.mock.key
}).then(res => {
this.$message({
message: res.data,
......@@ -549,7 +570,7 @@ export default {
const self = this
modifyCluService({ serviceName: this.serviceName, image: this.tagName, namespace: this.namespace, type: this.type }).then(res => {
this.$message({
message: '更新成功',
message: `更新${this.serviceName}成功`,
type: 'success',
duration: 1000,
onClose() {
......@@ -563,7 +584,7 @@ export default {
redeployClusterService({ namespace: this.namespace, podName: data.podName }).then(res => {
this.$message({
type: 'success',
message: '服务重部署成功!'
message: `服务${data.serviceName}重置成功!`
})
})
},
......
......@@ -81,7 +81,7 @@ export default {
fetchKubernetesList().then(res => {
const exculde = ['default', 'kube-system']
this.tableData = res.data.namespaces.filter((item) => {
if (!exculde.includes(item.name) && item.description !== 'dev') {
if (!exculde.includes(item.name)) {
return item
}
})
......
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