Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
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
wanli
evm-store
Commits
d95fcc62
Commit
d95fcc62
authored
Sep 10, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix: 更新资源监视器前端
parent
e1bc1a28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
31 deletions
+18
-31
frontend/src/views/system/monitor.vue
frontend/src/views/system/monitor.vue
+18
-31
No files found.
frontend/src/views/system/monitor.vue
View file @
d95fcc62
...
...
@@ -369,55 +369,42 @@ function byteToKiloByte(obj) {
}
function
calculate
(
obj
,
name
,
list
)
{
result
[
name
]
=
[{
title
:
"
最新值
"
},
{
title
:
"
最旧值
"
},
{
title
:
"
最大值
"
},
{
title
:
"
最小值
"
},
{
title
:
"
平均值
"
}];
// new old max min avg
Object
.
keys
(
obj
).
forEach
((
k
)
=>
{
result
[
name
+
"
First
"
][
k
]
=
0
;
result
[
name
+
"
Last
"
][
k
]
=
0
;
let
first
=
0
,
last
=
Date
.
now
();
result
[
name
][
0
][
k
]
=
0
;
result
[
name
][
1
][
k
]
=
0
;
result
[
name
][
2
][
k
]
=
0
;
result
[
name
][
3
][
k
]
=
0
;
result
[
name
][
4
][
k
]
=
0
;
let
first
=
0
,
last
=
Date
.
now
();
const
t
=
list
.
map
((
item
)
=>
{
if
(
item
.
ts
>
first
)
{
first
=
item
.
ts
;
result
[
name
+
"
First
"
][
k
]
=
item
[
k
];
result
[
name
][
0
][
k
]
=
item
[
k
];
}
if
(
item
.
ts
<
last
)
{
last
=
item
.
ts
;
result
[
name
+
"
Last
"
][
k
]
=
item
[
k
];
result
[
name
][
1
][
k
]
=
item
[
k
];
}
return
item
[
k
];
});
result
[
name
+
"
Max
"
][
k
]
=
Math
.
max
.
apply
(
null
,
t
);
result
[
name
+
"
Min
"
][
k
]
=
Math
.
min
.
apply
(
null
,
t
);
result
[
name
+
"
Avg
"
][
k
]
=
Math
.
ceil
(
t
.
reduce
((
prev
,
curr
)
=>
prev
+
curr
)
/
t
.
length
);
result
[
name
][
2
][
k
]
=
Math
.
max
.
apply
(
null
,
t
);
result
[
name
][
3
][
k
]
=
Math
.
min
.
apply
(
null
,
t
);
result
[
name
][
4
][
k
]
=
Math
.
ceil
(
t
.
reduce
((
prev
,
curr
)
=>
prev
+
curr
)
/
t
.
length
);
});
}
function
resetResult
()
{
return
{
evmMax
:
{},
evmMin
:
{},
evmAvg
:
{},
evmFirst
:
{},
evmLast
:
{},
lvglMax
:
{},
lvglMin
:
{},
lvglAvg
:
{},
lvglFirst
:
{},
lvglLast
:
{},
systemMax
:
{},
systemMin
:
{},
systemAvg
:
{},
systemFirst
:
{},
systemLast
:
{},
systemImg
:
null
,
evm
:
[],
lvgl
:
[],
system
:
[],
evmImg
:
null
,
lvglImg
:
null
,
systemImg
:
null
,
imageList
:
[],
};
}
...
...
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