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
87deb187
Commit
87deb187
authored
Oct 22, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改command 批量执行左侧选择系统用户
parent
82a63695
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
manager.py
apps/assets/backends/manager.py
+0
-2
command_execution_create.html
apps/ops/templates/ops/command_execution_create.html
+2
-3
command.py
apps/ops/views/command.py
+1
-1
No files found.
apps/assets/backends/manager.py
View file @
87deb187
...
...
@@ -67,8 +67,6 @@ class AssetUserManager:
return
AssetUserQuerySet
(
instances
)
def
get
(
self
,
username
,
asset
,
**
kwargs
):
print
(
username
)
print
(
asset
)
instances
=
self
.
filter
(
username
,
assets
=
[
asset
],
**
kwargs
)
if
len
(
instances
)
==
1
:
return
instances
[
0
]
...
...
apps/ops/templates/ops/command_execution_create.html
View file @
87deb187
...
...
@@ -80,9 +80,7 @@
<select
class=
"select2 form-control"
id=
"system-users-select"
>
{% for s in system_users %}
{% if s.protocol == 'ssh' and s.login_mode == 'auto' %}
<option
value=
"{{ s.id }}"
>
{{ s }}
</option>
{% endif %}
<option
value=
"{{ s.id }}"
{%
if
s
.
protocol
!=
'
ssh
'
or
s
.
login_mode
!=
'
auto
'
%}
disabled
{%
endif
%}
>
{{ s }}
</option>
{% endfor %}
</select>
<button
type=
"button"
...
...
@@ -207,6 +205,7 @@
lineHeight
:
1
,
rightClickSelectsWord
:
true
,
disableStdin
:
true
,
cursorBlink
:
false
,
theme
:
{
background
:
'#1f1b1b'
}
...
...
apps/ops/views/command.py
View file @
87deb187
...
...
@@ -70,7 +70,7 @@ class CommandExecutionStartView(PermissionsMixin, TemplateView):
user
=
self
.
request
.
user
with
tmp_to_root_org
():
util
=
AssetPermissionUtilV2
(
user
)
system_users
=
[
s
for
s
in
util
.
get_system_users
()
if
s
.
protocol
==
'ssh'
]
system_users
=
util
.
get_system_users
()
return
system_users
def
get_context_data
(
self
,
**
kwargs
):
...
...
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