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
68f67aec
Commit
68f67aec
authored
Jan 22, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加显示详情
parent
c54bc85b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
1 deletion
+83
-1
urls.py
juser/urls.py
+1
-0
views.py
juser/views.py
+9
-0
user_detail.html
templates/juser/user_detail.html
+72
-0
user_list.html
templates/juser/user_list.html
+1
-1
No files found.
juser/urls.py
View file @
68f67aec
...
...
@@ -10,4 +10,5 @@ urlpatterns = patterns('juser.views',
(
r'^user_list/$'
,
'user_list'
),
(
r'^group_add/$'
,
'group_add'
),
(
r'^group_list/$'
,
'group_list'
),
(
r"^user_detail/$"
,
'user_detail'
),
)
juser/views.py
View file @
68f67aec
...
...
@@ -11,6 +11,7 @@ import ldap
from
ldap
import
modlist
from
Crypto.PublicKey
import
RSA
import
crypt
from
django.http
import
HttpResponseRedirect
from
django.shortcuts
import
render_to_response
from
django.core.exceptions
import
ObjectDoesNotExist
...
...
@@ -169,6 +170,14 @@ def user_list(request):
return
render_to_response
(
'juser/user_list.html'
,
locals
())
def
user_detail
(
request
):
username
=
request
.
GET
.
get
(
'username'
,
None
)
if
not
username
:
return
HttpResponseRedirect
(
'/'
)
user
=
User
.
objects
.
get
(
username
=
username
)
return
render_to_response
(
'juser/user_detail.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
db_add_user
(
**
kwargs
):
groups_post
=
kwargs
.
pop
(
'groups'
)
user
=
User
(
**
kwargs
)
...
...
templates/juser/user_detail.html
0 → 100644
View file @
68f67aec
{% 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"
>
<div
class=
""
>
<a
target=
"_blank"
href=
"/juser/user_add/"
class=
"btn btn-sm btn-primary "
>
添加
</a>
</div>
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<thead>
<tr>
<th
class=
"text-center"
>
用户
</th>
<th
class=
"text-center"
>
详情
</th>
</tr>
</thead>
<tbody>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
ID
</td>
<td
class=
"text-center"
>
{{ user.id }}
</td>
</tr>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
username
</td>
<td
class=
"text-center"
>
{{ user.username }}
</td>
</tr>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
姓名
</td>
<td
class=
"text-center"
>
{{ user.name }}
</td>
</tr>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
角色
</td>
<td
class=
"text-center"
>
{{ user.id|get_role }}
</td>
</tr>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
属组
</td>
<td
class=
"text-center"
>
{{ user.id|get_role }}
</td>
</tr>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
Email
</td>
<td
class=
"text-center"
>
{{ user.email }}
</td>
</tr>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
激活
</td>
<td
class=
"text-center"
>
{{ user.is_active|bool2str }}
</td>
</tr>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
添加时间
</td>
<td
class=
"text-center"
>
{{ user.joined }}
</td>
</tr>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
最后登录
</td>
<td
class=
"text-center"
>
{{ user.last_login }}
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
\ No newline at end of file
templates/juser/user_list.html
View file @
68f67aec
...
...
@@ -59,7 +59,7 @@
<td
class=
"text-center"
>
{{ user.email }}
</td>
<td
class=
"text-center"
>
{{ user.is_active|bool2str }}
</td>
<td
class=
"text-center"
>
<a
href=
"/juser/{{ user.username }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/juser/
user_detail/?
{{ user.username }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/juser/user_edit/{{ user.username }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"/juser/user_del/{{ user.username }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
...
...
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