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
|
|
|
|
|
|
|
|
|
|
|
|
class TerminalSettingSerializer(serializers.Serializer):
|
2022-11-04 06:22:38 +00:00
|
|
|
PREFIX_TITLE = _('Terminal')
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
SORT_BY_CHOICES = (
|
2024-02-27 08:43:44 +00:00
|
|
|
('name', _('Name')),
|
|
|
|
('ip', _('Address'))
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
PAGE_SIZE_CHOICES = (
|
|
|
|
('all', _('All')),
|
|
|
|
('auto', _('Auto')),
|
|
|
|
('10', '10'),
|
|
|
|
('15', '15'),
|
|
|
|
('25', '25'),
|
|
|
|
('50', '50'),
|
|
|
|
)
|
2023-08-15 05:45:44 +00:00
|
|
|
SECURITY_SERVICE_ACCOUNT_REGISTRATION = serializers.BooleanField(
|
2024-05-24 06:41:28 +00:00
|
|
|
required=True, label=_('Registration'),
|
2023-08-15 05:45:44 +00:00
|
|
|
help_text=_(
|
2024-05-24 06:41:28 +00:00
|
|
|
"Allow component register, after all component setup, you should disable this for security"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
TERMINAL_PASSWORD_AUTH = serializers.BooleanField(
|
|
|
|
required=False, label=_("Password"),
|
|
|
|
help_text=_(
|
|
|
|
'* Allow users to log in to the KoKo component via password authentication'
|
2023-08-15 05:45:44 +00:00
|
|
|
)
|
|
|
|
)
|
2021-09-09 06:00:50 +00:00
|
|
|
TERMINAL_PUBLIC_KEY_AUTH = serializers.BooleanField(
|
2024-05-24 06:41:28 +00:00
|
|
|
required=False, label=_("Public key"),
|
|
|
|
help_text=_(
|
|
|
|
'* Allow users to log in to the KoKo component via Public key authentication'
|
|
|
|
'<br/>'
|
|
|
|
'If third-party authentication services, such as AD/LDAP, are enabled, you should '
|
|
|
|
'disable this option to prevent users from logging in after being deleted from the AD/LDAP server'
|
|
|
|
)
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
2022-03-25 06:45:08 +00:00
|
|
|
TERMINAL_ASSET_LIST_SORT_BY = serializers.ChoiceField(
|
2024-05-24 06:41:28 +00:00
|
|
|
SORT_BY_CHOICES, required=False, label=_('Asset sorting')
|
2022-03-25 06:45:08 +00:00
|
|
|
)
|
|
|
|
TERMINAL_ASSET_LIST_PAGE_SIZE = serializers.ChoiceField(
|
2024-05-24 06:41:28 +00:00
|
|
|
PAGE_SIZE_CHOICES, required=False, label=_('Asset page size')
|
|
|
|
)
|
|
|
|
TERMINAL_MAGNUS_ENABLED = serializers.BooleanField(
|
|
|
|
label="Magnus",
|
|
|
|
help_text=_(
|
|
|
|
'* You can individually configure the service address and port in the service endpoint'
|
|
|
|
'<br/>'
|
|
|
|
'If enabled, the Luna page will display the DB client launch method when connecting to assets'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
TERMINAL_RAZOR_ENABLED = serializers.BooleanField(
|
|
|
|
label="Razor",
|
|
|
|
help_text=_(
|
|
|
|
'* You can individually configure the service address and port in the service endpoint'
|
|
|
|
'<br/>'
|
|
|
|
'If enabled, the Luna page will display the download rdp file button '
|
|
|
|
'and RDP Client launch method when connecting to assets'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
TERMINAL_KOKO_SSH_ENABLED = serializers.BooleanField(
|
2024-06-27 03:17:14 +00:00
|
|
|
label=_("Client connection"),
|
2024-05-24 06:41:28 +00:00
|
|
|
help_text=_(
|
|
|
|
'* Allow connecting to the KoKo component via SSH client'
|
|
|
|
'<br/>'
|
|
|
|
'If enabled, the Luna page will display the SSH client launch method when connecting to assets'
|
|
|
|
)
|
2022-03-25 06:45:08 +00:00
|
|
|
)
|