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
bd0fd90e
Commit
bd0fd90e
authored
Apr 06, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ûͨû
parent
7e532283
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
407 additions
and
101 deletions
+407
-101
AddUserAsset.py
docs/AddUserAsset.py
+7
-7
api.py
jumpserver/api.py
+1
-0
context_processors.py
jumpserver/context_processors.py
+1
-0
settings.py
jumpserver/settings.py
+1
-0
mytags.py
jumpserver/templatetags/mytags.py
+35
-1
views.py
jumpserver/views.py
+7
-0
views.py
juser/views.py
+16
-8
index_cu.html
templates/index_cu.html
+39
-0
perm_detail.html
templates/jperm/perm_detail.html
+1
-1
profile.html
templates/juser/profile.html
+83
-0
user_detail.html
templates/juser/user_detail.html
+210
-80
user_list.html
templates/juser/user_list.html
+3
-1
nav.html
templates/nav.html
+2
-2
nav_li_profile.html
templates/nav_li_profile.html
+1
-1
No files found.
docs/AddUserAsset.py
View file @
bd0fd90e
...
...
@@ -127,13 +127,13 @@ def test_add_log():
if
__name__
==
'__main__'
:
install
()
test_add_dept
()
test_add_group
()
test_add_user
()
test_add_idc
()
test_add_asset_group
()
test_add_asset
()
#
install()
#
test_add_dept()
#
test_add_group()
#
test_add_user()
#
test_add_idc()
#
test_add_asset_group()
#
test_add_asset()
test_add_log
()
...
...
jumpserver/api.py
View file @
bd0fd90e
...
...
@@ -10,6 +10,7 @@ from binascii import b2a_hex, a2b_hex
import
ldap
from
ldap
import
modlist
import
hashlib
import
datetime
from
django.core.paginator
import
Paginator
,
EmptyPage
,
InvalidPage
from
django.http
import
HttpResponse
,
Http404
from
juser.models
import
User
,
UserGroup
...
...
jumpserver/context_processors.py
View file @
bd0fd90e
...
...
@@ -2,6 +2,7 @@ from juser.models import User
from
jasset.models
import
Asset
from
jumpserver.api
import
*
def
name_proc
(
request
):
user_id
=
request
.
session
.
get
(
'user_id'
)
role_id
=
request
.
session
.
get
(
'role_id'
)
...
...
jumpserver/settings.py
View file @
bd0fd90e
...
...
@@ -108,6 +108,7 @@ TEMPLATE_DIRS = (
STATICFILES_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
"static"
),
os
.
path
.
join
(
BASE_DIR
,
"keys"
),
)
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
...
...
jumpserver/templatetags/mytags.py
View file @
bd0fd90e
...
...
@@ -56,7 +56,7 @@ def groups_str2(group_list):
@register.filter
(
name
=
'group_str2_all'
)
def
group
s_str2
(
group_list
):
def
group
_str2_all
(
group_list
):
group_lis
=
[]
for
i
in
group_list
:
if
str
(
i
)
!=
'ALL'
:
...
...
@@ -106,6 +106,12 @@ def member_count(group_id):
return
group
.
user_set
.
count
()
@register.filter
(
name
=
'group_user_count'
)
def
group_user_count
(
group_id
):
group
=
UserGroup
.
objects
.
get
(
id
=
group_id
)
return
group
.
user_set
.
count
()
@register.filter
(
name
=
'dept_user_num'
)
def
dept_user_num
(
dept_id
):
dept
=
DEPT
.
objects
.
filter
(
id
=
dept_id
)
...
...
@@ -217,3 +223,31 @@ def to_avatar(role_id='0'):
@register.filter
(
name
=
'get_user_asset_group'
)
def
get_user_asset_group
(
user
):
return
user_perm_group_api
(
user
)
@register.filter
(
name
=
'group_asset_list'
)
def
group_asset_list
(
group
):
return
group
.
asset_set
.
all
()
@register.filter
(
name
=
'group_asset_list_count'
)
def
group_asset_list_count
(
group
):
return
group
.
asset_set
.
all
()
.
count
()
@register.filter
(
name
=
'time_delta'
)
def
time_delta
(
time_before
):
delta
=
datetime
.
datetime
.
now
()
-
time_before
days
=
delta
.
days
if
days
:
return
"
%
s 天前"
%
days
else
:
hours
=
delta
.
seconds
/
3600
if
hours
:
return
"
%
s 小时前"
%
hours
else
:
mins
=
delta
.
seconds
/
60
if
mins
:
return
'
%
s 分钟前'
%
mins
else
:
return
'
%
s 秒前'
%
delta
.
seconds
jumpserver/views.py
View file @
bd0fd90e
...
...
@@ -42,8 +42,15 @@ def get_data(data, items, option):
return
dic
@require_login
def
index_cu
(
request
):
return
render_to_response
(
'index_cu.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
@require_login
def
index
(
request
):
if
request
.
session
.
get
(
'role_id'
)
==
0
:
return
index_cu
(
request
)
users
=
User
.
objects
.
all
()
hosts
=
Asset
.
objects
.
all
()
online_host
=
Log
.
objects
.
filter
(
is_finished
=
0
)
...
...
juser/views.py
View file @
bd0fd90e
...
...
@@ -109,7 +109,7 @@ def db_del_user(username):
def
gen_ssh_key
(
username
,
password
=
None
,
length
=
2048
):
private_key_dir
=
os
.
path
.
join
(
BASE_DIR
,
'keys/jumpserver/'
)
private_key_file
=
os
.
path
.
join
(
private_key_dir
,
username
)
private_key_file
=
os
.
path
.
join
(
private_key_dir
,
username
+
".pem"
)
public_key_dir
=
'/home/
%
s/.ssh/'
%
username
public_key_file
=
os
.
path
.
join
(
public_key_dir
,
'authorized_keys'
)
is_dir
(
private_key_dir
)
...
...
@@ -775,18 +775,26 @@ def user_list_adm(request):
return
render_to_response
(
'juser/user_list.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
@require_
adm
in
@require_
log
in
def
user_detail
(
request
):
user_id
=
request
.
GET
.
get
(
'id'
,
''
)
header_title
,
path1
,
path2
=
'查看用户'
,
'用户管理'
,
'用户详情'
if
request
.
session
.
get
(
'role_id'
)
==
0
:
user_id
=
request
.
session
.
get
(
'user_id'
)
else
:
user_id
=
request
.
GET
.
get
(
'id'
,
''
)
if
request
.
session
.
get
(
'role_id'
)
==
1
:
user
,
dept
=
get_session_user_dept
(
request
)
if
not
validate
(
request
,
user
=
[
user_id
]):
return
HttpResponseRedirect
(
'/'
)
if
not
user_id
:
return
HttpResponseRedirect
(
'/juser/user_list/'
)
if
request
.
session
.
get
(
'role_id'
,
''
)
==
'1'
:
if
not
validate
(
request
,
user
=
[
user_id
]):
return
HttpResponseRedirect
(
'/juser/user_list/'
)
user
=
User
.
objects
.
filter
(
id
=
user_id
)
if
user
:
user
=
user
[
0
]
asset_group_permed
=
user_perm_group_api
(
user
)
logs_last
=
Log
.
objects
.
filter
(
user
=
user
.
name
)
.
order_by
(
'-start_time'
)[
0
:
10
]
logs_all
=
Log
.
objects
.
filter
(
user
=
user
.
name
)
.
order_by
(
'-start_time'
)
return
render_to_response
(
'juser/user_detail.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
...
...
@@ -953,11 +961,11 @@ def profile(request):
if
not
user_id
:
return
HttpResponseRedirect
(
'/'
)
user
=
User
.
objects
.
get
(
id
=
user_id
)
return
render_to_response
(
'juser/
user_detail
.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'juser/
profile
.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
chg_info
(
request
):
header_title
,
path1
,
path2
=
'修改信息
| Edit Info
'
,
'用户管理'
,
'修改个人信息'
header_title
,
path1
,
path2
=
'修改信息'
,
'用户管理'
,
'修改个人信息'
user_id
=
request
.
session
.
get
(
'user_id'
)
user_set
=
User
.
objects
.
filter
(
id
=
user_id
)
error
=
''
...
...
templates/index_cu.html
0 → 100644
View file @
bd0fd90e
{% extends 'base.html' %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"col-lg-8"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
使用说明
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
</a>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
<i
class=
"fa fa-wrench"
></i>
</a>
<ul
class=
"dropdown-menu dropdown-user"
>
<li><a
href=
"#"
>
未启用 1
</a>
</li>
<li><a
href=
"#"
>
未启用 2
</a>
</li>
</ul>
<a
class=
"close-link"
>
<i
class=
"fa fa-times"
></i>
</a>
</div>
</div>
<div
class=
"ibox-content"
>
helo
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
templates/jperm/perm_detail.html
View file @
bd0fd90e
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-6"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
授权用户
<small>
User.
</small>
</h5>
<h5>
用户详情
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/juser/profile.html
0 → 100644
View file @
bd0fd90e
{% load mytags %}
<html>
<head>
{% include 'link_css.html' %}
<style
type=
"text/css"
>
body
{
background
:
#FFFFFF
;
}
</style>
</head>
<body>
<div
class=
"row"
>
<div
class=
"contact-box"
>
<h2
class=
"text-center"
>
{{ user.name }} 用户详情
</h2>
<div
class=
"ibox-content"
>
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<thead>
<tr>
<td
class=
"text-center"
width=
"120"
>
ID
</td>
<td
class=
"text-center"
>
用户名
</td>
<td
class=
"text-center"
>
姓名
</td>
<td
class=
"text-center"
>
角色
</td>
<td
class=
"text-center"
>
部门
</td>
<td
class=
"text-center"
>
Email
</td>
<td
class=
"text-center"
>
激活
</td>
{#
<td
class=
"text-center"
>
添加时间
</td>
#}
{#
<td
class=
"text-center"
>
最后登录
</td>
#}
</tr>
</thead>
<tbody>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
{{ user.id }}
</td>
<td
class=
"text-center"
>
{{ user.username }}
</td>
<td
class=
"text-center"
>
{{ user.name }}
</td>
<td
class=
"text-center"
>
{{ user.id | get_role }}
</td>
<td
class=
"text-center"
>
{{ user.dept.name }}
</td>
<td
class=
"text-center"
>
{{ user.email }}
</td>
<td
class=
"text-center"
>
{{ user.is_active|bool2str }}
</td>
{#
<td
class=
"text-center"
>
{{ user.date_joined }}
</td>
#}
{#
<td
class=
"text-center"
>
{{ user.last_login }}
</td>
#}
</tr>
<tr>
<td
class=
"text-center"
>
添加日期:
</td>
<td
colspan=
"2"
class=
"text-center"
>
{{ user.date_joined }}
</td>
<td
class=
"text-center"
>
最后登录:
</td>
<td
colspan=
"3"
class=
"text-center"
>
{{ user.last_login }}
</td>
</tr>
<tr>
<td
colspan=
"1"
class=
"text-center"
>
用户组:
</td>
<td
colspan=
"6"
class=
"text-center"
>
{% for group in user.group.all %}
<b>
{{ group.name }}
</b>
{% endfor %}
</td>
</tr>
{#
<tr>
#}
{#
<td
colspan=
"1"
class=
"text-center"
>
授权主机组:
</td>
#}
{#
<td
colspan=
"6"
class=
"text-center"
>
#}
{# {% for group in user|get_user_asset_group %}#}
{#
<b>
{{ group.name }}
</b>
#}
{# {% endfor %}#}
{#
</td>
#}
{#
</tr>
#}
{# #}
{#
<tr
class=
"gradeX"
>
#}
{#
<td
class=
"text-center"
>
授权主机组
</td>
#}
{#
<td
class=
"text-center"
>
#}
{# {% for asset_group in asset_group_permed %}#}
{# {{ asset_group.name }}#}
{# {% endfor %}#}
{#
</td>
#}
{#
</tr>
#}
</table>
</div>
</div>
</body>
</html>
\ No newline at end of file
templates/juser/user_detail.html
View file @
bd0fd90e
{% extends 'base.html' %}
{% load mytags %}
<html>
<head>
{% include 'link_css.html' %}
<style
type=
"text/css"
>
body
{
background
:
#FFFFFF
;
}
</style>
</head>
<body>
{% block content %}
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"contact-box"
>
<h2
class=
"text-center"
>
{{ user.name }} 用户详情
</h2>
<div
class=
"ibox-content"
>
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<thead>
<tr>
<td
class=
"text-center"
width=
"120"
>
ID
</td>
<td
class=
"text-center"
>
用户名
</td>
<td
class=
"text-center"
>
姓名
</td>
<td
class=
"text-center"
>
角色
</td>
<td
class=
"text-center"
>
部门
</td>
<td
class=
"text-center"
>
Email
</td>
<td
class=
"text-center"
>
激活
</td>
{#
<td
class=
"text-center"
>
添加时间
</td>
#}
{#
<td
class=
"text-center"
>
最后登录
</td>
#}
</tr>
</thead>
<tbody>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
{{ user.id }}
</td>
<td
class=
"text-center"
>
{{ user.username }}
</td>
<td
class=
"text-center"
>
{{ user.name }}
</td>
<td
class=
"text-center"
>
{{ user.id | get_role }}
</td>
<td
class=
"text-center"
>
{{ user.dept.name }}
</td>
<td
class=
"text-center"
>
{{ user.email }}
</td>
<td
class=
"text-center"
>
{{ user.is_active|bool2str }}
</td>
{#
<td
class=
"text-center"
>
{{ user.date_joined }}
</td>
#}
{#
<td
class=
"text-center"
>
{{ user.last_login }}
</td>
#}
</tr>
<tr>
<td
class=
"text-center"
>
添加日期:
</td>
<td
colspan=
"2"
class=
"text-center"
>
{{ user.date_joined }}
</td>
<td
class=
"text-center"
>
最后登录:
</td>
<td
colspan=
"3"
class=
"text-center"
>
{{ user.last_login }}
</td>
</tr>
<tr>
<td
colspan=
"1"
class=
"text-center"
>
用户组:
</td>
<td
colspan=
"6"
class=
"text-center"
>
{% for group in user.group.all %}
<b>
{{ group.name }}
</b>
{% endfor %}
</td>
</tr>
<tr>
<td
colspan=
"1"
class=
"text-center"
>
授权主机组:
</td>
<td
colspan=
"6"
class=
"text-center"
>
{% for group in user|get_user_asset_group %}
<b>
{{ group.name }}
</b>
{% endfor %}
</td>
</tr>
{# #}
{#
<tr
class=
"gradeX"
>
#}
{#
<td
class=
"text-center"
>
授权主机组
</td>
#}
{#
<td
class=
"text-center"
>
#}
{# {% for asset_group in asset_group_permed %}#}
{# {{ asset_group.name }}#}
{# {% endfor %}#}
{#
</td>
#}
{#
</tr>
#}
</table>
<div
class=
"col-lg-4"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<span
class=
"label label-primary"
><b>
{{ user.name }}
</b></span>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
</a>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
<i
class=
"fa fa-wrench"
></i>
</a>
<ul
class=
"dropdown-menu dropdown-user"
>
<li><a
href=
"#"
></a>
</li>
<li><a
href=
"#"
></a>
</li>
</ul>
<a
class=
"close-link"
>
<i
class=
"fa fa-times"
></i>
</a>
</div>
</div>
<div
class=
"ibox-content"
>
<div>
<div
class=
"text-left"
>
<table
class=
"table"
>
<tr>
<td
class=
"text-navy"
>
ID
</td>
<td>
{{ user.id }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
用户名
</td>
<td>
{{ user.username }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
姓名
</td>
<td>
{{ user.name }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
角色
</td>
<td>
{{ user.id | get_role }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
部门
</td>
<td>
{{ user.dept.name }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
Email
</td>
<td>
{{ user.email }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
激活
</td>
<td>
{{ user.is_active|bool2str }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
添加日期
</td>
<td>
{{ user.date_joined|date:"Y-m-d H:i:s" }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
最后登录
</td>
<td>
{{ user.last_login|date:"Y-m-d H:i:s" }}
</td>
</tr>
<tr>
<td
class=
"text-navy"
>
所在用户组
</td>
<td>
<table
class=
"table"
>
{% for group in user.group.all %}
<tr>
<td>
{{ group.name }}
</td>
</tr>
{% endfor %}
</table>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div
class=
"col-lg-4"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
授权主机/组
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
</a>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
<i
class=
"fa fa-wrench"
></i>
</a>
<ul
class=
"dropdown-menu dropdown-user"
>
<li><a
href=
"#"
>
Config option 1
</a>
</li>
<li><a
href=
"#"
>
Config option 2
</a>
</li>
</ul>
<a
class=
"close-link"
>
<i
class=
"fa fa-times"
></i>
</a>
</div>
</div>
<div
class=
"ibox-content ibox-heading"
>
<h3>
用户的所有授权主机
</h3>
<small><i
class=
"fa fa-map-marker"
></i>
这里包含了用户所有的主机组和组下的主机.
</small>
</div>
<div
class=
"ibox-content inspinia-timeline"
>
{% for group in user|get_user_asset_group %}
<div
class=
"timeline-item"
>
<div
class=
"row"
>
<div
class=
"col-xs-3 date"
>
<i
class=
"fa fa-repeat"
></i>
<b>
{{ group.name }}
</b>
<br>
<small
class=
"text-navy"
>
共: {{ group | group_asset_list_count }}台
</small>
</div>
<div
class=
"col-xs-7 content no-top-border"
>
<p
class=
"m-b-xs"
><strong>
{{ group.comment }}
</strong></p>
<p>
{% for asset in group|group_asset_list %}
{{ asset.ip }}
<br>
{% endfor %}
</p>
<p></p>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<div
class=
"col-lg-4"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
登录记录
</h5>
<div
class=
"ibox-tools"
>
<span
class=
"label label-warning-light"
>
最近登录
</span>
</div>
</div>
<div
class=
"ibox-content"
>
<div
id=
"last"
>
<div
class=
"feed-activity-list"
>
{% for log in logs_last %}
<div
class=
"feed-element"
>
<a
href=
"profile.html"
class=
"pull-left"
>
<img
alt=
"image"
class=
"img-circle"
src=
"/static/img/{{ session_role_id | to_avatar }}.png"
>
</a>
<div
class=
"media-body "
>
<small
class=
"pull-right"
>
{{ log.start_time|time_delta }}
</small>
<strong>
{{ log.user }}
</strong>
登录了
<span
class=
"text-navy"
>
{{ log.host }}.
</span><br>
<small
class=
"text-muted"
>
{{ log.start_time|date:"Y-m-d H:i:s" }}
</small>
</div>
</div>
{% endfor %}
</div>
<button
id=
"show"
class=
"btn btn-primary btn-block m-t"
><i
class=
"fa fa-arrow-down"
></i>
Show All
</button>
</div>
<div
id=
"all"
style=
"display: none"
>
<div
class=
"feed-activity-list"
>
{% for log in logs_all %}
<div
class=
"feed-element"
>
<a
href=
"profile.html"
class=
"pull-left"
>
<img
alt=
"image"
class=
"img-circle"
src=
"/static/img/{{ session_role_id | to_avatar }}.png"
>
</a>
<div
class=
"media-body "
>
<small
class=
"pull-right"
>
{{ log.start_time|time_delta }}
</small>
<strong>
{{ log.user }}
</strong>
登录了
<span
class=
"text-navy"
>
{{ log.host }}.
</span><br>
<small
class=
"text-muted"
>
{{ log.start_time|date:"Y-m-d H:i:s" }}
</small>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
'#show'
).
click
(
function
(){
$
(
'#last'
).
css
(
'display'
,
'none'
);
$
(
'#all'
).
css
(
'display'
,
'block'
);
})
})
</script>
{% endblock %}
\ No newline at end of file
templates/juser/user_list.html
View file @
bd0fd90e
...
...
@@ -56,6 +56,7 @@
<th
class=
"text-center"
>
小组
</th>
<th
class=
"text-center"
>
角色
</th>
<th
class=
"text-center"
>
激活
</th>
<th
class=
"text-center"
>
下载密钥
</th>
<th
class=
"text-center"
>
操作
</th>
</tr>
</thead>
...
...
@@ -71,8 +72,9 @@
<td
class=
"text-center"
title=
"{% for user_group in user.group.all %} {{ user_group.name }} {% endfor %}"
>
{{ user.group.all | group_str2 }}
</td>
<td
class=
"text-center"
>
{{ user.id | get_role }}
</td>
<td
class=
"text-center"
>
{{ user.is_active|bool2str }}
</td>
<td
class=
"text-center"
><a
href=
"/static/jumpserver/{{ user.username }}.pem"
>
下载
</a></td>
<td
class=
"text-center"
>
<a
title=
"[ {{ user.name }} ] 详情"
value=
"../user_detail/?id={{ user.id }}"
class=
"iframe
btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"../user_detail/?id={{ user.id }}"
class=
"
btn btn-xs btn-primary"
>
详情
</a>
{% ifequal session_role_id 2 %}
<a
href=
"../user_edit/?id={{ user.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"../user_del/?id={{ user.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
...
...
templates/nav.html
View file @
bd0fd90e
...
...
@@ -19,7 +19,7 @@
<li
class=
"dept_add"
><a
href=
"/juser/dept_add/"
>
添加部门
</a></li>
<li
class=
"group_list group_edit"
><a
href=
"/juser/group_list/"
>
查看小组
</a></li>
<li
class=
"group_add"
><a
href=
"/juser/group_add/"
>
添加小组
</a></li>
<li
class=
"user_list user_edit"
><a
href=
"/juser/user_list/"
>
查看用户
<span
class=
"label {% ifequal user_active_num user_total_num %}label-primary {% else %}label-warning {% endifequal %}pull-right"
>
{{ user_active_num }}/{{ user_total_num }}
</span></a></li>
<li
class=
"user_list user_edit
user_detail
"
><a
href=
"/juser/user_list/"
>
查看用户
<span
class=
"label {% ifequal user_active_num user_total_num %}label-primary {% else %}label-warning {% endifequal %}pull-right"
>
{{ user_active_num }}/{{ user_total_num }}
</span></a></li>
<li
class=
"user_add"
><a
href=
"/juser/user_add/"
>
添加用户
</a></li>
</ul>
</li>
...
...
@@ -137,7 +137,7 @@
<a
href=
"/"
><i
class=
"fa fa-th-large"
></i>
<span
class=
"nav-label"
>
仪表盘
</span><span
class=
"label label-info pull-right"
></span></a>
</li>
<li>
<a
href=
"/"
><i
class=
"fa fa-rebel"
></i>
<span
class=
"nav-label"
>
个人信息
</span><span
class=
"label label-info pull-right"
></span></a>
<a
href=
"/
juser/user_detail/?id={{ session_user_id }}
"
><i
class=
"fa fa-rebel"
></i>
<span
class=
"nav-label"
>
个人信息
</span><span
class=
"label label-info pull-right"
></span></a>
</li>
<li
id=
"jasset"
>
<a
href=
"/jasset/host_list/"
><i
class=
"fa fa-cube"
></i>
<span
class=
"nav-label"
>
查看主机
</span><span
class=
"label label-info pull-right"
></span></a>
...
...
templates/nav_li_profile.html
View file @
bd0fd90e
...
...
@@ -8,7 +8,7 @@
<span
class=
"clear"
>
<span
class=
"block m-t-xs"
>
<strong
class=
"font-bold"
>
{{ session_user_id | to_name}}
</strong>
</span>
<span
class=
"text-muted text-xs block"
>
{{ session_role_id | to_role_name }}
<b
class=
"caret"
></b></span>
</span>
</a>
<ul
class=
"dropdown-menu animated fadeInRight m-t-xs"
>
<li><a
value=
"/juser/
user_detail
/?id={{ session_user_id }}"
class=
"iframe"
>
个人信息
</a></li>
<li><a
value=
"/juser/
profile
/?id={{ session_user_id }}"
class=
"iframe"
>
个人信息
</a></li>
<li><a
href=
"/juser/chg_info/"
>
修改信息
</a></li>
<li><a
href=
"/juser/chg_role/"
>
切换角色
</a></li>
...
...
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