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
75e1ea7f
Commit
75e1ea7f
authored
Apr 18, 2015
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
a269c43d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
412 additions
and
106 deletions
+412
-106
views.py
jasset/views.py
+0
-0
jumpserver.conf
jumpserver.conf
+2
-2
base.js
static/js/base.js
+4
-1
group_add.html
templates/jasset/group_add.html
+78
-34
group_detail.html
templates/jasset/group_detail.html
+72
-1
group_edit.html
templates/jasset/group_edit.html
+100
-35
idc_detail.html
templates/jasset/idc_detail.html
+72
-1
perm_apply.html
templates/jperm/perm_apply.html
+84
-32
No files found.
jasset/views.py
View file @
75e1ea7f
This diff is collapsed.
Click to expand it.
jumpserver.conf
View file @
75e1ea7f
#coding: utf8
[
base
]
ip
=
192
.
168
.
20
.
209
ip
=
192
.
168
.
8
.
61
port
=
80
key
=
88
aaaf7ffe3c6c04
...
...
@@ -24,7 +24,7 @@ root_pw = secret234
[
websocket
]
web_socket_host
=
192
.
168
.
173
.
129
:
3000
web_socket_host
=
192
.
168
.
8
.
61
:
3000
[
mail
]
...
...
static/js/base.js
View file @
75e1ea7f
...
...
@@ -70,10 +70,13 @@ function move(from, to, from_o, to_o) {
});
}
function
move_left
(
from
,
to
)
{
function
move_left
(
from
,
to
,
from_o
,
to_o
)
{
$
(
"#"
+
from
+
" option"
).
each
(
function
()
{
if
(
$
(
this
).
prop
(
"selected"
)
==
true
)
{
$
(
"#"
+
to
).
append
(
this
);
if
(
typeof
from_o
!==
'undefined'
){
$
(
"#"
+
to_o
).
append
(
$
(
"#"
+
from_o
+
" option[value='"
+
this
.
value
+
"']"
));
}
}
$
(
this
).
attr
(
"selected"
,
'true'
);
});
...
...
templates/jasset/group_add.html
View file @
75e1ea7f
...
...
@@ -2,6 +2,21 @@
{% load mytags %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<script
type=
"text/javascript"
>
function
search_ip
(
text
,
noselect
,
total
){
$
(
"#"
+
noselect
).
children
().
each
(
function
(){
$
(
this
).
remove
();
});
$
(
"#"
+
total
).
children
().
each
(
function
(){
if
(
$
(
this
).
text
().
search
(
text
)
!=
-
1
){
$
(
"#"
+
noselect
).
append
(
$
(
this
).
clone
())
}
})
}
</script>
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
...
...
@@ -26,6 +41,19 @@
</a>
</div>
</div>
<select
id=
"assets_total"
name=
"assets"
class=
"form-control m-b"
size=
"12"
multiple
style=
"display: none"
>
{% for asset in posts %}
<option
value=
"{{ asset.id }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</select>
<select
id=
"asset_select_total"
name=
"j_hosts"
class=
"form-control m-b"
size=
"12"
multiple
style=
"display: none"
>
{% for asset in eposts %}
<option
value=
"{{ asset.id }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</select>
<div
class=
"ibox-content"
>
{% if emg %}
<div
class=
"alert alert-warning text-center"
>
{{ emg }}
</div>
...
...
@@ -63,35 +91,40 @@
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<div>
<label
for=
"hosts"
class=
"col-lg-2 control-label"
>
主机
</label>
<div
class=
"col-sm-3"
>
<select
multiple=
"multiple"
id=
"id_domains_filter"
name=
"domains_filter"
style=
"display: none;"
>
</select>
<div
class=
"input-group"
style=
"padding-bottom: 5px"
>
<input
type=
"text"
size=
"19"
class=
"form-control input-sm"
id=
"search"
name=
"keyword"
placeholder=
"过滤"
>
</div>
<select
id=
"hosts"
size=
"12"
class=
"form-control m-b"
multiple
>
<label
for=
"group_name"
class=
"col-sm-2 control-label"
>
过滤
</label>
<div
class=
"col-sm-4"
>
<input
id=
"noselect"
class=
"form-control"
oninput=
"search_ip(this.value, 'assets', 'assets_total')"
>
</div>
<div
class=
"col-sm-1"
>
</div>
<div
id=
"select"
class=
"col-sm-3"
>
<input
class=
"form-control"
oninput=
"search_ip(this.value, 'asset_select', 'asset_select_total')"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
""
class=
"col-sm-2 control-label"
>
主机
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"col-sm-4"
>
<div>
<select
id=
"assets"
name=
"assets"
class=
"form-control m-b"
size=
"12"
multiple
>
{% for post in posts %}
<option
value=
"{{ post.id }}"
>
{{ post.ip }}
</option>
<option
value=
"{{ post.id }}"
>
{{ post.ip }}
</option>
{% endfor %}
</select>
</div>
<div
class=
"col-sm-1"
>
<div
class=
"btn-group"
style=
"margin-top: 50px;"
>
<button
type=
"button"
class=
"btn btn-xm btn-white"
onclick=
"move('hosts', 'hosts_selected')"
><i
class=
"fa fa-chevron-right"
></i></button>
<button
type=
"button"
class=
"btn btn-xm btn-white"
onclick=
"move_left('hosts_selected', 'hosts')"
><i
class=
"fa fa-chevron-left"
></i></button>
</div>
</div>
<div
class=
"col-sm-1"
>
<div
class=
"btn-group"
style=
"margin-top: 60px;"
>
<button
type=
"button"
class=
"btn btn-white"
onclick=
"move('assets', 'asset_select', 'assets_total', 'asset_select_total' )"
><i
class=
"fa fa-chevron-right"
></i></button>
<button
type=
"button"
class=
"btn btn-white"
onclick=
"move_left('asset_select', 'assets', 'asset_select_total', 'assets_total')"
><i
class=
"fa fa-chevron-left"
></i>
</button>
</div>
<div
class=
"col-sm-3"
>
<h4
style=
"padding-bottom: 5px"
>
已选中主机
</h4>
<div>
<select
id=
"hosts_selected"
name=
"j_hosts"
class=
"form-control m-b"
size=
"12"
multiple
>
{% for post in eposts %}
<option
value=
"{{ post.id }}"
>
{{ post.ip }}
</option>
{% endfor %}
</select>
</div>
</div>
<div
class=
"col-sm-3"
>
<div>
<select
id=
"asset_select"
name=
"j_hosts"
class=
"form-control m-b"
size=
"12"
multiple
></select>
</div>
</div>
</div>
...
...
@@ -105,7 +138,7 @@
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-5"
>
<button
class=
"btn btn-white"
type=
"submit"
>
重置
</button>
<button
class=
"btn btn-primary"
type=
"submit"
onclick=
"on_submit('groups_selected') "
>
提交
</button>
<button
class=
"btn btn-primary"
id=
"submit_button"
type=
"submit"
onclick=
"on_submit('groups_selected') "
>
提交
</button>
</div>
</div>
</form>
...
...
@@ -116,6 +149,15 @@
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
"#submit_button"
).
click
(
function
(){
$
(
'#assetForm option'
).
each
(
function
(){
$
(
this
).
prop
(
'selected'
,
true
)
})
});
})
$
(
'#assetForm'
).
validator
({
timely
:
2
,
theme
:
"yellow_right_effect"
,
...
...
@@ -140,15 +182,15 @@
})
}
$
(
'#search'
).
keyup
(
function
()
{
var
$rows
=
$
(
'#hosts option'
);
var
val
=
$
.
trim
(
$
(
this
).
val
()).
replace
(
/ +/g
,
' '
).
toLowerCase
();
$rows
.
show
().
filter
(
function
()
{
var
text
=
$
(
this
).
text
().
replace
(
/
\s
+/g
,
' '
).
toLowerCase
();
return
!~
text
.
indexOf
(
val
);
}).
hide
();
});
//
$('#search').keyup(function() {
//
var $rows = $('#hosts option');
//
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
//
//
$rows.show().filter(function() {
//
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
//
return !~text.indexOf(val);
//
}).hide();
//
});
function
change_dept
(
dept_id
){
$
.
get
(
'/jasset/dept_host_ajax/'
,
...
...
@@ -157,6 +199,7 @@
$
(
'#hosts'
).
html
(
data
)
})
}
</script>
{% endblock %}
\ No newline at end of file
templates/jasset/group_detail.html
View file @
75e1ea7f
...
...
@@ -75,7 +75,78 @@
<input
type=
"button"
id=
"del_button"
class=
"btn btn-danger btn-sm"
name=
"del_button"
value=
"删除"
onclick=
"del('contents_form')"
/>
<input
type=
"button"
id=
"alter_button"
class=
"btn btn-warning btn-sm"
name=
"alter_button"
value=
"修改"
onclick=
"alter('contents_form')"
/>
</div>
{% include 'paginator.html' %}
<div
class=
"col-sm-6"
>
<div
class=
"dataTables_paginate paging_simple_numbers"
id=
"editable_paginate"
>
<ul
class=
"pagination"
style=
"margin-top: 0; float: right"
>
{% if keyword %}
{% if contacts.has_previous %}
<li
class=
"paginate_button previous"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"?keyword={{ keyword }}&page={{ contacts.previous_page_number }}"
>
Previous
</a>
</li>
{% else %}
<li
class=
"paginate_button previous disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"#"
>
Previous
</a>
</li>
{% endif %}
{% ifequal show_first 1 %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page=1&id={{ group.id }}"
title=
"第1页"
>
1...
</a></li>
{% endifequal %}
{% for page in page_range %}
{% ifequal current_page page %}
<li
class=
"paginate_button active"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page={{ page }}&id={{ group.id }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% else %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page={{ page }}&id={{ group.id }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% endifequal %}
{% endfor %}
{% ifequal show_end 1 %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page={{ p.num_pages }}&id={{ group.id }}"
title=
"第{{ page }}页"
>
...{{ p.num_pages }}
</a></li>
{% endifequal %}
{% if contacts.has_next %}
<li
class=
"paginate_button next"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"?keyword={{ keyword }}&page={{ contacts.next_page_number }}&id={{ group.id }}"
>
Next
</a>
</li>
{% else %}
<li
class=
"paginate_button next disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"#"
>
Next
</a>
</li>
{% endif %}
{% else %}
{% if contacts.has_previous %}
<li
class=
"paginate_button previous"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"?page={{ contacts.previous_page_number }}&id={{ group.id }}"
>
Previous
</a>
</li>
{% else %}
<li
class=
"paginate_button previous disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"#"
>
Previous
</a>
</li>
{% endif %}
{% ifequal show_first 1 %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page=1&id={{ group.id }}"
title=
"第1页"
>
1...
</a></li>
{% endifequal %}
{% for page in page_range %}
{% ifequal current_page page %}
<li
class=
"paginate_button active"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}&id={{ group.id }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% else %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}&id={{ group.id }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% endifequal %}
{% endfor %}
{% ifequal show_end 1 %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ p.num_pages }}&id={{ group.id }}"
title=
"第{{ page }}页"
>
...{{ p.num_pages }}
</a></li>
{% endifequal %}
{% if contacts.has_next %}
<li
class=
"paginate_button next"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"?page={{ contacts.next_page_number }}&id={{ group.id }}"
>
Next
</a>
</li>
{% else %}
<li
class=
"paginate_button next disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"#"
>
Next
</a>
</li>
{% endif %}
{% endif %}
</ul>
</div>
</div>
</div>
</form>
</div>
...
...
templates/jasset/group_edit.html
View file @
75e1ea7f
...
...
@@ -2,13 +2,58 @@
{% load mytags %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<script
type=
"text/javascript"
>
function
search_ip
(
text
,
noselect
,
total
){
$
(
"#"
+
noselect
).
children
().
each
(
function
(){
$
(
this
).
remove
();
});
$
(
"#"
+
total
).
children
().
each
(
function
(){
if
(
$
(
this
).
text
().
search
(
text
)
!=
-
1
){
$
(
"#"
+
noselect
).
append
(
$
(
this
).
clone
())
}
})
}
</script>
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
id=
"ibox-content"
class=
"ibox-title"
>
<h5>
填写主机组基本信息
</h5>
</div>
<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>
<select
id=
"assets_total"
name=
"assets"
class=
"form-control m-b"
size=
"12"
multiple
style=
"display: none"
>
{% for asset in posts %}
<option
value=
"{{ asset.id }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</select>
<select
id=
"asset_select_total"
name=
"j_hosts"
class=
"form-control m-b"
size=
"12"
multiple
style=
"display: none"
>
{% for asset in eposts %}
<option
value=
"{{ asset.id }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</select>
<div
class=
"ibox-content"
>
{% if emg %}
<div
class=
"alert alert-warning text-center"
>
{{ emg }}
</div>
...
...
@@ -48,35 +93,46 @@
</div>
{% endifequal %}
<div
class=
"hr-line-dashed"
></div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<label
for=
"group_name"
class=
"col-sm-2 control-label"
>
过滤
</label>
<div
class=
"col-sm-4"
>
<input
id=
"noselect"
class=
"form-control"
oninput=
"search_ip(this.value, 'assets', 'assets_total')"
>
</div>
<div
class=
"col-sm-1"
>
</div>
<div
id=
"select"
class=
"col-sm-3"
>
<input
class=
"form-control"
oninput=
"search_ip(this.value, 'asset_select', 'asset_select_total')"
>
</div>
</div>
<div
class=
"form-group"
>
<div>
<label
for=
"hosts"
class=
"col-lg-2 control-label"
>
主机
</label>
<div
class=
"col-sm-3"
>
<div
class=
"input-group"
style=
"padding-bottom: 5px"
>
<input
type=
"text"
size=
"19"
class=
"form-control input-sm"
id=
"search"
name=
"keyword"
placeholder=
"过滤"
>
</div>
<select
id=
"hosts"
size=
"12"
class=
"form-control m-b"
multiple
>
<label
for=
""
class=
"col-sm-2 control-label"
>
主机
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"col-sm-4"
>
<div>
<select
id=
"assets"
name=
"assets"
class=
"form-control m-b"
size=
"12"
multiple
>
{% for post in posts %}
<option
value=
"{{ post.id }}"
>
{{ post.ip }}
</option>
<option
value=
"{{ post.id }}"
>
{{ post.ip }}
</option>
{% endfor %}
</select>
</div>
<div
class=
"col-sm-1"
>
<div
class=
"btn-group"
style=
"margin-top: 50px;"
>
<button
type=
"button"
class=
"btn btn-xm btn-white"
onclick=
"move('hosts', 'hosts_selected')"
><i
class=
"fa fa-chevron-right"
></i></button>
<button
type=
"button"
class=
"btn btn-xm btn-white"
onclick=
"move_left('hosts_selected', 'hosts')"
><i
class=
"fa fa-chevron-left"
></i></button>
</div>
</div>
<div
class=
"col-sm-1"
>
<div
class=
"btn-group"
style=
"margin-top: 60px;"
>
<button
type=
"button"
class=
"btn btn-white"
onclick=
"move('assets', 'asset_select', 'assets_total', 'asset_select_total' )"
><i
class=
"fa fa-chevron-right"
></i></button>
<button
type=
"button"
class=
"btn btn-white"
onclick=
"move_left('asset_select', 'assets', 'asset_select_total', 'assets_total')"
><i
class=
"fa fa-chevron-left"
></i>
</button>
</div>
<div
class=
"col-sm-3"
>
<h4
style=
"padding-bottom: 5px"
>
已选中主机
</h4>
<div
>
<select
id=
"hosts_selected"
name=
"j_hosts"
class=
"form-control m-b"
size=
"12"
multiple
>
{% for post in eposts %}
<option
value=
"{{ post.id }}"
>
{{ post.ip }}
</option>
{% endfor %}
</select>
</
div
>
</div
>
<div
class=
"col-sm-3"
>
<div
>
<select
id=
"asset_select"
name=
"j_hosts"
class=
"form-control m-b"
size=
"12"
multiple
>
{% for asset in eposts %}
<option
value=
"{{ asset.id }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</
select
>
</div>
</div>
</div>
...
...
@@ -90,7 +146,7 @@
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-5"
>
<button
class=
"btn btn-white"
type=
"submit"
>
重置
</button>
<button
class=
"btn btn-primary"
type=
"submit"
onclick=
"on_submit('groups_selected') "
>
提交
</button>
<button
class=
"btn btn-primary"
id=
"submit_button"
type=
"submit"
onclick=
"on_submit('groups_selected') "
>
提交
</button>
</div>
</div>
</form>
...
...
@@ -101,6 +157,15 @@
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
"#submit_button"
).
click
(
function
(){
$
(
'#assetForm option'
).
each
(
function
(){
$
(
this
).
prop
(
'selected'
,
true
)
})
});
})
$
(
'#assetForm'
).
validator
({
timely
:
2
,
theme
:
"yellow_right_effect"
,
...
...
@@ -125,16 +190,16 @@
})
}
$
(
'#search'
).
keyup
(
function
()
{
var
$rows
=
$
(
'#hosts option'
);
console
.
log
(
$rows
);
var
val
=
$
.
trim
(
$
(
this
).
val
()).
replace
(
/ +/g
,
' '
).
toLowerCase
();
$rows
.
show
().
filter
(
function
()
{
var
text
=
$
(
this
).
text
().
replace
(
/
\s
+/g
,
' '
).
toLowerCase
();
return
!~
text
.
indexOf
(
val
);
}).
hide
();
});
//
$('#search').keyup(function() {
//
var $rows = $('#hosts option');
//
console.log($rows);
//
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
//
//
$rows.show().filter(function() {
//
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
//
return !~text.indexOf(val);
//
}).hide();
//
});
function
change_dept
(
dept_id
){
$
.
get
(
'/jasset/dept_host_ajax/'
,
...
...
templates/jasset/idc_detail.html
View file @
75e1ea7f
...
...
@@ -83,7 +83,78 @@
<input
type=
"button"
id=
"del_button"
class=
"btn btn-danger btn-sm"
name=
"del_button"
value=
"删除"
onclick=
"del('contents_form')"
/>
<input
type=
"button"
id=
"alter_button"
class=
"btn btn-warning btn-sm"
name=
"alter_button"
value=
"修改"
onclick=
"alter('contents_form')"
/>
</div>
{% include 'paginator.html' %}
<div
class=
"col-sm-6"
>
<div
class=
"dataTables_paginate paging_simple_numbers"
id=
"editable_paginate"
>
<ul
class=
"pagination"
style=
"margin-top: 0; float: right"
>
{% if keyword %}
{% if contacts.has_previous %}
<li
class=
"paginate_button previous"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"?keyword={{ keyword }}&page={{ contacts.previous_page_number }}"
>
Previous
</a>
</li>
{% else %}
<li
class=
"paginate_button previous disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"#"
>
Previous
</a>
</li>
{% endif %}
{% ifequal show_first 1 %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page=1&id={{ idc.id }}"
title=
"第1页"
>
1...
</a></li>
{% endifequal %}
{% for page in page_range %}
{% ifequal current_page page %}
<li
class=
"paginate_button active"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page={{ page }}&id={{ idc.id }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% else %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page={{ page }}&id={{ idc.id }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% endifequal %}
{% endfor %}
{% ifequal show_end 1 %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page={{ p.num_pages }}&id={{ idc.id }}"
title=
"第{{ page }}页"
>
...{{ p.num_pages }}
</a></li>
{% endifequal %}
{% if contacts.has_next %}
<li
class=
"paginate_button next"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"?keyword={{ keyword }}&page={{ contacts.next_page_number }}&id={{ idc.id }}"
>
Next
</a>
</li>
{% else %}
<li
class=
"paginate_button next disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"#"
>
Next
</a>
</li>
{% endif %}
{% else %}
{% if contacts.has_previous %}
<li
class=
"paginate_button previous"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"?page={{ contacts.previous_page_number }}&id={{ idc.id }}"
>
Previous
</a>
</li>
{% else %}
<li
class=
"paginate_button previous disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"#"
>
Previous
</a>
</li>
{% endif %}
{% ifequal show_first 1 %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page=1&id={{ idc.id }}"
title=
"第1页"
>
1...
</a></li>
{% endifequal %}
{% for page in page_range %}
{% ifequal current_page page %}
<li
class=
"paginate_button active"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}&id={{ idc.id }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% else %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}&id={{ idc.id }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% endifequal %}
{% endfor %}
{% ifequal show_end 1 %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ p.num_pages }}&id={{ idc.id }}"
title=
"第{{ page }}页"
>
...{{ p.num_pages }}
</a></li>
{% endifequal %}
{% if contacts.has_next %}
<li
class=
"paginate_button next"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"?page={{ contacts.next_page_number }}&id={{ idc.id }}"
>
Next
</a>
</li>
{% else %}
<li
class=
"paginate_button next disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"#"
>
Next
</a>
</li>
{% endif %}
{% endif %}
</ul>
</div>
</div>
</div>
</form>
</div>
...
...
templates/jperm/perm_apply.html
View file @
75e1ea7f
{% extends 'base.html' %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<!--<h3 class="text-center">项目发布申请</h3>-->
<script
type=
"text/javascript"
>
function
search_ip
(
text
,
noselect
,
total
){
$
(
"#"
+
noselect
).
children
().
each
(
function
(){
$
(
this
).
remove
();
});
$
(
"#"
+
total
).
children
().
each
(
function
(){
if
(
$
(
this
).
text
().
search
(
text
)
!=
-
1
){
$
(
"#"
+
noselect
).
append
(
$
(
this
).
clone
())
}
})
}
</script>
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
...
...
@@ -16,10 +29,6 @@
<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>
...
...
@@ -27,6 +36,18 @@
</div>
</div>
<select
id=
"assets_total"
name=
"assets"
class=
"form-control m-b"
size=
"12"
multiple
style=
"display: none"
>
{% for asset in posts %}
<option
value=
"{{ asset.ip }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</select>
<select
id=
"asset_select_total"
name=
"j_hosts"
class=
"form-control m-b"
size=
"12"
multiple
style=
"display: none"
>
{% for asset in eposts %}
<option
value=
"{{ asset.ip }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</select>
<div
class=
"ibox-content"
>
{% if emg %}
<div
class=
"alert alert-warning text-center"
>
{{ emg }}
</div>
...
...
@@ -46,10 +67,10 @@
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
><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"
>
{% for da in dept_da %}
<label><input
type=
"radio"
value=
"{{ da.id }}"
id=
"da"
name=
"da"
>
{{ da }}
</label>
<label><input
type=
"radio"
value=
"{{ da.id }}"
name=
"da"
>
{{ da }}
</label>
{% endfor %}
</div>
</div>
...
...
@@ -68,35 +89,40 @@
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<div>
<label
for=
"groups"
class=
"col-lg-2 control-label"
>
主机
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"col-sm-3"
>
<select
multiple=
"multiple"
id=
"id_domains_filter"
name=
"domains_filter"
style=
"display: none;"
>
</select>
<div
class=
"input-group"
style=
"padding-bottom: 5px"
>
<input
type=
"text"
size=
"19"
class=
"form-control input-sm"
id=
"search"
name=
"keyword"
placeholder=
"过滤"
>
</div>
<select
id=
"groups"
size=
"12"
class=
"form-control m-b"
multiple
>
<label
for=
"group_name"
class=
"col-sm-2 control-label"
>
过滤
</label>
<div
class=
"col-sm-4"
>
<input
id=
"noselect"
class=
"form-control"
oninput=
"search_ip(this.value, 'assets', 'assets_total')"
>
</div>
<div
class=
"col-sm-1"
>
</div>
<div
id=
"select"
class=
"col-sm-3"
>
<input
class=
"form-control"
oninput=
"search_ip(this.value, 'asset_select', 'asset_select_total')"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
""
class=
"col-sm-2 control-label"
>
主机
<span
class=
"red-fonts"
>
*
</span></label>
<div
class=
"col-sm-4"
>
<div>
<select
id=
"assets"
name=
"assets"
class=
"form-control m-b"
size=
"12"
multiple
>
{% for post in posts %}
<option
value=
"{{ post.ip }}"
>
{{ post.ip }}
</option>
<option
value=
"{{ post.ip }}"
>
{{ post.ip }}
</option>
{% endfor %}
</select>
</div>
<div
class=
"col-sm-1"
>
<div
class=
"btn-group"
style=
"margin-top: 50px;"
>
<button
type=
"button"
class=
"btn btn-xm btn-white"
onclick=
"move('groups', 'groups_selected')"
><i
class=
"fa fa-chevron-right"
></i></button>
<button
type=
"button"
class=
"btn btn-xm btn-white"
onclick=
"move_left('groups_selected', 'groups')"
><i
class=
"fa fa-chevron-left"
></i></button>
</div>
</div>
<div
class=
"col-sm-1"
>
<div
class=
"btn-group"
style=
"margin-top: 60px;"
>
<button
type=
"button"
class=
"btn btn-white"
onclick=
"move('assets', 'asset_select', 'assets_total', 'asset_select_total' )"
><i
class=
"fa fa-chevron-right"
></i></button>
<button
type=
"button"
class=
"btn btn-white"
onclick=
"move_left('asset_select', 'assets', 'asset_select_total', 'assets_total')"
><i
class=
"fa fa-chevron-left"
></i>
</button>
</div>
<div
class=
"col-sm-3"
>
<h4
style=
"padding-bottom: 5px"
>
已选中主机
</h4>
<div>
<select
id=
"groups_selected"
name=
"hosts"
class=
"form-control m-b"
size=
"12"
multiple
>
{% for post in eposts %}
<option
value=
"{{ post.ip }}"
>
{{ post.ip }}
</option>
{% endfor %}
</select>
</div>
</div>
<div
class=
"col-sm-3"
>
<div>
<select
id=
"asset_select"
name=
"hosts"
class=
"form-control m-b"
size=
"12"
multiple
></select>
</div>
</div>
</div>
...
...
@@ -110,7 +136,7 @@
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-5"
>
<button
class=
"btn btn-primary"
type=
"submit"
>
提交
</button>
<button
class=
"btn btn-primary"
id=
"submit_button"
type=
"submit"
>
提交
</button>
</div>
</div>
</form>
...
...
@@ -121,6 +147,32 @@
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
"#submit_button"
).
click
(
function
(){
$
(
'#assetForm option'
).
each
(
function
(){
$
(
this
).
prop
(
'selected'
,
true
)
})
});
})
$
(
'#assetForm'
).
validator
({
timely
:
2
,
theme
:
"yellow_right_effect"
,
fields
:
{
"j_da"
:
{
rule
:
"required"
,
tip
:
"选择管理员"
,
ok
:
""
,
msg
:
{
required
:
"管理员必须选择!"
},
data
:
{
'data-ok'
:
"ok"
}
}
},
valid
:
function
(
form
)
{
form
.
submit
();
}
});
var
$rows
=
$
(
'#groups option'
);
$
(
'#search'
).
keyup
(
function
()
{
var
val
=
$
.
trim
(
$
(
this
).
val
()).
replace
(
/ +/g
,
' '
).
toLowerCase
();
...
...
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