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
7e532283
Commit
7e532283
authored
Apr 04, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'guanghongwei' and 'wangyong' of gitcafe.com:ibuler/jumpserver into guanghongwei
parents
afcc7847
6e976b05
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
302 additions
and
60 deletions
+302
-60
urls.py
jperm/urls.py
+2
-0
views.py
jperm/views.py
+83
-16
mytags.py
jumpserver/templatetags/mytags.py
+18
-2
host_list.html
templates/jasset/host_list.html
+1
-3
perm_apply_exec.html
templates/jperm/perm_apply_exec.html
+15
-23
perm_apply_info.html
templates/jperm/perm_apply_info.html
+56
-0
perm_apply_search.html
templates/jperm/perm_apply_search.html
+43
-0
perm_log_offline.html
templates/jperm/perm_log_offline.html
+42
-8
perm_log_online.html
templates/jperm/perm_log_online.html
+40
-8
nav.html
templates/nav.html
+2
-0
No files found.
jperm/urls.py
View file @
7e532283
...
...
@@ -26,4 +26,6 @@ urlpatterns = patterns('jperm.views',
(
r'^apply/$'
,
'perm_apply'
),
(
r'^apply_show/(\w+)/$'
,
'perm_apply_log'
),
(
r'^apply_exec/$'
,
'perm_apply_exec'
),
(
r'^apply_info/$'
,
'perm_apply_info'
),
(
r'^apply_search/$'
,
'perm_apply_search'
),
)
jperm/views.py
View file @
7e532283
...
...
@@ -648,7 +648,6 @@ def perm_apply(request):
da
=
User
.
objects
.
get
(
id
=
da
)
mail_address
=
da
.
email
mail_title
=
'
%
s - 权限申请'
%
username
# print da.username, applyer, group, hosts, datetime.datetime.now(), comment, url
group_lis
=
', '
.
join
(
group
)
hosts_lis
=
', '
.
join
(
hosts
)
time_now
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
...
...
@@ -663,31 +662,42 @@ def perm_apply(request):
申请的主机:
%
s
申请时间:
%
s
申请说明:
%
s
请及时审批, 审批完成后点击以下链接,告知各位。
请及时审批, 审批完成后点击以下链接,告知申请人。
%
s
"""
%
(
da
.
username
,
applyer
,
group_lis
,
hosts_lis
,
time_now
,
comment
,
url
)
send_mail
(
mail_title
,
mail_msg
,
'j
kfunshion@fun.tv
'
,
[
mail_address
],
fail_silently
=
False
)
send_mail
(
mail_title
,
mail_msg
,
'j
umpserver@163.com
'
,
[
mail_address
],
fail_silently
=
False
)
smg
=
"提交成功,已发邮件通知部门管理员。"
return
render_to_response
(
'jperm/perm_apply.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jperm/perm_apply.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
@require_admin
def
perm_apply_exec
(
request
):
header_title
,
path1
,
path2
=
u'主机权限申请'
,
u'权限管理'
,
u'审批完成'
uuid
=
request
.
GET
.
get
(
'uuid'
)
p_apply
=
Apply
.
objects
.
filter
(
uuid
=
str
(
uuid
))
q_apply
=
Apply
.
objects
.
get
(
uuid
=
str
(
uuid
))
if
p_apply
:
user
=
User
.
objects
.
get
(
username
=
q_apply
.
applyer
)
mail_address
=
user
.
email
time_now
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
p_apply
.
update
(
status
=
1
,
date_end
=
time_now
)
mail_title
=
'
%
s - 权限审批完成'
%
q_apply
.
applyer
mail_msg
=
"""
Hi,
%
s:
您所申请的权限已由
%
s 在
%
s 审批完成, 请登录验证。
"""
%
(
q_apply
.
applyer
,
q_apply
.
approver
,
time_now
)
send_mail
(
mail_title
,
mail_msg
,
'jkfunshion@fun.tv'
,
[
mail_address
],
fail_silently
=
False
)
if
uuid
:
p_apply
=
Apply
.
objects
.
filter
(
uuid
=
str
(
uuid
))
q_apply
=
Apply
.
objects
.
get
(
uuid
=
str
(
uuid
))
if
q_apply
.
status
==
1
:
smg
=
'此权限已经审批完成, 请勿重复审批, 十秒钟后返回首页'
return
render_to_response
(
'jperm/perm_apply_exec.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
else
:
user
=
User
.
objects
.
get
(
username
=
q_apply
.
applyer
)
mail_address
=
user
.
email
time_now
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
p_apply
.
update
(
status
=
1
,
date_end
=
time_now
)
mail_title
=
'
%
s - 权限审批完成'
%
q_apply
.
applyer
mail_msg
=
"""
Hi,
%
s:
您所申请的权限已由
%
s 在
%
s 审批完成, 请登录验证。
"""
%
(
q_apply
.
applyer
,
q_apply
.
approver
,
time_now
)
send_mail
(
mail_title
,
mail_msg
,
'jkfunshion@fun.tv'
,
[
mail_address
],
fail_silently
=
False
)
smg
=
'授权完成, 已邮件通知申请人, 十秒钟后返回首页'
return
render_to_response
(
'jperm/perm_apply_exec.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
else
:
smg
=
'没有此授权, 十秒钟后返回首页'
return
render_to_response
(
'jperm/perm_apply_exec.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
...
...
@@ -715,6 +725,7 @@ def get_apply_posts(request, status, username, dept_name, keyword=None):
return
posts
@require_login
def
perm_apply_log
(
request
,
offset
):
header_title
,
path1
,
path2
=
u'权限申请记录'
,
u'权限管理'
,
u'申请记录'
keyword
=
request
.
GET
.
get
(
'keyword'
)
...
...
@@ -731,3 +742,59 @@ def perm_apply_log(request, offset):
posts
=
get_apply_posts
(
request
,
1
,
username
,
dept_name
,
keyword
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
return
render_to_response
(
'jperm/perm_log_offline.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
perm_apply_info
(
request
):
uuid
=
request
.
GET
.
get
(
'uuid'
)
post
=
Apply
.
objects
.
get
(
uuid
=
uuid
)
return
render_to_response
(
'jperm/perm_apply_info.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
perm_apply_search
(
request
):
keyword
=
request
.
GET
.
get
(
'keyword'
)
env
=
request
.
GET
.
get
(
'env'
)
dept_id
=
get_user_dept
(
request
)
dept_name
=
DEPT
.
objects
.
get
(
id
=
dept_id
)
.
name
user_id
=
request
.
session
.
get
(
'user_id'
)
username
=
User
.
objects
.
get
(
id
=
user_id
)
.
username
if
is_super_user
(
request
):
if
env
==
'online'
:
posts
=
Apply
.
objects
.
filter
(
Q
(
applyer__contains
=
keyword
)
|
Q
(
approver__contains
=
keyword
))
\
.
filter
(
status
=
0
)
.
order_by
(
'-date_add'
)
elif
env
==
'offline'
:
posts
=
Apply
.
objects
.
filter
(
Q
(
applyer__contains
=
keyword
)
|
Q
(
approver__contains
=
keyword
))
\
.
filter
(
status
=
1
)
.
order_by
(
'-date_add'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
elif
is_group_admin
(
request
):
if
env
==
'online'
:
posts
=
Apply
.
objects
.
filter
(
Q
(
applyer__contains
=
keyword
)
|
Q
(
approver__contains
=
keyword
))
\
.
filter
(
status
=
0
)
.
filter
(
dept_name
=
dept_name
)
.
order_by
(
'-date_add'
)
elif
env
==
'offline'
:
posts
=
Apply
.
objects
.
filter
(
Q
(
applyer__contains
=
keyword
)
|
Q
(
approver__contains
=
keyword
))
\
.
filter
(
status
=
1
)
.
filter
(
dept_name
=
dept_name
)
.
order_by
(
'-date_add'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
elif
is_common_user
(
request
):
if
env
==
'online'
:
posts
=
Apply
.
objects
.
filter
(
Q
(
applyer__contains
=
keyword
)
|
Q
(
approver__contains
=
keyword
))
\
.
filter
(
status
=
0
)
.
filter
(
user
=
username
)
.
order_by
(
'-date_add'
)
elif
env
==
'offline'
:
posts
=
Apply
.
objects
.
filter
(
Q
(
applyer__contains
=
keyword
)
|
Q
(
approver__contains
=
keyword
))
\
.
filter
(
status
=
1
)
.
filter
(
applyer
=
username
)
.
order_by
(
'-date_add'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
return
render_to_response
(
'jperm/perm_apply_search.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
jumpserver/templatetags/mytags.py
View file @
7e532283
...
...
@@ -55,6 +55,18 @@ def groups_str2(group_list):
return
'
%
s ...'
%
' '
.
join
([
group
.
name
for
group
in
group_list
[
0
:
2
]])
@register.filter
(
name
=
'group_str2_all'
)
def
groups_str2
(
group_list
):
group_lis
=
[]
for
i
in
group_list
:
if
str
(
i
)
!=
'ALL'
:
group_lis
.
append
(
i
)
if
len
(
group_lis
)
<
3
:
return
' '
.
join
([
group
.
name
for
group
in
group_lis
])
else
:
return
'
%
s ...'
%
' '
.
join
([
group
.
name
for
group
in
group_lis
[
0
:
2
]])
@register.filter
(
name
=
'group_manage_str'
)
def
group_manage_str
(
username
):
user
=
User
.
objects
.
get
(
username
=
username
)
...
...
@@ -162,6 +174,11 @@ def group_type_to_str(type_name):
@register.filter
(
name
=
'ast_to_list'
)
def
ast_to_list
(
lis
):
return
ast
.
literal_eval
(
lis
)[
0
:
2
]
@register.filter
(
name
=
'ast_to_list_1'
)
def
ast_to_list_1
(
lis
):
return
ast
.
literal_eval
(
lis
)
...
...
@@ -199,4 +216,4 @@ def to_avatar(role_id='0'):
@register.filter
(
name
=
'get_user_asset_group'
)
def
get_user_asset_group
(
user
):
return
user_perm_group_api
(
user
)
\ No newline at end of file
return
user_perm_group_api
(
user
)
templates/jasset/host_list.html
View file @
7e532283
...
...
@@ -56,7 +56,6 @@
<th
class=
"text-center"
>
所属部门
</th>
<th
class=
"text-center"
>
所属主机组
</th>
<th
class=
"text-center"
>
是否激活
</th>
<!--<th class="text-center" name="j_time"> 添加时间 </th>-->
<th
class=
"text-center"
name=
"j_comment"
>
备注
</th>
<th
class=
"text-center"
>
操作
</th>
</tr>
...
...
@@ -70,9 +69,8 @@
<td
class=
"text-center"
name=
"j_type"
>
{{ login_types|get_item:post.login_type }}
</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_group"
>
{{ post.bis_group.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_active"
>
{{ post.is_active|bool2str }}
</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"
data-editable=
'false'
>
<a
value=
"/jasset/{{ post.ip }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
...
...
templates/jperm/perm_apply_exec.html
View file @
7e532283
...
...
@@ -6,35 +6,26 @@
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
<div
id=
"add_asset"
class=
"ibox float-e-margins"
>
<div
id=
"ibox-content"
class=
"ibox-title"
>
<h5>
填写要申请主机的基本信息
</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"
>
<h
3>
授权完成, 已邮件通知申请人, 五秒钟后关闭页面
</h3
>
<h
2
id=
"jumpTo"
class=
"text-center text-info"
></h2
>
</div>
</div>
</div>
</div>
</div>
<script>
<script>
function
countDown
(
secs
,
surl
){
var
jumpTo
=
document
.
getElementById
(
'jumpTo'
);
jumpTo
.
innerHTML
=
'{{ smg }}......'
+
secs
+
'秒'
;
if
(
--
secs
>
0
){
setTimeout
(
"countDown("
+
secs
+
",'"
+
surl
+
"')"
,
1000
);
}
else
{
location
.
href
=
surl
;
}
}
countDown
(
10
,
'/'
);
</script>
{% endblock content %}
\ No newline at end of file
templates/jperm/perm_apply_info.html
0 → 100644
View file @
7e532283
{% load mytags %}
<html>
<head>
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<script
src=
"/static/js/jquery-2.1.1.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<!--<link href="/static/css/style.css" rel="stylesheet">
<!--{% include 'head_script.html' %}
<!--<style type="text/css">-->
<!--body-->
<!--{-->
<!--background: #FFFFFF;-->
<!--}-->
<!--</style>-->
</head>
<body>
<div
class=
"container"
>
<h3
class=
"text-center"
><span
class=
"text-success"
>
{{ post.applyer }}
</span>
权限申请详情
</h3>
<br/>
<div
class=
"row"
>
<div
class=
"col-xs-5"
>
<h6
class=
"text-right"
>
申请人
</h6>
<h6
class=
"text-right"
>
所属部门
</h6>
<h6
class=
"text-right"
>
申请主机组
</h6>
<h6
class=
"text-right"
>
申请主机
</h6>
{% for i in post.asset|ast_to_list_1 %}
<h6
class=
"text-right"
style=
"color: #ffffff"
>
Null
</h6>
{% endfor %}
<h6
class=
"text-right"
>
批准人
</h6>
<h6
class=
"text-right"
>
申请时间
</h6>
<h6
class=
"text-right"
>
批准时间
</h6>
<h6
class=
"text-right"
>
备注
</h6>
</div>
<div
class=
"col-xs-2"
>
<div
class=
"col-sm-offset-6"
style=
"width: 2; height: 70%; background-color: #1AB394; padding-top: 200px"
></div>
</div>
<div
class=
"col-xs-5"
>
<h6
class=
"text-left"
>
{{ post.applyer }}
</h6>
<h6
class=
"text-left"
>
{{ post.dept }}
</h6>
<h6
class=
"text-left"
>
{% for i in post.bisgroup|ast_to_list_1 %} {{ i }} {% endfor %}
</h6>
{% for i in post.asset|ast_to_list_1 %}
<h6
class=
"text-left"
>
{{ i }}
</h6>
{% endfor %}
<h6
class=
"text-right"
style=
"color: #ffffff"
>
Null
</h6>
<h6
class=
"text-left"
>
{{ post.approver }}1
</h6>
<h6
class=
"text-left"
>
{{ post.date_add|date:"Y-m-d H:i:s"}}
</h6>
<h6
class=
"text-left"
>
{{ post.date_end|date:"Y-m-d H:i:s" }}1
</h6>
<h6
class=
"text-left"
>
{{ post.comment }}
</h6>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
templates/jperm/perm_apply_search.html
0 → 100644
View file @
7e532283
{% load mytags %}
<div
class=
"tab-content"
>
<table
class=
"table table-striped table-bordered table-hover "
>
<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>
<th
class=
"text-center"
>
申请时间
</th>
<!--<th class="text-center"> 批准时间 </th>-->
<th
class=
"text-center"
>
备注
</th>
<th
class=
"text-center"
>
详情
</th>
</tr>
</thead>
<tbody>
{% for post in contacts.object_list %}
<tr
class=
"gradeX"
>
<td
class=
"text-center"
id=
"username"
>
{{ post.applyer }}
</td>
<td
class=
"text-center"
id=
"dept"
>
{{ post.dept }}
</td>
<td
class=
"text-center"
id=
"ip"
>
{% for i in post.bisgroup|ast_to_list %} {{ i }} {% endfor %}...
</td>
<td
class=
"text-center"
id=
"remote_ip"
>
{% for i in post.asset|ast_to_list %} {{ i }} {% endfor %}...
</td>
<td
class=
"text-center"
id=
"approver"
>
{{ post.approver }}
</td>
<td
class=
"text-center"
id=
"start_time"
>
{{ post.date_add|date:"Y-m-d H:i:s"}}
</td>
<!--<td class="text-center" id="end_time"> {{ post.date_end|date:"Y-m-d H:i:s" }} </td>-->
<td
class=
"text-center"
id=
""
>
{{ post.comment }}
</td>
<td
class=
"text-center"
data-editable=
'false'
>
<a
value=
"/jperm/apply_info/?uuid={{ post.uuid }}"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
</div>
{% include 'paginator.html' %}
</div>
</div>
</div>
\ No newline at end of file
templates/jperm/perm_log_offline.html
View file @
7e532283
...
...
@@ -38,7 +38,7 @@
<input
type=
"text"
class=
"form-control input-sm"
id=
"search_input"
name=
"keyword"
placeholder=
"Search"
>
<input
type=
"text"
style=
"display: none"
>
<div
class=
"input-group-btn"
>
<button
id=
'search_btn'
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"
log
_search()"
>
<button
id=
'search_btn'
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"
apply
_search()"
>
Search
</button>
</div>
...
...
@@ -58,8 +58,9 @@
<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>
</thead>
...
...
@@ -68,15 +69,15 @@
<tr
class=
"gradeX"
>
<td
class=
"text-center"
id=
"username"
>
{{ post.applyer }}
</td>
<td
class=
"text-center"
id=
"dept"
>
{{ post.dept }}
</td>
<td
class=
"text-center"
id=
"ip"
>
{% for i in post.bisgroup|ast_to_list %} {{ i }} {% endfor %}
</td>
<td
class=
"text-center"
id=
"remote_ip"
>
{% for i in post.asset|ast_to_list %} {{ i }} {% endfor %}
</td>
<td
class=
"text-center"
id=
"ip"
>
{% for i in post.bisgroup|ast_to_list %} {{ i }} {% endfor %}
...
</td>
<td
class=
"text-center"
id=
"remote_ip"
>
{% for i in post.asset|ast_to_list %} {{ i }} {% endfor %}
...
</td>
<td
class=
"text-center"
id=
"approver"
>
{{ post.approver }}
</td>
<!--{% ifnotequal session_role_id 0 %}-->
<!--<td class="text-center"><a href="/jlog/history/?id={{ post.id }}" class="log_command"> 命令统计 </td>-->
<!--{% endifnotequal %}-->
<td
class=
"text-center"
id=
"start_time"
>
{{ post.date_add|date:"Y-m-d H:i:s"}}
</td>
<
td
class=
"text-center"
id=
"end_time"
>
{{ post.date_end|date:"Y-m-d H:i:s" }}
</td
>
<
!--<td class="text-center" id="end_time"> {{ post.date_end|date:"Y-m-d H:i:s" }} </td>--
>
<td
class=
"text-center"
id=
""
>
{{ post.comment }}
</td>
<td
class=
"text-center"
data-editable=
'false'
>
<a
value=
"/jperm/apply_info/?uuid={{ post.uuid }}"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
</td>
</tr>
{% endfor %}
</tbody>
...
...
@@ -93,4 +94,36 @@
</div>
</div>
<script>
$
(
".iframe"
).
on
(
'click'
,
function
(){
var
url
=
$
(
this
).
attr
(
"value"
);
$
.
layer
({
type
:
2
,
title
:
'权限申请详情'
,
maxmin
:
true
,
shift
:
'top'
,
border
:
[
2
,
0.3
,
'#1AB394'
],
shade
:
[
0.5
,
'#000000'
],
shadeClose
:
true
,
area
:
[
'800px'
,
'600px'
],
iframe
:
{
src
:
url
}
});
});
function
apply_search
(){
$
.
ajax
({
type
:
"GET"
,
url
:
"/jperm/apply_search/?env=offline"
,
data
:
$
(
"#search_form"
).
serialize
(),
success
:
function
(
data
)
{
$
(
".tab-content"
).
html
(
data
);
}
});
}
$
(
"#search_input"
).
keydown
(
function
(
e
){
if
(
e
.
keyCode
==
13
){
apply_search
()
}
})
</script>
{% endblock %}
\ No newline at end of file
templates/jperm/perm_log_online.html
View file @
7e532283
{% extends 'base.html' %}
{% load mytags %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
...
...
@@ -37,7 +38,7 @@
<input
type=
"text"
class=
"form-control input-sm"
id=
"search_input"
name=
"keyword"
placeholder=
"Search"
>
<input
type=
"text"
style=
"display: none"
>
<div
class=
"input-group-btn"
>
<button
id=
'search_btn'
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"
log
_search()"
>
<button
id=
'search_btn'
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"
apply
_search()"
>
Search
</button>
</div>
...
...
@@ -56,8 +57,8 @@
<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>
</thead>
...
...
@@ -66,14 +67,13 @@
<tr
class=
"gradeX"
>
<td
class=
"text-center"
id=
"username"
>
{{ post.applyer }}
</td>
<td
class=
"text-center"
id=
"dept"
>
{{ post.dept }}
</td>
<td
class=
"text-center"
id=
"ip"
>
{{ post.bisgroup }}
</td>
<td
class=
"text-center"
id=
"remote_ip"
>
{{ post.asset }}
</td>
<!--{% ifnotequal session_role_id 0 %}-->
<!--<td class="text-center"><a href="/jlog/history/?id={{ post.id }}" class="log_command"> 命令统计 </td>-->
<!--{% endifnotequal %}-->
<td
class=
"text-center"
id=
"ip"
>
{% for i in post.bisgroup|ast_to_list %} {{ i }} {% endfor %}...
</td>
<td
class=
"text-center"
id=
"remote_ip"
>
{% for i in post.asset|ast_to_list %} {{ i }} {% endfor %}...
</td>
<td
class=
"text-center"
id=
"start_time"
>
{{ post.date_add|date:"Y-m-d H:i:s"}}
</td>
<td
class=
"text-center"
id=
"end_time"
>
{{ post.date_end|date:"Y-m-d H:i:s" }}
</td>
<td
class=
"text-center"
id=
""
>
{{ post.comment }}
</td>
<td
class=
"text-center"
data-editable=
'false'
>
<a
value=
"/jperm/apply_info/?uuid={{ post.uuid }}"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
</td>
</tr>
{% endfor %}
</tbody>
...
...
@@ -89,5 +89,36 @@
</div>
</div>
</div>
<script>
$
(
".iframe"
).
on
(
'click'
,
function
(){
var
url
=
$
(
this
).
attr
(
"value"
);
$
.
layer
({
type
:
2
,
title
:
'权限申请详情'
,
maxmin
:
true
,
shift
:
'top'
,
border
:
[
2
,
0.3
,
'#1AB394'
],
shade
:
[
0.5
,
'#000000'
],
shadeClose
:
true
,
area
:
[
'800px'
,
'600px'
],
iframe
:
{
src
:
url
}
});
});
function
apply_search
(){
$
.
ajax
({
type
:
"GET"
,
url
:
"/jperm/apply_search/?env=online"
,
data
:
$
(
"#search_form"
).
serialize
(),
success
:
function
(
data
)
{
$
(
".tab-content"
).
html
(
data
);
}
});
}
$
(
"#search_input"
).
keydown
(
function
(
e
){
if
(
e
.
keyCode
==
13
){
apply_search
()
}
})
</script>
{% endblock %}
\ No newline at end of file
templates/nav.html
View file @
7e532283
...
...
@@ -48,6 +48,7 @@
<li
class=
"sudo_list sudo_edit sudo_add cmd_list cmd_edit"
>
<a
href=
"/jperm/sudo_list/"
>
Sudo授权
</a>
</li>
<li
class=
"apply_show online"
><a
href=
"/jperm/apply_show/online/"
>
权限审批
</a></li>
</ul>
</li>
{#
<li
id=
"jlog"
>
#}
...
...
@@ -112,6 +113,7 @@
<li
id=
"sudo_add"
>
<a
href=
"/jperm/sudo_list/"
>
Sudo授权
</a>
</li>
<li
class=
"apply_show online"
><a
href=
"/jperm/apply_show/online/"
>
权限审批
</a></li>
</ul>
</li>
<li
id=
"jlog"
>
...
...
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