diff --git a/jumpserver/views.py b/jumpserver/views.py index a52e99881..7f03b8f44 100644 --- a/jumpserver/views.py +++ b/jumpserver/views.py @@ -43,7 +43,6 @@ def get_data(data, items, option): @require_login def index(request): - path1, path2 = u'仪表盘', 'Dashboard' users = User.objects.all() hosts = Asset.objects.all() online_host = Log.objects.filter(is_finished=0) @@ -55,7 +54,6 @@ def index(request): user_top_ten = week_data.values('user').annotate(times=Count('user')).order_by('-times')[:10] host_top_ten = week_data.values('host').annotate(times=Count('host')).order_by('-times')[:10] user_dic, host_dic = get_data(week_data, user_top_ten, 'user'), get_data(week_data, host_top_ten, 'host') - print "##############%s" % request.session.get('role_id') top = {'user': '活跃用户数', 'host': '活跃主机数', 'times': '登录次数'} top_dic = {} diff --git a/juser/urls.py b/juser/urls.py index 1480008b4..acb5d6064 100644 --- a/juser/urls.py +++ b/juser/urls.py @@ -28,4 +28,5 @@ urlpatterns = patterns('juser.views', (r'^user_edit/$', view_splitter, {'su': user_edit, 'adm': user_edit_adm}), (r'^profile/$', 'profile'), (r'^chg_pass/$', 'chg_pass'), + (r'^chg_role/$', 'chg_role'), ) diff --git a/juser/views.py b/juser/views.py index c9fa02101..2b6530969 100644 --- a/juser/views.py +++ b/juser/views.py @@ -234,6 +234,12 @@ def dept_list_adm(request): +@require_admin +def chg_role(request): + request.session['role_id'] = 0 + return HttpResponseRedirect('/') + + @require_super_user def dept_detail(request): dept_id = request.GET.get('id', None) diff --git a/static/img/admin.png b/static/img/admin.png index cd140b2e5..701f897ae 100644 Binary files a/static/img/admin.png and b/static/img/admin.png differ diff --git a/static/img/root.png b/static/img/root.png index 06291e7e0..aaa37e666 100644 Binary files a/static/img/root.png and b/static/img/root.png differ diff --git a/templates/nav_cat_bar.html b/templates/nav_cat_bar.html index 322bb62d1..78c02e9c1 100644 --- a/templates/nav_cat_bar.html +++ b/templates/nav_cat_bar.html @@ -6,11 +6,15 @@ 仪表盘
  • + {% if path1 %} {{ path1 }} + {% endif %}
  • + {% if path2 %}
  • {{ path2 }}
  • + {% endif %}
    diff --git a/templates/nav_li_profile.html b/templates/nav_li_profile.html index 156b976f3..70a375d19 100644 --- a/templates/nav_li_profile.html +++ b/templates/nav_li_profile.html @@ -10,6 +10,13 @@