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

mock

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