Commit 87deb187 authored by ibuler's avatar ibuler

[Update] 修改command 批量执行左侧选择系统用户

parent 82a63695
......@@ -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]
......
......@@ -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'
}
......
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment