Commit 9660832b authored by 黎博's avatar 黎博

修复基础服务及业务服务镜像和分支显示问题,新增filters

parent 9e1cc19c
// 格式化基础镜像名
export function formatImages(images) {
// return images.map(i => i.split(':')[1]).join(',')
if (images !== null) {
return images.replace('ccr.ccs.tencentyun.com/qa-base/', '')
}
}
// 格式化java、ui、node等服务的分支名
export function filterTag(image) {
if (image != null) {
const arr = image.split(':')
return (arr && arr[1]) || ''
}
}
......@@ -13,6 +13,7 @@ import store from './store/store'
import JsonViewer from 'vue-json-viewer'
import bus from '../src/utils/bus'
import directives from '@/directives'
import * as filters from './filters' // global filters
// import Sortable from 'sortablejs'
import {
......@@ -73,6 +74,10 @@ Vue.prototype.$bus = bus
// axios.defaults.baseURL = 'https://qa-platform-pre.liangkebang.net'
// axios.defaults.baseURL = 'http://localhost:8082'
// register global utility filters.
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
Vue.use(Container)
Vue.use(Header)
Vue.use(Aside)
......
......@@ -146,7 +146,7 @@
</el-table-column>
<el-table-column prop="image" label="镜像">
<template slot-scope="scope">
{{ scope.row.image | formatImages }}
{{ scope.row.image | filterTag }}
</template>
</el-table-column>
<el-table-column prop="createdAt" width="200" label="创建时间" />
......@@ -415,10 +415,6 @@ export default {
})
},
methods: {
// 格式化镜像名
formatImages(images) {
return images.replace('ccr.ccs.tencentyun.com/qa-base/', '')
},
indexMethod(index) {
return index + 1
},
......
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