2021-09-09 06:00:50 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
|
|
|
|
|
|
|
class OtherSettingSerializer(serializers.Serializer):
|
2022-11-04 06:22:38 +00:00
|
|
|
PREFIX_TITLE = _('More...')
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
EMAIL_SUFFIX = serializers.CharField(
|
|
|
|
required=False, max_length=1024, label=_("Email suffix"),
|
|
|
|
help_text=_('This is used by default if no email is returned during SSO authentication')
|
|
|
|
)
|
|
|
|
|
|
|
|
OTP_ISSUER_NAME = serializers.CharField(
|
2021-10-28 06:56:56 +00:00
|
|
|
required=False, max_length=16, label=_('OTP issuer name'),
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
2021-09-15 08:22:51 +00:00
|
|
|
OTP_VALID_WINDOW = serializers.IntegerField(
|
|
|
|
min_value=1, max_value=10,
|
|
|
|
label=_("OTP valid window")
|
|
|
|
)
|
2021-09-09 06:00:50 +00:00
|
|
|
|
2021-09-13 12:15:59 +00:00
|
|
|
WINDOWS_SSH_DEFAULT_SHELL = serializers.ChoiceField(
|
|
|
|
choices=[
|
|
|
|
('cmd', _("CMD")),
|
|
|
|
('powershell', _("PowerShell"))
|
|
|
|
],
|
2021-09-13 12:37:45 +00:00
|
|
|
label=_('Shell (Windows)'),
|
2021-09-13 09:07:46 +00:00
|
|
|
help_text=_('The shell type used when Windows assets perform ansible tasks')
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
PERM_SINGLE_ASSET_TO_UNGROUP_NODE = serializers.BooleanField(
|
2021-11-10 10:15:46 +00:00
|
|
|
required=False, label=_("Perm ungroup node"),
|
|
|
|
help_text=_("Perm single to ungroup node")
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
|
|
|
|
2022-07-22 07:23:16 +00:00
|
|
|
TICKET_AUTHORIZE_DEFAULT_TIME = serializers.IntegerField(
|
2022-11-15 09:30:29 +00:00
|
|
|
min_value=1, max_value=999999, required=False,
|
|
|
|
label=_("Ticket authorize default time")
|
|
|
|
)
|
|
|
|
TICKET_AUTHORIZE_DEFAULT_TIME_UNIT = serializers.ChoiceField(
|
|
|
|
choices=[('day', _("day")), ('hour', _("hour"))],
|
|
|
|
label=_("Ticket authorize default time unit"), required=False,
|
2022-07-22 07:23:16 +00:00
|
|
|
)
|
2021-11-10 07:52:28 +00:00
|
|
|
HELP_DOCUMENT_URL = serializers.URLField(
|
|
|
|
required=False, allow_blank=True, allow_null=True, label=_("Help Docs URL"),
|
|
|
|
help_text=_('default: http://docs.jumpserver.org')
|
|
|
|
)
|
|
|
|
|
|
|
|
HELP_SUPPORT_URL = serializers.URLField(
|
|
|
|
required=False, allow_blank=True, allow_null=True, label=_("Help Support URL"),
|
|
|
|
help_text=_('default: http://www.jumpserver.org/support/')
|
|
|
|
)
|
|
|
|
|
2021-09-14 09:36:57 +00:00
|
|
|
# 准备废弃
|
|
|
|
# PERIOD_TASK_ENABLED = serializers.BooleanField(
|
|
|
|
# required=False, label=_("Enable period task")
|
|
|
|
# )
|