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
3bd48911
Commit
3bd48911
authored
Apr 16, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
c1196462
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
132 additions
and
1 deletion
+132
-1
backend/controller/apps_manager.py
backend/controller/apps_manager.py
+1
-1
backend/test/api.py
backend/test/api.py
+34
-0
backend/test/watch_launcher/Launcher.json
backend/test/watch_launcher/Launcher.json
+1
-0
backend/test/watch_launcher/app.js
backend/test/watch_launcher/app.js
+7
-0
backend/test/watch_launcher/evue_launcher.evue
backend/test/watch_launcher/evue_launcher.evue
+84
-0
backend/test/watch_launcher/evue_launcher.md5
backend/test/watch_launcher/evue_launcher.md5
+3
-0
backend/test/watch_launcher/evue_logo.bin
backend/test/watch_launcher/evue_logo.bin
+0
-0
backend/test/watch_launcher/watch_launcher.json
backend/test/watch_launcher/watch_launcher.json
+1
-0
backend/view/api.py
backend/view/api.py
+1
-0
No files found.
backend/controller/apps_manager.py
View file @
3bd48911
...
...
@@ -341,6 +341,6 @@ class AppsManager(object):
AppLogs
(
app_name
=
app
.
app_name
,
app_path
=
epk_path
,
app_version
=
app
.
app_version
,
app_info
=
app_info
,
create_by
=
user
,
create_at
=
datetime
.
now
())
commit
()
return
{
'app_name'
:
app
.
app_name
,
'app_
path
'
:
parse
.
urljoin
(
config
[
'UPLOAD_SERVER'
],
epk_path
)
},
"application build {}."
.
format
(
"success"
if
app_info
else
"fail"
)
return
{
'app_name'
:
app
.
app_name
,
'app_
file'
:
"{}.epk"
.
format
(
app
.
app_name
),
'app_url
'
:
parse
.
urljoin
(
config
[
'UPLOAD_SERVER'
],
epk_path
)
},
"application build {}."
.
format
(
"success"
if
app_info
else
"fail"
)
appsManager
=
AppsManager
()
backend/test/api.py
0 → 100644
View file @
3bd48911
import
os
import
requests
if
__name__
==
"__main__"
:
url
=
"http://localhost:5000/api/v1/evm_store/application/build"
datas
=
{
"access_key"
:
"04edb4d8-855e-11eb-9faf-00155d073e1f"
,
"app_name"
:
"test"
,
"app_version"
:
"v1.0"
,
"category"
:
"test"
,
}
# upload_files = [
# ("field1" , ("filename1", open("filePath1", "rb"))),
# ("field1" , ("filename2", open("filePath2", "rb"), "image/png")),
# ("field1" , open("filePath3", "rb")),
# ("field1" , open("filePath4", "rb").read())
# ]
upload_files
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
"./watch_launcher"
):
for
f
in
files
:
upload_files
.
append
((
"binfiles"
,
(
f
,
open
(
os
.
sep
.
join
([
root
,
f
]),
"rb"
))))
# print(upload_files)
res
=
requests
.
post
(
url
,
datas
,
files
=
upload_files
)
result
=
res
.
json
()
print
(
result
)
if
result
[
'code'
]
==
200
:
down_res
=
requests
.
get
(
url
=
result
[
'data'
][
'app_url'
])
with
open
(
result
[
'data'
][
'app_file'
],
"wb"
)
as
fd
:
fd
.
write
(
down_res
.
content
)
\ No newline at end of file
backend/test/watch_launcher/Launcher.json
0 → 100644
View file @
3bd48911
{
"appName"
:
"Launcher"
,
"appVersion"
:
"1.0"
,
"files"
:
[{
"path"
:
"C:/Launcher.json"
,
"name"
:
"Launcher.json"
,
"size"
:
723
,
"basename"
:
"Launcher"
,
"ext"
:
"json"
},
{
"path"
:
"C:/app.js"
,
"name"
:
"app.js"
,
"size"
:
126
,
"basename"
:
"app"
,
"ext"
:
"js"
},
{
"path"
:
"C:/evue_launcher.evue"
,
"name"
:
"evue_launcher.evue"
,
"size"
:
2371
,
"basename"
:
"evue_launcher"
,
"ext"
:
"evue"
},
{
"path"
:
"C:/evue_launcher.md5"
,
"name"
:
"evue_launcher.md5"
,
"size"
:
16
,
"basename"
:
"evue_launcher"
,
"ext"
:
"md5"
},
{
"path"
:
"C:/evue_logo.bin"
,
"name"
:
"evue_logo.bin"
,
"size"
:
67504
,
"basename"
:
"evue_logo"
,
"ext"
:
"bin"
},
{
"path"
:
"C:/watch_launcher.json"
,
"name"
:
"watch_launcher.json"
,
"size"
:
622
,
"basename"
:
"watch_launcher"
,
"ext"
:
"json"
}]}
\ No newline at end of file
backend/test/watch_launcher/app.js
0 → 100644
View file @
3bd48911
function
onCreate
()
{
print
(
"
Application onCreate
"
);
}
function
onDestroy
()
{
print
(
"
Application onDestroy
"
);
}
\ No newline at end of file
backend/test/watch_launcher/evue_launcher.evue
0 → 100644
View file @
3bd48911
<html>
<div
class=
"container"
>
<image
src=
"evue_logo.bin"
style=
"top: 20px;left: 40px;"
></image>
<text
style=
"top:190px;background-color: transparent; color: white;font-size: 20px;width: 240px;height: 25px;text-align: center;"
>
{{ title }}
</text>
</div>
</html>
<script>
router
=
require
(
"
@system.router
"
)
http
=
require
(
"
@system.http
"
)
fs
=
require
(
"
@system.fs
"
)
watch
=
require
(
"
@system.watch
"
)
os
=
require
(
"
@system.os
"
)
export
default
{
data
:
{
title
:
'
Power by EVM!
'
,
epk_remote_url
:
'
http://store.evmiot.com/api/v1/evm_store/download/apps
'
,
path_prefix
:
''
,
epk_name
:
'
evue_launcher.epk
'
,
fpath
:
''
,
url_dock
:
'
evue_dock
'
,
url_404
:
'
evue_404
'
,
appId
:
"
evue_launcher
"
},
onInit
:
function
()
{},
onReady
:
function
()
{
this
.
fpath
=
this
.
epk_name
;
},
onShow
:
function
()
{
setTimeout
(
function
()
{
this
.
install
();
},
10
)
},
install
:
function
()
{
this
.
installLauncherEpk
(
this
.
appId
,
this
.
epk_remote_url
)
router
.
push
({
path
:
this
.
url_dock
})
},
onHide
:
function
()
{},
onDestroy
:
function
()
{},
installLauncherEpk
:
function
(
appId
,
epk_remote_url
)
{
headers
=
[
"
Accept: application/json
"
,
"
Content-Type: application/json
"
,
"
charsets: utf-8
"
]
var
res
=
http
.
request
({
method
:
"
POST
"
,
url
:
epk_remote_url
,
headers
:
headers
,
data
:
JSON
.
stringify
({
"
id
"
:
appId
,
"
imei
"
:
watch
.
imei
()
}),
timeout
:
10000
,
responseType
:
"
epk
"
,
callback
:
function
(
res
,
len
)
{},
error
:
function
(
code
)
{}
});
}
}
</script>
<style>
.container
{
width
:
240px
;
height
:
240px
;
border-width
:
0px
;
border-radius
:
0px
;
margin
:
0px
;
padding
:
0px
;
opacity
:
0
;
background-color
:
transparent
;
align-items
:
off
;
}
</style>
\ No newline at end of file
backend/test/watch_launcher/evue_launcher.md5
0 → 100644
View file @
3bd48911
q
TMC
\ No newline at end of file
backend/test/watch_launcher/evue_logo.bin
0 → 100644
View file @
3bd48911
File added
backend/test/watch_launcher/watch_launcher.json
0 → 100644
View file @
3bd48911
{
"appName"
:
"watch_launcher"
,
"appVersion"
:
"1.0"
,
"files"
:
[{
"path"
:
"C:/watch_launcher.json"
,
"name"
:
"watch_launcher.json"
,
"size"
:
622
,
"basename"
:
"watch_launcher"
,
"ext"
:
"json"
},
{
"path"
:
"C:/app.js"
,
"name"
:
"app.js"
,
"size"
:
126
,
"basename"
:
"app"
,
"ext"
:
"js"
},
{
"path"
:
"C:/evue_launcher.evue"
,
"name"
:
"evue_launcher.evue"
,
"size"
:
2371
,
"basename"
:
"evue_launcher"
,
"ext"
:
"evue"
},
{
"path"
:
"C:/evue_launcher.md5"
,
"name"
:
"evue_launcher.md5"
,
"size"
:
16
,
"basename"
:
"evue_launcher"
,
"ext"
:
"md5"
},
{
"path"
:
"C:/evue_logo.bin"
,
"name"
:
"evue_logo.bin"
,
"size"
:
67504
,
"basename"
:
"evue_logo"
,
"ext"
:
"bin"
}]}
\ No newline at end of file
backend/view/api.py
View file @
3bd48911
...
...
@@ -79,6 +79,7 @@ def application_build():
os
.
makedirs
(
upload_path
)
for
f
in
request
.
files
.
getlist
(
'binfiles'
):
filename
=
secure_filename
(
f
.
filename
)
print
(
filename
)
file_path
=
os
.
sep
.
join
([
upload_path
,
filename
])
f
.
save
(
file_path
)
files
.
append
(
file_path
)
...
...
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