Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
ops
luna
Commits
18597586
Commit
18597586
authored
Mar 31, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Change] 添加leftbar api
parent
3cd172fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
__init__.py
luna/views/__init__.py
+2
-1
views.py
luna/views/views.py
+12
-2
No files found.
luna/views/__init__.py
View file @
18597586
__version__
=
'0.0.1'
from
.views
import
*
from
.websocket
import
*
__version__
=
'0.0.1'
luna/views/views.py
View file @
18597586
...
...
@@ -39,6 +39,7 @@ def version():
@app.route
(
'/api/nav'
)
@login_required
def
nav
():
with
open
(
os
.
path
.
join
(
API_MOCK_DIR
,
'nav'
))
as
f
:
response
=
json
.
load
(
f
)
...
...
@@ -46,9 +47,18 @@ def nav():
@app.route
(
'/api/leftbar'
)
@login_required
def
leftbar
():
with
open
(
os
.
path
.
join
(
API_MOCK_DIR
,
'leftbar'
))
as
f
:
response
=
json
.
load
(
f
)
response
=
[]
user_service
=
g
.
user_service
asset_groups_assets
=
user_service
.
get_my_asset_groups_assets
()
for
asset_group
in
asset_groups_assets
:
asset_group
[
'title'
]
=
asset_group
[
'name'
]
asset_group
[
'children'
]
=
asset_group
[
'assets'
]
asset_group
[
'folder'
]
=
True
for
asset
in
asset_group
[
'children'
]:
asset
[
'title'
]
=
asset
[
'hostname'
]
response
.
append
(
asset_group
)
return
jsonify
(
response
)
...
...
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