Commit 258641b1 authored by 智勇's avatar 智勇

异常在http服务统一处理

parent 79ebb1ea
...@@ -55,6 +55,8 @@ export function formatStatus(tsatus) { ...@@ -55,6 +55,8 @@ export function formatStatus(tsatus) {
return '服务更新中' return '服务更新中'
case 'RollingBack' : case 'RollingBack' :
return '服务回滚中' return '服务回滚中'
case 'Terminating':
return '删除中'
default : default :
return '未知状态' return '未知状态'
} }
...@@ -67,4 +69,3 @@ export function filterTag(image) { ...@@ -67,4 +69,3 @@ export function filterTag(image) {
const arr = image.split(':') const arr = image.split(':')
return (arr && arr[1]) || '' return (arr && arr[1]) || ''
} }
...@@ -102,18 +102,14 @@ export default { ...@@ -102,18 +102,14 @@ export default {
} }
createEnv(param).then(res => { createEnv(param).then(res => {
if (res.data.code === '0000') { this.$router.push({
this.$message({ path: `/dockers/runingEnv/${this.namespace}`
message: res.data.data, })
type: 'success', })
duration: 1000 this.$message({
}) message: '正在创建,请稍候',
} else { type: 'success',
this.$message({ duration: 2000
message: res.data.msg,
type: 'error'
})
}
}) })
} }
} }
......
...@@ -346,14 +346,14 @@ export default { ...@@ -346,14 +346,14 @@ export default {
fetchK8sdetail({ 'namespace': this.namespace }).then(res => { fetchK8sdetail({ 'namespace': this.namespace }).then(res => {
const servicelist = res.data.services const servicelist = res.data.services
this.array2Object(servicelist) this.array2Object(servicelist)
this.$message({
message: '服务状态已拉取',
type: 'success'
})
}) })
}, },
refresh() { refresh() {
this.getServicelist() this.getServicelist()
this.$message({
message: '状态已刷新',
type: 'success'
})
}, },
getRepository(label) { getRepository(label) {
this.label = label this.label = label
......
...@@ -87,7 +87,6 @@ export default { ...@@ -87,7 +87,6 @@ export default {
// 遍历设置 // 遍历设置
const keys = Object.keys(t) const keys = Object.keys(t)
keys.forEach(key => { keys.forEach(key => {
console.log(t, key)
if (key !== 'name' && key !== '_id') { if (key !== 'name' && key !== '_id') {
t[key].forEach(repo => { t[key].forEach(repo => {
vm.selectSystem(repo, key) vm.selectSystem(repo, key)
...@@ -103,18 +102,11 @@ export default { ...@@ -103,18 +102,11 @@ export default {
} }
createEnvTemplate(param).then(res => { createEnvTemplate(param).then(res => {
// todo: 异常在http服务统一处理 // todo: 异常在http服务统一处理
if (res.data.code === '0000') { this.$message({
this.$message({ message: res.data || '环境模板创建成功',
message: res.data.data, type: 'success',
type: 'success', duration: 1000
duration: 1000 })
})
} else {
this.$message({
message: res.data.msg,
type: 'error'
})
}
}) })
} }
} }
......
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