Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
2e5b2241
Commit
2e5b2241
authored
Mar 30, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
л
parent
38445a1d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
2 deletions
+18
-2
views.py
jumpserver/views.py
+0
-2
urls.py
juser/urls.py
+1
-0
views.py
juser/views.py
+6
-0
admin.png
static/img/admin.png
+0
-0
root.png
static/img/root.png
+0
-0
nav_cat_bar.html
templates/nav_cat_bar.html
+4
-0
nav_li_profile.html
templates/nav_li_profile.html
+7
-0
No files found.
jumpserver/views.py
View file @
2e5b2241
...
...
@@ -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
=
{}
...
...
juser/urls.py
View file @
2e5b2241
...
...
@@ -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'
),
)
juser/views.py
View file @
2e5b2241
...
...
@@ -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
)
...
...
static/img/admin.png
View replaced file @
38445a1d
View file @
2e5b2241
This diff is collapsed.
Click to expand it.
static/img/root.png
View replaced file @
38445a1d
View file @
2e5b2241
6.42 KB
|
W:
|
H:
105 KB
|
W:
|
H:
2-up
Swipe
Onion skin
templates/nav_cat_bar.html
View file @
2e5b2241
...
...
@@ -6,11 +6,15 @@
<a
href=
"/"
>
仪表盘
</a>
</li>
<li>
{% if path1 %}
<a>
{{ path1 }}
</a>
{% endif %}
</li>
{% if path2 %}
<li
class=
"active"
>
<strong>
{{ path2 }}
</strong>
</li>
{% endif %}
</ol>
</div>
<div
class=
"col-lg-2"
>
...
...
templates/nav_li_profile.html
View file @
2e5b2241
...
...
@@ -10,6 +10,13 @@
<ul
class=
"dropdown-menu animated fadeInRight m-t-xs"
>
<li><a
href=
"/juser/profile/"
>
个人信息
</a></li>
<li><a
href=
"/juser/chg_pass/"
>
修改密码
</a></li>
{% ifequal session_role_id 2 %}
<li><a
href=
"/juser/chg_role/"
>
切换普通角色
</a></li>
{% endifequal %}
{% ifequal session_role_id 1 %}
<li><a
href=
"/juser/chg_role/"
>
切换普通角色
</a></li>
{% endifequal %}
<li
class=
"divider"
></li>
<li><a
href=
"/logout/"
>
注销
</a></li>
</ul>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment