2021-09-27 11:06:26 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2022-11-10 06:44:23 +00:00
|
|
|
from django.db.models import TextChoices, IntegerChoices
|
2021-09-27 11:06:26 +00:00
|
|
|
|
|
|
|
DEFAULT_CITY = _("Unknown")
|
2022-05-05 06:42:09 +00:00
|
|
|
|
2023-01-16 11:02:09 +00:00
|
|
|
MODELS_NEED_RECORD = set()
|
2022-11-10 06:44:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
class OperateChoices(TextChoices):
|
2022-11-11 07:11:10 +00:00
|
|
|
mkdir = "mkdir", _("Mkdir")
|
|
|
|
rmdir = "rmdir", _("Rmdir")
|
|
|
|
delete = "delete", _("Delete")
|
|
|
|
upload = "upload", _("Upload")
|
|
|
|
rename = "rename", _("Rename")
|
|
|
|
symlink = "symlink", _("Symlink")
|
|
|
|
download = "download", _("Download")
|
2022-11-10 06:44:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ActionChoices(TextChoices):
|
2022-11-11 07:11:10 +00:00
|
|
|
view = "view", _("View")
|
|
|
|
update = "update", _("Update")
|
|
|
|
delete = "delete", _("Delete")
|
|
|
|
create = "create", _("Create")
|
2023-01-16 11:02:09 +00:00
|
|
|
# Activities action
|
|
|
|
connect = "connect", _("Connect")
|
|
|
|
login = "login", _("Login")
|
|
|
|
change_auth = "change_password", _("Change password")
|
2022-11-10 06:44:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
class LoginTypeChoices(TextChoices):
|
2022-11-11 07:11:10 +00:00
|
|
|
web = "W", _("Web")
|
|
|
|
terminal = "T", _("Terminal")
|
|
|
|
unknown = "U", _("Unknown")
|
2022-11-10 06:44:23 +00:00
|
|
|
|
|
|
|
|
2023-02-07 00:52:48 +00:00
|
|
|
class ActivityChoices(TextChoices):
|
|
|
|
operate_log = 'O', _('Operate log')
|
|
|
|
session_log = 'S', _('Session log')
|
|
|
|
login_log = 'L', _('Login log')
|
|
|
|
task = 'T', _('Task')
|
|
|
|
|
|
|
|
|
2022-11-10 06:44:23 +00:00
|
|
|
class MFAChoices(IntegerChoices):
|
2022-11-11 07:11:10 +00:00
|
|
|
disabled = 0, _("Disabled")
|
|
|
|
enabled = 1, _("Enabled")
|
|
|
|
unknown = 2, _("-")
|
2022-11-10 06:44:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
class LoginStatusChoices(IntegerChoices):
|
2022-11-11 07:11:10 +00:00
|
|
|
success = True, _("Success")
|
|
|
|
failed = False, _("Failed")
|