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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
8 deletions
+12
-8
settings.py
apps/jumpserver/settings.py
+1
-1
db.py
apps/terminal/backends/command/db.py
+3
-3
es.py
apps/terminal/backends/command/es.py
+6
-3
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 = {
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
LANGUAGE_CODE
=
'
zh-c
n'
LANGUAGE_CODE
=
'
e
n'
TIME_ZONE
=
'Asia/Shanghai'
...
...
apps/terminal/backends/command/db.py
View file @
8014cc48
...
...
@@ -73,11 +73,11 @@ class CommandStore(CommandBase):
session
=
session
,
)
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
,
user
=
None
,
asset
=
None
,
system_user
=
None
,
input
=
None
,
session
=
None
):
user
=
None
,
asset
=
None
,
system_user
=
None
,
input
=
None
,
session
=
None
):
filter_kwargs
=
self
.
make_filter_kwargs
(
date_from
=
date_from
,
date_to
=
date_to
,
user
=
user
,
asset
=
asset
,
system_user
=
system_user
,
input
=
input
,
...
...
apps/terminal/backends/command/es.py
View file @
8014cc48
...
...
@@ -3,6 +3,7 @@
from
jms_es_sdk
import
ESStore
from
.base
import
CommandBase
from
.models
import
AbstractSessionCommand
class
CommandStore
(
CommandBase
,
ESStore
):
...
...
@@ -25,11 +26,13 @@ class CommandStore(CommandBase, ESStore):
user
=
user
,
asset
=
asset
,
system_user
=
system_user
,
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
,
user
=
None
,
asset
=
None
,
system_user
=
None
,
input
=
None
,
session
=
None
):
user
=
None
,
asset
=
None
,
system_user
=
None
,
input
=
None
,
session
=
None
):
amount
=
ESStore
.
count
(
self
,
date_from
=
date_from
,
date_to
=
date_to
,
user
=
user
,
asset
=
asset
,
system_user
=
system_user
,
...
...
apps/terminal/backends/command/multi.py
View file @
8014cc48
...
...
@@ -10,9 +10,10 @@ class CommandStore(CommandBase):
def
filter
(
self
,
**
kwargs
):
queryset
=
[]
for
storage
in
self
.
storage_list
:
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
):
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