diff --git a/apps/static/css/jumpserver.css b/apps/static/css/jumpserver.css index 3a21d2979..18ac6eab9 100644 --- a/apps/static/css/jumpserver.css +++ b/apps/static/css/jumpserver.css @@ -23,4 +23,38 @@ th a { color: #676a6c; -} \ No newline at end of file +} + +.select2-container--default .select2-results__option--highlighted[aria-selected] { + background-color: #1ab394; + color: white; + } + +.select2-selection--multiple { + border: 1px solid #e5e6e7 !important; + cursor: text !important; + } + +.select2-container--forcus { + border: 1px solid #1AB394 !important; + } + +.select2-selection__choice, +.chosen-container-multi .chosen-choices li.search-choice { + background: #f1f1f1 !important; + border: 1px solid #e5e6e7 !important; + /*border: 1px solid #ededed;*/ + border-radius: 2px !important; + box-shadow: none !important; + color: #333333 !important; + cursor: default !important; + line-height: 13px !important; + /*margin: 3px 0 3px 5px !important;*/ + padding: 3px 20px 3px 5px !important; + position: relative !important; + } + +.select2-container--default.select2-container--focus .select2-selection--multiple { + border: 1px solid #1ab394 !important; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) !important; +} diff --git a/apps/static/js/base.js b/apps/static/js/jumpserver.js similarity index 100% rename from apps/static/js/base.js rename to apps/static/js/jumpserver.js diff --git a/apps/templates/_foot_js.html b/apps/templates/_foot_js.html index 3ab927336..1b81e3406 100644 --- a/apps/templates/_foot_js.html +++ b/apps/templates/_foot_js.html @@ -4,7 +4,7 @@ - + - -{##} -{##} -{##} + + diff --git a/apps/templates/base.html b/apps/templates/base.html index 2b07c3227..16e14963c 100644 --- a/apps/templates/base.html +++ b/apps/templates/base.html @@ -11,8 +11,8 @@ {% include '_head_css_js.html' %} {% block custom_head_css_js %} {% endblock %} - - + + diff --git a/apps/users/models.py b/apps/users/models.py index acd0ed182..79f8e8abd 100644 --- a/apps/users/models.py +++ b/apps/users/models.py @@ -115,7 +115,7 @@ class User(AbstractUser): private_key = models.CharField(max_length=5000, blank=True, verbose_name='ssh私钥') # ssh key max length 4096 bit public_key = models.CharField(max_length=1000, blank=True, verbose_name='公钥') comment = models.TextField(max_length=200, blank=True, verbose_name='描述') - first_login = models.BooleanField(default=False) + is_first_login = models.BooleanField(default=False) date_expired = models.DateTimeField(default=date_expired_default, blank=True, null=True, verbose_name='有效期') created_by = models.CharField(max_length=30, default='') diff --git a/config-example.py b/config-example.py index f452e7464..06ff87bab 100644 --- a/config-example.py +++ b/config-example.py @@ -13,25 +13,61 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) class Config: + # Use it to encrypt or decrypt data + # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get('SECRET_KEY') or '2vym+ky!997d5kkcc64mnz06y1mmui3lut#(^wd=%s_qj$1%x' + + # How many line display every page, default 20 DISPLAY_PER_PAGE = 20 - SITE_URL = 'http://m' + + # It's used to identify your site, When we send a create mail to user, we only know login url is /login/ + # But we should know the absolute url like: http://jms.jumpserver.org/login/, so SITE_URL is + # HTTP_PROTOCOL://HOST[:PORT] + SITE_URL = 'http://localhost' + + # Django security setting, if your disable debug model, you should setting that ALLOWED_HOSTS = ['*'] - DEBUG = False + + # Development env open this, when error occur display the full process track, Production disable it + DEBUG = True + + # DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/ LOG_LEVEL = 'DEBUG' + + # Database setting, Support sqlite3, mysql, postgres .... + # See https://docs.djangoproject.com/en/1.10/ref/settings/#databases + + # Sqlite setting: DATABASE_ENGINE = 'sqlite3' + DB_NAME = os.path.join(BASE_DIR, 'db.sqlite3') + + # Mysql or postgres setting like: + # DB_ENGINE = 'mysql' + # DB_HOST = '127.0.0.1' + # DB_PORT = 3306 + # DB_USER = 'root' + # DB_PASSWORD = '' + # DB_NAME = 'jumpserver' + + # When Django start it will bind this host and port + # ./manage.py runserver 127.0.0.1:8080 + # Todo: Gunicorn or uwsgi run may be use it HTTP_LISTEN_HOST = '127.0.0.1' - HTTP_LISTEN_PORT = 8000 + HTTP_LISTEN_PORT = 8080 + + # Use Redis as broker for celery and web socket REDIS_HOST = '127.0.0.1' REDIS_PORT = 6379 - REDIS_PASSWORD = '' - EMAIL_HOST = '' - EMAIL_PORT = 25 - EMAIL_HOST_USER = '' - EMAIL_HOST_PASSWORD = '' - EMAIL_USE_SSL = False # If port is 465, set True - EMAIL_USE_TLS = False # If port is 587, set True - EMAIL_SUBJECT_PREFIX = '[Jumpserver] ' + # REDIS_PASSWORD = '' + + # Email SMTP setting, we only support smtp send mail + # EMAIL_HOST = 'smtp.qq.com' + # EMAIL_PORT = 25 + # EMAIL_HOST_USER = '' + # EMAIL_HOST_PASSWORD = '' + # EMAIL_USE_SSL = False # If port is 465, set True + # EMAIL_USE_TLS = False # If port is 587, set True + # EMAIL_SUBJECT_PREFIX = '[Jumpserver] ' def __init__(self): pass