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
4842c1df
Commit
4842c1df
authored
Sep 03, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix: 更新监视器,动态转换Byte到KB
parent
083183e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
59 deletions
+42
-59
frontend/src/views/system/monitor.vue
frontend/src/views/system/monitor.vue
+42
-59
No files found.
frontend/src/views/system/monitor.vue
View file @
4842c1df
...
@@ -111,39 +111,39 @@
...
@@ -111,39 +111,39 @@
<div
class=
"list-element"
>
<div
class=
"list-element"
>
<div
style=
"background: yellow;"
>
<div
style=
"background: yellow;"
>
<label>
evue_free_size
</label>
<label>
evue_free_size
</label>
<p>
{{
evmList
.
evue_free_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
evue_free_size
}}
(KB)
</p>
</div>
</div>
<div
style=
"background: orange;"
>
<div
style=
"background: orange;"
>
<label>
evue_total_size
</label>
<label>
evue_total_size
</label>
<p>
{{
evmList
.
evue_total_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
evue_total_size
}}
(KB)
</p>
</div>
</div>
<div
style=
"background: orange;"
>
<div
style=
"background: orange;"
>
<label>
evue_used_size
</label>
<label>
evue_used_size
</label>
<p>
{{
evmList
.
evue_used_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
evue_used_size
}}
(KB)
</p>
</div>
</div>
<div
style=
"background: yellowgreen;"
>
<div
style=
"background: yellowgreen;"
>
<label>
ext_total_size
</label>
<label>
ext_total_size
</label>
<p>
{{
evmList
.
ext_total_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
ext_total_size
}}
(KB)
</p>
</div>
</div>
<div
style=
"background: yellowgreen;"
>
<div
style=
"background: yellowgreen;"
>
<label>
ext_used_size
</label>
<label>
ext_used_size
</label>
<p>
{{
evmList
.
ext_used_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
ext_used_size
}}
(KB)
</p>
</div>
</div>
<div
style=
"background: paleturquoise;"
>
<div
style=
"background: paleturquoise;"
>
<label>
heap_total_size
</label>
<label>
heap_total_size
</label>
<p>
{{
evmList
.
heap_total_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
heap_total_size
}}
(KB)
</p>
</div>
</div>
<div
style=
"background: paleturquoise;"
>
<div
style=
"background: paleturquoise;"
>
<label>
heap_used_size
</label>
<label>
heap_used_size
</label>
<p>
{{
evmList
.
heap_used_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
heap_used_size
}}
(KB)
</p>
</div>
</div>
<div
style=
"background: darksalmon;"
>
<div
style=
"background: darksalmon;"
>
<label>
stack_total_size
</label>
<label>
stack_total_size
</label>
<p>
{{
evmList
.
stack_total_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
stack_total_size
}}
(KB)
</p>
</div>
</div>
<div
style=
"background: darksalmon;"
>
<div
style=
"background: darksalmon;"
>
<label>
stack_used_size
</label>
<label>
stack_used_size
</label>
<p>
{{
evmList
.
stack_used_size
|
byte2kb
}}
(KB)
</p>
<p>
{{
evmList
.
stack_used_size
}}
(KB)
</p>
</div>
</div>
</div>
</div>
</grid-item>
</grid-item>
...
@@ -405,6 +405,18 @@ const indexedDb = Database(),
...
@@ -405,6 +405,18 @@ const indexedDb = Database(),
jsonFile
=
"
evue-monitor.json
"
;
jsonFile
=
"
evue-monitor.json
"
;
let
monitor
=
new
indexedDb
(
dbObject
);
let
monitor
=
new
indexedDb
(
dbObject
);
function
isNumber
(
value
)
{
return
typeof
value
===
"
number
"
&&
!
isNaN
(
value
);
}
function
byteToKiloByte
(
obj
)
{
Object
.
prototype
.
toString
.
call
(
obj
)
===
"
[object Object]
"
&&
Object
.
keys
(
obj
).
forEach
(
k
=>
{
if
(
k
.
indexOf
(
"
size
"
)
!==
-
1
&&
isNumber
(
obj
[
k
]))
{
obj
[
k
]
=
Math
.
ceil
(
obj
[
k
]
/
1024
)
}
})
}
function
resetResult
()
{
function
resetResult
()
{
return
{
return
{
systemMax
:
{},
systemMax
:
{},
...
@@ -433,6 +445,7 @@ function resetResult() {
...
@@ -433,6 +445,7 @@ function resetResult() {
};
};
}
}
// 统计使用
const
result
=
resetResult
();
const
result
=
resetResult
();
const
system
=
{
const
system
=
{
...
@@ -441,7 +454,6 @@ const system = {
...
@@ -441,7 +454,6 @@ const system = {
used_space_size
:
null
,
used_space_size
:
null
,
},
},
evm
=
{
evm
=
{
heap_map_size
:
null
,
heap_total_size
:
null
,
heap_total_size
:
null
,
heap_used_size
:
null
,
heap_used_size
:
null
,
stack_total_size
:
null
,
stack_total_size
:
null
,
...
@@ -483,7 +495,6 @@ export default {
...
@@ -483,7 +495,6 @@ export default {
evmHistory
:
[],
evmHistory
:
[],
lvglHistory
:
[],
lvglHistory
:
[],
evm
:
{
evm
:
{
heap_map_size
:
null
,
heap_total_size
:
null
,
heap_total_size
:
null
,
heap_used_size
:
null
,
heap_used_size
:
null
,
stack_total_size
:
null
,
stack_total_size
:
null
,
...
@@ -515,18 +526,6 @@ export default {
...
@@ -515,18 +526,6 @@ export default {
pngShowMode
:
true
,
pngShowMode
:
true
,
currentPngList
:
[],
currentPngList
:
[],
socket
:
null
,
socket
:
null
,
form
:
{
system
:
[
"
free_size
"
,
"
free_space_size
"
,
"
used_space_size
"
],
lvgl
:
[
"
total_size
"
,
"
free_size
"
,
"
free_biggest_size
"
],
evm
:
[
"
heap_map_size
"
,
"
heap_total_size
"
,
"
heap_used_size
"
,
"
stack_total_size
"
,
"
stack_used_size
"
,
],
image
:
[
"
png_uncompressed_size
"
,
"
png_file_size
"
,
"
length
"
],
},
layout
:
[
layout
:
[
{
x
:
0
,
y
:
0
,
w
:
6
,
h
:
5
,
i
:
"
1
"
,
static
:
false
},
{
x
:
0
,
y
:
0
,
w
:
6
,
h
:
5
,
i
:
"
1
"
,
static
:
false
},
{
x
:
6
,
y
:
0
,
w
:
6
,
h
:
5
,
i
:
"
2
"
,
static
:
true
},
{
x
:
6
,
y
:
0
,
w
:
6
,
h
:
5
,
i
:
"
2
"
,
static
:
true
},
...
@@ -771,7 +770,18 @@ export default {
...
@@ -771,7 +770,18 @@ export default {
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
});
});
},
},
queryData
()
{
onChange
(
res
)
{
if
(
!
res
)
return
null
;
var
t
=
this
.
watchs
.
find
((
item
)
=>
{
return
item
.
id
==
res
;
});
if
(
t
)
this
.
device
=
t
.
imei
;
// 清空之前数据
this
.
resetData
();
},
onSubmit
()
{
getMonitorData
({
getMonitorData
({
watch
:
this
.
device
,
watch
:
this
.
device
,
})
})
...
@@ -786,20 +796,6 @@ export default {
...
@@ -786,20 +796,6 @@ export default {
this
.
$message
.
warning
(
err
.
msg
);
this
.
$message
.
warning
(
err
.
msg
);
});
});
},
},
onChange
(
res
)
{
if
(
!
res
)
return
null
;
var
t
=
this
.
watchs
.
find
((
item
)
=>
{
return
item
.
id
==
res
;
});
if
(
t
)
this
.
device
=
t
.
imei
;
// 清空之前数据
this
.
resetData
();
},
onSubmit
()
{
this
.
queryData
();
},
onReset
(
formName
)
{
onReset
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
();
this
.
$refs
[
formName
].
resetFields
();
this
.
fetchData
();
this
.
fetchData
();
...
@@ -855,25 +851,15 @@ export default {
...
@@ -855,25 +851,15 @@ export default {
this
.
resetData
(
m
);
this
.
resetData
(
m
);
},
},
processData
(
msg
)
{
processData
(
msg
)
{
function
isNumber
(
value
)
{
if
(
Object
.
prototype
.
toString
.
call
(
msg
)
!==
"
[object Object]
"
)
return
null
;
return
typeof
value
===
"
number
"
&&
!
isNaN
(
value
);
}
if
(
!
msg
)
return
null
;
Object
.
keys
(
msg
).
forEach
((
key
)
=>
{
Object
.
keys
(
msg
).
forEach
((
item
)
=>
{
if
(
Array
.
isArray
(
msg
[
key
]))
{
if
(
this
.
form
[
item
])
{
msg
[
key
].
forEach
(
item
=>
{
var
keys
=
this
.
form
[
item
];
byteToKiloByte
(
item
)
for
(
var
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
})
var
k
=
keys
[
i
];
}
else
{
if
(
item
==
"
image
"
)
{
byteToKiloByte
(
msg
[
key
])
for
(
var
j
=
0
;
j
<
msg
[
item
].
length
;
j
++
)
{
if
(
isNumber
(
msg
[
item
][
j
][
k
]))
msg
[
item
][
j
][
k
]
=
Math
.
ceil
(
msg
[
item
][
j
][
k
]
/
1024
);
}
}
else
{
msg
[
item
][
k
]
=
Math
.
ceil
(
msg
[
item
][
k
]
/
1024
);
}
}
}
}
});
});
...
@@ -881,8 +867,6 @@ export default {
...
@@ -881,8 +867,6 @@ export default {
if
(
item
.
png_detail
&&
item
.
png_detail
.
length
)
{
if
(
item
.
png_detail
&&
item
.
png_detail
.
length
)
{
item
.
png_detail
=
item
.
png_detail
.
map
((
png
)
=>
{
item
.
png_detail
=
item
.
png_detail
.
map
((
png
)
=>
{
png
.
ratio
=
Math
.
floor
(
png
.
ratio
*
100
)
/
100
;
png
.
ratio
=
Math
.
floor
(
png
.
ratio
*
100
)
/
100
;
// png.filesize = Math.floor(png.filesize / 1024);
// png.uncompressed_size = Math.floor(png.uncompressed_size / 1024);
return
png
;
return
png
;
});
});
}
}
...
@@ -943,7 +927,6 @@ export default {
...
@@ -943,7 +927,6 @@ export default {
target
.
png_total_count
=
item
.
png_total_count
;
target
.
png_total_count
=
item
.
png_total_count
;
target
.
highlight
=
item
.
highlight
;
target
.
highlight
=
item
.
highlight
;
if
(
item
.
png_uncompressed_size
)
{
if
(
item
.
png_uncompressed_size
)
{
// target.highlight = true;
if
(
item
.
png_uncompressed_size
!==
target
.
png_uncompressed_size
)
{
if
(
item
.
png_uncompressed_size
!==
target
.
png_uncompressed_size
)
{
target
.
png_uncompressed_size
=
item
.
png_uncompressed_size
;
target
.
png_uncompressed_size
=
item
.
png_uncompressed_size
;
if
(
this
.
pngShowMode
)
this
.
pngList
=
item
.
png_detail
||
[];
if
(
this
.
pngShowMode
)
this
.
pngList
=
item
.
png_detail
||
[];
...
...
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