Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
guo xiaoyong
Jumpserver
Commits
cdf3cf3e
Unverified
Commit
cdf3cf3e
authored
4 years ago
by
Jiangjie.Bai
Committed by
GitHub
4 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #4667 from jumpserver/dev
fix(command): 修复命令导出选中项问题
parents
47f2df0a
11856457
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/terminal/api/command.py
+0
-17
apps/terminal/api/command.py
with
0 additions
and
17 deletions
+0
-17
apps/terminal/api/command.py
+
0
-
17
View file @
cdf3cf3e
...
...
@@ -3,7 +3,6 @@
import
time
from
django.utils
import
timezone
from
django.shortcuts
import
HttpResponse
from
django.core.cache
import
cache
from
rest_framework
import
viewsets
from
rest_framework
import
generics
from
rest_framework.fields
import
DateTimeField
...
...
@@ -14,7 +13,6 @@ from django.template import loader
from
orgs.utils
import
current_org
from
common.permissions
import
IsOrgAdminOrAppUser
,
IsOrgAuditor
from
common.utils
import
get_logger
from
common
import
const
from
..backends
import
(
get_command_storage
,
get_multi_command_storage
,
SessionCommandSerializer
,
...
...
@@ -64,23 +62,8 @@ class CommandQueryMixin:
)
return
queryset
def
filter_queryset_spm
(
self
,
queryset
):
spm
=
self
.
request
.
query_params
.
get
(
'spm'
)
if
not
spm
:
return
queryset
cache_key
=
const
.
KEY_CACHE_RESOURCES_ID
.
format
(
spm
)
resources_id
=
cache
.
get
(
cache_key
)
if
resources_id
is
None
or
not
isinstance
(
resources_id
,
list
):
return
queryset
if
isinstance
(
queryset
,
list
):
queryset
=
[
q
for
q
in
queryset
if
q
[
'id'
]
in
resources_id
]
else
:
queryset
=
queryset
.
filter
(
id__in
=
resources_id
)
return
queryset
def
filter_queryset
(
self
,
queryset
):
# 解决es存储命令时,父类根据filter_fields过滤出现异常的问题,返回的queryset类型list
queryset
=
self
.
filter_queryset_spm
(
queryset
)
return
queryset
def
get_date_range
(
self
):
...
...
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
Menu
Projects
Groups
Snippets
Help