From b78e4e58e27906b158d9497b5d930016757a51e8 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 30 May 2020 23:49:52 +0000 Subject: [PATCH] more fixes for windows agent --- api/tacticalrmm/api/views.py | 13 ++++++++++--- api/tacticalrmm/checks/serializers.py | 3 +-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/api/tacticalrmm/api/views.py b/api/tacticalrmm/api/views.py index ee222961..eb48dbd2 100644 --- a/api/tacticalrmm/api/views.py +++ b/api/tacticalrmm/api/views.py @@ -393,8 +393,15 @@ class CheckRunner(APIView): permission_classes = [IsAuthenticated] def get(self, request, pk): + agent = get_object_or_404(Agent, pk=pk) checks = Check.objects.filter(agent__pk=pk) - return Response(CheckRunnerGetSerializer(checks, many=True).data) + + ret = { + "agent": agent.pk, + "check_interval": agent.check_interval, + "checks": CheckRunnerGetSerializer(checks, many=True).data, + } + return Response(ret) def patch(self, request, pk): check = get_object_or_404(Check, pk=pk) @@ -420,8 +427,8 @@ class TaskRunner(APIView): For windows agent """ - # authentication_classes = [TokenAuthentication] - # permission_classes = [IsAuthenticated] + authentication_classes = [TokenAuthentication] + permission_classes = [IsAuthenticated] def get(self, request, pk): diff --git a/api/tacticalrmm/checks/serializers.py b/api/tacticalrmm/checks/serializers.py index 0ef60baf..e82e056b 100644 --- a/api/tacticalrmm/checks/serializers.py +++ b/api/tacticalrmm/checks/serializers.py @@ -63,7 +63,7 @@ class CheckSerializer(serializers.ModelSerializer): class AssignedTaskCheckRunnerField(serializers.ModelSerializer): class Meta: model = AutomatedTask - fields = ["id", "win_task_name", "enabled"] + fields = ["id", "enabled"] class CheckRunnerGetSerializer(serializers.ModelSerializer): @@ -81,7 +81,6 @@ class CheckRunnerGetSerializer(serializers.ModelSerializer): class Meta: model = Check exclude = [ - "agent", "policy", "name", "more_info",