feat: command exexution audit log的搜索

pull/4086/head
ibuler 2020-06-05 14:07:23 +08:00
parent 34c556d375
commit 8569910658
2 changed files with 2 additions and 5 deletions

View File

@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-
#
import random
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import RetrieveAPIView
from django.shortcuts import get_object_or_404

View File

@ -92,8 +92,8 @@ class CommandExecutionViewSet(ListModelMixin, OrgGenericViewSet):
date_range_filter_fields = [
('date_start', ('date_from', 'date_to'))
]
filter_fields = ['user__name', 'command', 'run_as__name']
search_fields = ['command']
filter_fields = ['user__name', 'command', 'run_as__name', 'is_finished']
search_fields = ['command', 'user__name', 'run_as__name']
ordering = ['-date_created']