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
6a8db896
Commit
6a8db896
authored
Jan 28, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
һbug
parent
5cd09a65
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
18 deletions
+16
-18
jumpserver.conf
jumpserver.conf
+1
-5
mytags.py
jumpserver/templatetags/mytags.py
+7
-2
views.py
juser/views.py
+0
-0
group_list.html
templates/juser/group_list.html
+2
-2
user_add.html
templates/juser/user_add.html
+5
-5
user_detail.html
templates/juser/user_detail.html
+1
-4
No files found.
jumpserver.conf
View file @
6a8db896
...
@@ -8,11 +8,7 @@ password = mysql234
...
@@ -8,11 +8,7 @@ password = mysql234
database
=
jumpserver
database
=
jumpserver
[
ldap
]
[
ldap
]
host_url
=
ldap
://
192
.
168
.
8
.
60
:
389
ldap_enable
=
1
base_dn
=
dc
=
fengxing
,
dc
=
org
root_dn
=
cn
=
admin
,
dc
=
fengxing
,
dc
=
org
root_pw
=
123456
ldap_enable
=
0
host_url
=
ldap
://
127
.
0
.
0
.
1
:
389
host_url
=
ldap
://
127
.
0
.
0
.
1
:
389
base_dn
=
dc
=
jumpserver
,
dc
=
org
base_dn
=
dc
=
jumpserver
,
dc
=
org
root_dn
=
cn
=
admin
,
dc
=
jumpserver
,
dc
=
org
root_dn
=
cn
=
admin
,
dc
=
jumpserver
,
dc
=
org
...
...
jumpserver/templatetags/mytags.py
View file @
6a8db896
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
import
time
import
time
from
django
import
template
from
django
import
template
from
django.db.models
import
Q
from
django.db.models
import
Q
from
juser.models
import
User
from
juser.models
import
User
,
UserGroup
register
=
template
.
Library
()
register
=
template
.
Library
()
...
@@ -56,6 +56,12 @@ def perm_count(user_id):
...
@@ -56,6 +56,12 @@ def perm_count(user_id):
return
user
.
perm_set
.
all
()
.
count
()
return
user
.
perm_set
.
all
()
.
count
()
@register.filter
(
name
=
'member_count'
)
def
member_count
(
group_id
):
group
=
UserGroup
.
objects
.
get
(
id
=
group_id
)
return
group
.
user_set
.
count
()
@register.filter
(
name
=
'group_type_to_str'
)
@register.filter
(
name
=
'group_type_to_str'
)
def
group_type_to_str
(
type_name
):
def
group_type_to_str
(
type_name
):
group_types
=
{
group_types
=
{
...
@@ -63,5 +69,4 @@ def group_type_to_str(type_name):
...
@@ -63,5 +69,4 @@ def group_type_to_str(type_name):
'M'
:
'管理组'
,
'M'
:
'管理组'
,
'A'
:
'授权组'
,
'A'
:
'授权组'
,
}
}
return
group_types
.
get
(
type_name
)
return
group_types
.
get
(
type_name
)
juser/views.py
View file @
6a8db896
This diff is collapsed.
Click to expand it.
templates/juser/group_list.html
View file @
6a8db896
...
@@ -36,10 +36,10 @@
...
@@ -36,10 +36,10 @@
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<thead>
<thead>
<tr>
<tr>
<th
class=
"text-center"
><input
type=
"checkbox"
class=
"i-checks"
name=
""
></th>
<th
class=
"text-center"
>
ID
</th>
<th
class=
"text-center"
>
ID
</th>
<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>
<th
class=
"text-center"
>
备注
</th>
<th
class=
"text-center"
>
备注
</th>
<th
class=
"text-center"
>
操作
</th>
<th
class=
"text-center"
>
操作
</th>
</tr>
</tr>
...
@@ -47,10 +47,10 @@
...
@@ -47,10 +47,10 @@
<tbody>
<tbody>
{% for group in contacts.object_list %}
{% for group in contacts.object_list %}
<tr
class=
"gradeX"
>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
><input
type=
"checkbox"
class=
"i-checks"
name=
""
></td>
<td
class=
"text-center"
>
{{ group.id }}
</td>
<td
class=
"text-center"
>
{{ group.id }}
</td>
<td
class=
"text-center"
>
{{ group.name }}
</td>
<td
class=
"text-center"
>
{{ group.name }}
</td>
<td
class=
"text-center"
>
{{ group.type|group_type_to_str }}
</td>
<td
class=
"text-center"
>
{{ group.type|group_type_to_str }}
</td>
<td
class=
"text-center"
>
{{ group.id|member_count }}
</td>
<td
class=
"text-center"
>
{{ group.comment }}
</td>
<td
class=
"text-center"
>
{{ group.comment }}
</td>
<td
class=
"text-center"
>
<td
class=
"text-center"
>
<a
href=
"../group_detail/?id={{ group.id }}"
class=
"iframe btn btn-xs btn-primary"
>
成员
</a>
<a
href=
"../group_detail/?id={{ group.id }}"
class=
"iframe btn btn-xs btn-primary"
>
成员
</a>
...
...
templates/juser/user_add.html
View file @
6a8db896
...
@@ -73,19 +73,19 @@
...
@@ -73,19 +73,19 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"groups"
class=
"col-lg-2 control-label"
>
属组
<span
class=
"red-fonts"
>
*
</span></label>
<label
for=
"groups"
class=
"col-lg-2 control-label"
>
属组
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"col-sm-8"
>
<div
class=
"col-sm-8"
>
<select
id=
"groups"
name=
"groups"
class=
"form-control m-b"
multiple
>
<select
id=
"groups"
name=
"groups"
class=
"form-control m-b"
multiple
size=
"10"
>
{% for group in all_group %}
{% for group in all_group %}
{% if groups_str %}
{% if groups_str %}
{% if group.id|int2str in groups_str %}
{% if group.id|int2str in groups_str %}
<option
value=
"{{ group.id }}"
selected
>
{{ group.name }}
</option>
<option
value=
"{{ group.id }}"
selected
>
{{ group.name }}
--- {{ group.type|group_type_to_str }}
</option>
{% else %}
{% else %}
<option
value=
"{{ group.id }}"
>
{{ group.name }}
</option>
<option
value=
"{{ group.id }}"
>
{{ group.name }}
--- {{ group.type|group_type_to_str }}
</option>
{% endif %}
{% endif %}
{% else %}
{% else %}
{% if forloop.first %}
{% if forloop.first %}
<option
value=
"{{ group.id }}"
selected
>
{{ group.name }}
</option>
<option
value=
"{{ group.id }}"
selected
>
{{ group.name }}
--- {{ group.type|group_type_to_str }}
</option>
{% else %}
{% else %}
<option
value=
"{{ group.id }}"
>
{{ group.name }}
</option>
<option
value=
"{{ group.id }}"
>
{{ group.name }}
--- {{ group.type|group_type_to_str }}
</option>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
...
...
templates/juser/user_detail.html
View file @
6a8db896
...
@@ -16,9 +16,6 @@
...
@@ -16,9 +16,6 @@
<div
class=
"contact-box"
>
<div
class=
"contact-box"
>
<h2
class=
"text-center"
>
{{ user.name }} 用户详情
</h2>
<h2
class=
"text-center"
>
{{ user.name }} 用户详情
</h2>
<div
class=
"ibox-content"
>
<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"
>
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<thead>
<thead>
...
@@ -58,7 +55,7 @@
...
@@ -58,7 +55,7 @@
</tr>
</tr>
<tr
class=
"gradeX"
>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
添加时间
</td>
<td
class=
"text-center"
>
添加时间
</td>
<td
class=
"text-center"
>
{{ user.
joined
}}
</td>
<td
class=
"text-center"
>
{{ user.
date_joined|stamp2str
}}
</td>
</tr>
</tr>
<tr
class=
"gradeX"
>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
最后登录
</td>
<td
class=
"text-center"
>
最后登录
</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