Commit 3e8fe7f3 authored by 薛智杰's avatar 薛智杰

Merge branch 'kewei' into 'master'

展示ip 端口 版本 格式化 状态



See merge request !16
parents 6c6e591a bfbb044c
...@@ -40,3 +40,25 @@ export function numberFormatter(num, digits) { ...@@ -40,3 +40,25 @@ export function numberFormatter(num, digits) {
export function toThousandFilter(num) { export function toThousandFilter(num) {
return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ',')) return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
} }
export function formatStatus(tsatus) {
switch (tsatus) {
case 'Normal':
return '正常'
case 'Abnormal' :
return '服务异常'
case 'Waiting' :
return '服务等待中'
case 'Paused' :
return '更新暂停中'
case 'Updating' :
return '服务更新中'
case 'RollingBack' :
return '服务回滚中'
default :
return '未知状态'
}
}
export function formatImages(images) {
return images.replace('ccr.ccs.tencentyun.com/qa-base/', '')
}
...@@ -32,15 +32,36 @@ ...@@ -32,15 +32,36 @@
prop="serviceName" prop="serviceName"
label="服务名" label="服务名"
/> />
<el-table-column
prop="serviceIp"
label="ip地址"
/>
<el-table-column
prop="portMappings"
label="服务端口"
width="300px">
<template slot-scope="scope">
<span v-for="item in scope.row.portMappings" :key="item.containerPort" class="port">{{ item.containerPort }}>{{ item.lbPort }}</span>
</template>
</el-table-column>
<el-table-column
prop="image"
label="镜像版本">
<template slot-scope="scope">
{{ scope.row.image | formatImages }}
</template>
</el-table-column>
<el-table-column <el-table-column
prop="createdAt" prop="createdAt"
label="日期" label="日期"
/> />
<el-tooltip class="item" effect="dark" content="Bottom Center 提示文字" placement="bottom"> <el-table-column
<el-table-column prop="status"
prop="status" label="运行状态">
label="运行状态"/> <template slot-scope="scope">
</el-tooltip> {{ scope.row.status | formatStatus }}
</template>
</el-table-column>
<el-table-column label="更多" width="80" fixed="right"> <el-table-column label="更多" width="80" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-dropdown> <el-dropdown>
...@@ -88,7 +109,11 @@ ...@@ -88,7 +109,11 @@
/> />
<el-table-column <el-table-column
prop="status" prop="status"
label="运行状态"/> label="运行状态">
<template slot-scope="scope">
{{ scope.row.status | formatStatus }}
</template>
</el-table-column>
<el-table-column <el-table-column
label="调试状态"> label="调试状态">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -556,5 +581,11 @@ export default { ...@@ -556,5 +581,11 @@ export default {
.elSelect { .elSelect {
width: 100%; width: 100%;
} }
.port{
display: inline-block;
padding: 2px;
/*background: #f0f0f0;*/
border: 1px solid #f0f2f5;
margin: 2px;
}
</style> </style>
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