diff --git a/apps/audits/__init__.py b/apps/audits/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/audits/admin.py b/apps/audits/admin.py new file mode 100644 index 000000000..8c38f3f3d --- /dev/null +++ b/apps/audits/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/apps/audits/api.py b/apps/audits/api.py new file mode 100644 index 000000000..0d583d246 --- /dev/null +++ b/apps/audits/api.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# + +from rest_framework import viewsets + +from common.permissions import IsSuperUserOrAppUser +from .models import FTPLog +from .serializers import FTPLogSerializer + + +class FTPLogViewSet(viewsets.ModelViewSet): + queryset = FTPLog.objects.all() + serializer_class = FTPLogSerializer + permission_classes = (IsSuperUserOrAppUser,) diff --git a/apps/audits/apps.py b/apps/audits/apps.py new file mode 100644 index 000000000..f049f49bd --- /dev/null +++ b/apps/audits/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AuditsConfig(AppConfig): + name = 'audits' diff --git a/apps/audits/models.py b/apps/audits/models.py new file mode 100644 index 000000000..667087e18 --- /dev/null +++ b/apps/audits/models.py @@ -0,0 +1,16 @@ +import uuid + +from django.db import models +from django.utils.translation import ugettext_lazy as _ + + +class FTPLog(models.Model): + id = models.UUIDField(default=uuid.uuid4, primary_key=True) + user = models.CharField(max_length=128, verbose_name=_('User')) + remote_addr = models.CharField(max_length=15, verbose_name=_("Remote addr"), blank=True, null=True) + asset = models.CharField(max_length=1024, verbose_name=_("Asset")) + system_user = models.CharField(max_length=128, verbose_name=_("System user")) + operate = models.CharField(max_length=16, verbose_name=_("Operate")) + filename = models.CharField(max_length=1024, verbose_name=_("Filename")) + is_success = models.BooleanField(default=True, verbose_name=_("Success")) + date_start = models.DateTimeField(auto_now_add=True) diff --git a/apps/audits/serializers.py b/apps/audits/serializers.py new file mode 100644 index 000000000..8aa0301b0 --- /dev/null +++ b/apps/audits/serializers.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# + +from rest_framework import serializers + +from .models import FTPLog + + +class FTPLogSerializer(serializers.ModelSerializer): + + class Meta: + model = FTPLog + fields = '__all__' diff --git a/apps/audits/templates/audits/ftp_log_list.html b/apps/audits/templates/audits/ftp_log_list.html new file mode 100644 index 000000000..f5d4e5b7f --- /dev/null +++ b/apps/audits/templates/audits/ftp_log_list.html @@ -0,0 +1,135 @@ +{% extends '_base_list.html' %} +{% load i18n %} +{% load static %} +{% load terminal_tags %} +{% load common_tags %} +{% block custom_head_css_js %} + + + + +{% endblock %} + +{% block content_left_head %} +{% endblock %} + + +{% block table_search %} +
+
+
+ + + to + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+{% endblock %} + +{% block table_head %} + +{# {% trans 'ID' %}#} + {% trans 'User' %} + {% trans 'Asset' %} + {% trans 'System user' %} + {% trans 'Remote addr' %} + {% trans 'Operate' %} + {% trans 'Filename' %} + {% trans 'Success' %} + {% trans 'Date start' %} +{# {% trans 'Action' %}#} +{% endblock %} + +{% block table_body %} + {% for object in object_list %} + + +{# #} +{# {{ forloop.counter }}#} +{# #} + {{ object.user }} + {{ object.asset }} + {{ object.system_user }} + {{ object.remote_addr|default:"" }} + {{ object.operate }} + {{ object.filename }} + + {% if object.is_success %} + + {% else %} + + {% endif %} + + {{ object.date_start }} + + {% endfor %} +{% endblock %} + +{% block content_bottom_left %} +{% endblock %} + +{% block custom_foot_js %} + + +{% endblock %} + diff --git a/apps/audits/tests.py b/apps/audits/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/apps/audits/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/apps/audits/urls/__init__.py b/apps/audits/urls/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/audits/urls/api_urls.py b/apps/audits/urls/api_urls.py new file mode 100644 index 000000000..f90057ca2 --- /dev/null +++ b/apps/audits/urls/api_urls.py @@ -0,0 +1,18 @@ +# ~*~ coding: utf-8 ~*~ +from __future__ import unicode_literals + +from django.conf.urls import url +from rest_framework.routers import DefaultRouter +from .. import api + + +app_name = "audits" + +router = DefaultRouter() +router.register(r'v1/ftp-log', api.FTPLogViewSet, 'ftp-log') + +urlpatterns = [ +# url(r'^v1/celery/task/(?P[0-9a-zA-Z\-]{36})/log/$', api.CeleryTaskLogApi.as_view(), name='celery-task-log'), +] + +urlpatterns += router.urls diff --git a/apps/audits/urls/view_urls.py b/apps/audits/urls/view_urls.py new file mode 100644 index 000000000..76afbef84 --- /dev/null +++ b/apps/audits/urls/view_urls.py @@ -0,0 +1,14 @@ +# ~*~ coding: utf-8 ~*~ +from __future__ import unicode_literals + + +from django.conf.urls import url +from .. import views + +__all__ = ["urlpatterns"] + +app_name = "audits" + +urlpatterns = [ + url(r'^ftp-log/$', views.FTPLogListView.as_view(), name='ftp-log-list'), +] diff --git a/apps/audits/views.py b/apps/audits/views.py new file mode 100644 index 000000000..072d13f60 --- /dev/null +++ b/apps/audits/views.py @@ -0,0 +1,51 @@ +from django.conf import settings +from django.views.generic import ListView + +from common.mixins import AdminUserRequiredMixin, DatetimeSearchMixin + +from .models import FTPLog + + +class FTPLogListView(AdminUserRequiredMixin, DatetimeSearchMixin, ListView): + model = FTPLog + template_name = 'audits/ftp_log_list.html' + paginate_by = settings.DISPLAY_PER_PAGE + user = asset = system_user = filename = '' + date_from = date_to = None + + def get_queryset(self): + self.queryset = super().get_queryset() + self.user = self.request.GET.get('user') + self.asset = self.request.GET.get('asset') + self.system_user = self.request.GET.get('system_user') + self.filename = self.request.GET.get('filename', '') + + filter_kwargs = dict() + filter_kwargs['date_start__gt'] = self.date_from + filter_kwargs['date_start__lt'] = self.date_to + if self.user: + filter_kwargs['user'] = self.user + if self.asset: + filter_kwargs['asset'] = self.asset + if self.system_user: + filter_kwargs['system_user'] = self.system_user + if self.filename: + filter_kwargs['filename__contains'] = self.filename + if filter_kwargs: + self.queryset = self.queryset.filter(**filter_kwargs).order_by('-date_start') + return self.queryset + + def get_context_data(self, **kwargs): + context = { + 'user_list': FTPLog.objects.values_list('user', flat=True).distinct(), + 'asset_list': FTPLog.objects.values_list('asset', flat=True).distinct(), + 'system_user_list': FTPLog.objects.values_list('system_user', flat=True).distinct(), + 'date_from': self.date_from, + 'date_to': self.date_to, + 'user': self.user, + 'asset': self.asset, + 'system_user': self.system_user, + 'filename': self.filename, + } + kwargs.update(context) + return super().get_context_data(**kwargs) diff --git a/apps/i18n/zh/LC_MESSAGES/django.mo b/apps/i18n/zh/LC_MESSAGES/django.mo index 033a23bea..57d3d9d92 100644 Binary files a/apps/i18n/zh/LC_MESSAGES/django.mo and b/apps/i18n/zh/LC_MESSAGES/django.mo differ diff --git a/apps/i18n/zh/LC_MESSAGES/django.po b/apps/i18n/zh/LC_MESSAGES/django.po index 7d305070e..e19a33c25 100644 --- a/apps/i18n/zh/LC_MESSAGES/django.po +++ b/apps/i18n/zh/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Jumpserver 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-02 15:49+0800\n" +"POT-Creation-Date: 2018-04-06 10:24+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: Jumpserver team\n" @@ -21,11 +21,11 @@ msgstr "" msgid "New node {}" msgstr "新节点 {}" -#: assets/api/node.py:134 +#: assets/api/node.py:133 msgid "更新节点资产硬件信息: {}" msgstr "" -#: assets/api/node.py:147 +#: assets/api/node.py:146 msgid "测试节点下资产是否可连接: {}" msgstr "" @@ -100,7 +100,9 @@ msgstr "选择节点" #: assets/templates/assets/domain_detail.html:60 #: assets/templates/assets/domain_list.html:15 #: assets/templates/assets/label_list.html:16 -#: assets/templates/assets/system_user_list.html:29 perms/models.py:17 +#: assets/templates/assets/system_user_list.html:29 audits/models.py:11 +#: audits/templates/audits/ftp_log_list.html:41 +#: audits/templates/audits/ftp_log_list.html:72 perms/models.py:17 #: terminal/backends/command/models.py:11 terminal/models.py:123 #: terminal/templates/terminal/command_list.html:40 #: terminal/templates/terminal/command_list.html:73 @@ -122,7 +124,7 @@ msgstr "资产" #: assets/templates/assets/system_user_list.html:26 common/models.py:26 #: common/templates/common/terminal_setting.html:67 #: common/templates/common/terminal_setting.html:85 ops/models/adhoc.py:36 -#: ops/templates/ops/task_detail.html:59 ops/templates/ops/task_list.html:34 +#: ops/templates/ops/task_detail.html:59 ops/templates/ops/task_list.html:35 #: perms/models.py:14 perms/templates/perms/asset_permission_detail.html:62 #: perms/templates/perms/asset_permission_user.html:54 terminal/models.py:16 #: terminal/models.py:149 terminal/templates/terminal/terminal_detail.html:43 @@ -402,7 +404,9 @@ msgstr "资产组" msgid "Default asset group" msgstr "默认资产组" -#: assets/models/label.py:14 perms/models.py:15 +#: assets/models/label.py:14 audits/models.py:9 +#: audits/templates/audits/ftp_log_list.html:33 +#: audits/templates/audits/ftp_log_list.html:71 perms/models.py:15 #: terminal/backends/command/models.py:10 terminal/models.py:122 #: terminal/templates/terminal/command_list.html:32 #: terminal/templates/terminal/command_list.html:72 @@ -445,8 +449,11 @@ msgstr "Sudo" msgid "Shell" msgstr "Shell" -#: assets/models/user.py:150 perms/forms.py:25 perms/models.py:19 -#: perms/models.py:76 perms/templates/perms/asset_permission_detail.html:136 +#: assets/models/user.py:150 audits/models.py:12 +#: audits/templates/audits/ftp_log_list.html:49 +#: audits/templates/audits/ftp_log_list.html:73 perms/forms.py:25 +#: perms/models.py:19 perms/models.py:76 +#: perms/templates/perms/asset_permission_detail.html:136 #: perms/templates/perms/asset_permission_list.html:69 templates/_nav.html:26 #: terminal/backends/command/models.py:12 terminal/models.py:124 #: terminal/templates/terminal/command_list.html:48 @@ -493,7 +500,7 @@ msgstr "" msgid "推送系统用户到节点资产: {} => {}" msgstr "" -#: assets/tasks.py:432 +#: assets/tasks.py:433 msgid "推送节点系统用户到新加入资产中: {}" msgstr "" @@ -586,7 +593,6 @@ msgstr "激活中" #: assets/templates/assets/_asset_list_modal.html:24 #: assets/templates/assets/admin_user_assets.html:54 #: assets/templates/assets/admin_user_list.html:26 -#: assets/templates/assets/asset_detail.html:359 #: assets/templates/assets/asset_list.html:90 #: assets/templates/assets/system_user_asset.html:52 #: assets/templates/assets/system_user_list.html:30 @@ -603,7 +609,7 @@ msgstr "可连接" #: assets/templates/assets/label_list.html:17 #: assets/templates/assets/system_user_list.html:34 #: ops/templates/ops/adhoc_history.html:59 ops/templates/ops/task_adhoc.html:64 -#: ops/templates/ops/task_history.html:65 ops/templates/ops/task_list.html:41 +#: ops/templates/ops/task_history.html:65 ops/templates/ops/task_list.html:42 #: perms/templates/perms/asset_permission_list.html:72 #: terminal/templates/terminal/session_list.html:80 #: terminal/templates/terminal/terminal_list.html:36 @@ -672,7 +678,7 @@ msgstr "提交" #: assets/templates/assets/domain_detail.html:24 #: assets/templates/assets/domain_detail.html:103 #: assets/templates/assets/domain_gateway_list.html:90 -#: assets/templates/assets/domain_list.html:38 +#: assets/templates/assets/domain_list.html:42 #: assets/templates/assets/label_list.html:38 #: assets/templates/assets/system_user_detail.html:26 #: assets/templates/assets/system_user_list.html:88 @@ -697,11 +703,11 @@ msgstr "更新" #: assets/templates/assets/domain_detail.html:28 #: assets/templates/assets/domain_detail.html:104 #: assets/templates/assets/domain_gateway_list.html:91 -#: assets/templates/assets/domain_list.html:39 +#: assets/templates/assets/domain_list.html:43 #: assets/templates/assets/label_list.html:39 #: assets/templates/assets/system_user_detail.html:30 #: assets/templates/assets/system_user_list.html:89 -#: ops/templates/ops/task_list.html:71 +#: ops/templates/ops/task_list.html:72 #: perms/templates/perms/asset_permission_detail.html:34 #: perms/templates/perms/asset_permission_list.html:122 #: terminal/templates/terminal/terminal_list.html:73 @@ -812,17 +818,13 @@ msgstr "测试可连接性" msgid "Test" msgstr "测试" -#: assets/templates/assets/admin_user_assets.html:131 -msgid "Task has been send, seen left asset status" -msgstr "任务已下发,查看左侧资产状态" - #: assets/templates/assets/admin_user_detail.html:83 msgid "Replace node assets admin user with this" msgstr "替换资产的管理员" #: assets/templates/assets/admin_user_detail.html:100 #: assets/templates/assets/asset_detail.html:200 -#: assets/templates/assets/asset_list.html:594 +#: assets/templates/assets/asset_list.html:600 #: assets/templates/assets/system_user_detail.html:183 #: assets/templates/assets/system_user_list.html:138 templates/_modal.html:16 #: terminal/templates/terminal/session_detail.html:108 @@ -899,7 +901,7 @@ msgstr "更新硬件信息" msgid "Refresh" msgstr "刷新" -#: assets/templates/assets/asset_detail.html:301 +#: assets/templates/assets/asset_detail.html:300 #: users/templates/users/user_detail.html:273 msgid "Update successfully!" msgstr "更新成功" @@ -955,7 +957,7 @@ msgstr "创建节点失败" msgid "Have child node, cancel" msgstr "存在子节点,不能删除" -#: assets/templates/assets/asset_list.html:589 +#: assets/templates/assets/asset_list.html:595 #: assets/templates/assets/system_user_list.html:133 #: users/templates/users/user_detail.html:334 #: users/templates/users/user_detail.html:359 @@ -964,20 +966,20 @@ msgstr "存在子节点,不能删除" msgid "Are you sure?" msgstr "你确认吗?" -#: assets/templates/assets/asset_list.html:590 +#: assets/templates/assets/asset_list.html:596 msgid "This will delete the selected assets !!!" msgstr "删除选择资产" -#: assets/templates/assets/asset_list.html:598 +#: assets/templates/assets/asset_list.html:604 msgid "Asset Deleted." msgstr "已被删除" -#: assets/templates/assets/asset_list.html:599 -#: assets/templates/assets/asset_list.html:604 +#: assets/templates/assets/asset_list.html:605 +#: assets/templates/assets/asset_list.html:610 msgid "Asset Delete" msgstr "删除" -#: assets/templates/assets/asset_list.html:603 +#: assets/templates/assets/asset_list.html:609 msgid "Asset Deleting failed." msgstr "删除失败" @@ -1045,12 +1047,10 @@ msgid "Test assets connective" msgstr "测试资产可连接性" #: assets/templates/assets/system_user_asset.html:147 -#: assets/templates/assets/system_user_detail.html:303 msgid "Task has been send, Go to ops task list seen result" msgstr "任务已下发,查看ops任务列表" #: assets/templates/assets/system_user_asset.html:159 -#: assets/templates/assets/system_user_detail.html:315 msgid "Task has been send, seen left assets status" msgstr "任务已下发,查看左侧资产状态" @@ -1120,7 +1120,7 @@ msgstr "批量更新资产" msgid "Update asset" msgstr "更新资产" -#: assets/views/asset.py:299 +#: assets/views/asset.py:300 msgid "already exists" msgstr "已经存在" @@ -1172,6 +1172,28 @@ msgstr "资产管理" msgid "System user asset" msgstr "系统用户集群资产" +#: audits/models.py:10 audits/templates/audits/ftp_log_list.html:74 +#: terminal/models.py:126 terminal/templates/terminal/session_list.html:74 +#: terminal/templates/terminal/terminal_detail.html:47 +msgid "Remote addr" +msgstr "远端地址" + +#: audits/models.py:13 audits/templates/audits/ftp_log_list.html:75 +msgid "Operate" +msgstr "操作" + +#: audits/models.py:14 audits/templates/audits/ftp_log_list.html:76 +msgid "Filename" +msgstr "文件名" + +#: audits/templates/audits/ftp_log_list.html:77 +#: ops/templates/ops/adhoc_history.html:52 +#: ops/templates/ops/adhoc_history_detail.html:61 +#: ops/templates/ops/task_history.html:58 terminal/models.py:132 +#: terminal/templates/terminal/session_list.html:77 +msgid "Date start" +msgstr "开始日期" + #: common/api.py:18 msgid "Test mail sent to {}, please check" msgstr "邮件已经发送{}, 请检查" @@ -1381,7 +1403,7 @@ msgid "Type" msgstr "类型" #: common/views.py:21 common/views.py:47 common/views.py:73 common/views.py:103 -#: templates/_nav.html:73 +#: templates/_nav.html:81 msgid "Settings" msgstr "系统设置" @@ -1423,7 +1445,7 @@ msgid "Options" msgstr "选项" #: ops/models/adhoc.py:157 ops/templates/ops/adhoc_detail.html:53 -#: ops/templates/ops/task_adhoc.html:59 ops/templates/ops/task_list.html:37 +#: ops/templates/ops/task_adhoc.html:59 ops/templates/ops/task_list.html:38 msgid "Hosts" msgstr "主机" @@ -1454,7 +1476,7 @@ msgid "End time" msgstr "完成时间" #: ops/models/adhoc.py:325 ops/templates/ops/adhoc_history.html:57 -#: ops/templates/ops/task_history.html:63 ops/templates/ops/task_list.html:40 +#: ops/templates/ops/task_history.html:63 ops/templates/ops/task_list.html:41 msgid "Time" msgstr "时间" @@ -1496,7 +1518,7 @@ msgstr "执行历史" msgid "ID" msgstr "ID" -#: ops/templates/ops/adhoc_detail.html:94 ops/templates/ops/task_list.html:35 +#: ops/templates/ops/adhoc_detail.html:94 ops/templates/ops/task_list.html:36 msgid "Run times" msgstr "执行次数" @@ -1538,13 +1560,6 @@ msgstr "最后运行成功主机" msgid "History of " msgstr "执行历史" -#: ops/templates/ops/adhoc_history.html:52 -#: ops/templates/ops/adhoc_history_detail.html:61 -#: ops/templates/ops/task_history.html:58 terminal/models.py:132 -#: terminal/templates/terminal/session_list.html:77 -msgid "Date start" -msgstr "开始日期" - #: ops/templates/ops/adhoc_history.html:53 #: ops/templates/ops/task_history.html:59 msgid "F/S/T" @@ -1628,7 +1643,7 @@ msgstr "最新版本" msgid "Contents" msgstr "内容" -#: ops/templates/ops/task_list.html:20 ops/templates/ops/task_list.html:25 +#: ops/templates/ops/task_list.html:21 ops/templates/ops/task_list.html:26 #: templates/_base_list.html:43 templates/_header_bar.html:8 #: terminal/templates/terminal/command_list.html:60 #: users/templates/users/login_log_list.html:35 @@ -1636,24 +1651,24 @@ msgstr "内容" msgid "Search" msgstr "搜索" -#: ops/templates/ops/task_list.html:36 +#: ops/templates/ops/task_list.html:37 msgid "Versions" msgstr "版本" -#: ops/templates/ops/task_list.html:38 +#: ops/templates/ops/task_list.html:39 msgid "Success" msgstr "成功" -#: ops/templates/ops/task_list.html:39 +#: ops/templates/ops/task_list.html:40 #: users/templates/users/login_log_list.html:54 msgid "Date" msgstr "日期" -#: ops/templates/ops/task_list.html:70 +#: ops/templates/ops/task_list.html:71 msgid "Run" msgstr "执行" -#: ops/templates/ops/task_list.html:124 +#: ops/templates/ops/task_list.html:125 msgid "Task start: " msgstr "任务开始: " @@ -1910,6 +1925,14 @@ msgstr "终端管理" msgid "Job Center" msgstr "作业中心" +#: templates/_nav.html:64 +msgid "Audits" +msgstr "审计" + +#: templates/_nav.html:67 +msgid "FTP log" +msgstr "FTP日志" + #: templates/captcha/image.html:3 msgid "Play CAPTCHA as audio file" msgstr "语言播放验证码" @@ -1981,11 +2004,6 @@ msgstr "线程数" msgid "Boot Time" msgstr "运行时间" -#: terminal/models.py:126 terminal/templates/terminal/session_list.html:74 -#: terminal/templates/terminal/terminal_detail.html:47 -msgid "Remote addr" -msgstr "远端地址" - #: terminal/models.py:128 terminal/templates/terminal/session_list.html:102 msgid "Replay" msgstr "回放" @@ -2787,3 +2805,6 @@ msgstr "密码更新" #: users/views/user.py:375 msgid "Public key update" msgstr "密钥更新" + +#~ msgid "Task has been send, seen left asset status" +#~ msgstr "任务已下发,查看左侧资产状态" diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index b19ac0350..0afcd4e72 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -62,6 +62,7 @@ INSTALLED_APPS = [ 'ops.apps.OpsConfig', 'common.apps.CommonConfig', 'terminal.apps.TerminalConfig', + 'audits.apps.AuditsConfig', 'rest_framework', 'rest_framework_swagger', 'django_filters', diff --git a/apps/jumpserver/urls.py b/apps/jumpserver/urls.py index fe8a4417a..ced4797d5 100644 --- a/apps/jumpserver/urls.py +++ b/apps/jumpserver/urls.py @@ -19,6 +19,7 @@ urlpatterns = [ url(r'^perms/', include('perms.urls.views_urls', namespace='perms')), url(r'^terminal/', include('terminal.urls.views_urls', namespace='terminal')), url(r'^ops/', include('ops.urls.view_urls', namespace='ops')), + url(r'^audits/', include('audits.urls.view_urls', namespace='audits')), url(r'^settings/', include('common.urls.view_urls', namespace='settings')), url(r'^common/', include('common.urls.view_urls', namespace='common')), @@ -28,6 +29,7 @@ urlpatterns = [ url(r'^api/perms/', include('perms.urls.api_urls', namespace='api-perms')), url(r'^api/terminal/', include('terminal.urls.api_urls', namespace='api-terminal')), url(r'^api/ops/', include('ops.urls.api_urls', namespace='api-ops')), + url(r'^api/audits/', include('audits.urls.api_urls', namespace='api-audits')), url(r'^api/common/', include('common.urls.api_urls', namespace='api-common')), # External apps url diff --git a/apps/templates/_nav.html b/apps/templates/_nav.html index 7b277a251..778578eb2 100644 --- a/apps/templates/_nav.html +++ b/apps/templates/_nav.html @@ -59,6 +59,14 @@
  • {% trans 'Task list' %}
  • +
  • + + {% trans 'Audits' %} + + +
  • {#
  • #} {# #} {# {% trans 'File' %}#} diff --git a/apps/terminal/views/command.py b/apps/terminal/views/command.py index 0af0b5bfd..a77bea37f 100644 --- a/apps/terminal/views/command.py +++ b/apps/terminal/views/command.py @@ -38,7 +38,7 @@ class CommandListView(DatetimeSearchMixin, AdminUserRequiredMixin, ListView): if self.system_user: filter_kwargs['system_user'] = self.system_user if self.command: - filter_kwargs['input'] = self.command + filter_kwargs['input__contains'] = self.command queryset = common_storage.filter(**filter_kwargs) return queryset