2017-12-12 04:19:45 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
2023-04-03 07:01:48 +00:00
|
|
|
from django.db.models import TextChoices
|
2021-01-12 10:06:42 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2019-12-05 07:09:25 +00:00
|
|
|
|
|
|
|
|
2022-11-04 03:40:16 +00:00
|
|
|
class ReplayStorageType(TextChoices):
|
2021-01-12 10:06:42 +00:00
|
|
|
null = 'null', 'Null',
|
|
|
|
server = 'server', 'Server'
|
|
|
|
s3 = 's3', 'S3'
|
|
|
|
ceph = 'ceph', 'Ceph'
|
|
|
|
swift = 'swift', 'Swift'
|
|
|
|
oss = 'oss', 'OSS'
|
|
|
|
azure = 'azure', 'Azure'
|
2021-04-12 11:37:04 +00:00
|
|
|
obs = 'obs', 'OBS'
|
2022-02-28 11:28:58 +00:00
|
|
|
cos = 'cos', 'COS'
|
2019-12-05 07:09:25 +00:00
|
|
|
|
|
|
|
|
2022-11-04 03:40:16 +00:00
|
|
|
class CommandStorageType(TextChoices):
|
2021-01-12 10:06:42 +00:00
|
|
|
null = 'null', 'Null',
|
|
|
|
server = 'server', 'Server'
|
|
|
|
es = 'es', 'Elasticsearch'
|
2020-12-10 12:50:22 +00:00
|
|
|
|
|
|
|
|
2021-01-12 10:06:42 +00:00
|
|
|
# Component Status Choices
|
|
|
|
# ------------------------
|
2020-12-10 12:50:22 +00:00
|
|
|
|
2022-11-04 03:40:16 +00:00
|
|
|
class ComponentLoad(TextChoices):
|
2020-12-10 12:50:22 +00:00
|
|
|
critical = 'critical', _('Critical')
|
|
|
|
high = 'high', _('High')
|
|
|
|
normal = 'normal', _('Normal')
|
2021-03-26 11:09:34 +00:00
|
|
|
offline = 'offline', _('Offline')
|
2020-12-10 12:50:22 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def status(cls):
|
|
|
|
return set(dict(cls.choices).keys())
|
|
|
|
|
|
|
|
|
2022-11-17 12:48:50 +00:00
|
|
|
class TerminalType(TextChoices):
|
|
|
|
koko = 'koko', 'KoKo'
|
|
|
|
guacamole = 'guacamole', 'Guacamole'
|
|
|
|
omnidb = 'omnidb', 'OmniDB'
|
|
|
|
xrdp = 'xrdp', 'Xrdp'
|
|
|
|
lion = 'lion', 'Lion'
|
|
|
|
core = 'core', 'Core'
|
|
|
|
celery = 'celery', 'Celery'
|
|
|
|
magnus = 'magnus', 'Magnus'
|
|
|
|
razor = 'razor', 'Razor'
|
|
|
|
tinker = 'tinker', 'Tinker'
|
2023-04-27 11:31:58 +00:00
|
|
|
video_worker = 'video_worker', 'Video Worker'
|
2022-11-16 13:05:15 +00:00
|
|
|
|
|
|
|
@classmethod
|
2022-11-17 12:48:50 +00:00
|
|
|
def types(cls):
|
|
|
|
return set(dict(cls.choices).keys())
|
2023-01-16 11:02:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PublishStatus(TextChoices):
|
|
|
|
pending = 'pending', _('Pending')
|
|
|
|
success = 'success', _("Success")
|
|
|
|
failed = 'failed', _("Failed")
|
|
|
|
mismatch = 'mismatch', _("Mismatch")
|
2023-02-17 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SessionType(TextChoices):
|
|
|
|
normal = 'normal', _('Normal')
|
|
|
|
tunnel = 'tunnel', _('Tunnel')
|
|
|
|
command = 'command', _('Command')
|
2023-04-03 05:55:27 +00:00
|
|
|
|
|
|
|
|
2023-04-03 07:01:48 +00:00
|
|
|
class ActionPermission(TextChoices):
|
2023-04-03 07:37:32 +00:00
|
|
|
readonly = "readonly", _('Read Only')
|
2023-04-03 07:01:48 +00:00
|
|
|
writable = "writable", _('Writable')
|