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
b3079a4a
Unverified
Commit
b3079a4a
authored
Dec 19, 2018
by
老广
Committed by
GitHub
Dec 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] Add index (#2208)
parent
9a228743
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
24 additions
and
32 deletions
+24
-32
0020_auto_20180816_1652.py
apps/assets/migrations/0020_auto_20180816_1652.py
+7
-7
0022_auto_20181012_1717.py
apps/assets/migrations/0022_auto_20181012_1717.py
+2
-2
0002_ftplog_org_id.py
apps/audits/migrations/0002_ftplog_org_id.py
+1
-1
0003_auto_20180816_1652.py
apps/audits/migrations/0003_auto_20180816_1652.py
+1
-1
0004_operatelog_passwordchangelog_userloginlog.py
...rations/0004_operatelog_passwordchangelog_userloginlog.py
+1
-1
mixins.py
apps/orgs/mixins.py
+1
-1
0008_auto_20180816_1652.py
apps/perms/migrations/0008_auto_20180816_1652.py
+2
-2
0011_auto_20180807_1116.py
apps/terminal/migrations/0011_auto_20180807_1116.py
+2
-2
0012_auto_20180816_1652.py
apps/terminal/migrations/0012_auto_20180816_1652.py
+0
-10
utils.py
apps/terminal/utils.py
+6
-4
0014_auto_20180816_1652.py
apps/users/migrations/0014_auto_20180816_1652.py
+1
-1
No files found.
apps/assets/migrations/0020_auto_20180816_1652.py
View file @
b3079a4a
...
...
@@ -13,36 +13,36 @@ class Migration(migrations.Migration):
migrations
.
AlterField
(
model_name
=
'adminuser'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'asset'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'domain'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'gateway'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'label'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'node'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'systemuser'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
]
apps/assets/migrations/0022_auto_20181012_1717.py
View file @
b3079a4a
...
...
@@ -16,7 +16,7 @@ class Migration(migrations.Migration):
migrations
.
CreateModel
(
name
=
'CommandFilter'
,
fields
=
[
(
'org_id'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
)),
(
'org_id'
,
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
)),
(
'id'
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
,
serialize
=
False
)),
(
'name'
,
models
.
CharField
(
max_length
=
64
,
verbose_name
=
'Name'
)),
(
'is_active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'Is active'
)),
...
...
@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
migrations
.
CreateModel
(
name
=
'CommandFilterRule'
,
fields
=
[
(
'org_id'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
)),
(
'org_id'
,
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
)),
(
'id'
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
,
serialize
=
False
)),
(
'type'
,
models
.
CharField
(
choices
=
[(
'regex'
,
'Regex'
),
(
'command'
,
'Command'
)],
default
=
'command'
,
max_length
=
16
,
verbose_name
=
'Type'
)),
(
'priority'
,
models
.
IntegerField
(
default
=
50
,
help_text
=
'1-100, the lower will be match first'
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
1
),
django
.
core
.
validators
.
MaxValueValidator
(
100
)],
verbose_name
=
'Priority'
)),
...
...
apps/audits/migrations/0002_ftplog_org_id.py
View file @
b3079a4a
...
...
@@ -13,6 +13,6 @@ class Migration(migrations.Migration):
migrations
.
AddField
(
model_name
=
'ftplog'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
None
,
max_length
=
36
,
null
=
True
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
None
,
max_length
=
36
,
null
=
True
),
),
]
apps/audits/migrations/0003_auto_20180816_1652.py
View file @
b3079a4a
...
...
@@ -13,6 +13,6 @@ class Migration(migrations.Migration):
migrations
.
AlterField
(
model_name
=
'ftplog'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
]
apps/audits/migrations/0004_operatelog_passwordchangelog_userloginlog.py
View file @
b3079a4a
...
...
@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
migrations
.
CreateModel
(
name
=
'OperateLog'
,
fields
=
[
(
'org_id'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
)),
(
'org_id'
,
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
)),
(
'id'
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
,
serialize
=
False
)),
(
'user'
,
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'User'
)),
(
'action'
,
models
.
CharField
(
choices
=
[(
'create'
,
'Create'
),
(
'update'
,
'Update'
),
(
'delete'
,
'Delete'
)],
max_length
=
16
,
verbose_name
=
'Action'
)),
...
...
apps/orgs/mixins.py
View file @
b3079a4a
...
...
@@ -74,7 +74,7 @@ class OrgManager(models.Manager):
class
OrgModelMixin
(
models
.
Model
):
org_id
=
models
.
CharField
(
max_length
=
36
,
blank
=
True
,
default
=
''
,
verbose_name
=
_
(
"Organization"
))
org_id
=
models
.
CharField
(
max_length
=
36
,
blank
=
True
,
default
=
''
,
verbose_name
=
_
(
"Organization"
)
,
db_index
=
True
)
objects
=
OrgManager
()
sep
=
'@'
...
...
apps/perms/migrations/0008_auto_20180816_1652.py
View file @
b3079a4a
...
...
@@ -13,11 +13,11 @@ class Migration(migrations.Migration):
migrations
.
AlterField
(
model_name
=
'assetpermission'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'nodepermission'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
]
apps/terminal/migrations/0011_auto_20180807_1116.py
View file @
b3079a4a
...
...
@@ -13,11 +13,11 @@ class Migration(migrations.Migration):
migrations
.
AddField
(
model_name
=
'command'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
d
efault
=
None
,
max_length
=
36
,
null
=
True
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AddField
(
model_name
=
'session'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
d
efault
=
None
,
max_length
=
36
,
null
=
True
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
]
apps/terminal/migrations/0012_auto_20180816_1652.py
View file @
b3079a4a
...
...
@@ -10,14 +10,4 @@ class Migration(migrations.Migration):
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'command'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'session'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
]
apps/terminal/utils.py
View file @
b3079a4a
# -*- coding: utf-8 -*-
#
from
django.core.cache
import
cache
from
.models
import
Session
from
assets.models
import
Asset
,
SystemUser
from
users.models
import
User
from
.const
import
USERS_CACHE_KEY
,
ASSETS_CACHE_KEY
,
SYSTEM_USER_CACHE_KEY
def
get_session_asset_list
():
return
set
(
list
(
Session
.
objects
.
values_list
(
'asset'
,
flat
=
True
))
)
return
Asset
.
objects
.
values_list
(
'hostname'
,
flat
=
True
)
def
get_session_user_list
():
return
set
(
list
(
Session
.
objects
.
values_list
(
'user'
,
flat
=
True
))
)
return
User
.
objects
.
values_list
(
'username'
,
flat
=
True
)
def
get_session_system_user_list
():
return
set
(
list
(
Session
.
objects
.
values_list
(
'system_user'
,
flat
=
True
))
)
return
SystemUser
.
objects
.
values_list
(
'username'
,
flat
=
True
)
def
get_user_list_from_cache
():
...
...
apps/users/migrations/0014_auto_20180816_1652.py
View file @
b3079a4a
...
...
@@ -13,6 +13,6 @@ class Migration(migrations.Migration):
migrations
.
AlterField
(
model_name
=
'usergroup'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
field
=
models
.
CharField
(
blank
=
True
,
d
b_index
=
True
,
d
efault
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
]
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