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
ebfda168
Commit
ebfda168
authored
Aug 07, 2019
by
智勇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jiakewei' into 'master'
添加日期范围搜索 See merge request !35
parents
1c4aa6cd
35eb974a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
50 deletions
+58
-50
cpuDetails.vue
src/views/resources/cpuDetails.vue
+27
-24
memoryDetails.vue
src/views/resources/memoryDetails.vue
+31
-26
No files found.
src/views/resources/cpuDetails.vue
View file @
ebfda168
...
@@ -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>
...
@@ -38,7 +43,7 @@
...
@@ -38,7 +43,7 @@
</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,35 +68,33 @@ export default {
...
@@ -63,35 +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
(),
cpuResources
:
null
cpuResources
:
null
}
}
},
},
created
()
{
created
()
{
getCpu
({
create_time
:
this
.
time
}).
then
((
res
)
=>
{
this
.
fetchDate
()
console
.
log
(
res
.
data
.
length
)
if
(
res
.
data
.
length
>
0
)
{
this
.
cpuResources
=
res
.
data
[
0
].
cpu
}
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
'
)
this
.
fetchDate
()
getCpu
({
create_time
:
this
.
create_time
}).
then
((
res
)
=>
{
},
console
.
log
(
res
.
data
.
length
)
fetchDate
()
{
if
(
this
.
startTime
===
null
||
this
.
endTime
===
null
)
{
this
.
$notify
({
title
:
'
错误
'
,
message
:
'
请选择开始日期和结束日期
'
,
type
:
'
error
'
})
return
false
}
getCpu
({
startTime
:
this
.
startTime
,
endTime
:
this
.
endTime
}).
then
((
res
)
=>
{
if
(
res
.
data
.
length
>
0
)
{
if
(
res
.
data
.
length
>
0
)
{
this
.
cpuResources
=
res
.
data
[
0
].
cpu
this
.
memoryResources
=
res
.
data
}
else
{
}
else
{
this
.
cpuResources
=
null
this
.
$notify
({
this
.
$notify
({
title
:
'
警告
'
,
title
:
'
警告
'
,
message
:
'
当前日期暂无数据
'
,
message
:
'
当前日期暂无数据
'
,
...
...
src/views/resources/memoryDetails.vue
View file @
ebfda168
...
@@ -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