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
8014cc48
Commit
8014cc48
authored
Mar 28, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改settings和缩进
parent
829f57e2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
settings.py
apps/jumpserver/settings.py
+1
-1
db.py
apps/terminal/backends/command/db.py
+1
-1
es.py
apps/terminal/backends/command/es.py
+4
-1
multi.py
apps/terminal/backends/command/multi.py
+2
-1
No files found.
apps/jumpserver/settings.py
View file @
8014cc48
...
@@ -234,7 +234,7 @@ LOGGING = {
...
@@ -234,7 +234,7 @@ LOGGING = {
# Internationalization
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
# https://docs.djangoproject.com/en/1.10/topics/i18n/
LANGUAGE_CODE
=
'
zh-c
n'
LANGUAGE_CODE
=
'
e
n'
TIME_ZONE
=
'Asia/Shanghai'
TIME_ZONE
=
'Asia/Shanghai'
...
...
apps/terminal/backends/command/db.py
View file @
8014cc48
...
@@ -73,7 +73,7 @@ class CommandStore(CommandBase):
...
@@ -73,7 +73,7 @@ class CommandStore(CommandBase):
session
=
session
,
session
=
session
,
)
)
queryset
=
self
.
model
.
objects
.
filter
(
**
filter_kwargs
)
queryset
=
self
.
model
.
objects
.
filter
(
**
filter_kwargs
)
return
[
command
.
to_dict
()
for
command
in
queryset
]
return
queryset
def
count
(
self
,
date_from
=
None
,
date_to
=
None
,
def
count
(
self
,
date_from
=
None
,
date_to
=
None
,
user
=
None
,
asset
=
None
,
system_user
=
None
,
user
=
None
,
asset
=
None
,
system_user
=
None
,
...
...
apps/terminal/backends/command/es.py
View file @
8014cc48
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
from
jms_es_sdk
import
ESStore
from
jms_es_sdk
import
ESStore
from
.base
import
CommandBase
from
.base
import
CommandBase
from
.models
import
AbstractSessionCommand
class
CommandStore
(
CommandBase
,
ESStore
):
class
CommandStore
(
CommandBase
,
ESStore
):
...
@@ -25,7 +26,9 @@ class CommandStore(CommandBase, ESStore):
...
@@ -25,7 +26,9 @@ class CommandStore(CommandBase, ESStore):
user
=
user
,
asset
=
asset
,
system_user
=
system_user
,
user
=
user
,
asset
=
asset
,
system_user
=
system_user
,
input
=
input
,
session
=
session
input
=
input
,
session
=
session
)
)
return
[
item
[
"_source"
]
for
item
in
data
[
"hits"
]
if
item
]
return
AbstractSessionCommand
.
from_multi_dict
(
[
item
[
"_source"
]
for
item
in
data
[
"hits"
]
if
item
]
)
def
count
(
self
,
date_from
=
None
,
date_to
=
None
,
def
count
(
self
,
date_from
=
None
,
date_to
=
None
,
user
=
None
,
asset
=
None
,
system_user
=
None
,
user
=
None
,
asset
=
None
,
system_user
=
None
,
...
...
apps/terminal/backends/command/multi.py
View file @
8014cc48
...
@@ -10,9 +10,10 @@ class CommandStore(CommandBase):
...
@@ -10,9 +10,10 @@ class CommandStore(CommandBase):
def
filter
(
self
,
**
kwargs
):
def
filter
(
self
,
**
kwargs
):
queryset
=
[]
queryset
=
[]
for
storage
in
self
.
storage_list
:
for
storage
in
self
.
storage_list
:
queryset
.
extend
(
storage
.
filter
(
**
kwargs
))
queryset
.
extend
(
storage
.
filter
(
**
kwargs
))
return
sorted
(
queryset
,
key
=
lambda
command
:
command
[
"timestamp"
]
,
reverse
=
True
)
return
sorted
(
queryset
,
key
=
lambda
command
:
command
.
timestamp
,
reverse
=
True
)
def
count
(
self
,
**
kwargs
):
def
count
(
self
,
**
kwargs
):
amount
=
0
amount
=
0
...
...
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