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
07b0e298
Commit
07b0e298
authored
Mar 05, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
今天到此为止
parent
8bc40dbe
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
162 additions
and
155 deletions
+162
-155
AddUserAsset.py
docs/AddUserAsset.py
+22
-12
views.py
jperm/views.py
+31
-31
context_processors.py
jumpserver/context_processors.py
+8
-2
mytags.py
jumpserver/templatetags/mytags.py
+2
-2
views.py
juser/views.py
+1
-1
perm_add.html
templates/jperm/perm_add.html
+1
-1
perm_asset_detail.html
templates/jperm/perm_asset_detail.html
+1
-1
perm_detail.html
templates/jperm/perm_detail.html
+1
-1
perm_edit.html
templates/jperm/perm_edit.html
+1
-1
perm_list.html
templates/jperm/perm_list.html
+65
-65
perm_user_detail.html
templates/jperm/perm_user_detail.html
+1
-1
sudo_add.html
templates/jperm/sudo_add.html
+1
-1
sudo_cmd_add.html
templates/jperm/sudo_cmd_add.html
+1
-1
sudo_cmd_list.html
templates/jperm/sudo_cmd_list.html
+1
-1
sudo_detail.html
templates/jperm/sudo_detail.html
+1
-1
sudo_edit.html
templates/jperm/sudo_edit.html
+1
-1
sudo_list.html
templates/jperm/sudo_list.html
+1
-1
user_list.html
templates/juser/user_list.html
+1
-1
nav.html
templates/nav.html
+19
-28
nav_li_profile.html
templates/nav_li_profile.html
+2
-2
No files found.
docs/AddUserAsset.py
View file @
07b0e298
...
...
@@ -24,14 +24,6 @@ def test_add_idc():
print
'Add:
%
s'
%
name
def
test_add_asset_group
():
BisGroup
.
objects
.
create
(
name
=
'ALL'
,
type
=
'A'
,
comment
=
'ALL'
)
for
i
in
range
(
1
,
20
):
name
=
'AssetGroup'
+
str
(
i
)
BisGroup
.
objects
.
create
(
name
=
name
,
type
=
'A'
,
comment
=
name
)
print
'Add:
%
s'
%
name
def
test_add_dept
():
for
i
in
range
(
1
,
100
):
name
=
'DEPT'
+
str
(
i
)
...
...
@@ -73,18 +65,36 @@ def test_add_user():
print
"Add:
%
s"
%
username
def
test_add_asset_group
():
BisGroup
.
objects
.
create
(
name
=
'ALL'
,
type
=
'A'
,
comment
=
'ALL'
)
user_all
=
Asset
.
objects
.
all
()
for
i
in
range
(
1
,
20
):
name
=
'AssetGroup'
+
str
(
i
)
group
=
BisGroup
(
name
=
name
,
type
=
'A'
,
comment
=
name
)
group
.
save
()
print
'Add:
%
s'
%
name
def
test_add_asset
():
test_idc
=
IDC
.
objects
.
get
(
id
=
1
)
idc_all
=
IDC
.
objects
.
all
()
test_idc
=
random
.
choice
(
idc_all
)
bis_group_all
=
BisGroup
.
objects
.
all
()
for
i
in
range
(
1
,
500
):
ip
=
'192.168.1.'
+
str
(
i
)
Asset
.
objects
.
create
(
ip
=
ip
,
port
=
22
,
login_type
=
'L'
,
idc
=
test_idc
,
is_active
=
True
,
comment
=
'test'
)
asset
=
Asset
(
ip
=
ip
,
port
=
22
,
login_type
=
'L'
,
idc
=
test_idc
,
is_active
=
True
,
comment
=
'test'
)
asset
.
save
()
asset
.
bis_group
=
[
random
.
choice
(
bis_group_all
)
for
i
in
range
(
2
)]
print
"Add:
%
s"
%
ip
if
__name__
==
'__main__'
:
test_add_dept
()
test_add_group
()
#
test_add_dept()
#
test_add_group()
#test_add_user()
#test_add_idc()
#test_add_asset_group()
test_add_asset
()
...
...
jperm/views.py
View file @
07b0e298
...
...
@@ -35,25 +35,6 @@ def perm_group_update(user_group_name='', user_group_id='', asset_groups_name=''
Perm
(
user_group
=
user_group
,
asset_group
=
asset_group
)
.
save
()
def
perm_list
(
request
):
header_title
,
path1
,
path2
=
u'主机授权 | Perm Host Detail.'
,
u'授权管理'
,
u'授权详情'
groups
=
contact_list
=
Perm
.
objects
.
all
()
users
=
contact_list2
=
User
.
objects
.
all
()
.
order_by
(
'id'
)
p
=
paginator
=
Paginator
(
contact_list
,
10
)
try
:
current_page
=
int
(
request
.
GET
.
get
(
'page'
,
'1'
))
except
ValueError
:
current_page
=
1
page_range
=
page_list_return
(
len
(
p
.
page_range
),
current_page
)
try
:
contacts
=
paginator
.
page
(
current_page
)
except
(
EmptyPage
,
InvalidPage
):
contacts
=
paginator
.
page
(
paginator
.
num_pages
)
return
render_to_response
(
'jperm/perm_list.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
user_asset_cmd_groups_get
(
user_groups_select
=
''
,
asset_groups_select
=
''
,
cmd_groups_select
=
''
):
user_groups_select_list
=
[]
asset_groups_select_list
=
[]
...
...
@@ -72,10 +53,10 @@ def user_asset_cmd_groups_get(user_groups_select='', asset_groups_select='', cmd
def
perm_add
(
request
):
header_title
,
path1
,
path2
=
u'主机授权添加
| Perm Add Detail
.'
,
u'授权管理'
,
u'授权添加'
header_title
,
path1
,
path2
=
u'主机授权添加.'
,
u'授权管理'
,
u'授权添加'
if
request
.
method
==
'GET'
:
user_groups
=
UserGroup
.
objects
.
all
(
)
user_groups
=
UserGroup
.
objects
.
filter
(
id__gt
=
2
)
asset_groups
=
BisGroup
.
objects
.
all
()
else
:
...
...
@@ -95,6 +76,25 @@ def perm_add(request):
return
render_to_response
(
'jperm/perm_add.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
perm_list
(
request
):
header_title
,
path1
,
path2
=
u'主机授权'
,
u'授权管理'
,
u'授权详情'
contact_list
=
Perm
.
objects
.
all
()
contact_list2
=
User
.
objects
.
all
()
.
order_by
(
'id'
)
p
=
paginator
=
Paginator
(
contact_list
,
10
)
try
:
current_page
=
int
(
request
.
GET
.
get
(
'page'
,
'1'
))
except
ValueError
:
current_page
=
1
page_range
=
page_list_return
(
len
(
p
.
page_range
),
current_page
)
try
:
contacts
=
paginator
.
page
(
current_page
)
except
(
EmptyPage
,
InvalidPage
):
contacts
=
paginator
.
page
(
paginator
.
num_pages
)
return
render_to_response
(
'jperm/perm_list.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
perm_list_ajax
(
request
):
tab
=
request
.
POST
.
get
(
'tab'
,
'tab1'
)
search
=
request
.
POST
.
get
(
'search'
,
''
)
...
...
@@ -132,7 +132,7 @@ def perm_list_ajax(request):
def
perm_edit
(
request
):
if
request
.
method
==
'GET'
:
header_title
,
path1
,
path2
=
u'编辑授权
| Perm Host Edit.
'
,
u'授权管理'
,
u'授权编辑'
header_title
,
path1
,
path2
=
u'编辑授权'
,
u'授权管理'
,
u'授权编辑'
perm_id
=
request
.
GET
.
get
(
'id'
)
perm
=
Perm
.
objects
.
filter
(
id
=
perm_id
)
if
perm
:
...
...
@@ -156,7 +156,7 @@ def perm_edit(request):
def
perm_detail
(
request
):
header_title
,
path1
,
path2
=
u'编辑授权
| Perm Host Edit.
'
,
u'授权管理'
,
u'授权详情'
header_title
,
path1
,
path2
=
u'编辑授权'
,
u'授权管理'
,
u'授权详情'
perm_id
=
request
.
GET
.
get
(
'id'
)
perm
=
Perm
.
objects
.
filter
(
id
=
perm_id
)
if
perm
:
...
...
@@ -185,7 +185,7 @@ def perm_del(request):
def
perm_asset_detail
(
request
):
header_title
,
path1
,
path2
=
u'用户授权主机
| User Perm Asset.
'
,
u'权限管理'
,
u'用户主机详情'
header_title
,
path1
,
path2
=
u'用户授权主机'
,
u'权限管理'
,
u'用户主机详情'
user_id
=
request
.
GET
.
get
(
'id'
)
user
=
User
.
objects
.
filter
(
id
=
user_id
)
if
user
:
...
...
@@ -268,7 +268,7 @@ def sudo_ldap_add(name, users_runas, user_groups_select, asset_groups_select,
def
sudo_add
(
request
):
header_title
,
path1
,
path2
=
u'Sudo授权
| Perm Sudo Add.
'
,
u'权限管理'
,
u'添加Sudo权限'
header_title
,
path1
,
path2
=
u'Sudo授权'
,
u'权限管理'
,
u'添加Sudo权限'
user_groups
=
UserGroup
.
objects
.
all
()
asset_groups
=
BisGroup
.
objects
.
all
()
cmd_groups
=
CmdGroup
.
objects
.
all
()
...
...
@@ -290,7 +290,7 @@ def sudo_add(request):
def
sudo_list
(
request
):
header_title
,
path1
,
path2
=
u'Sudo授权
| Perm Sudo Detail.
'
,
u'权限管理'
,
u'Sudo权限详情'
header_title
,
path1
,
path2
=
u'Sudo授权'
,
u'权限管理'
,
u'Sudo权限详情'
sudo_perms
=
contact_list
=
SudoPerm
.
objects
.
all
()
p1
=
paginator1
=
Paginator
(
contact_list
,
10
)
user_groups
=
UserGroup
.
objects
.
filter
(
Q
(
type
=
'A'
)
|
Q
(
type
=
'P'
))
...
...
@@ -310,7 +310,7 @@ def sudo_list(request):
def
sudo_edit
(
request
):
header_title
,
path1
,
path2
=
u'Sudo授权
| Perm Sudo Detail.
'
,
u'授权管理'
,
u'Sudo修改'
header_title
,
path1
,
path2
=
u'Sudo授权'
,
u'授权管理'
,
u'Sudo修改'
if
request
.
method
==
'GET'
:
sudo_perm_id
=
request
.
GET
.
get
(
'id'
,
'0'
)
...
...
@@ -356,7 +356,7 @@ def sudo_edit(request):
def
sudo_detail
(
request
):
header_title
,
path1
,
path2
=
u'Sudo授权详情
| Perm Sudo Detail.
'
,
u'授权管理'
,
u'授权详情'
header_title
,
path1
,
path2
=
u'Sudo授权详情'
,
u'授权管理'
,
u'授权详情'
sudo_perm_id
=
request
.
GET
.
get
(
'id'
)
sudo_perm
=
SudoPerm
.
objects
.
filter
(
id
=
sudo_perm_id
)
if
sudo_perm
:
...
...
@@ -391,7 +391,7 @@ def sudo_del(request):
def
cmd_add
(
request
):
header_title
,
path1
,
path2
=
u'sudo命令添加
| Sudo Cmd Add.'
,
u'授权管理
管理'
,
u'命令组添加'
header_title
,
path1
,
path2
=
u'sudo命令添加
'
,
u'授权
管理'
,
u'命令组添加'
if
request
.
method
==
'POST'
:
name
=
request
.
POST
.
get
(
'name'
)
...
...
@@ -407,7 +407,7 @@ def cmd_add(request):
def
cmd_edit
(
request
):
header_title
,
path1
,
path2
=
u'sudo命令修改
| Sudo Cmd Edit.
'
,
u'授权管理管理'
,
u'命令组修改'
header_title
,
path1
,
path2
=
u'sudo命令修改'
,
u'授权管理管理'
,
u'命令组修改'
cmd_group_id
=
request
.
GET
.
get
(
'id'
)
cmd_group
=
CmdGroup
.
objects
.
filter
(
id
=
cmd_group_id
)
...
...
@@ -433,7 +433,7 @@ def cmd_edit(request):
def
cmd_list
(
request
):
header_title
,
path1
,
path2
=
u'sudo命令查看
| Sudo Cmd List.
'
,
u'权限管理'
,
u'Sudo命令添加'
header_title
,
path1
,
path2
=
u'sudo命令查看'
,
u'权限管理'
,
u'Sudo命令添加'
cmd_groups
=
contact_list
=
CmdGroup
.
objects
.
all
()
p
=
paginator
=
Paginator
(
contact_list
,
10
)
...
...
jumpserver/context_processors.py
View file @
07b0e298
from
juser.models
import
User
def
name_proc
(
request
):
user_id
=
request
.
session
.
get
(
'user_id'
)
role
=
request
.
session
.
get
(
'role_id'
)
return
{
'user_id'
:
user_id
,
'role_id'
:
role
}
\ No newline at end of file
user_total_num
=
User
.
objects
.
all
()
.
count
()
user_active_num
=
User
.
objects
.
filter
(
is_active
=
True
)
.
count
()
return
{
'session_user_id'
:
user_id
,
'session_role_id'
:
role
,
'user_total_num'
:
user_total_num
,
'user_active_num'
:
user_active_num
}
jumpserver/templatetags/mytags.py
View file @
07b0e298
...
...
@@ -41,10 +41,10 @@ def groups_str(user_id):
user
=
User
.
objects
.
get
(
id
=
user_id
)
for
group
in
user
.
group
.
all
():
groups
.
append
(
group
.
name
)
if
len
(
groups
)
<
4
:
if
len
(
groups
)
<
3
:
return
' '
.
join
(
groups
)
else
:
return
"
%
s ..."
%
' '
.
join
(
groups
[
0
:
3
])
return
"
%
s ..."
%
' '
.
join
(
groups
[
0
:
2
])
@register.filter
(
name
=
'group_manage_str'
)
...
...
juser/views.py
View file @
07b0e298
...
...
@@ -427,7 +427,7 @@ def group_update_member(group_id, users_id_list):
def
group_edit
(
request
):
error
=
''
msg
=
''
header_title
,
path1
,
path2
=
'修改
属组 | Edit Group'
,
'juser'
,
'group_edit
'
header_title
,
path1
,
path2
=
'修改
小组信息'
,
'用户管理'
,
'编辑小组
'
if
request
.
method
==
'GET'
:
group_id
=
request
.
GET
.
get
(
'id'
,
''
)
group
=
UserGroup
.
objects
.
filter
(
id
=
group_id
)
...
...
templates/jperm/perm_add.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
主机授权
<small>
Perm Add info.
</small>
</h5>
<h5>
主机授权
添加
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/perm_asset_detail.html
View file @
07b0e298
...
...
@@ -9,7 +9,7 @@
<div
class=
"col-lg-6"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
授权主机
<small>
Asset.
</small>
</h5>
<h5>
授权主机
详情
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/perm_detail.html
View file @
07b0e298
...
...
@@ -55,7 +55,7 @@
<div
class=
"col-lg-6"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
授权
主机
<small>
Asset.
</small>
</h5>
<h5>
授权
详情
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/perm_edit.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
主机授权
<small>
Perm Add info.
</small>
</h5>
<h5>
主机授权
修改
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/perm_list.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
用户组授权
<small>
show host perm info.
</small>
</h5>
<h5>
授权列表
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
@@ -33,8 +33,8 @@
<div
class=
"panel-heading"
>
<div
class=
"panel-options"
>
<ul
class=
"nav nav-tabs"
>
<li
id=
"tab1"
class=
"active"
><a
data-toggle=
"tab"
href=
"
/perm_list/
"
>
授权查看
</a></li>
<li
id=
"tab2"
class=
""
><a
data-toggle=
"tab"
href=
"
/perm_user_detail/
"
>
用户授权详情
</a></li>
<li
id=
"tab1"
class=
"active"
><a
data-toggle=
"tab"
href=
"
#tab-1
"
>
授权查看
</a></li>
<li
id=
"tab2"
class=
""
><a
data-toggle=
"tab"
href=
"
#tab-2
"
>
用户授权详情
</a></li>
<li
style=
"float: right"
>
<form
method=
"get"
action=
""
class=
"pull-right mail-search"
>
<div
class=
"input-group"
>
...
...
@@ -130,68 +130,68 @@
</div>
<div
id=
"tab-2"
class=
"tab-pane"
>
{#
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
#}
{#
<thead>
#}
{#
<tr>
#}
{#
<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>
#}
{#
<tbody
id=
"perm_list"
>
#}
{# {% for user in contacts2.object_list %}#
}
{#
<tr
class=
"gradeX"
>
#}
{#
<td
class=
"text-center"
>
{{ user.name }}
</td>
#}
{#
<td
class=
"text-center"
>
{{ user.id | get_role }}
</td>
#}
{#
<td
class=
"text-center"
>
{{ user.username | groups_str }}
</td>
#}
{#
<td
class=
"text-center"
>
{{ user.id | perm_asset_count }}
</td>
#}
{#
<td
class=
"text-center"
>
#}
{#
<a
title=
"[ {{ user.name }} ] 授权详情"
href=
"../perm_asset_detail/?id={{ user.id }}"
class=
"btn btn-xs btn-primary"
>
详情
</a>
#}
{#
</td>
#}
{#
</tr>
#}
{# {% endfor %}#
}
{#
</tbody>
#}
{#
</table>
#}
{#
<div
class=
"row"
>
#}
{#
<div
class=
"col-sm-6"
>
#}
{#
<div
class=
"dataTables_info"
id=
"editable_info"
role=
"status"
aria-live=
"polite"
>
#}
{# Showing {{ contacts2.start_index }} to {{ contacts2.end_index }} of {{ p2.count }} entries#}
{#
</div>
#}
{#
</div>
#}
{#
<div
class=
"col-sm-6"
>
#}
{#
<div
class=
"dataTables_paginate paging_simple_numbers"
id=
"editable_paginate"
>
#}
{#
<ul
class=
"pagination"
style=
"margin-top: 0; float: right"
>
#}
{# {% if contacts2.has_previous %}#
}
{#
<li
class=
"paginate_button previous"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
#}
{#
<a
href=
"?page={{ contacts2.previous_page_number }}"
>
Previous
</a>
#}
{#
</li>
#}
{# {% else %}#
}
{#
<li
class=
"paginate_button previous disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
#}
{#
<a
href=
"#"
>
Previous
</a>
#}
{#
</li>
#}
{# {% endif %}#
}
{# {% for page in page_range2 %}#
}
{# {% ifequal current_page page %}#
}
{#
<li
class=
"paginate_button active"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
#}
{# {% else %}#
}
{#
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
#}
{# {% endifequal %}#
}
{# {% endfor %}#
}
{# {% if contacts2.has_next %}#
}
{#
<li
class=
"paginate_button next"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
#}
{#
<a
href=
"?page={{ contacts2.next_page_number }}"
>
Next
</a>
#}
{#
</li>
#}
{# {% else %}#
}
{#
<li
class=
"paginate_button next disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
#}
{#
<a
href=
"#"
>
Next
</a>
#}
{#
</li>
#}
{# {% endif %}#
}
{#
</ul>
#}
{#
</div>
#}
{#
</div>
#}
{#
</div>
#}
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<thead>
<tr>
<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>
<tbody
id=
"perm_list"
>
{% for user in contacts2.object_list %
}
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
{{ user.name }}
</td>
<td
class=
"text-center"
>
{{ user.id | get_role }}
</td>
<td
class=
"text-center"
>
{{ user.username | groups_str }}
</td>
<td
class=
"text-center"
>
{{ user.id | perm_asset_count }}
</td>
<td
class=
"text-center"
>
<a
title=
"[ {{ user.name }} ] 授权详情"
href=
"#"
class=
"btn btn-xs btn-primary"
>
详情
</a>
</td>
</tr>
{% endfor %
}
</tbody>
</table>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"dataTables_info"
id=
"editable_info"
role=
"status"
aria-live=
"polite"
>
Showing {{ contacts2.start_index }} to {{ contacts2.end_index }} of {{ p2.count }} entries
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"dataTables_paginate paging_simple_numbers"
id=
"editable_paginate"
>
<ul
class=
"pagination"
style=
"margin-top: 0; float: right"
>
{% if contacts2.has_previous %
}
<li
class=
"paginate_button previous"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"?page={{ contacts2.previous_page_number }}"
>
Previous
</a>
</li>
{% else %
}
<li
class=
"paginate_button previous disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"#"
>
Previous
</a>
</li>
{% endif %
}
{% for page in page_range2 %
}
{% ifequal current_page page %
}
<li
class=
"paginate_button active"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% else %
}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% endifequal %
}
{% endfor %
}
{% if contacts2.has_next %
}
<li
class=
"paginate_button next"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"?page={{ contacts2.next_page_number }}"
>
Next
</a>
</li>
{% else %
}
<li
class=
"paginate_button next disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"#"
>
Next
</a>
</li>
{% endif %
}
</ul>
</div>
</div>
</div>
</div>
</div>
...
...
templates/jperm/perm_user_detail.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
用户
组授权
<small>
show host perm info.
</small>
</h5>
<h5>
用户
授权详情
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/sudo_add.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
Sudo授权
<small>
show sudo perm info.
</small>
</h5>
<h5>
Sudo授权
添加
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/sudo_cmd_add.html
View file @
07b0e298
...
...
@@ -7,7 +7,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
填写基本信息
<small>
Fill Cmd info.
</small>
</h5>
<h5>
填写基本信息
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/sudo_cmd_list.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
查看
分组
<small>
show group info.
</small>
</h5>
<h5>
查看
命令分组
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/sudo_detail.html
View file @
07b0e298
...
...
@@ -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>
Sudo授权详情
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/sudo_edit.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
Sudo授权
<small>
show sudo perm info.
</small>
</h5>
<h5>
Sudo授权
编辑
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/jperm/sudo_list.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
Sudo授权
<small>
show sudo perm info.
</small>
</h5>
<h5>
Sudo授权
列表
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/juser/user_list.html
View file @
07b0e298
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
查看用户
<
small>
show user info.
</small>
<
/h5>
<h5>
查看用户
</h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
templates/nav.html
View file @
07b0e298
...
...
@@ -14,12 +14,12 @@
<li
id=
"juser"
>
<a
href=
"#"
><i
class=
"fa fa-rebel"
></i>
<span
class=
"nav-label"
>
用户管理
</span><span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
>
<li
id=
"user_list"
><a
href=
"/juser/user_list/"
>
查看用户
<span
class=
"label label-primary pull-right"
>
16/24
</span></a></li>
<li
id=
"user_add"
><a
href=
"/juser/user_add/"
>
添加用户
</a></li>
<li
id=
"dept_list"
><a
href=
"/juser/dept_list/"
>
查看部门
</a></li>
<li
id=
"dept_add"
><a
href=
"/juser/dept_add/"
>
添加部门
</a></li>
<li
id=
"group_list"
><a
href=
"/juser/group_list/"
>
查看小组
</a></li>
<li
id=
"group_add"
><a
href=
"/juser/group_add/"
>
添加小组
</a></li>
<li
id=
"user_list"
><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
id=
"user_add"
><a
href=
"/juser/user_add/"
>
添加用户
</a></li>
</ul>
</li>
<li
id=
"jasset"
>
...
...
@@ -34,34 +34,25 @@
<li
id=
"jperm"
>
<a
href=
"#"
><i
class=
"fa fa-edit"
></i>
<span
class=
"nav-label"
>
授权管理
</span><span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
>
<li
id=
"perm_list"
><a
href=
"/jperm/perm_list/"
>
主机授权
<span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-third-level"
>
<li
id=
"perm_add"
>
<a
href=
"/jperm/perm_add/"
>
授权添加
</a>
</li>
<li
id=
"perm_list"
>
<a
href=
"/jperm/perm_list/"
>
授权查看
</a>
</li>
</ul>
<li
id=
"perm_add"
>
<a
href=
"/jperm/perm_add/"
>
授权添加
</a>
</li>
<li>
<a
href=
"#"
>
Sudo授权
<span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-third-level"
>
<li
id=
"cmd_add"
>
<a
href=
"/jperm/cmd_add/"
>
命令组添加
</a>
</li>
<li
id=
"cmd_list"
>
<a
href=
"/jperm/cmd_list/"
>
命令组查看
</a>
</li>
<li
id=
"sudo_add"
>
<a
href=
"/jperm/sudo_add/"
>
Sudo添加
</a>
</li>
<li
id=
"sudo_list"
>
<a
href=
"/jperm/sudo_list/"
>
Sudo查看
</a>
</li>
</ul>
<li
id=
"perm_list"
>
<a
href=
"/jperm/perm_list/"
>
授权查看
</a>
</li>
<li
id=
"cmd_add"
>
<a
href=
"/jperm/cmd_add/"
>
命令组添加
</a>
</li>
<li
id=
"cmd_list"
>
<a
href=
"/jperm/cmd_list/"
>
命令组查看
</a>
</li>
<li
id=
"sudo_add"
>
<a
href=
"/jperm/sudo_add/"
>
Sudo添加
</a>
</li>
<li
id=
"sudo_list"
>
<a
href=
"/jperm/sudo_list/"
>
Sudo查看
</a>
</li>
</ul>
</li>
<li
id=
"jlog"
>
...
...
templates/nav_li_profile.html
View file @
07b0e298
{% load mytags %}
<li
class=
"nav-header"
>
<div
class=
"dropdown profile-element"
>
<span>
<img
alt=
"image"
class=
"img-circle"
width=
"48"
height=
"48"
src=
"/static/img/{{ role_id | to_avatar }}.png"
/>
<img
alt=
"image"
class=
"img-circle"
width=
"48"
height=
"48"
src=
"/static/img/{{
session_
role_id | to_avatar }}.png"
/>
{#
<img
alt=
"image"
class=
"img-circle"
src=
"/static/img/profile_small.jpg"
>
#}
</span>
<a
data-toggle=
"dropdown"
class=
"dropdown-toggle"
href=
"#"
>
<span
class=
"clear"
>
<span
class=
"block m-t-xs"
>
<strong
class=
"font-bold"
>
{{ user_id | to_name}}
</strong>
<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"
>
{{ role_id | to_role_name }}
<b
class=
"caret"
></b></span>
</span>
</a>
<ul
class=
"dropdown-menu animated fadeInRight m-t-xs"
>
<li><a
href=
"/juser/profile/"
>
个人信息
</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