mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
892 B
28 lines
892 B
4 years ago
|
from __future__ import unicode_literals
|
||
|
|
||
|
import uuid
|
||
|
|
||
|
from django.db import models
|
||
|
from django.utils.translation import ugettext_lazy as _
|
||
|
from .terminal import Terminal
|
||
|
|
||
|
|
||
|
class Task(models.Model):
|
||
|
NAME_CHOICES = (
|
||
|
("kill_session", "Kill Session"),
|
||
|
)
|
||
|
|
||
|
id = models.UUIDField(default=uuid.uuid4, primary_key=True)
|
||
|
name = models.CharField(max_length=128, choices=NAME_CHOICES, verbose_name=_("Name"))
|
||
|
args = models.CharField(max_length=1024, verbose_name=_("Args"))
|
||
3 years ago
|
kwargs = models.JSONField(default=dict, verbose_name=_("Kwargs"))
|
||
4 years ago
|
terminal = models.ForeignKey(Terminal, null=True, on_delete=models.SET_NULL)
|
||
|
is_finished = models.BooleanField(default=False)
|
||
|
date_created = models.DateTimeField(auto_now_add=True)
|
||
|
date_finished = models.DateTimeField(null=True)
|
||
|
|
||
|
class Meta:
|
||
|
db_table = "terminal_task"
|
||
3 years ago
|
verbose_name = _("Task")
|
||
4 years ago
|
|