Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
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
jumpserver
Commits
cb4afabc
Commit
cb4afabc
authored
May 15, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复创建node节点的问题,修复windows session的问题
parent
ebc1b497
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
node.py
apps/assets/api/node.py
+4
-4
api.py
apps/terminal/api.py
+3
-0
No files found.
apps/assets/api/node.py
View file @
cb4afabc
...
@@ -51,10 +51,10 @@ class NodeViewSet(BulkModelViewSet):
...
@@ -51,10 +51,10 @@ class NodeViewSet(BulkModelViewSet):
else
:
else
:
return
serializers
.
NodeSerializer
return
serializers
.
NodeSerializer
#
def perform_create(self, serializer):
def
perform_create
(
self
,
serializer
):
#
child_key = Node.root().get_next_child_key()
child_key
=
Node
.
root
()
.
get_next_child_key
()
#
serializer.validated_data["key"] = child_key
serializer
.
validated_data
[
"key"
]
=
child_key
#
serializer.save()
serializer
.
save
()
class
NodeWithAssetsApi
(
generics
.
ListAPIView
):
class
NodeWithAssetsApi
(
generics
.
ListAPIView
):
...
...
apps/terminal/api.py
View file @
cb4afabc
...
@@ -108,6 +108,9 @@ class StatusViewSet(viewsets.ModelViewSet):
...
@@ -108,6 +108,9 @@ class StatusViewSet(viewsets.ModelViewSet):
task_serializer_class
=
TaskSerializer
task_serializer_class
=
TaskSerializer
def
create
(
self
,
request
,
*
args
,
**
kwargs
):
def
create
(
self
,
request
,
*
args
,
**
kwargs
):
if
self
.
request
.
query_params
.
get
(
"from_guacamole"
,
None
):
return
Response
({
"msg"
:
"From guacamole, not support now"
})
self
.
handle_sessions
()
self
.
handle_sessions
()
super
()
.
create
(
request
,
*
args
,
**
kwargs
)
super
()
.
create
(
request
,
*
args
,
**
kwargs
)
tasks
=
self
.
request
.
user
.
terminal
.
task_set
.
filter
(
is_finished
=
False
)
tasks
=
self
.
request
.
user
.
terminal
.
task_set
.
filter
(
is_finished
=
False
)
...
...
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