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
58053bf3
Commit
58053bf3
authored
Jul 26, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(): 解决切换设备数据污染问题
parent
9b869e37
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
5 deletions
+31
-5
frontend/src/views/system/components/EvmChart.vue
frontend/src/views/system/components/EvmChart.vue
+1
-0
frontend/src/views/system/components/LvglChart.vue
frontend/src/views/system/components/LvglChart.vue
+1
-0
frontend/src/views/system/components/SystemChart.vue
frontend/src/views/system/components/SystemChart.vue
+1
-0
frontend/src/views/system/monitor.vue
frontend/src/views/system/monitor.vue
+4
-1
tools/build_out/tests/http_interval.py
tools/build_out/tests/http_interval.py
+24
-4
No files found.
frontend/src/views/system/components/EvmChart.vue
View file @
58053bf3
...
...
@@ -145,6 +145,7 @@ export default {
});
wsNotify
.
eventBus
.
$on
(
"
clear-evm-chart
"
,
()
=>
{
chart
.
clear
();
this
.
setOptions
();
});
},
...
...
frontend/src/views/system/components/LvglChart.vue
View file @
58053bf3
...
...
@@ -169,6 +169,7 @@ export default {
});
wsNotify
.
eventBus
.
$on
(
"
clear-lvgl-chart
"
,
()
=>
{
chart
.
clear
()
this
.
setOptions
()
});
},
...
...
frontend/src/views/system/components/SystemChart.vue
View file @
58053bf3
...
...
@@ -117,6 +117,7 @@ export default {
});
wsNotify
.
eventBus
.
$on
(
"
clear-system-chart
"
,
()
=>
{
chart
.
clear
()
this
.
setOptions
()
})
},
...
...
frontend/src/views/system/monitor.vue
View file @
58053bf3
...
...
@@ -791,7 +791,6 @@ export default {
// 将设备发送过来的消息存储到浏览器中
// 这里可以优化,将所有数据,保存到indexed datebase中
const
m
=
deepClone
(
msg
);
if
(
!
this
.
deviceList
)
{
this
.
deviceList
=
[];
}
...
...
@@ -858,6 +857,10 @@ export default {
wsNotify
.
eventBus
.
$emit
(
"
clear-evm-chart
"
);
wsNotify
.
eventBus
.
$emit
(
"
clear-lvgl-chart
"
);
// 清空各个表格数据
this
.
imageList
=
[]
this
.
pngList
=
[]
// this.processData(this.devices[this.device]);
// this.resetData();
},
...
...
tools/build_out/tests/http_interval.py
View file @
58053bf3
'''
Author: your name
Date: 2021-07-22 19:01:41
LastEditTime: 2021-07-26 1
3:05:19
LastEditTime: 2021-07-26 1
6:51:21
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\t
ests
\
http_interval.py
'''
import
json
import
time
import
signal
import
random
import
requests
from
threading
import
Timer
,
Thread
thread_list
=
[]
def
sig_handler
(
sig
,
frame
):
try
:
global
thread_list
for
t
in
thread_list
:
t
.
stop
()
t
.
join
()
except
Exception
as
e
:
print
(
e
)
exit
(
0
)
def
send_request
(
imei
):
payload
=
{
...
...
@@ -94,7 +106,7 @@ def send_request(imei):
'png_file_size'
:
random
.
randint
(
0
,
10000
)
})
r
=
requests
.
post
(
"http://
store.evmiot.com
/api/v1/evm_store/monitor"
,
data
=
json
.
dumps
(
payload
))
r
=
requests
.
post
(
"http://
localhost:3000
/api/v1/evm_store/monitor"
,
data
=
json
.
dumps
(
payload
))
print
(
r
.
status_code
)
print
(
r
.
json
())
...
...
@@ -119,14 +131,22 @@ class myThread(Thread):
if
__name__
==
"__main__"
:
# send_request()
signal
.
signal
(
signal
.
SIGTERM
,
sig_handler
)
signal
.
signal
(
signal
.
SIGINT
,
sig_handler
)
# 创建新线程
thread1
=
myThread
(
1
,
"Thread-1"
,
1
,
"352099001761481"
)
thread2
=
myThread
(
2
,
"Thread-2"
,
2
,
"866866040000447"
)
thread_list
.
append
(
thread1
)
thread_list
.
append
(
thread2
)
thread1
.
setDaemon
(
'True'
)
thread1
.
setDaemon
(
'True'
)
# 开启新线程
thread1
.
start
()
thread2
.
start
()
thread1
.
join
()
thread2
.
join
()
#
thread1.join()
#
thread2.join()
print
(
"退出主线程"
)
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