2023-10-07 09:41:45 +00:00
|
|
|
from django.conf import settings
|
2023-07-24 03:52:25 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2021-09-09 06:00:50 +00:00
|
|
|
from rest_framework import serializers
|
|
|
|
|
|
|
|
__all__ = ['CleaningSerializer']
|
|
|
|
|
2023-10-08 02:32:51 +00:00
|
|
|
MIN_VALUE = 180 if settings.LIMIT_SUPER_PRIV else 1
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
|
|
|
|
class CleaningSerializer(serializers.Serializer):
|
2022-11-04 06:22:38 +00:00
|
|
|
PREFIX_TITLE = _('Period clean')
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
LOGIN_LOG_KEEP_DAYS = serializers.IntegerField(
|
2023-10-08 02:32:51 +00:00
|
|
|
min_value=MIN_VALUE, max_value=9999,
|
2023-05-30 09:02:16 +00:00
|
|
|
label=_("Login log keep days (day)"),
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
|
|
|
TASK_LOG_KEEP_DAYS = serializers.IntegerField(
|
2023-10-08 02:32:51 +00:00
|
|
|
min_value=MIN_VALUE, max_value=9999,
|
2023-05-30 09:02:16 +00:00
|
|
|
label=_("Task log keep days (day)"),
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
|
|
|
OPERATE_LOG_KEEP_DAYS = serializers.IntegerField(
|
2023-10-08 02:32:51 +00:00
|
|
|
min_value=MIN_VALUE, max_value=9999,
|
2023-05-30 09:02:16 +00:00
|
|
|
label=_("Operate log keep days (day)"),
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
2024-02-05 08:36:03 +00:00
|
|
|
PASSWORD_CHANGE_LOG_KEEP_DAYS = serializers.IntegerField(
|
|
|
|
min_value=MIN_VALUE, max_value=9999,
|
|
|
|
label=_("password change log keep days (day)"),
|
|
|
|
)
|
2021-09-09 06:00:50 +00:00
|
|
|
FTP_LOG_KEEP_DAYS = serializers.IntegerField(
|
2023-10-08 02:32:51 +00:00
|
|
|
min_value=MIN_VALUE, max_value=9999,
|
2023-05-30 09:02:16 +00:00
|
|
|
label=_("FTP log keep days (day)"),
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
|
|
|
CLOUD_SYNC_TASK_EXECUTION_KEEP_DAYS = serializers.IntegerField(
|
2023-10-08 02:32:51 +00:00
|
|
|
min_value=MIN_VALUE, max_value=9999,
|
2023-05-30 09:02:16 +00:00
|
|
|
label=_("Cloud sync record keep days (day)"),
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
2023-10-20 08:31:47 +00:00
|
|
|
JOB_EXECUTION_KEEP_DAYS = serializers.IntegerField(
|
|
|
|
min_value=MIN_VALUE, max_value=9999,
|
|
|
|
label=_("job execution keep days (day)"),
|
|
|
|
)
|
2023-10-07 09:41:45 +00:00
|
|
|
ACTIVITY_LOG_KEEP_DAYS = serializers.IntegerField(
|
2023-10-08 02:32:51 +00:00
|
|
|
min_value=MIN_VALUE, max_value=9999,
|
2023-10-07 09:41:45 +00:00
|
|
|
label=_("Activity log keep days (day)"),
|
|
|
|
)
|
2021-11-12 03:04:38 +00:00
|
|
|
TERMINAL_SESSION_KEEP_DURATION = serializers.IntegerField(
|
2023-10-08 02:32:51 +00:00
|
|
|
min_value=MIN_VALUE, max_value=99999, required=True, label=_('Session keep duration (day)'),
|
2023-07-24 03:52:25 +00:00
|
|
|
help_text=_(
|
|
|
|
'Session, record, command will be delete if more than duration, only in database, OSS will not be affected.')
|
2021-11-12 03:04:38 +00:00
|
|
|
)
|