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
66098188
Commit
66098188
authored
Mar 15, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add assets
parent
1f4835b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
1 deletion
+42
-1
websocket.py
luna/views/websocket.py
+42
-1
No files found.
luna/views/websocket.py
View file @
66098188
...
@@ -21,10 +21,51 @@ __all__ = [
...
@@ -21,10 +21,51 @@ __all__ = [
@socket_io.on
(
'nav'
)
@socket_io.on
(
'nav'
)
def
handle_
api
():
def
handle_
nav
():
socket_io
.
emit
(
'nav'
,
json
.
dumps
(
nav
))
socket_io
.
emit
(
'nav'
,
json
.
dumps
(
nav
))
@socket_io.on
(
'assets'
)
def
handle_assets
():
groups_assets
=
{
'DB'
:
[
{
'id'
:
1
,
'hostname'
:
'test-db-1'
,
'ip'
:
'192.168.1.1'
,
'system_users'
:
[
{
'id'
:
3
,
'name'
:
'测试环境web'
,
'username'
:
'web'
},
{
'id'
:
6
,
'name'
:
'测试环境sa'
,
'username'
:
'sa'
},
]
}
],
'JAVA'
:
[
{
'id'
:
3
,
'hostname'
:
'test1-java'
,
'ip'
:
'120.25.240.109'
,
'port'
:
8022
,
'system_users'
:
[
{
'id'
:
3
,
'name'
:
'web'
,
'username'
:
'web'
}
]
}
]
}
socket_io
.
emit
(
'assets'
,
json
.
dumps
(
groups_assets
))
@socket_io.on
(
'connect'
,
namespace
=
'/'
)
@socket_io.on
(
'connect'
,
namespace
=
'/'
)
def
handle_term_connect
():
def
handle_term_connect
():
clients
[
request
.
sid
]
=
collections
.
defaultdict
(
dict
)
clients
[
request
.
sid
]
=
collections
.
defaultdict
(
dict
)
...
...
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