Commit 08cf6dd2 authored by 智勇's avatar 智勇

创建ns支持多集群

parent d52dd8a2
...@@ -45,21 +45,16 @@ export function formatStatus(tsatus) { ...@@ -45,21 +45,16 @@ export function formatStatus(tsatus) {
case 'Active': case 'Active':
case 'Normal': case 'Normal':
return '正常' return '正常'
case 'Abnormal' :
return '服务启动中'
case 'Pending': case 'Pending':
return 'Pod等待中'
case 'Waiting' : case 'Waiting' :
return '服务等待中' return '服务等待中'
case 'Paused' :
return '更新暂停中'
case 'PodScheduling': case 'PodScheduling':
return 'Pod调度中' return 'Pod调度中'
case 'Initializing': case 'ContainerCreating':
return '初始化中' return '容器创建中'
case 'Updating' : // case 'RollingBack' :
return '服务更新中' // return '服务回滚中'
case 'RollingBack' :
return '服务回滚中'
case 'Terminating': case 'Terminating':
return '删除中' return '删除中'
default : default :
......
...@@ -106,6 +106,7 @@ export default { ...@@ -106,6 +106,7 @@ export default {
return item.serviceName.indexOf('mysql') > -1 return item.serviceName.indexOf('mysql') > -1
}) })
this.sqlList = mysqlList this.sqlList = mysqlList
this.temp.mysqlName = this.sqlList[0].serviceName
}) })
}, },
getNamespace() { getNamespace() {
......
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
<el-input v-model="namespace" placeholder="请输入,必输"/> <el-input v-model="namespace" placeholder="请输入,必输"/>
</el-form-item> </el-form-item>
<el-form-item label="所属集群" >
<el-select v-model="cluster" style="width:100%" placeholder="请选择,必选">
<el-option v-for="item in clusterArray" :value="item" :key="item" />
</el-select>
</el-form-item>
<el-form-item label="环境归属" > <el-form-item label="环境归属" >
<el-select v-model="group" style="width:100%" placeholder="请选择,必选"> <el-select v-model="group" style="width:100%" placeholder="请选择,必选">
<el-option v-for="item in groups" :value="item" :key="item" /> <el-option v-for="item in groups" :value="item" :key="item" />
...@@ -46,7 +52,7 @@ ...@@ -46,7 +52,7 @@
</template> </template>
<script> <script>
import { getBaseRepos, getAllEnvTemplate, createEnv, getGroup } from '@/api/docker' import { getBaseRepos, getAllEnvTemplate, createEnv, getGroup, getCluster } from '@/api/docker'
import permission from '@/directive/permission/index.js' // 权限判断指令 import permission from '@/directive/permission/index.js' // 权限判断指令
export default { export default {
...@@ -67,7 +73,9 @@ export default { ...@@ -67,7 +73,9 @@ export default {
currentTemplate: '', currentTemplate: '',
templates: {}, templates: {},
groups: [], groups: [],
group: '' group: '',
clusterArray: [],
cluster: ''
} }
}, },
...@@ -75,6 +83,7 @@ export default { ...@@ -75,6 +83,7 @@ export default {
this.getAllRepos() this.getAllRepos()
this.getAllEnvTemplate() this.getAllEnvTemplate()
this.getGroup() this.getGroup()
this.getCluster()
}, },
methods: { methods: {
...@@ -90,6 +99,17 @@ export default { ...@@ -90,6 +99,17 @@ export default {
}) })
}, },
getCluster() {
getCluster().then(res => {
this.clusterArray = res.data
})
},
changeCluster() {
this.$store.dispatch('changeCluster', this.cluster)
sessionStorage.setItem('cluster', this.cluster)
},
getAllEnvTemplate() { getAllEnvTemplate() {
getAllEnvTemplate().then(res => { getAllEnvTemplate().then(res => {
this.templates = res.data this.templates = res.data
...@@ -127,11 +147,14 @@ export default { ...@@ -127,11 +147,14 @@ export default {
const param = { const param = {
namespace: this.namespace, namespace: this.namespace,
description: this.group, description: this.group,
cluster: this.cluster,
dependant: { dependant: {
base: this.dependant.base base: this.dependant.base
} }
} }
this.changeCluster()
createEnv(param).then(res => { createEnv(param).then(res => {
this.$router.push({ this.$router.push({
path: `/dockers/runingEnv/${this.namespace}` path: `/dockers/runingEnv/${this.namespace}`
......
...@@ -657,6 +657,7 @@ export default { ...@@ -657,6 +657,7 @@ export default {
type: 'success' type: 'success'
}) })
this.dialogHost = false this.dialogHost = false
this.getServicelist()
}) })
} }
}) })
...@@ -743,7 +744,7 @@ export default { ...@@ -743,7 +744,7 @@ export default {
}, },
deleteService(data, item) { deleteService(data, item) {
this.$confirm( this.$confirm(
'此操作将删除服务, 是否继续?', `此操作将删除 ${data.serviceName} 服务, 是否继续?`,
'提示', '提示',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
......
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