Merge pull request #3889 from jumpserver/dev_bai

Dev bai
pull/3891/head
BaiJiangJie 2020-04-14 12:55:35 +08:00 committed by GitHub
commit 043aa08f23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View File

@ -83,7 +83,7 @@ $(document).ready(function () {
var $this = $(this);
var name = "{{ object.name}}";
var uid = "{{ object.id }}";
var the_url = '{% url "api-assets:asset-platform-detail" pk=DEFAULT_PK %}'.replace('{{ DEFAULT_PK }}', uid);
var the_url = '{% url "api-assets:platform-detail" pk=DEFAULT_PK %}'.replace('{{ DEFAULT_PK }}', uid);
var redirect_url = "{% url 'assets:platform-list' %}";
objectDelete($this, name, the_url, redirect_url);
})

View File

@ -44,7 +44,7 @@
<select class="select2 form-control" name="action">
<option value="">{% trans 'Action' %}</option>
{% for k, v in actions.items %}
<option value="{{ k }}" {% if k == action %} selected {% endif %}>{{ v }}</option>
<option value="{{ k }}" {% if k == search_action %} selected {% endif %}>{{ v }}</option>
{% endfor %}
</select>
</div>

View File

@ -120,8 +120,9 @@ class OperateLogListView(PermissionsMixin, DatetimeSearchMixin, ListView):
def get_context_data(self, **kwargs):
context = {
'user_list': current_org.get_org_members(),
'user_list': [str(user) for user in current_org.get_org_members()],
'actions': self.actions_dict,
'search_action': self.action,
'resource_type_list': get_resource_type_list(),
'date_from': self.date_from,
'date_to': self.date_to,
@ -160,7 +161,7 @@ class PasswordChangeLogList(PermissionsMixin, DatetimeSearchMixin, ListView):
def get_context_data(self, **kwargs):
context = {
'user_list': current_org.get_org_members(),
'user_list': [str(user) for user in current_org.get_org_members()],
'date_from': self.date_from,
'date_to': self.date_to,
'user': self.user,
@ -245,7 +246,7 @@ class CommandExecutionListView(UserCommandExecutionListView):
'action': _('Command execution log'),
'date_from': self.date_from,
'date_to': self.date_to,
'user_list': self.get_user_list(),
'user_list': [(str(user.id), user) for user in self.get_user_list()],
'keyword': self.keyword,
'user_id': self.user_id,
})

View File

@ -39,8 +39,8 @@
<div class="input-group">
<select class="select2 form-control" name="user">
<option value="">{% trans 'User' %}</option>
{% for u in user_list %}
<option value="{{ u.id }}" {% if u.id == user_id %} selected {% endif %}>{{ u }}</option>
{% for id, u in user_list %}
<option value="{{ id }}" {% if id == user_id %} selected {% endif %}>{{ u }}</option>
{% endfor %}
</select>
</div>