mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-24 13:00:26 +00:00
perf: Add viewAssetOnlineSessionInfo conf
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import os
|
||||
import tarfile
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.files.storage import default_storage
|
||||
from django.db.models import F
|
||||
from django.http import FileResponse
|
||||
@@ -160,6 +161,8 @@ class SessionViewSet(RecordViewLogMixin, OrgBulkModelViewSet):
|
||||
|
||||
@action(methods=[GET], detail=False, permission_classes=[IsAuthenticated], url_path='online-info', )
|
||||
def online_info(self, request, *args, **kwargs):
|
||||
if not settings.VIEW_ASSET_ONLINE_SESSION_INFO:
|
||||
return self.permission_denied(request, "view asset online session info disabled")
|
||||
asset = self.request.query_params.get('asset_id')
|
||||
account = self.request.query_params.get('account')
|
||||
if asset is None or account is None:
|
||||
|
Reference in New Issue
Block a user