diff --git a/docs/__init__.py b/docs/__init__.py new file mode 100644 index 000000000..bfd53d39f --- /dev/null +++ b/docs/__init__.py @@ -0,0 +1 @@ +__author__ = 'Hudie' diff --git a/docs/developer_doc.txt b/docs/developer_doc.txt new file mode 100644 index 000000000..a8b53bceb --- /dev/null +++ b/docs/developer_doc.txt @@ -0,0 +1,21 @@ +# coding: utf8 + +Jumpserver开发者文档 + +开发规范: + 1. 遵守PE8规范 1) 命名规范 2) 导入模块规范 3) 空行规范 4) 长度规范 + 2. 缩进统一4个空格 + 3. 变量命名明了易懂多个单词下划线隔开 + 4. 注释到位 + + +框架说明: + 1. 项目名称 Jumpserver + 2. APP: + juser 用户管理 + jasset 资产管理(设备管理) + jpermission 授权管理 + jlog 日志管理 + 3. connect.py 用户登录入口程序 + 4. logs 日志保存目录 + 5. jumpserver.conf 配置文件 diff --git a/test_add_user.py b/docs/test_add_user.py similarity index 100% rename from test_add_user.py rename to docs/test_add_user.py diff --git a/jlog/models.py b/jlog/models.py index 71a836239..b1bcbe14d 100644 --- a/jlog/models.py +++ b/jlog/models.py @@ -1,3 +1,17 @@ from django.db import models -# Create your models here. +from juser.models import User +from jasset.models import Asset + + +class Log(models.Model): + username = models.ForeignKey(User) + asset = models.ForeignKey(Asset) + log_path = models.CharField(max_length=100) + start_time = models.IntegerField() + pid = models.IntegerField(max_length=10) + is_finished = models.BooleanField(default=False) + end_time = models.IntegerField(blank=True, null=True) + + def __unicode__(self): + return self.log_path \ No newline at end of file diff --git a/jumpserver/settings.py b/jumpserver/settings.py index dd605974c..c4e6ed3ce 100644 --- a/jumpserver/settings.py +++ b/jumpserver/settings.py @@ -49,6 +49,7 @@ INSTALLED_APPS = ( 'juser', 'jasset', 'jpermission', + 'jlog', ) MIDDLEWARE_CLASSES = (