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
6ddc5256
Commit
6ddc5256
authored
Jul 22, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat(): 新增两个接口
parent
8ac587bd
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
345 additions
and
97 deletions
+345
-97
tools/build_out/views/__init__.py
tools/build_out/views/__init__.py
+5
-1
tools/build_out/views/menu.py
tools/build_out/views/menu.py
+215
-0
tools/build_out/views/openapi.py
tools/build_out/views/openapi.py
+114
-21
tools/build_out/views/package.20210715165358.py
tools/build_out/views/package.20210715165358.py
+0
-69
tools/frontend/src/components/GlobalHeader/RightContent.vue
tools/frontend/src/components/GlobalHeader/RightContent.vue
+4
-1
tools/frontend/src/store/modules/global-nav.js
tools/frontend/src/store/modules/global-nav.js
+2
-0
tools/frontend/src/views/Application/Manager.vue
tools/frontend/src/views/Application/Manager.vue
+5
-5
No files found.
tools/build_out/views/__init__.py
View file @
6ddc5256
'''
Author: your name
Date: 2021-07-15 03:22:19
LastEditTime: 2021-07-2
0 10:07:12
LastEditTime: 2021-07-2
2 18:51:05
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\v
iews
\
__init__.py
...
...
@@ -20,6 +20,7 @@ from . import login
from
.
import
device
from
.
import
annex
from
.
import
file
from
.
import
menu
from
.
import
monitorWatch
from
.
import
monitorSystem
from
.
import
monitorLvgl
...
...
@@ -55,6 +56,9 @@ api.add_resource(user.UserResourceList, '/user')
api
.
add_resource
(
login
.
LoginResource
,
'/login/<string:uuid>'
)
api
.
add_resource
(
login
.
LoginResourceList
,
'/login'
)
api
.
add_resource
(
menu
.
MenuResource
,
'/menu/<string:uuid>'
)
api
.
add_resource
(
menu
.
MenuResourceList
,
'/menu'
)
api
.
add_resource
(
device
.
DeviceResource
,
'/device/<string:uuid>'
)
api
.
add_resource
(
device
.
DeviceResourceList
,
'/device'
)
...
...
tools/build_out/views/menu.py
0 → 100644
View file @
6ddc5256
'''
Author: your name
Date: 2021-07-15 09:33:39
LastEditTime: 2021-07-22 18:49:47
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\v
iews
\
package.20210715165358.py
'''
from
flask
import
current_app
,
jsonify
,
request
from
flask_restful
import
Resource
from
flask_restful.reqparse
import
RequestParser
from
flask_jwt_extended
import
(
jwt_required
,
get_jwt_identity
)
from
application.signal_manager
import
signalManager
from
webcreator.log
import
logger
from
webcreator.response
import
ResponseCode
,
response_result
class
MenuResourceList
(
Resource
):
def
__init__
(
self
):
pass
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
self
.
parser
=
RequestParser
()
def
get
(
self
):
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("pageSize", type=int, location="args", default=15)
# args = self.parser.parse_args()
try
:
json_payload
=
request
.
json
logger
.
warn
(
json_payload
)
return
response_result
(
ResponseCode
.
HTTP_INVAILD_REQUEST
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
)
def
post
(
self
):
result
=
[
{
"id"
:
"1044886626813353984"
,
"parentId"
:
"0"
,
"name"
:
"dashboard"
,
"path"
:
"/dashboard"
,
"icon"
:
"dashboard"
,
"leaf"
:
False
,
"children"
:
[
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"analysis"
,
"path"
:
"/dashboard/analysis"
,
"leaf"
:
True
,
"children"
:
[]
},
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"workplace"
,
"path"
:
"/dashboard/workplace"
,
"leaf"
:
True
,
"children"
:
[]
}
]
},
{
"id"
:
"1044886626813353984"
,
"parentId"
:
"0"
,
"name"
:
"system"
,
"path"
:
"/system"
,
"icon"
:
"setting"
,
"leaf"
:
False
,
"children"
:
[
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"setting"
,
"path"
:
"/system/setting"
,
"leaf"
:
False
,
"children"
:
[
{
"id"
:
"1044886630026190848"
,
"parentId"
:
"1044886629921333248"
,
"name"
:
"menu"
,
"path"
:
"/system/setting/menu"
,
"leaf"
:
True
,
"children"
:
[]
},
{
"id"
:
"1044886630122659840"
,
"parentId"
:
"1044886629921333248"
,
"name"
:
"module"
,
"path"
:
"/system/setting/module"
,
"leaf"
:
True
,
"children"
:
[]
},
{
"id"
:
"1044886630122659841"
,
"parentId"
:
"1044886629921333248"
,
"name"
:
"file-manager"
,
"path"
:
"/system/setting/file-manager"
,
"leaf"
:
True
,
"children"
:
[]
}
]
},
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"role"
,
"path"
:
"/system/role"
,
"leaf"
:
True
},
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"admin"
,
"path"
:
"/system/admin"
,
"leaf"
:
True
}
]
},
{
"id"
:
"1044886626813353984"
,
"icon"
:
"shop"
,
"parentId"
:
"0"
,
"name"
:
"application"
,
"path"
:
"/application"
,
"leaf"
:
False
,
"children"
:
[
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"index"
,
"path"
:
"/application/index"
,
"leaf"
:
True
,
"children"
:
[]
},
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"manager"
,
"path"
:
"/application/manager"
,
"leaf"
:
True
,
"children"
:
[]
}
]
},
{
"id"
:
"1044886626813353984"
,
"icon"
:
"usb"
,
"parentId"
:
"0"
,
"name"
:
"device"
,
"path"
:
"/device"
,
"leaf"
:
False
,
"children"
:
[
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"index"
,
"path"
:
"/device/index"
,
"leaf"
:
True
,
"children"
:
[]
}
]
},
{
"id"
:
"1044886626813353984"
,
"icon"
:
"tool"
,
"parentId"
:
"0"
,
"name"
:
"tools"
,
"path"
:
"/tools"
,
"leaf"
:
False
,
"children"
:
[
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"monitor"
,
"path"
:
"/tools/monitor"
,
"leaf"
:
True
,
"children"
:
[]
},
{
"id"
:
"1044886629921333248"
,
"parentId"
:
"1044886626813353984"
,
"name"
:
"index"
,
"path"
:
"/tools/index"
,
"leaf"
:
True
,
"children"
:
[]
}
]
}
]
return
response_result
(
ResponseCode
.
HTTP_SUCCESS
,
data
=
result
)
class
MenuResource
(
Resource
):
def
__init__
(
self
):
pass
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# self.parser = RequestParser()
@
jwt_required
(
locations
=
[
"headers"
])
def
get
(
self
,
uuid
):
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("pageSize", type=int, location="args", default=15)
# args = self.parser.parse_args()
try
:
json_payload
=
request
.
json
print
(
"========>"
,
uuid
,
json_payload
)
return
response_result
(
ResponseCode
.
HTTP_NOT_FOUND
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
)
tools/build_out/views/openapi.py
View file @
6ddc5256
This diff is collapsed.
Click to expand it.
tools/build_out/views/package.20210715165358.py
deleted
100644 → 0
View file @
8ac587bd
'''
Author: your name
Date: 2021-07-15 09:33:39
LastEditTime: 2021-07-16 19:27:36
LastEditors: your name
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\v
iews
\
package.20210715165358.py
'''
from
flask
import
current_app
,
jsonify
,
request
from
flask_restful
import
Resource
from
flask_restful.reqparse
import
RequestParser
from
flask_jwt_extended
import
(
jwt_required
,
get_jwt_identity
)
from
application.signal_manager
import
signalManager
from
models.package
import
getListPackageSchema
,
getListPackagesSchema
,
getPackageSchema
from
webcreator.log
import
logger
from
webcreator.response
import
ResponseCode
,
response_result
class
PackageResourceList
(
Resource
):
def
__init__
(
self
):
pass
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
self
.
parser
=
RequestParser
()
def
get
(
self
):
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("pageSize", type=int, location="args", default=15)
# args = self.parser.parse_args()
try
:
json_payload
=
request
.
json
logger
.
warn
(
json_payload
)
data
=
getListPackageSchema
.
load
(
json_payload
)
result
=
signalManager
.
actionGetListPackage
.
emit
(
data
)
json_dumps
=
getListPackageSchema
.
dump
(
result
)
if
result
[
0
]:
json_dumps
=
getListPackagesSchema
.
dump
(
result
[
1
])
logger
.
warn
(
json_dumps
)
return
response_result
(
ResponseCode
.
OK
,
data
=
json_dumps
,
count
=
result
[
2
])
return
response_result
(
ResponseCode
.
REQUEST_ERROR
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
response_result
(
ResponseCode
.
DB_ERROR
)
class
PackageResource
(
Resource
):
def
__init__
(
self
):
pass
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# self.parser = RequestParser()
@
jwt_required
(
locations
=
[
"headers"
])
def
get
(
self
,
uuid
):
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("pageSize", type=int, location="args", default=15)
# args = self.parser.parse_args()
try
:
json_payload
=
request
.
json
print
(
"========>"
,
uuid
,
json_payload
)
data
=
getPackageSchema
.
load
(
json_payload
)
result
=
signalManager
.
actionGetPackage
.
emit
(
uuid
,
data
)
if
result
[
0
]:
json_dumps
=
getPackageSchema
.
dump
(
result
[
1
])
return
response_result
(
ResponseCode
.
OK
,
data
=
json_dumps
)
return
response_result
(
ResponseCode
.
NO_DATA
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
response_result
(
ResponseCode
.
DB_ERROR
)
tools/frontend/src/components/GlobalHeader/RightContent.vue
View file @
6ddc5256
...
...
@@ -112,7 +112,7 @@
src=
"https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
alt=
"avatar"
/>
<span
class=
"name"
>
EVM
</span>
<span
class=
"name"
>
{{
userinfo
.
name
}}
</span>
</span>
<a-menu
slot=
"overlay"
class=
"menu"
>
...
...
@@ -226,6 +226,9 @@ export default {
}
return
className
;
},
userinfo
()
{
return
this
.
$store
.
state
.
frontend
.
login
.
userinfo
}
},
};
</
script
>
tools/frontend/src/store/modules/global-nav.js
View file @
6ddc5256
...
...
@@ -167,9 +167,11 @@ const state = {
const
actions
=
{
[
"
getMenuNav
"
]({
commit
,
state
},
config
)
{
state
.
loading
=
true
;
console
.
log
(
config
)
return
new
Promise
((
resolve
,
reject
)
=>
{
menuNav
()
.
then
((
response
)
=>
{
console
.
log
(
response
)
// console.log(mock);
commit
(
"
setMenuNav
"
,
mock
);
state
.
loading
=
false
;
...
...
tools/frontend/src/views/Application/Manager.vue
View file @
6ddc5256
...
...
@@ -233,11 +233,11 @@ export default {
methods
:
{
handleDownload
(
record
)
{
download
(
`
${
record
.
app_name
}
_
${
record
.
app_version
}
.epk`
,
record
.
file_path
)
.
then
((
res
)
=>
{
message
.
success
(
res
.
msg
);
.
then
(()
=>
{
message
.
success
(
"
下载成功
"
)
})
.
catch
((
err
)
=>
{
message
.
error
(
err
.
msg
);
.
catch
(()
=>
{
message
.
error
(
"
下载失败
"
)
});
},
hadnleEdit
(
record
)
{
...
...
@@ -261,7 +261,7 @@ export default {
message
.
success
(
res
.
msg
);
if
(
res
.
code
==
200
)
{
this
.
tableData
.
list
=
res
.
data
.
map
(
item
=>
{
if
(
item
.
source
==
1
)
item
.
source_text
=
"
Frontend
"
if
(
item
.
source
==
0
)
item
.
source_text
=
"
Frontend
"
else
item
.
source_text
=
"
API
"
return
item
;
});
...
...
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