mirror of https://github.com/jumpserver/jumpserver
perf: report to iframe
parent
456b96a369
commit
919cdeae20
|
@ -1,6 +1,7 @@
|
|||
from django.http import HttpResponse
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views.decorators.clickjacking import xframe_options_sameorigin
|
||||
from rest_framework import status, mixins, viewsets
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.response import Response
|
||||
|
@ -115,9 +116,9 @@ class AutomationExecutionViewSet(
|
|||
)
|
||||
return Response({'task': task.id}, status=status.HTTP_201_CREATED)
|
||||
|
||||
@xframe_options_sameorigin
|
||||
@action(methods=['get'], detail=True, url_path='report')
|
||||
def report(self, request, *args, **kwargs):
|
||||
execution = self.get_object()
|
||||
report = execution.manager.gen_report()
|
||||
return HttpResponse(report)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.views.decorators.clickjacking import xframe_options_sameorigin
|
||||
from rest_framework import status
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.response import Response
|
||||
|
@ -48,6 +49,7 @@ class DiscoverAccountsExecutionViewSet(AutomationExecutionViewSet):
|
|||
queryset = queryset.filter(automation__type=self.tp)
|
||||
return queryset
|
||||
|
||||
@xframe_options_sameorigin
|
||||
@action(methods=["get"], detail=False, url_path="adhoc")
|
||||
def adhoc(self, request, *args, **kwargs):
|
||||
asset_id = request.query_params.get("asset_id")
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
"AccountDeleteConfirmMsg": "Delete account, continue?",
|
||||
"AccountDeleted": "Account deleted",
|
||||
"AccountDiscoverDetail": "Gather account details",
|
||||
"AccountDiscoverList": "Discover accounts",
|
||||
"AccountDiscoverTask": "Discover accounts tasks",
|
||||
"AccountDiscover": "Discover accounts",
|
||||
"AccountDiscoverTaskCreate": "Create discover accounts task",
|
||||
"AccountDiscoverTaskUpdate": "Update the discover accounts task",
|
||||
"AccountExportTips": "The exported information contains sensitive information such as encrypted account numbers. the exported format is an encrypted zip file (if you have not set the encryption password, please go to personal info to set the file encryption password).",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"AccountData": "账号数据",
|
||||
"AccountDeleteConfirmMsg": "删除账号,是否继续?",
|
||||
"AccountDeleted": "账号删除",
|
||||
"AccountDiscoverTask": "账号发现",
|
||||
"AccountDiscover": "账号发现",
|
||||
"AccountExportTips": "导出信息中包含账号密文涉及敏感信息,导出的格式为一个加密的zip文件(若没有设置加密密码,请前往个人信息中设置文件加密密码)。",
|
||||
"AccountList": "账号",
|
||||
"AccountPolicy": "账号策略",
|
||||
|
|
Loading…
Reference in New Issue