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
37574987
Commit
37574987
authored
Mar 17, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
9e94ef6b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
8 deletions
+21
-8
backend/controller/apps_manager.py
backend/controller/apps_manager.py
+5
-1
backend/controller/download_manager.py
backend/controller/download_manager.py
+0
-2
backend/model/apps.py
backend/model/apps.py
+1
-1
backend/model/build_logs.py
backend/model/build_logs.py
+1
-1
backend/view/download.py
backend/view/download.py
+2
-2
frontend/src/views/app-store/index.vue
frontend/src/views/app-store/index.vue
+12
-1
No files found.
backend/controller/apps_manager.py
View file @
37574987
...
@@ -86,6 +86,9 @@ class AppsManager(object):
...
@@ -86,6 +86,9 @@ class AppsManager(object):
epk_filename
=
os
.
sep
.
join
([
target_dir
.
replace
(
config
.
get
(
"UPLOAD_PATH"
),
""
),
"{}.epk"
.
format
(
app
.
app_name
)])
.
replace
(
'
\\
'
,
'/'
)
epk_filename
=
os
.
sep
.
join
([
target_dir
.
replace
(
config
.
get
(
"UPLOAD_PATH"
),
""
),
"{}.epk"
.
format
(
app
.
app_name
)])
.
replace
(
'
\\
'
,
'/'
)
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
app_info
.
update
({
"epk_size"
:
os
.
path
.
getsize
(
os
.
sep
.
join
([
config
.
get
(
"UPLOAD_PATH"
),
epk_filename
]))
})
result
=
BuildLogs
(
app
=
app
,
app_path
=
epk_filename
,
app_info
=
app_info
,
create_by
=
editor
,
create_at
=
datetime
.
now
(),
update_by
=
editor
,
update_at
=
datetime
.
now
())
result
=
BuildLogs
(
app
=
app
,
app_path
=
epk_filename
,
app_info
=
app_info
,
create_by
=
editor
,
create_at
=
datetime
.
now
(),
update_by
=
editor
,
update_at
=
datetime
.
now
())
commit
()
commit
()
...
@@ -137,8 +140,9 @@ class AppsManager(object):
...
@@ -137,8 +140,9 @@ class AppsManager(object):
if
result
and
len
(
result
):
if
result
and
len
(
result
):
temp
=
[]
temp
=
[]
for
item
in
result
:
for
item
in
result
:
t
=
item
.
to_dict
(
with_collections
=
True
,
related_objects
=
True
,
exclude
=
[
"app_annex"
,
"app_download"
,
"app_icon"
,
"
app_build_log"
,
"
is_delete"
,
"delete_by"
,
"delete_at"
])
t
=
item
.
to_dict
(
with_collections
=
True
,
related_objects
=
True
,
exclude
=
[
"app_annex"
,
"app_download"
,
"app_icon"
,
"is_delete"
,
"delete_by"
,
"delete_at"
])
t
.
update
({
t
.
update
({
"app_build_log"
:
item
.
app_build_log
.
to_dict
(
exclude
=
[
"is_delete"
,
"delete_by"
,
"delete_at"
,
"create_by"
,
"update_by"
]),
"create_by"
:
item
.
create_by
.
to_dict
(
only
=
[
"uuid"
,
"username"
]),
"create_by"
:
item
.
create_by
.
to_dict
(
only
=
[
"uuid"
,
"username"
]),
"update_by"
:
item
.
update_by
.
to_dict
(
only
=
[
"uuid"
,
"username"
]),
"update_by"
:
item
.
update_by
.
to_dict
(
only
=
[
"uuid"
,
"username"
]),
"create_at"
:
item
.
create_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
item
.
create_at
else
None
,
"create_at"
:
item
.
create_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
item
.
create_at
else
None
,
...
...
backend/controller/download_manager.py
View file @
37574987
...
@@ -101,10 +101,8 @@ class DownloadManager(object):
...
@@ -101,10 +101,8 @@ class DownloadManager(object):
return
False
,
"app not found"
return
False
,
"app not found"
tmp
=
app
.
to_dict
(
with_collections
=
True
,
related_objects
=
True
)
tmp
=
app
.
to_dict
(
with_collections
=
True
,
related_objects
=
True
)
if
tmp
.
get
(
"app_build_log"
):
if
tmp
.
get
(
"app_build_log"
):
epk_path
=
convert_url_to_local_path
(
tmp
.
get
(
"app_build_log"
)[
0
]
.
app_path
)
epk_path
=
convert_url_to_local_path
(
tmp
.
get
(
"app_build_log"
)[
0
]
.
app_path
)
if
not
os
.
path
.
exists
(
epk_path
):
if
not
os
.
path
.
exists
(
epk_path
):
return
False
,
"epk file not found"
return
False
,
"epk file not found"
...
...
backend/model/apps.py
View file @
37574987
...
@@ -25,7 +25,7 @@ class Apps(db.Entity):
...
@@ -25,7 +25,7 @@ class Apps(db.Entity):
app_desc
=
Optional
(
str
,
default
=
""
)
app_desc
=
Optional
(
str
,
default
=
""
)
app_annex
=
Set
(
"Annex"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_annex
=
Set
(
"Annex"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_user
=
Optional
(
"AppUser"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_user
=
Optional
(
"AppUser"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_build_log
=
Set
(
"BuildLogs"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_build_log
=
Optional
(
"BuildLogs"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_download
=
Set
(
"AppDownload"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_download
=
Set
(
"AppDownload"
,
reverse
=
"app"
,
cascade_delete
=
True
)
create_at
=
Required
(
datetime
,
default
=
datetime
.
now
)
create_at
=
Required
(
datetime
,
default
=
datetime
.
now
)
create_by
=
Required
(
"User"
,
reverse
=
'apps_creator'
)
# BuildLogs与User一对一关系
create_by
=
Required
(
"User"
,
reverse
=
'apps_creator'
)
# BuildLogs与User一对一关系
...
...
backend/model/build_logs.py
View file @
37574987
...
@@ -13,7 +13,7 @@ class BuildLogs(db.Entity):
...
@@ -13,7 +13,7 @@ class BuildLogs(db.Entity):
_table_
=
"{}"
.
format
(
config
[
'TABLE_PREFIX'
])
+
"build_logs"
_table_
=
"{}"
.
format
(
config
[
'TABLE_PREFIX'
])
+
"build_logs"
id
=
PrimaryKey
(
int
,
auto
=
True
)
id
=
PrimaryKey
(
int
,
auto
=
True
)
uuid
=
Required
(
uuid
.
UUID
,
unique
=
True
,
default
=
uuid
.
uuid1
,
index
=
True
)
uuid
=
Required
(
uuid
.
UUID
,
unique
=
True
,
default
=
uuid
.
uuid1
,
index
=
True
)
app
=
Optional
(
"Apps"
,
reverse
=
"app_build_log"
)
app
=
Required
(
"Apps"
,
reverse
=
"app_build_log"
)
app_path
=
Optional
(
str
,
default
=
""
)
app_path
=
Optional
(
str
,
default
=
""
)
app_info
=
Optional
(
Json
,
default
=
{})
app_info
=
Optional
(
Json
,
default
=
{})
create_at
=
Required
(
datetime
,
default
=
datetime
.
now
)
create_at
=
Required
(
datetime
,
default
=
datetime
.
now
)
...
...
backend/view/download.py
View file @
37574987
...
@@ -56,11 +56,11 @@ def get():
...
@@ -56,11 +56,11 @@ def get():
print
(
message
)
print
(
message
)
# 读取epk文件,按照格式返回相应结构体数据
# 读取epk文件,按照格式返回相应结构体数据
ret
=
""
ret
=
""
if
os
.
path
.
exists
(
result
):
if
isinstance
(
result
,
str
)
and
os
.
path
.
exists
(
result
):
with
open
(
result
,
"rb"
)
as
f
:
with
open
(
result
,
"rb"
)
as
f
:
ret
=
f
.
read
()
ret
=
f
.
read
()
return
ret
return
ret
return
response_result
(
ResponseCode
.
SERVER_ERROR
,
msg
=
"file not found
:
%
s"
%
"
"
)
return
response_result
(
ResponseCode
.
SERVER_ERROR
,
msg
=
"file not found"
)
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
traceback
.
print_exc
()
logger
.
error
(
str
(
e
))
logger
.
error
(
str
(
e
))
...
...
frontend/src/views/app-store/index.vue
View file @
37574987
...
@@ -39,6 +39,11 @@
...
@@ -39,6 +39,11 @@
label=
"应用路径"
label=
"应用路径"
width=
"120"
width=
"120"
></el-table-column>
></el-table-column>
<el-table-column
prop=
"epk_size"
label=
"应用大小"
width=
"120"
></el-table-column>
<el-table-column
<el-table-column
prop=
"app_desc"
prop=
"app_desc"
label=
"应用描述"
label=
"应用描述"
...
@@ -307,7 +312,13 @@ export default {
...
@@ -307,7 +312,13 @@ export default {
getAppsList
(
params
)
getAppsList
(
params
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
this
.
total
=
res
.
count
;
this
.
total
=
res
.
count
;
this
.
list
=
res
.
data
;
this
.
list
=
res
.
data
.
map
((
item
)
=>
{
if
(
item
.
app_build_log
&&
item
.
app_build_log
.
app_info
)
item
.
epk_size
=
(
item
.
app_build_log
.
app_info
.
epk_size
/
1024
).
toFixed
(
2
)
+
"
KB
"
;
else
item
.
epk_size
=
""
;
return
item
;
});
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
// this.$message.error(err.message)
// this.$message.error(err.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