Commit 3383b2b5 authored by ibuler's avatar ibuler

Add terminal mode

parent 9960a6cd
......@@ -9,8 +9,9 @@ from django.utils.translation import ugettext_lazy as _
class LoginLog(models.Model):
LOGIN_TYPE_CHOICE = (
('S', 'ssh'),
('W', 'web'),
('W', 'Web'),
('T', 'Terminal'),
('WT', 'Web Terminal')
)
username = models.CharField(max_length=20, verbose_name=_('Username'))
......@@ -19,6 +20,7 @@ class LoginLog(models.Model):
login_ip = models.GenericIPAddressField(verbose_name=_('Login ip'))
login_city = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Login city'))
user_agent = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('User agent'))
from_terminal = models.ForeignKey
date_login = models.DateTimeField(auto_now=True, verbose_name=_('Date login'))
date_logout = models.DateTimeField(null=True, verbose_name=_('Date logout'))
......
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
# Create your models here.
from users.models import User
class Terminal(models.Model):
name = models.CharField(max_length=30, verbose_name=_('Name'))
ip = models.GenericIPAddressField(verbose_name=_('From ip'))
is_active = models.BooleanField(default=False, verbose_name=_('Is active'))
is_bound_ip = models.BooleanField(default=False, verbose_name=_('Is bound ip'))
heatbeat_interval = models.IntegerField(default=60, verbose_name=_('Heatbeat interval'))
mail_to = models.ManyToManyField(User, verbose_name=_('Mail to '))
date_created = models.DateTimeField(auto_now=True)
comment = models.TextField(verbose_name=_('Comment'))
class Meta:
db_table = 'terminal'
ordering = ['name']
class TerminalHeatbeat(models.Model):
terminal = models.ForeignKey(Terminal, on_delete=models.SET_NULL)
date_timestamp = models.IntegerField()
class Meta:
db_table = 'terminal_heatbeat'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment