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
81f7507b
Commit
81f7507b
authored
Jan 21, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加查看授权页面
parent
736c58ce
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
145 additions
and
1 deletion
+145
-1
urls.py
jpermission/urls.py
+2
-0
views.py
jpermission/views.py
+20
-0
perm_list.html
templates/jperm/perm_list.html
+60
-0
perm_user_list.html
templates/jperm/perm_user_list.html
+1
-1
perm_user_show.html
templates/jperm/perm_user_show.html
+62
-0
No files found.
jpermission/urls.py
View file @
81f7507b
...
@@ -8,4 +8,6 @@ urlpatterns = patterns('jpermission.views',
...
@@ -8,4 +8,6 @@ urlpatterns = patterns('jpermission.views',
(
r'^perm_user_list/$'
,
'perm_user_list'
),
(
r'^perm_user_list/$'
,
'perm_user_list'
),
(
r'^perm_add/$'
,
'perm_add'
),
(
r'^perm_add/$'
,
'perm_add'
),
(
r'^perm_user_show/$'
,
'perm_user_show'
),
(
r'^perm_list/$'
,
'perm_list'
),
)
)
jpermission/views.py
View file @
81f7507b
...
@@ -40,3 +40,23 @@ def perm_add(request):
...
@@ -40,3 +40,23 @@ def perm_add(request):
msg
=
u'添加成功'
msg
=
u'添加成功'
return
render_to_response
(
'jperm/perm_add.html'
,
locals
())
return
render_to_response
(
'jperm/perm_add.html'
,
locals
())
def
perm_user_show
(
request
):
header_title
,
path1
,
path2
=
u'查看授权用户 | Perm User Detail.'
,
u'授权管理'
,
u'用户详情'
users
=
User
.
objects
.
all
()
return
render_to_response
(
'jperm/perm_user_show.html'
,
locals
(),)
def
perm_list
(
request
):
header_title
,
path1
,
path2
=
u'查看用户授权 | Perm User Detail.'
,
u'授权管理'
,
u'用户详情'
username
=
request
.
GET
.
get
(
'username'
,
None
)
if
not
username
:
return
HttpResponseRedirect
(
'/'
)
user
=
User
.
objects
.
get
(
username
=
username
)
hosts
=
[]
for
perm
in
user
.
permission_set
.
all
():
hosts
.
append
(
perm
.
asset
)
return
render_to_response
(
'jperm/perm_list.html'
,
locals
())
templates/jperm/perm_list.html
0 → 100644
View file @
81f7507b
{% extends 'base.html' %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
权限主机 {{ user.username }}
<small>
show perm host info.
</small></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"
style=
"display: block;"
>
<form
method=
"post"
action=
""
>
<table
class=
"table table-hover"
>
<thead>
<tr>
<th>
ID
</th>
<th>
IP
</th>
</tr>
</thead>
<tbody>
{% for host in hosts %}
<tr>
<td>
{{ host.id }}
</td>
<td>
{{ host.ip }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-2"
>
<button
class=
"btn btn-white"
type=
"submit"
>
取消
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
确认删除
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
templates/jperm/perm_user_list.html
View file @
81f7507b
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<tr>
<tr>
<td>
{{ user.id }}
</td>
<td>
{{ user.id }}
</td>
<td>
{{ user.username }}
</td>
<td>
{{ user.username }}
</td>
<td><a
href=
"../perm_add/?username={{ user.username }}"
>
添加
授权
</a></td>
<td><a
href=
"../perm_add/?username={{ user.username }}"
>
添加
权限
</a></td>
</tr>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</tbody>
...
...
templates/jperm/perm_user_show.html
0 → 100644
View file @
81f7507b
{% extends 'base.html' %}
{% load mytags %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
用户信息
<small>
show user info.
</small></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"
style=
"display: block;"
>
<form
method=
"post"
action=
""
>
<table
class=
"table table-hover"
>
<thead>
<tr>
<th>
ID
</th>
<th>
添加授权
</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>
{{ user.id }}
</td>
<td>
{{ user.username }}
</td>
<td><a
href=
"../perm_list/?username={{ user.username }}"
>
查看权限
</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-2"
>
<button
class=
"btn btn-white"
type=
"submit"
>
取消
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
确认删除
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
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