mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-24 21:08:30 +00:00
feat: 资产登录工单页面增加监控与中断
This commit is contained in:
@@ -3,4 +3,4 @@
|
||||
from .ticket import *
|
||||
from .comment import *
|
||||
from .flow import *
|
||||
|
||||
from .relation import *
|
||||
|
14
apps/tickets/models/relation.py
Normal file
14
apps/tickets/models/relation.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.db import models
|
||||
from django.db.models import Model
|
||||
|
||||
|
||||
class TicketSession(Model):
|
||||
ticket = models.ForeignKey('tickets.Ticket', related_name='session_relation', on_delete=models.CASCADE, db_constraint=False)
|
||||
session = models.ForeignKey('terminal.Session', related_name='ticket_relation', on_delete=models.CASCADE, db_constraint=False)
|
||||
|
||||
@classmethod
|
||||
def get_ticket_by_session_id(cls, session_id):
|
||||
relation = cls.objects.filter(session=session_id).first()
|
||||
if relation:
|
||||
return relation.ticket
|
||||
return None
|
@@ -13,7 +13,7 @@ from tickets.signals import post_change_ticket_action
|
||||
from tickets.handler import get_ticket_handler
|
||||
from tickets.errors import AlreadyClosed
|
||||
|
||||
__all__ = ['Ticket']
|
||||
__all__ = ['Ticket', 'TicketStep', 'TicketAssignee']
|
||||
|
||||
|
||||
class TicketStep(CommonModelMixin):
|
||||
|
Reference in New Issue
Block a user