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
37d89b4e
Commit
37d89b4e
authored
Aug 01, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tmp_org' into org
parents
227cc4e9
87e0e1f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
asset.py
apps/assets/models/asset.py
+6
-0
asset.py
apps/assets/serializers/asset.py
+4
-4
No files found.
apps/assets/models/asset.py
View file @
37d89b4e
...
...
@@ -161,6 +161,12 @@ class Asset(OrgModelMixin):
nodes
=
list
(
reduce
(
lambda
x
,
y
:
set
(
x
)
|
set
(
y
),
nodes
))
return
nodes
@property
def
org_name
(
self
):
from
orgs.models
import
Organization
org
=
Organization
.
get_instance
(
self
.
org_id
)
return
org
.
name
@property
def
hardware_info
(
self
):
if
self
.
cpu_count
:
...
...
apps/assets/serializers/asset.py
View file @
37d89b4e
...
...
@@ -25,7 +25,7 @@ class AssetSerializer(BulkSerializerMixin, serializers.ModelSerializer):
def
get_field_names
(
self
,
declared_fields
,
info
):
fields
=
super
()
.
get_field_names
(
declared_fields
,
info
)
fields
.
extend
([
'hardware_info'
,
'is_connective'
,
'hardware_info'
,
'is_connective'
,
'org_name'
])
return
fields
...
...
@@ -43,7 +43,7 @@ class AssetGrantedSerializer(serializers.ModelSerializer):
fields
=
(
"id"
,
"hostname"
,
"ip"
,
"port"
,
"system_users_granted"
,
"is_active"
,
"system_users_join"
,
"os"
,
'domain'
,
"platform"
,
"comment"
,
"protocol"
,
"org_id"
,
"platform"
,
"comment"
,
"protocol"
,
"org_id"
,
"org_name"
,
)
@staticmethod
...
...
@@ -61,6 +61,6 @@ class MyAssetGrantedSerializer(AssetGrantedSerializer):
model
=
Asset
fields
=
(
"id"
,
"hostname"
,
"system_users_granted"
,
"is_active"
,
"system_users_join"
,
"os"
,
"platform"
,
"comment"
,
"is_active"
,
"system_users_join"
,
"org_name"
,
"os"
,
"platform"
,
"comment"
,
"org_id"
,
"protocol"
)
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