jumpserver/apps/tickets/const.py
fit2bot 7e2f81a418
perf: 重构 ticket (#8281)
* perf: 重构 ticket

* perf: 优化 tickets

* perf: 暂存

* perf: 建立 ticket model

* perf: 暂存一下

* perf: 修改 tickets

* perf: 修改 import

* perf: 修改model

* perf: 暂存一波

* perf: 修改...

* del process_map field

* 工单重构

* 资产 应用对接前端

* perf: 修改 ticket

* fix: bug

* 修改迁移文件

* 添加其他api

* 去掉process_map

* perf: 优化去掉 signal

* perf: 修改这里

* 修改一点

* perf: 修改工单

* perf: 修改状态

* perf: 修改工单流转

* step 状态切换

* perf: 修改 ticket open

* perf: 修改流程

* perf: stash it

* 改又改

* stash it

* perf: stash

* stash

* migrate

* perf migrate

* 调整一下

* 修复bug

* 修改一点

* 修改一点

* 优化一波

* perf: ticket migrations

Co-authored-by: ibuler <ibuler@qq.com>
Co-authored-by: feng626 <1304903146@qq.com>
2022-06-23 13:52:28 +08:00

60 lines
1.7 KiB
Python

from django.db.models import TextChoices, IntegerChoices
from django.utils.translation import ugettext_lazy as _
TICKET_DETAIL_URL = '/ui/#/tickets/tickets/{id}?type={type}'
class TicketType(TextChoices):
general = 'general', _("General")
login_confirm = 'login_confirm', _("Login confirm")
apply_asset = 'apply_asset', _('Apply for asset')
apply_application = 'apply_application', _('Apply for application')
login_asset_confirm = 'login_asset_confirm', _('Login asset confirm')
command_confirm = 'command_confirm', _('Command confirm')
class TicketState(TextChoices):
pending = 'pending', _('Open')
approved = 'approved', _('Approved')
rejected = 'rejected', _('Rejected')
closed = 'closed', _("Cancel")
reopen = 'reopen', _("Reopen")
class TicketStatus(TextChoices):
open = 'open', _("Open")
closed = 'closed', _("Finished")
class StepState(TextChoices):
pending = 'pending', _('Pending')
approved = 'approved', _('Approved')
rejected = 'rejected', _('Rejected')
closed = 'closed', _("Closed")
reopen = 'reopen', _("Reopen")
class StepStatus(TextChoices):
pending = 'pending', _('Pending')
active = 'active', _('Active')
closed = 'closed', _("Closed")
class TicketAction(TextChoices):
open = 'open', _("Open")
close = 'close', _("Close")
approve = 'approve', _('Approve')
reject = 'reject', _('Reject')
class TicketLevel(IntegerChoices):
one = 1, _("One level")
two = 2, _("Two level")
class TicketApprovalStrategy(TextChoices):
super_admin = 'super_admin', _("Super admin")
org_admin = 'org_admin', _("Org admin")
super_org_admin = 'super_org_admin', _("Super admin and org admin")
custom_user = 'custom_user', _("Custom user")