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
8e74a042
Commit
8e74a042
authored
May 09, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改一些bug
parent
0a9af987
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
system_user.py
apps/assets/api/system_user.py
+3
-0
base.py
apps/assets/models/base.py
+5
-0
api.py
apps/common/api.py
+1
-8
asset_permission_list.html
apps/perms/templates/perms/asset_permission_list.html
+1
-1
No files found.
apps/assets/api/system_user.py
View file @
8e74a042
...
...
@@ -58,6 +58,9 @@ class SystemUserPushApi(generics.RetrieveAPIView):
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
system_user
=
self
.
get_object
()
nodes
=
system_user
.
nodes
.
all
()
for
node
in
nodes
:
system_user
.
assets
.
add
(
*
tuple
(
node
.
get_all_assets
()))
task
=
push_system_user_to_assets_manual
.
delay
(
system_user
)
return
Response
({
"task"
:
task
.
id
})
...
...
apps/assets/models/base.py
View file @
8e74a042
...
...
@@ -104,6 +104,11 @@ class AssetUser(models.Model):
if
update_fields
:
self
.
save
(
update_fields
=
update_fields
)
def
clear_auth
(
self
):
self
.
_password
=
''
self
.
_private_key
=
''
self
.
save
()
def
auto_gen_auth
(
self
):
password
=
str
(
uuid
.
uuid4
())
private_key
,
public_key
=
ssh_key_gen
(
...
...
apps/common/api.py
View file @
8e74a042
...
...
@@ -96,14 +96,7 @@ class LDAPTestingAPI(APIView):
class
DjangoSettingsAPI
(
APIView
):
def
get
(
self
,
request
):
if
not
settings
.
DEBUG
:
return
Response
(
'Only debug mode support'
)
configs
=
{}
for
i
in
dir
(
settings
):
if
i
.
isupper
():
configs
[
i
]
=
str
(
getattr
(
settings
,
i
))
return
Response
(
configs
)
return
Response
(
'Danger, Close now'
)
apps/perms/templates/perms/asset_permission_list.html
View file @
8e74a042
...
...
@@ -250,7 +250,7 @@ function initTree() {
{
#
$
.
fn
.
zTree
.
init
(
$
(
"#assetTree"
),
setting
);
#
}
$
.
fn
.
zTree
.
init
(
$
(
"#assetTree"
),
setting
,
zNodes
);
zTree
=
$
.
fn
.
zTree
.
getZTreeObj
(
"assetTree"
);
selectQueryNode
();
{
#
selectQueryNode
();
#
}
});
}
...
...
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