mirror of https://github.com/jumpserver/jumpserver
perf: 支持配置文件配置限制的最大数量
parent
5157514c62
commit
a7a099f290
|
@ -4,6 +4,7 @@ import re
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import pyzipper
|
import pyzipper
|
||||||
|
from django.conf import settings
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework.renderers import BaseRenderer
|
from rest_framework.renderers import BaseRenderer
|
||||||
|
@ -77,7 +78,7 @@ class BaseFileRenderer(BaseRenderer):
|
||||||
results = [results[0]] if results else results
|
results = [results[0]] if results else results
|
||||||
else:
|
else:
|
||||||
# 限制数据数量
|
# 限制数据数量
|
||||||
results = results[:10000]
|
results = results[:settings.MAX_LIMIT_PER_PAGE]
|
||||||
# 会将一些 UUID 字段转化为 string
|
# 会将一些 UUID 字段转化为 string
|
||||||
results = json.loads(json.dumps(results, cls=encoders.JSONEncoder))
|
results = json.loads(json.dumps(results, cls=encoders.JSONEncoder))
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in New Issue