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
86e334e4
Commit
86e334e4
authored
Apr 19, 2015
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last bug?
parent
c8d91884
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
147 additions
and
75 deletions
+147
-75
urls.py
jasset/urls.py
+1
-0
views.py
jasset/views.py
+26
-11
models.py
jperm/models.py
+2
-0
views.py
jperm/views.py
+21
-7
jumpserver.conf
jumpserver.conf
+3
-3
context_processors.py
jumpserver/context_processors.py
+6
-1
mytags.py
jumpserver/templatetags/mytags.py
+9
-0
log_handler.py
log_handler.py
+1
-1
group_detail.html
templates/jasset/group_detail.html
+1
-1
host_list.html
templates/jasset/host_list.html
+31
-1
show_all_ajax.html
templates/jasset/show_all_ajax.html
+8
-0
perm_apply.html
templates/jperm/perm_apply.html
+4
-3
nav_bar_header.html
templates/nav_bar_header.html
+34
-46
nohup.out
websocket/nohup.out
+0
-1
npm-debug.log
websocket/npm-debug.log
+0
-0
No files found.
jasset/urls.py
View file @
86e334e4
...
@@ -9,6 +9,7 @@ urlpatterns = patterns('',
...
@@ -9,6 +9,7 @@ urlpatterns = patterns('',
url
(
r'^search/$'
,
host_search
),
url
(
r'^search/$'
,
host_search
),
url
(
r"^host_detail/$"
,
host_detail
),
url
(
r"^host_detail/$"
,
host_detail
),
url
(
r"^dept_host_ajax/$"
,
dept_host_ajax
),
url
(
r"^dept_host_ajax/$"
,
dept_host_ajax
),
url
(
r"^show_all_ajax/$"
,
show_all_ajax
),
url
(
r'^idc_add/$'
,
idc_add
),
url
(
r'^idc_add/$'
,
idc_add
),
url
(
r'^idc_list/$'
,
idc_list
),
url
(
r'^idc_list/$'
,
idc_list
),
url
(
r'^idc_edit/$'
,
idc_edit
),
url
(
r'^idc_edit/$'
,
idc_edit
),
...
...
jasset/views.py
View file @
86e334e4
...
@@ -105,15 +105,23 @@ def batch_host_edit(host_info, j_user='', j_password=''):
...
@@ -105,15 +105,23 @@ def batch_host_edit(host_info, j_user='', j_password=''):
groups
,
depts
=
[],
[]
groups
,
depts
=
[],
[]
is_active
=
{
u'是'
:
'1'
,
u'否'
:
'2'
}
is_active
=
{
u'是'
:
'1'
,
u'否'
:
'2'
}
login_types
=
{
'LDAP'
:
'L'
,
'MAP'
:
'M'
}
login_types
=
{
'LDAP'
:
'L'
,
'MAP'
:
'M'
}
for
group
in
j_group
[
0
]
.
split
():
a
=
Asset
.
objects
.
get
(
id
=
j_id
)
c
=
BisGroup
.
objects
.
get
(
name
=
group
.
strip
())
if
'...'
in
j_group
[
0
]
.
split
():
groups
.
append
(
c
)
groups
=
a
.
bis_group
.
all
()
for
d
in
j_dept
[
0
]
.
split
():
else
:
p
=
DEPT
.
objects
.
get
(
name
=
d
.
strip
())
for
group
in
j_group
[
0
]
.
split
():
depts
.
append
(
p
)
c
=
BisGroup
.
objects
.
get
(
name
=
group
.
strip
())
groups
.
append
(
c
)
if
'...'
in
j_dept
[
0
]
.
split
():
depts
=
a
.
dept
.
all
()
else
:
for
d
in
j_dept
[
0
]
.
split
():
p
=
DEPT
.
objects
.
get
(
name
=
d
.
strip
())
depts
.
append
(
p
)
j_type
=
login_types
[
j_type
]
j_type
=
login_types
[
j_type
]
j_idc
=
IDC
.
objects
.
get
(
name
=
j_idc
)
j_idc
=
IDC
.
objects
.
get
(
name
=
j_idc
)
a
=
Asset
.
objects
.
get
(
id
=
j_id
)
if
j_type
==
'M'
:
if
j_type
==
'M'
:
if
a
.
password
!=
j_password
:
if
a
.
password
!=
j_password
:
j_password
=
cryptor
.
decrypt
(
j_password
)
j_password
=
cryptor
.
decrypt
(
j_password
)
...
@@ -140,7 +148,6 @@ def batch_host_edit(host_info, j_user='', j_password=''):
...
@@ -140,7 +148,6 @@ def batch_host_edit(host_info, j_user='', j_password=''):
def
db_host_delete
(
request
,
host_id
):
def
db_host_delete
(
request
,
host_id
):
""" 删除主机操作 """
""" 删除主机操作 """
print
host_id
if
is_group_admin
(
request
)
and
not
validate
(
request
,
asset
=
[
host_id
]):
if
is_group_admin
(
request
)
and
not
validate
(
request
,
asset
=
[
host_id
]):
return
httperror
(
request
,
'删除失败, 您无权删除!'
)
return
httperror
(
request
,
'删除失败, 您无权删除!'
)
...
@@ -197,7 +204,6 @@ def host_add(request):
...
@@ -197,7 +204,6 @@ def host_add(request):
host_info
=
[
j_ip
,
j_port
,
j_idc
,
j_type
,
j_group
,
[
j_dept
],
j_active
,
j_comment
]
host_info
=
[
j_ip
,
j_port
,
j_idc
,
j_type
,
j_group
,
[
j_dept
],
j_active
,
j_comment
]
if
is_group_admin
(
request
)
and
not
validate
(
request
,
asset_group
=
j_group
,
edept
=
[
j_dept
]):
if
is_group_admin
(
request
)
and
not
validate
(
request
,
asset_group
=
j_group
,
edept
=
[
j_dept
]):
print
j_dept
return
httperror
(
request
,
u'添加失败,您无权操作!'
)
return
httperror
(
request
,
u'添加失败,您无权操作!'
)
if
Asset
.
objects
.
filter
(
ip
=
str
(
j_ip
)):
if
Asset
.
objects
.
filter
(
ip
=
str
(
j_ip
)):
...
@@ -430,8 +436,7 @@ def host_del(request, offset):
...
@@ -430,8 +436,7 @@ def host_del(request, offset):
host_id
=
request
.
POST
.
get
(
key
)
host_id
=
request
.
POST
.
get
(
key
)
db_host_delete
(
request
,
host_id
)
db_host_delete
(
request
,
host_id
)
else
:
else
:
host_id
=
int
(
offset
)
db_host_delete
(
request
,
offset
)
db_host_delete
(
request
,
host_id
)
return
HttpResponseRedirect
(
'/jasset/host_list/'
)
return
HttpResponseRedirect
(
'/jasset/host_list/'
)
...
@@ -886,6 +891,16 @@ def dept_host_ajax(request):
...
@@ -886,6 +891,16 @@ def dept_host_ajax(request):
return
my_render
(
'jasset/dept_host_ajax.html'
,
locals
(),
request
)
return
my_render
(
'jasset/dept_host_ajax.html'
,
locals
(),
request
)
def
show_all_ajax
(
request
):
""" 批量修改主机时, 部门和组全部显示 """
env
=
request
.
GET
.
get
(
'env'
,
''
)
get_id
=
request
.
GET
.
get
(
'id'
,
''
)
host
=
Asset
.
objects
.
filter
(
id
=
get_id
)
if
host
:
host
=
host
[
0
]
return
my_render
(
'jasset/show_all_ajax.html'
,
locals
(),
request
)
@require_login
@require_login
def
host_search
(
request
):
def
host_search
(
request
):
""" 搜索主机 """
""" 搜索主机 """
...
...
jperm/models.py
View file @
86e334e4
...
@@ -39,6 +39,7 @@ class SudoPerm(models.Model):
...
@@ -39,6 +39,7 @@ class SudoPerm(models.Model):
class
Apply
(
models
.
Model
):
class
Apply
(
models
.
Model
):
uuid
=
UUIDField
(
auto
=
True
)
uuid
=
UUIDField
(
auto
=
True
)
applyer
=
models
.
CharField
(
max_length
=
20
)
applyer
=
models
.
CharField
(
max_length
=
20
)
admin
=
models
.
CharField
(
max_length
=
20
)
approver
=
models
.
CharField
(
max_length
=
20
)
approver
=
models
.
CharField
(
max_length
=
20
)
dept
=
models
.
CharField
(
max_length
=
20
)
dept
=
models
.
CharField
(
max_length
=
20
)
bisgroup
=
models
.
CharField
(
max_length
=
500
)
bisgroup
=
models
.
CharField
(
max_length
=
500
)
...
@@ -47,6 +48,7 @@ class Apply(models.Model):
...
@@ -47,6 +48,7 @@ class Apply(models.Model):
status
=
models
.
IntegerField
(
max_length
=
2
)
status
=
models
.
IntegerField
(
max_length
=
2
)
date_add
=
models
.
DateTimeField
(
null
=
True
)
date_add
=
models
.
DateTimeField
(
null
=
True
)
date_end
=
models
.
DateTimeField
(
null
=
True
)
date_end
=
models
.
DateTimeField
(
null
=
True
)
read
=
models
.
IntegerField
(
max_length
=
2
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
applyer
return
self
.
applyer
jperm/views.py
View file @
86e334e4
...
@@ -676,6 +676,7 @@ def perm_apply(request):
...
@@ -676,6 +676,7 @@ def perm_apply(request):
""" 权限申请 """
""" 权限申请 """
header_title
,
path1
,
path2
=
u'主机权限申请'
,
u'权限管理'
,
u'申请主机'
header_title
,
path1
,
path2
=
u'主机权限申请'
,
u'权限管理'
,
u'申请主机'
user_id
,
username
=
get_session_user_info
(
request
)[
0
:
2
]
user_id
,
username
=
get_session_user_info
(
request
)[
0
:
2
]
name
=
User
.
objects
.
get
(
id
=
user_id
)
.
name
dept_id
,
deptname
,
dept
=
get_session_user_info
(
request
)[
3
:
6
]
dept_id
,
deptname
,
dept
=
get_session_user_info
(
request
)[
3
:
6
]
perm_host
=
user_perm_asset_api
(
username
)
perm_host
=
user_perm_asset_api
(
username
)
all_host
=
Asset
.
objects
.
filter
(
dept
=
dept
)
all_host
=
Asset
.
objects
.
filter
(
dept
=
dept
)
...
@@ -687,6 +688,7 @@ def perm_apply(request):
...
@@ -687,6 +688,7 @@ def perm_apply(request):
egroup
=
[
d
for
d
in
all_group
if
d
not
in
perm_group
]
egroup
=
[
d
for
d
in
all_group
if
d
not
in
perm_group
]
dept_da
=
User
.
objects
.
filter
(
dept_id
=
dept_id
,
role
=
'DA'
)
dept_da
=
User
.
objects
.
filter
(
dept_id
=
dept_id
,
role
=
'DA'
)
admin
=
User
.
objects
.
get
(
name
=
'admin'
)
if
request
.
method
==
'POST'
:
if
request
.
method
==
'POST'
:
applyer
=
request
.
POST
.
get
(
'applyer'
)
applyer
=
request
.
POST
.
get
(
'applyer'
)
...
@@ -695,14 +697,16 @@ def perm_apply(request):
...
@@ -695,14 +697,16 @@ def perm_apply(request):
group
=
request
.
POST
.
getlist
(
'group'
)
group
=
request
.
POST
.
getlist
(
'group'
)
hosts
=
request
.
POST
.
getlist
(
'hosts'
)
hosts
=
request
.
POST
.
getlist
(
'hosts'
)
comment
=
request
.
POST
.
get
(
'comment'
)
comment
=
request
.
POST
.
get
(
'comment'
)
if
not
da
:
return
httperror
(
request
,
u'请选择管理员!'
)
da
=
User
.
objects
.
get
(
id
=
da
)
da
=
User
.
objects
.
get
(
id
=
da
)
mail_address
=
da
.
email
mail_address
=
da
.
email
mail_title
=
'
%
s - 权限申请'
%
username
mail_title
=
'
%
s - 权限申请'
%
username
group_lis
=
', '
.
join
(
group
)
group_lis
=
', '
.
join
(
group
)
hosts_lis
=
', '
.
join
(
hosts
)
hosts_lis
=
', '
.
join
(
hosts
)
time_now
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
time_now
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
a
=
Apply
.
objects
.
create
(
applyer
=
applyer
,
dept
=
dept
,
bisgroup
=
group
,
date_add
=
datetime
.
datetime
.
now
(),
a
=
Apply
.
objects
.
create
(
applyer
=
applyer
,
admin
=
da
,
dept
=
dept
,
bisgroup
=
group
,
date_add
=
datetime
.
datetime
.
now
(),
asset
=
hosts
,
status
=
0
,
comment
=
comment
)
asset
=
hosts
,
status
=
0
,
comment
=
comment
,
read
=
0
)
uuid
=
a
.
uuid
uuid
=
a
.
uuid
url
=
"http://
%
s:
%
s/jperm/apply_exec/?uuid=
%
s"
%
(
SEND_IP
,
SEND_PORT
,
uuid
)
url
=
"http://
%
s:
%
s/jperm/apply_exec/?uuid=
%
s"
%
(
SEND_IP
,
SEND_PORT
,
uuid
)
mail_msg
=
"""
mail_msg
=
"""
...
@@ -774,9 +778,9 @@ def get_apply_posts(request, status, username, dept_name, keyword=None):
...
@@ -774,9 +778,9 @@ def get_apply_posts(request, status, username, dept_name, keyword=None):
posts
=
post_all
.
filter
(
dept
=
dept_name
)
posts
=
post_all
.
filter
(
dept
=
dept_name
)
elif
is_common_user
(
request
):
elif
is_common_user
(
request
):
if
keyword
:
if
keyword
:
posts
=
post_keyword_all
.
filter
(
us
er
=
username
)
posts
=
post_keyword_all
.
filter
(
apply
er
=
username
)
else
:
else
:
posts
=
post_all
.
filter
(
us
er
=
username
)
posts
=
post_all
.
filter
(
apply
er
=
username
)
return
posts
return
posts
...
@@ -786,7 +790,8 @@ def perm_apply_log(request, offset):
...
@@ -786,7 +790,8 @@ def perm_apply_log(request, offset):
""" 申请记录 """
""" 申请记录 """
header_title
,
path1
,
path2
=
u'权限申请记录'
,
u'权限管理'
,
u'申请记录'
header_title
,
path1
,
path2
=
u'权限申请记录'
,
u'权限管理'
,
u'申请记录'
keyword
=
request
.
GET
.
get
(
'keyword'
,
''
)
keyword
=
request
.
GET
.
get
(
'keyword'
,
''
)
username
=
get_session_user_info
(
request
)[
1
]
user_id
=
get_session_user_info
(
request
)[
0
]
username
=
User
.
objects
.
get
(
id
=
user_id
)
.
name
dept_name
=
get_session_user_info
(
request
)[
4
]
dept_name
=
get_session_user_info
(
request
)[
4
]
status_dic
=
{
'online'
:
0
,
'offline'
:
1
}
status_dic
=
{
'online'
:
0
,
'offline'
:
1
}
status
=
status_dic
[
offset
]
status
=
status_dic
[
offset
]
...
@@ -798,8 +803,17 @@ def perm_apply_log(request, offset):
...
@@ -798,8 +803,17 @@ def perm_apply_log(request, offset):
@require_login
@require_login
def
perm_apply_info
(
request
):
def
perm_apply_info
(
request
):
""" 申请信息详情 """
""" 申请信息详情 """
uuid
=
request
.
GET
.
get
(
'uuid'
)
uuid
=
request
.
GET
.
get
(
'uuid'
,
''
)
post
=
Apply
.
objects
.
get
(
uuid
=
uuid
)
post
=
Apply
.
objects
.
filter
(
uuid
=
uuid
)
username
=
get_session_user_info
(
request
)[
1
]
if
post
:
post
=
post
[
0
]
if
post
.
read
==
0
and
post
.
applyer
!=
username
:
post
.
read
=
1
post
.
save
()
else
:
return
httperror
(
request
,
u'没有这个申请记录!'
)
return
render_to_response
(
'jperm/perm_apply_info.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jperm/perm_apply_info.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
...
...
jumpserver.conf
View file @
86e334e4
#coding: utf8
#coding: utf8
[
base
]
[
base
]
ip
=
192
.
168
.
0
.
129
ip
=
192
.
168
.
199
.
180
port
=
80
port
=
80
key
=
88
aaaf7ffe3c6c04
key
=
88
aaaf7ffe3c6c04
...
@@ -16,14 +16,14 @@ database = jumpserver
...
@@ -16,14 +16,14 @@ database = jumpserver
[
ldap
]
[
ldap
]
ldap_enable
=
1
ldap_enable
=
1
host_url
=
ldap
://
1
27
.
0
.
0
.
1
:
389
host_url
=
ldap
://
1
92
.
168
.
199
.
180
:
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
root_pw
=
secret234
root_pw
=
secret234
[
websocket
]
[
websocket
]
web_socket_host
=
192
.
168
.
20
.
209
:
3000
web_socket_host
=
192
.
168
.
199
.
180
:
3000
[
mail
]
[
mail
]
...
...
jumpserver/context_processors.py
View file @
86e334e4
from
juser.models
import
User
from
juser.models
import
User
from
jasset.models
import
Asset
from
jasset.models
import
Asset
from
jumpserver.api
import
*
from
jumpserver.api
import
*
from
jperm.models
import
Apply
def
name_proc
(
request
):
def
name_proc
(
request
):
...
@@ -17,6 +18,9 @@ def name_proc(request):
...
@@ -17,6 +18,9 @@ def name_proc(request):
user_active_num
=
dept
.
user_set
.
filter
(
is_active
=
True
)
.
count
()
user_active_num
=
dept
.
user_set
.
filter
(
is_active
=
True
)
.
count
()
host_total_num
=
dept
.
asset_set
.
all
()
.
count
()
host_total_num
=
dept
.
asset_set
.
all
()
.
count
()
host_active_num
=
dept
.
asset_set
.
all
()
.
filter
(
is_active
=
True
)
.
count
()
host_active_num
=
dept
.
asset_set
.
all
()
.
filter
(
is_active
=
True
)
.
count
()
username
=
User
.
objects
.
get
(
id
=
user_id
)
.
name
apply_info
=
Apply
.
objects
.
filter
(
admin
=
username
,
status
=
0
,
read
=
0
)
request
.
session
.
set_expiry
(
3600
)
request
.
session
.
set_expiry
(
3600
)
info_dic
=
{
'session_user_id'
:
user_id
,
info_dic
=
{
'session_user_id'
:
user_id
,
...
@@ -24,7 +28,8 @@ def name_proc(request):
...
@@ -24,7 +28,8 @@ def name_proc(request):
'user_total_num'
:
user_total_num
,
'user_total_num'
:
user_total_num
,
'user_active_num'
:
user_active_num
,
'user_active_num'
:
user_active_num
,
'host_total_num'
:
host_total_num
,
'host_total_num'
:
host_total_num
,
'host_active_num'
:
host_active_num
}
'host_active_num'
:
host_active_num
,
'apply_info'
:
apply_info
}
return
info_dic
return
info_dic
jumpserver/templatetags/mytags.py
View file @
86e334e4
...
@@ -68,6 +68,15 @@ def group_str2_all(group_list):
...
@@ -68,6 +68,15 @@ def group_str2_all(group_list):
return
'
%
s ...'
%
' '
.
join
([
group
.
name
for
group
in
group_lis
[
0
:
2
]])
return
'
%
s ...'
%
' '
.
join
([
group
.
name
for
group
in
group_lis
[
0
:
2
]])
@register.filter
(
name
=
'group_dept_all'
)
def
group_dept_all
(
group_list
):
group_lis
=
[]
for
i
in
group_list
:
if
str
(
i
)
!=
'ALL'
:
group_lis
.
append
(
i
)
return
' '
.
join
([
group
.
name
for
group
in
group_lis
])
@register.filter
(
name
=
'group_manage_str'
)
@register.filter
(
name
=
'group_manage_str'
)
def
group_manage_str
(
username
):
def
group_manage_str
(
username
):
user
=
User
.
objects
.
get
(
username
=
username
)
user
=
User
.
objects
.
get
(
username
=
username
)
...
...
log_handler.py
View file @
86e334e4
...
@@ -16,7 +16,7 @@ from jlog.models import Log
...
@@ -16,7 +16,7 @@ from jlog.models import Log
def
log_hanler
(
id
):
def
log_hanler
(
id
):
log
=
Log
.
objects
.
get
(
id
=
id
)
log
=
Log
.
objects
.
get
(
id
=
id
)
pattern
=
re
.
compile
(
r'([\[.*@.*\][\$#].*
| mysql>.*]
)'
)
pattern
=
re
.
compile
(
r'([\[.*@.*\][\$#].*
)|(.*mysql>.*
)'
)
if
log
:
if
log
:
filename
=
log
.
log_path
filename
=
log
.
log_path
if
os
.
path
.
isfile
(
filename
):
if
os
.
path
.
isfile
(
filename
):
...
...
templates/jasset/group_detail.html
View file @
86e334e4
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
<td
class=
"text-center"
>
{{ post.date_added|date:"Y-m-d H:i:s" }}
</td>
<td
class=
"text-center"
>
{{ post.date_added|date:"Y-m-d H:i:s" }}
</td>
<td
class=
"text-center"
name=
"j_comment"
>
{{ post.comment }}
</td>
<td
class=
"text-center"
name=
"j_comment"
>
{{ post.comment }}
</td>
<td
class=
"text-center"
data-editable=
'false'
>
<td
class=
"text-center"
data-editable=
'false'
>
<a
value=
"/jasset/{{ post.ip }}/
"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/jasset/host_detail/?id={{ post.id }}
"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/jasset/host_edit/?id={{ post.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"/jasset/host_edit/?id={{ post.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"/jasset/group_del_host/?id={{ post.id }}&gid={{ group.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
<a
href=
"/jasset/group_del_host/?id={{ post.id }}&gid={{ group.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
</td>
...
...
templates/jasset/host_list.html
View file @
86e334e4
...
@@ -69,7 +69,9 @@
...
@@ -69,7 +69,9 @@
<td
class=
"text-center"
name=
"j_type"
>
{{ post.login_type|get_login_type }}
</td>
<td
class=
"text-center"
name=
"j_type"
>
{{ post.login_type|get_login_type }}
</td>
<td
class=
"text-center"
name=
"j_idc"
>
{{ post.idc.name }}
</td>
<td
class=
"text-center"
name=
"j_idc"
>
{{ post.idc.name }}
</td>
<td
class=
"text-center"
name=
"j_dept"
>
{{ post.dept.all | group_str2 }}
</td>
<td
class=
"text-center"
name=
"j_dept"
>
{{ post.dept.all | group_str2 }}
</td>
<!--<td class="text-center" id="j_dept_{{post.id}}" name="j_dept" onclick="show_all('dept', '{{post.id}}')">{{ post.dept.all | group_str2 }}</td>-->
<td
class=
"text-center"
name=
"j_group"
>
{{ post.bis_group.all | group_str2_all }}
</td>
<td
class=
"text-center"
name=
"j_group"
>
{{ post.bis_group.all | group_str2_all }}
</td>
<!--<td class="text-center" id="j_group_{{post.id}}" name="j_group" onclick="show_all('group', '{{post.id}}')">{{ post.bis_group.all | group_str2_all }}</td>-->
<td
class=
"text-center"
name=
"j_active"
>
{{ post.is_active|bool2str }}
</td>
<td
class=
"text-center"
name=
"j_active"
>
{{ post.is_active|bool2str }}
</td>
<td
class=
"text-center"
name=
"j_comment"
>
{{ post.comment }}
</td>
<td
class=
"text-center"
name=
"j_comment"
>
{{ post.comment }}
</td>
<td
class=
"text-center"
data-editable=
'false'
>
<td
class=
"text-center"
data-editable=
'false'
>
...
@@ -98,13 +100,27 @@
...
@@ -98,13 +100,27 @@
</div>
</div>
<script>
<script>
$
(
'table td'
).
on
(
'change'
,
function
(
env
,
id
){
var
url
=
"/jasset/show_all_ajax/?env="
+
env
+
"&id="
+
id
;
console
.
log
(
url
);
$
.
ajax
({
type
:
"GET"
,
url
:
url
,
// data: $("#search_form").serialize(),
success
:
function
(
data
)
{
$
(
"#j_dept_"
+
id
).
html
(
data
);
}
});
})
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
(
'#editable'
).
editableTableWidget
();
$
(
'#editable'
).
editableTableWidget
(
{
editor
:
$
(
'<textarea>'
)}
);
});
});
function
alter
(
form
)
{
function
alter
(
form
)
{
selectData
=
GetTableDataBox
();
selectData
=
GetTableDataBox
();
console
.
log
(
selectData
[
0
])
if
(
selectData
[
1
]
!=
0
)
{
if
(
selectData
[
1
]
!=
0
)
{
$
.
ajax
({
$
.
ajax
({
type
:
"post"
,
type
:
"post"
,
...
@@ -113,6 +129,7 @@
...
@@ -113,6 +129,7 @@
success
:
function
(
data
)
{
success
:
function
(
data
)
{
alert
(
"修改成功"
);
alert
(
"修改成功"
);
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
error
:
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
}
}
});
});
}
}
...
@@ -157,7 +174,19 @@
...
@@ -157,7 +174,19 @@
}
}
})
})
function
show_all
(
env
,
id
)
{
var
url
=
"/jasset/show_all_ajax/?env="
+
env
+
"&id="
+
id
;
console
.
log
(
url
);
$
.
ajax
({
type
:
"GET"
,
url
:
url
,
// data: $("#search_form").serialize(),
success
:
function
(
data
)
{
$
(
"#j_group_"
+
id
).
html
(
data
);
}
});
}
</script>
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
templates/jasset/show_all_ajax.html
0 → 100644
View file @
86e334e4
{% load mytags %}
{% ifequal env 'group' %}
{{ host.bis_group.all|group_dept_all }}
{% endifequal %}
{% ifequal env 'dept' %}
{{ host.dept.all|group_dept_all }}
{% endifequal %}
\ No newline at end of file
templates/jperm/perm_apply.html
View file @
86e334e4
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
<form
id=
"assetForm"
method=
"post"
class=
"form-horizontal"
>
<form
id=
"assetForm"
method=
"post"
class=
"form-horizontal"
>
{% csrf_token %}
{% csrf_token %}
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
申请人
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
申请人
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"col-sm-8"
><input
type=
"text"
name=
"applyer"
value=
"{{
user
name }}"
class=
"form-control"
readonly=
"readonly"
></div>
<div
class=
"col-sm-8"
><input
type=
"text"
name=
"applyer"
value=
"{{ name }}"
class=
"form-control"
readonly=
"readonly"
></div>
</div>
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"hr-line-dashed"
></div>
...
@@ -67,10 +67,11 @@
...
@@ -67,10 +67,11 @@
</div>
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
id=
"j_da"
><label
class=
"col-sm-2 control-label"
>
部门
管理员
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"form-group"
id=
"j_da"
><label
class=
"col-sm-2 control-label"
>
管理员
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"radio"
>
<div
class=
"radio"
>
<label><input
type=
"radio"
value=
"{{ admin.id }}"
name=
"da"
>
{{ admin.name }}
</label>
{% for da in dept_da %}
{% for da in dept_da %}
<label><input
type=
"radio"
value=
"{{ da.id }}"
name=
"da"
>
{{ da }}
</label>
<label><input
type=
"radio"
value=
"{{ da.id }}"
name=
"da"
>
{{ da
.name
}}
</label>
{% endfor %}
{% endfor %}
</div>
</div>
</div>
</div>
...
...
templates/nav_bar_header.html
View file @
86e334e4
{% load humanize %}
{% load mytags %}
<nav
class=
"navbar navbar-static-top"
role=
"navigation"
style=
"margin-bottom: 0"
>
<nav
class=
"navbar navbar-static-top"
role=
"navigation"
style=
"margin-bottom: 0"
>
<div
class=
"navbar-header"
>
<div
class=
"navbar-header"
>
<a
class=
"navbar-minimalize minimalize-styl-2 btn btn-primary "
href=
"#"
><i
class=
"fa fa-bars"
></i>
</a>
<a
class=
"navbar-minimalize minimalize-styl-2 btn btn-primary "
href=
"#"
><i
class=
"fa fa-bars"
></i>
</a>
...
@@ -13,55 +15,41 @@
...
@@ -13,55 +15,41 @@
</li>
</li>
<li
class=
"dropdown"
>
<li
class=
"dropdown"
>
<a
class=
"dropdown-toggle count-info"
data-toggle=
"dropdown"
href=
"#"
>
<a
class=
"dropdown-toggle count-info"
data-toggle=
"dropdown"
href=
"#"
>
<i
class=
"fa fa-envelope"
></i>
<span
class=
"label label-warning"
>
{{
message
}}
</span>
<i
class=
"fa fa-envelope"
></i>
<span
class=
"label label-warning"
>
{{
apply_info.count
}}
</span>
</a>
</a>
<ul
class=
"dropdown-menu dropdown-messages"
>
<ul
class=
"dropdown-menu dropdown-messages"
>
<li>
{% if apply_info %}
<div
class=
"dropdown-messages-box"
>
{% for apply in apply_info %}
<a
href=
"profile.html"
class=
"pull-left"
>
<li>
<img
alt=
"image"
class=
"img-circle"
src=
"/static/img/a7.jpg"
>
<div
class=
"dropdown-messages-box"
>
</a>
<a
href=
"/jperm/apply_show/online/"
class=
"pull-left"
>
<div
class=
"media-body"
>
<img
alt=
"image"
class=
"img-circle"
src=
"/static/img/a4.jpg"
>
<small
class=
"pull-right"
>
46h ago
</small>
</a>
<strong>
Mike Loreipsum
</strong>
started following
<strong>
Monica Smith
</strong>
.
<br>
<div
class=
"media-body"
>
<small
class=
"text-muted"
>
3 days ago at 7:58 pm - 10.06.2014
</small>
<small
class=
"pull-right text-navy"
>
{{ apply.date_add|naturaltime }}
</small>
<strong>
{{ apply.applyer }}
</strong><br>
<small
class=
"text-muted"
>
主机组: {{ apply.bisgroup|ast_to_list }}
</small><br/>
<small
class=
"text-muted"
>
主机: {{ apply.asset|ast_to_list }}
</small><br/>
<small
class=
"text-muted"
>
申请时间: {{ apply.date_add|date:"Y-m-d H:i:s" }}
</small>
</div>
</div>
</li>
<li
class=
"divider"
></li>
{% endfor %}
<li>
<div
class=
"text-center link-block"
>
<a
href=
"/jperm/apply_show/online/"
>
<i
class=
"fa fa-envelope"
></i>
<strong>
Read All Messages
</strong>
</a>
</div>
</li>
{% else %}
<li>
<div
class=
"text-center link-block"
>
<i
class=
"fa fa-envelope"
></i>
<strong>
(暂无通知)
</strong>
</div>
</div>
</div>
</li>
</li>
{% endif %}
<li
class=
"divider"
></li>
<li>
<div
class=
"dropdown-messages-box"
>
<a
href=
"profile.html"
class=
"pull-left"
>
<img
alt=
"image"
class=
"img-circle"
src=
"/static/img/a4.jpg"
>
</a>
<div
class=
"media-body "
>
<small
class=
"pull-right text-navy"
>
5h ago
</small>
<strong>
Chris Johnatan Overtunk
</strong>
started following
<strong>
Monica Smith
</strong>
.
<br>
<small
class=
"text-muted"
>
Yesterday 1:21 pm - 11.06.2014
</small>
</div>
</div>
</li>
<li
class=
"divider"
></li>
<li>
<div
class=
"dropdown-messages-box"
>
<a
href=
"profile.html"
class=
"pull-left"
>
<img
alt=
"image"
class=
"img-circle"
src=
"/static/img/profile.jpg"
>
</a>
<div
class=
"media-body "
>
<small
class=
"pull-right"
>
23h ago
</small>
<strong>
Monica Smith
</strong>
love
<strong>
Kim Smith
</strong>
.
<br>
<small
class=
"text-muted"
>
2 days ago at 2:30 am - 11.06.2014
</small>
</div>
</div>
</li>
<li
class=
"divider"
></li>
<li>
<div
class=
"text-center link-block"
>
<a
href=
"mailbox.html"
>
<i
class=
"fa fa-envelope"
></i>
<strong>
Read All Messages
</strong>
</a>
</div>
</li>
</ul>
</ul>
</li>
</li>
<li>
<li>
...
...
websocket/nohup.out
deleted
100644 → 0
View file @
c8d91884
listening on *:3000
websocket/npm-debug.log
View file @
86e334e4
This diff is collapsed.
Click to expand it.
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