2021-09-27 11:06:26 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2022-11-10 06:44:23 +00:00
|
|
|
from django.db.models import TextChoices, IntegerChoices
|
2023-07-24 03:52:25 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
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")
|
2023-06-08 10:04:07 +00:00
|
|
|
rename_dir = "rename_dir", _("Rename dir")
|
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
|
2023-08-29 06:21:06 +00:00
|
|
|
download = "download", _("Download")
|
2023-01-16 11:02:09 +00:00
|
|
|
connect = "connect", _("Connect")
|
|
|
|
login = "login", _("Login")
|
|
|
|
change_auth = "change_password", _("Change password")
|
2023-10-16 08:40:21 +00:00
|
|
|
|
2023-10-07 07:50:28 +00:00
|
|
|
accept = 'accept', _('Accept')
|
|
|
|
review = 'review', _('Review')
|
2023-10-09 09:16:38 +00:00
|
|
|
notice = 'notice', _('Notifications')
|
2023-10-16 08:40:21 +00:00
|
|
|
reject = 'reject', _('Reject')
|
|
|
|
approve = 'approve', _('Approve')
|
|
|
|
close = 'close', _('Close')
|
2022-11-10 06:44:23 +00:00
|
|
|
|
2024-05-31 03:05:35 +00:00
|
|
|
# Custom action
|
|
|
|
finished = 'finished', _('Finished')
|
|
|
|
|
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")
|