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
995e5e4f
Commit
995e5e4f
authored
Aug 13, 2019
by
kewei.jia
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/views/resources/cpuDetails.vue
parents
dff45e1e
17e4d144
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
87 deletions
+122
-87
envDetail.vue
src/views/docker/envDetail.vue
+0
-1
index.vue
src/views/proconfig/index.vue
+89
-58
cpuDetails.vue
src/views/resources/cpuDetails.vue
+2
-2
memoryDetails.vue
src/views/resources/memoryDetails.vue
+31
-26
No files found.
src/views/docker/envDetail.vue
View file @
995e5e4f
...
@@ -571,7 +571,6 @@ export default {
...
@@ -571,7 +571,6 @@ export default {
// })
// })
},
},
openRabbitmq
(
data
)
{
openRabbitmq
(
data
)
{
console
.
log
(
data
)
const
port
=
data
.
portMappings
.
filter
(
item
=>
item
.
port
===
15672
)[
0
].
nodePort
const
port
=
data
.
portMappings
.
filter
(
item
=>
item
.
port
===
15672
)[
0
].
nodePort
window
.
open
(
`http://
${
data
.
lanIp
}
:
${
port
}
/`
,
'
_blank
'
)
window
.
open
(
`http://
${
data
.
lanIp
}
:
${
port
}
/`
,
'
_blank
'
)
},
},
...
...
src/views/proconfig/index.vue
View file @
995e5e4f
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
<el-select
v-model=
"listQuery.type"
placeholder=
"项目类型"
clearable
style=
"width: 200px"
class=
"filter-item"
>
<el-select
v-model=
"listQuery.type"
placeholder=
"项目类型"
clearable
style=
"width: 200px"
class=
"filter-item"
>
<el-option
v-for=
"item in typeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
<el-option
v-for=
"item in typeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
</el-select>
<el-select
v-model=
"listQuery.is_active"
placeholder=
"是否服役"
clearable
style=
"width: 200px"
class=
"filter-item"
>
<el-option
v-for=
"item in avtiveOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
<el-select
v-model=
"listQuery.sort"
style=
"width: 140px"
class=
"filter-item"
@
change=
"handleFilter"
>
<el-select
v-model=
"listQuery.sort"
style=
"width: 140px"
class=
"filter-item"
@
change=
"handleFilter"
>
<el-option
v-for=
"item in sortOptions"
:key=
"item.key"
:label=
"item.label"
:value=
"item.key"
/>
<el-option
v-for=
"item in sortOptions"
:key=
"item.key"
:label=
"item.label"
:value=
"item.key"
/>
</el-select>
</el-select>
...
@@ -14,36 +17,34 @@
...
@@ -14,36 +17,34 @@
<el-table
<el-table
:data=
"proconfigs"
:data=
"proconfigs"
border
fit
fit
highlight-current-row
size=
"medium"
style=
"width: 100%;"
style=
"width: 100%;"
>
@
sort-change=
"sortChange"
>
<el-table-column
:label=
"$t('table.id')"
prop=
"id"
align=
"center"
width=
"
6
5"
>
<el-table-column
:label=
"$t('table.id')"
prop=
"id"
align=
"center"
width=
"
5
5"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"服务名称"
prop=
"project_name"
sortable=
"custom"
align=
"center"
>
<el-table-column
label=
"服务名称"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
class=
"link-type"
@
click=
"handleUpdate(scope.row)"
>
{{
scope
.
row
.
project_name
}}
</span>
<span
class=
"link-type"
@
click=
"handleUpdate(scope.row)"
>
{{
scope
.
row
.
project_name
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"服务描述"
align=
"center"
>
<el-table-column
label=
"服务描述"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
des
}}
</span>
<span
>
{{
scope
.
row
.
des
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"线上域名"
align=
"center"
>
<el-table-column
label=
"线上域名"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
host_name
}}
</span>
<span>
{{
scope
.
row
.
host_name
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"Git地址"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
git_path
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"负责人"
width=
"80px"
align=
"center"
>
<el-table-column
label=
"负责人"
width=
"80px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
auth
}}
</span>
<span>
{{
scope
.
row
.
auth
}}
</span>
...
@@ -54,33 +55,77 @@
...
@@ -54,33 +55,77 @@
<el-tag
:type=
"scope.row.is_active | statusFilter"
>
{{
scope
.
row
.
is_active
|
activeFileter
}}
</el-tag>
<el-tag
:type=
"scope.row.is_active | statusFilter"
>
{{
scope
.
row
.
is_active
|
activeFileter
}}
</el-tag>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"部署容器"
width=
"90px"
align=
"center"
>
<el-table-column
label=
"部署容器"
width=
"90px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.deploy_to_testenv | statusFilter"
>
{{
scope
.
row
.
deploy_to_testenv
|
deployFileter
}}
</el-tag>
<el-tag
:type=
"scope.row.deploy_to_testenv | statusFilter"
>
{{
scope
.
row
.
deploy_to_testenv
|
deployFileter
}}
</el-tag>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
:label=
"$t('table.actions')"
align=
"center"
width=
"180"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"API地址"
align=
"center"
width=
"80px"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
:content=
"scope.row.api"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-show=
"scope.row.api"
type=
"primary"
icon=
"el-icon-tickets"
circle
@
click=
"openUrl(scope.row.api)"
/>
</el-tooltip>
</
template
>
</el-table-column>
<el-table-column
label=
"DDL地址"
width=
"80px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
:content=
"scope.row.ddl"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-show=
"scope.row.ddl"
type=
"success"
icon=
"el-icon-time"
circle
@
click=
"openUrl(scope.row.ddl)"
/>
</el-tooltip>
</
template
>
</el-table-column>
<el-table-column
label=
"Wiki"
width=
"80px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
:content=
"scope.row.wiki"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-show=
"scope.row.wiki"
type=
"warning"
icon=
"el-icon-time"
circle
@
click=
"openUrl(scope.row.wiki)"
/>
</el-tooltip>
</
template
>
</el-table-column>
<el-table-column
label=
"Git地址"
width=
"80px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
:content=
"scope.row.git_path"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-show=
"scope.row.git_path"
type=
"info"
icon=
"el-icon-time"
circle
/>
</el-tooltip>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('table.actions')"
align=
"center"
width=
"70"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
{{
$t
(
'
table.edit
'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
{{
$t
(
'
table.edit
'
)
}}
</el-button>
<
el-button
v-if=
"scope.row.status!='deleted'"
size=
"mini"
type=
"danger"
@
click=
"handleDelete(scope.row)"
>
{{
$t
(
'
table.delete
'
)
}}
<
!--
<el-button
size=
"mini"
type=
"danger"
@
click=
"handleDelete(scope.row)"
>
{{
$t
(
'
table.delete
'
)
}}
</el-button>
</el-button>
-->
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> -->
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-form
ref=
"dataForm"
:
rules=
"rules"
:
model=
"temp"
label-position=
"left"
label-width=
"105px"
style=
"width: 90%; margin-left:40px;"
>
<el-form
ref=
"dataForm"
:model=
"temp"
label-position=
"left"
label-width=
"105px"
style=
"width: 90%; margin-left:40px;"
>
<el-form-item
label=
"类型"
prop=
"type"
>
<el-form-item
label=
"类型"
prop=
"type"
>
<el-select
v-model=
"temp.type"
class=
"filter-item"
placeholder=
"Please select"
>
<el-select
v-model=
"temp.type"
class=
"filter-item"
placeholder=
"Please select"
>
<el-option
v-for=
"item in typeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
<el-option
v-for=
"item in typeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"Git地址"
prop=
"git_path"
style=
"width:
100%
"
>
<el-form-item
label=
"Git地址"
prop=
"git_path"
style=
"width:
100%;
"
>
<el-input
v-model=
"temp.git_path"
/>
<el-input
v-model=
"temp.git_path"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"是否
激活
"
>
<el-form-item
label=
"是否
服役
"
>
<el-select
v-model=
"temp.is_active"
class=
"filter-item"
placeholder=
"Please select"
>
<el-select
v-model=
"temp.is_active"
class=
"filter-item"
placeholder=
"Please select"
>
<el-option
v-for=
"item in avtiveOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
<el-option
v-for=
"item in avtiveOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
</el-select>
...
@@ -90,38 +135,41 @@
...
@@ -90,38 +135,41 @@
<el-option
v-for=
"item in deployOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
<el-option
v-for=
"item in deployOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"项目描述"
style=
"width:
100%
"
>
<el-form-item
label=
"项目描述"
style=
"width:
100%;
"
>
<el-input
:autosize=
"{ minRows: 2, maxRows: 4}"
v-model=
"temp.des"
type=
"textarea"
placeholder=
"Please input"
/>
<el-input
:autosize=
"{ minRows: 2, maxRows: 4}"
v-model=
"temp.des"
type=
"textarea"
placeholder=
"Please input"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"线上域名"
prop=
"host_name"
style=
"width:100%
"
>
<el-form-item
label=
"线上域名"
style=
"width: 100%;
"
>
<el-input
v-model=
"temp.host_name"
/>
<el-input
v-model=
"temp.host_name"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"负责人"
prop=
"auth"
style=
"width:100%
"
>
<el-form-item
label=
"负责人"
style=
"width: 100%;
"
>
<el-input
v-model=
"temp.auth"
/>
<el-input
v-model=
"temp.auth"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"配置文件路径"
prop=
"config_path"
style=
"width:100%
"
>
<el-form-item
label=
"配置文件路径"
style=
"width: 100%;
"
>
<el-input
v-model=
"temp.config_path"
/>
<el-input
v-model=
"temp.config_path"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"Build文件路径"
prop=
"jar_path"
style=
"width:100%
"
>
<el-form-item
label=
"Build文件路径"
style=
"width: 100%;
"
>
<el-input
v-model=
"temp.jar_path"
/>
<el-input
v-model=
"temp.jar_path"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"日志路径"
prop=
"log_path"
style=
"width:100%
"
>
<el-form-item
label=
"日志路径"
style=
"width: 100%;
"
>
<el-input
v-model=
"temp.log_path"
/>
<el-input
v-model=
"temp.log_path"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"部署命令"
prop=
"build_command"
style=
"width:100%
"
>
<el-form-item
label=
"部署命令"
style=
"width: 100%;
"
>
<el-input
v-model=
"temp.build_command"
/>
<el-input
v-model=
"temp.build_command"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"启动命令"
prop=
"start_command"
style=
"width:100%"
>
<el-form-item
label=
"API"
style=
"width: 100%;"
>
<el-input
:autosize=
"{ minRows: 2, maxRows: 4}"
v-model=
"temp.start_command"
type=
"textarea"
/>
<el-input
v-model=
"temp.api"
/>
</el-form-item>
<el-form-item
label=
"数据库DDL"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.ddl"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
关闭命令"
prop=
"stop_command"
style=
"width:100%
"
>
<el-form-item
label=
"
Wiki"
style=
"width: 100%;
"
>
<el-input
v-model=
"temp.
stop_command
"
/>
<el-input
v-model=
"temp.
wiki
"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
{{ $t('table.cancel') }}
</el-button>
<el-button
@
click=
"dialogFormVisible = false"
>
{{ $t('table.cancel') }}
</el-button>
<el-button
type=
"primary"
@
click=
"createData()"
>
{{ $t('table.confirm') }}
</el-button>
<el-button
type=
"primary"
@
click=
"createData()"
>
{{ $t('table.confirm') }}
</el-button>
<!-- <el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">{{ $t('table.confirm') }}</el-button> -->
</div>
</div>
</el-dialog>
</el-dialog>
...
@@ -141,7 +189,6 @@
...
@@ -141,7 +189,6 @@
<
script
>
<
script
>
import
{
getProjects
,
saveProject
,
deleteProject
}
from
'
@/api/proconfig
'
import
{
getProjects
,
saveProject
,
deleteProject
}
from
'
@/api/proconfig
'
import
waves
from
'
@/directive/waves
'
// Waves directive
import
waves
from
'
@/directive/waves
'
// Waves directive
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
const
typeOptions
=
[
const
typeOptions
=
[
{
key
:
'
java
'
,
display_name
:
'
Java
'
},
{
key
:
'
java
'
,
display_name
:
'
Java
'
},
...
@@ -150,12 +197,6 @@ const typeOptions = [
...
@@ -150,12 +197,6 @@ const typeOptions = [
{
key
:
'
python
'
,
display_name
:
'
Python
'
}
{
key
:
'
python
'
,
display_name
:
'
Python
'
}
]
]
// arr to obj ,such as { CN : "China", US : "USA" }
const
calendarTypeKeyValue
=
typeOptions
.
reduce
((
acc
,
cur
)
=>
{
acc
[
cur
.
key
]
=
cur
.
display_name
return
acc
},
{})
const
avtiveOptions
=
[
const
avtiveOptions
=
[
{
key
:
true
,
display_name
:
'
服役中
'
},
{
key
:
true
,
display_name
:
'
服役中
'
},
{
key
:
false
,
display_name
:
'
退役了
'
}
{
key
:
false
,
display_name
:
'
退役了
'
}
...
@@ -177,8 +218,6 @@ const deployKeyValue = deployOptions.reduce((acc, cur) => {
...
@@ -177,8 +218,6 @@ const deployKeyValue = deployOptions.reduce((acc, cur) => {
},
{})
},
{})
export
default
{
export
default
{
name
:
'
ComplexTable
'
,
components
:
{
Pagination
},
directives
:
{
waves
},
directives
:
{
waves
},
filters
:
{
filters
:
{
statusFilter
(
status
)
{
statusFilter
(
status
)
{
...
@@ -188,9 +227,6 @@ export default {
...
@@ -188,9 +227,6 @@ export default {
}
}
return
statusMap
[
status
]
return
statusMap
[
status
]
},
},
typeFilter
(
type
)
{
return
calendarTypeKeyValue
[
type
]
},
activeFileter
(
status
)
{
activeFileter
(
status
)
{
return
activeKeyValue
[
status
]
return
activeKeyValue
[
status
]
},
},
...
@@ -202,8 +238,8 @@ export default {
...
@@ -202,8 +238,8 @@ export default {
return
{
return
{
total
:
0
,
total
:
0
,
listQuery
:
{
listQuery
:
{
project_name
:
undefined
,
// type: 'ui'
,
type
:
undefined
,
is_active
:
true
,
sort
:
'
+project_name
'
sort
:
'
+project_name
'
},
},
typeOptions
,
typeOptions
,
...
@@ -217,11 +253,6 @@ export default {
...
@@ -217,11 +253,6 @@ export default {
update
:
'
Edit
'
,
update
:
'
Edit
'
,
create
:
'
Create
'
create
:
'
Create
'
},
},
rules
:
{
// type: [{ required: true, message: 'type is required', trigger: 'change' }],
// timestamp: [{ type: 'date', required: true, message: 'timestamp is required', trigger: 'change' }],
// title: [{ required: true, message: 'title is required', trigger: 'blur' }]
},
proconfigs
:
[],
proconfigs
:
[],
avtiveOptions
,
avtiveOptions
,
deployOptions
deployOptions
...
@@ -245,6 +276,10 @@ export default {
...
@@ -245,6 +276,10 @@ export default {
this
.
getProjects
()
this
.
getProjects
()
},
},
openUrl
(
data
)
{
window
.
open
(
`
${
data
}
`
,
'
_blank
'
)
},
sortChange
(
data
)
{
sortChange
(
data
)
{
const
{
prop
,
order
}
=
data
const
{
prop
,
order
}
=
data
if
(
prop
===
'
project_name
'
)
{
if
(
prop
===
'
project_name
'
)
{
...
@@ -261,7 +296,6 @@ export default {
...
@@ -261,7 +296,6 @@ export default {
},
},
resetTemp
()
{
resetTemp
()
{
this
.
temp
=
{
this
.
temp
=
{
port
:
''
,
is_active
:
undefined
,
is_active
:
undefined
,
deploy_to_testenv
:
undefined
,
deploy_to_testenv
:
undefined
,
type
:
''
,
type
:
''
,
...
@@ -274,13 +308,10 @@ export default {
...
@@ -274,13 +308,10 @@ export default {
auth
:
''
,
auth
:
''
,
jar_path
:
''
,
jar_path
:
''
,
command1
:
''
,
command1
:
''
,
command2
:
''
,
command3
:
''
,
command4
:
''
,
command5
:
''
,
build_command
:
''
,
build_command
:
''
,
start_command
:
''
,
api
:
''
,
stop_command
:
''
ddl
:
''
,
wiki
:
''
}
}
},
},
handleCreate
()
{
handleCreate
()
{
...
...
src/views/resources/cpuDetails.vue
View file @
995e5e4f
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"服务名"
prop=
"Action"
align=
"center"
>
<el-table-column
label=
"服务名"
prop=
"Action"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
>
{{
scope
.
row
.
_id
}}
</span>
<span
>
{{
scope
.
row
.
name
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"Cpu Used Limit"
prop=
"Microservice Name"
align=
"center"
>
<el-table-column
label=
"Cpu Used Limit"
prop=
"Microservice Name"
align=
"center"
>
...
@@ -93,7 +93,7 @@ export default {
...
@@ -93,7 +93,7 @@ export default {
}
}
getCpu
({
startTime
:
this
.
startTime
,
endTime
:
this
.
endTime
}).
then
((
res
)
=>
{
getCpu
({
startTime
:
this
.
startTime
,
endTime
:
this
.
endTime
}).
then
((
res
)
=>
{
if
(
res
.
data
.
length
>
0
)
{
if
(
res
.
data
.
length
>
0
)
{
this
.
cpu
Resources
=
res
.
data
this
.
memory
Resources
=
res
.
data
}
else
{
}
else
{
this
.
$notify
({
this
.
$notify
({
title
:
'
警告
'
,
title
:
'
警告
'
,
...
...
src/views/resources/memoryDetails.vue
View file @
995e5e4f
...
@@ -2,11 +2,16 @@
...
@@ -2,11 +2,16 @@
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-date-picker
<el-date-picker
v-model=
"create_time"
v-model=
"startTime"
type=
"date"
type=
"datetime"
placeholder=
"选择日期"
dataformatas=
""
format=
"yyyy 年 MM 月 dd 日"
placeholder=
"选择日期时间"
value-format=
"yyyy-MM-dd"
/>
default-time=
"00:00:00"
/>
<el-date-picker
v-model=
"endTime"
type=
"datetime"
placeholder=
"选择日期时间"
default-time=
"23:59:59"
/>
<el-button
v-waves
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
{{
$t
(
'
table.search
'
)
}}
</el-button>
<el-button
v-waves
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
{{
$t
(
'
table.search
'
)
}}
</el-button>
</div>
</div>
...
@@ -23,22 +28,22 @@
...
@@ -23,22 +28,22 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"服务名"
prop=
"Action"
align=
"center"
>
<el-table-column
label=
"服务名"
prop=
"Action"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
>
{{
scope
.
row
.
name
}}
</span>
<span
>
{{
scope
.
row
.
_id
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"Memory Limit"
prop=
"Microservice Name"
align=
"center"
>
<el-table-column
label=
"Memory Limit
(Mib)
"
prop=
"Microservice Name"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
>
{{
scope
.
row
.
memoryLimit
}}
</span>
<span
>
{{
scope
.
row
.
memoryLimit
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"Memory Used Max"
prop=
"Namespace"
align=
"center"
>
<el-table-column
label=
"Memory Used Max
(Mib)
"
prop=
"Namespace"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
>
{{
scope
.
row
.
memoryMaxUsage
}}
</span>
<span
>
{{
scope
.
row
.
memoryMaxUsage
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"百分比"
prop=
"Namespace"
align=
"center"
>
<el-table-column
label=
"百分比"
prop=
"Namespace"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
>
{{
scope
.
row
.
Percentage
*
100
+
'
%
'
}}
</span>
<span
>
{{
(
scope
.
row
.
Percentage
*
100
).
toFixed
(
2
)
+
'
%
'
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -63,33 +68,33 @@ export default {
...
@@ -63,33 +68,33 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
create_time
:
moment
().
format
(
'
YYYY-MM-DD
'
),
startTime
:
moment
().
startOf
(
'
d
'
).
format
(),
endTime
:
moment
().
endOf
(
'
d
'
).
format
(),
memoryResources
:
null
memoryResources
:
null
}
}
},
},
created
()
{
created
()
{
getMemory
({
create_time
:
this
.
create_time
}).
then
((
res
)
=>
{
this
.
fetchDate
()
if
(
res
.
data
.
length
>
0
)
{
this
.
memoryResources
=
res
.
data
[
0
].
memory
}
else
{
this
.
$notify
({
title
:
'
警告
'
,
message
:
'
当前日期暂无数据
'
,
type
:
'
warning
'
})
}
})
},
},
methods
:
{
methods
:
{
handleFilter
()
{
handleFilter
()
{
this
.
create_time
=
this
.
create_time
?
this
.
create_time
:
moment
().
format
(
'
YYYY-MM-DD
'
)
console
.
log
(
this
.
startTime
)
getMemory
({
create_time
:
this
.
create_time
}).
then
((
res
)
=>
{
this
.
fetchDate
()
},
fetchDate
()
{
if
(
this
.
startTime
===
null
||
this
.
endTime
===
null
)
{
this
.
$notify
({
title
:
'
错误
'
,
message
:
'
请选择开始日期和结束日期
'
,
type
:
'
error
'
})
return
false
}
getMemory
({
startTime
:
this
.
startTime
,
endTime
:
this
.
endTime
}).
then
((
res
)
=>
{
if
(
res
.
data
.
length
>
0
)
{
if
(
res
.
data
.
length
>
0
)
{
this
.
memoryResources
=
res
.
data
[
0
].
memory
this
.
memoryResources
=
res
.
data
}
else
{
}
else
{
this
.
memoryResources
=
null
this
.
$notify
({
this
.
$notify
({
title
:
'
警告
'
,
title
:
'
警告
'
,
message
:
'
当前日期暂无数据
'
,
message
:
'
当前日期暂无数据
'
,
...
...
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