diff --git a/docs/requirements.txt b/docs/requirements.txt index d32aff3a4..28d7b9137 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -10,4 +10,7 @@ xlsxwriter==0.7.7 xlrd==0.9.4 django-bootstrap-form tornado -ansible \ No newline at end of file +ansible +pyinotify +passlib +argparse \ No newline at end of file diff --git a/jumpserver/api.py b/jumpserver/api.py index 5b964586c..97fc659bb 100644 --- a/jumpserver/api.py +++ b/jumpserver/api.py @@ -197,9 +197,9 @@ def require_role(role='user'): def _deco(func): def __deco(request, *args, **kwargs): + request.session['pre_url'] = request.path if not request.user.is_authenticated(): return HttpResponseRedirect('/login/') - if role == 'admin': # if request.session.get('role_id', 0) < 1: if request.user.role == 'CU': diff --git a/jumpserver/views.py b/jumpserver/views.py index 89bc75fd8..a907ced4f 100644 --- a/jumpserver/views.py +++ b/jumpserver/views.py @@ -235,7 +235,7 @@ def Login(request): request.session['role_id'] = 1 else: request.session['role_id'] = 0 - return HttpResponseRedirect(request.GET.get('next', '/'), ) + return HttpResponseRedirect(request.session.get('pre_url', '/')) # response.set_cookie('username', username, expires=604800) # response.set_cookie('seed', PyCrypt.md5_crypt(password), expires=604800) # return response diff --git a/keys/README.md b/keys/README.md new file mode 100644 index 000000000..9e060e41d --- /dev/null +++ b/keys/README.md @@ -0,0 +1,3 @@ +看山是山,看水是水 +看山不是山,看水不是水 +看山是山,看水是水 diff --git a/templates/index.html b/templates/index.html index af6966ef6..0d8baf9f9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -14,7 +14,6 @@

{{ users.count}}

-{#
{{ percent_user }}
#} All user
@@ -27,7 +26,6 @@

{{ hosts.count }}

-{#
{{ percent_host }}
#} All host
@@ -37,7 +35,7 @@
Online -
实时在线用户
+
在线用户

{{ online_user | length }}

@@ -55,7 +53,6 @@

{{ online_host | length }}

-{#
{{ percent_online_host }}
#} Connected host
@@ -169,7 +166,7 @@
-

一周Top10资产

+

一周Top10资产

登录次数及最近一次登录记录.
@@ -309,14 +306,7 @@
- - - - - - - - + {% endblock %} diff --git a/templates/nav.html b/templates/nav.html index 3f3e76d42..32d31bcc4 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -4,10 +4,10 @@