2017-12-12 04:19:45 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
2021-01-12 10:06:42 +00:00
|
|
|
from django.db.models import TextChoices
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2019-12-05 07:09:25 +00:00
|
|
|
|
2021-01-12 10:06:42 +00:00
|
|
|
# Replay & Command Storage Choices
|
|
|
|
# --------------------------------
|
2019-12-05 07:09:25 +00:00
|
|
|
|
|
|
|
|
2021-01-12 10:06:42 +00:00
|
|
|
class ReplayStorageTypeChoices(TextChoices):
|
|
|
|
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'
|
2019-12-05 07:09:25 +00:00
|
|
|
|
|
|
|
|
2021-01-12 10:06:42 +00:00
|
|
|
class CommandStorageTypeChoices(TextChoices):
|
|
|
|
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
|
|
|
|
|
|
|
class ComponentStatusChoices(TextChoices):
|
|
|
|
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())
|
|
|
|
|
|
|
|
|
|
|
|
class TerminalTypeChoices(TextChoices):
|
|
|
|
koko = 'koko', 'KoKo'
|
|
|
|
guacamole = 'guacamole', 'Guacamole'
|
|
|
|
omnidb = 'omnidb', 'OmniDB'
|
2021-03-03 03:20:40 +00:00
|
|
|
xrdp = 'xrdp', 'Xrdp'
|
2021-05-17 06:46:40 +00:00
|
|
|
lion = 'lion', 'Lion'
|
2021-08-06 11:16:18 +00:00
|
|
|
core = 'core', 'Core'
|
|
|
|
celery = 'celery', 'Celery'
|
2020-12-10 12:50:22 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def types(cls):
|
|
|
|
return set(dict(cls.choices).keys())
|
|
|
|
|