Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
l y
Jumpserver
Commits
a1e2d4ca
Unverified
Commit
a1e2d4ca
authored
3 years ago
by
feng626
Committed by
GitHub
3 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #7081 from jumpserver/pr@dev@command_record_filter
fix: 命令记录-导出选择项命令:却导出了所有命令
parents
203a0124
8a413563
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/terminal/backends/command/es.py
+15
-3
apps/terminal/backends/command/es.py
with
15 additions
and
3 deletions
+15
-3
apps/terminal/backends/command/es.py
+
15
-
3
View file @
a1e2d4ca
...
...
@@ -131,10 +131,13 @@ class CommandStore():
index
=
self
.
index
,
doc_type
=
self
.
doc_type
,
body
=
body
,
from_
=
from_
,
size
=
size
,
sort
=
sort
)
source_data
=
[]
for
item
in
data
[
'hits'
][
'hits'
]:
if
item
:
item
[
'_source'
].
update
({
'id'
:
item
[
'_id'
]})
source_data
.
append
(
item
[
'_source'
])
return
AbstractSessionCommand
.
from_multi_dict
(
[
item
[
'_source'
]
for
item
in
data
[
'hits'
][
'hits'
]
if
item
]
)
return
AbstractSessionCommand
.
from_multi_dict
(
source_data
)
def
count
(
self
,
**
query
):
body
=
self
.
get_query_body
(
**
query
)
...
...
@@ -160,11 +163,16 @@ class CommandStore():
new_kwargs
[
k
]
=
str
(
v
)
if
isinstance
(
v
,
UUID
)
else
v
kwargs
=
new_kwargs
index_in_field
=
'id__in'
exact_fields
=
self
.
exact_fields
match_fields
=
self
.
match_fields
match
=
{}
exact
=
{}
index
=
{}
if
index_in_field
in
kwargs
:
index
[
'values'
]
=
kwargs
[
index_in_field
]
for
k
,
v
in
kwargs
.
items
():
if
k
in
exact_fields
:
...
...
@@ -221,6 +229,10 @@ class CommandStore():
'timestamp'
:
timestamp_range
}
}
]
+
[
{
'ids'
:
{
k
:
v
}
}
for
k
,
v
in
index
.
items
()
]
}
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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