Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qahome-diamond
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qahome-diamond
Commits
bfbb044c
Commit
bfbb044c
authored
Apr 04, 2019
by
kewei.jia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
展示ip 端口 版本 格式化 状态
parent
6c6e591a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
7 deletions
+60
-7
index.js
src/filters/index.js
+22
-0
envDetail.vue
src/views/docker/envDetail.vue
+38
-7
No files found.
src/filters/index.js
View file @
bfbb044c
...
...
@@ -40,3 +40,25 @@ export function numberFormatter(num, digits) {
export
function
toThousandFilter
(
num
)
{
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/
'
,
''
)
}
src/views/docker/envDetail.vue
View file @
bfbb044c
...
...
@@ -32,15 +32,36 @@
prop=
"serviceName"
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
prop=
"createdAt"
label=
"日期"
/>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"Bottom Center 提示文字"
placement=
"bottom"
>
<el-table-column
prop=
"status"
label=
"运行状态"
/>
</el-tooltip>
<el-table-column
prop=
"status"
label=
"运行状态"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
status
|
formatStatus
}}
</
template
>
</el-table-column>
<el-table-column
label=
"更多"
width=
"80"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<el-dropdown>
...
...
@@ -88,7 +109,11 @@
/>
<el-table-column
prop=
"status"
label=
"运行状态"
/>
label=
"运行状态"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
status
|
formatStatus
}}
</
template
>
</el-table-column>
<el-table-column
label=
"调试状态"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -556,5 +581,11 @@ export default {
.elSelect
{
width
:
100%
;
}
.port
{
display
:
inline-block
;
padding
:
2px
;
/*background: #f0f0f0;*/
border
:
1px
solid
#f0f2f5
;
margin
:
2px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment