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
6c10b06d
Commit
6c10b06d
authored
Mar 07, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'master' and 'wangyong' of gitcafe.com:ibuler/jumpserver
parents
8f163eb6
95bb96eb
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
37 deletions
+101
-37
urls.py
jasset/urls.py
+2
-2
views.py
jasset/views.py
+21
-3
group_list.html
templates/jasset/group_list.html
+30
-0
host_list.html
templates/jasset/host_list.html
+6
-0
host_search.html
templates/jasset/host_search.html
+1
-32
idc_list.html
templates/jasset/idc_list.html
+33
-0
log_offline.html
templates/jlog/log_offline.html
+4
-0
log_online.html
templates/jlog/log_online.html
+4
-0
No files found.
jasset/urls.py
View file @
6c10b06d
...
@@ -12,13 +12,13 @@ urlpatterns = patterns('',
...
@@ -12,13 +12,13 @@ urlpatterns = patterns('',
url
(
r'^idc_add/$'
,
add_idc
),
url
(
r'^idc_add/$'
,
add_idc
),
url
(
r'^idc_list/$'
,
list_idc
),
url
(
r'^idc_list/$'
,
list_idc
),
url
(
r'^idc_detail/$'
,
detail_idc
),
url
(
r'^idc_detail/$'
,
detail_idc
),
url
(
r'^idc_del/(\
d
+)/$'
,
del_idc
),
url
(
r'^idc_del/(\
w
+)/$'
,
del_idc
),
url
(
r'^jgroup_add/$'
,
add_group
),
url
(
r'^jgroup_add/$'
,
add_group
),
url
(
r'^group_edit/$'
,
edit_group
),
url
(
r'^group_edit/$'
,
edit_group
),
url
(
r'^jgroup_list/$'
,
list_group
),
url
(
r'^jgroup_list/$'
,
list_group
),
url
(
r'^group_detail/$'
,
detail_group
),
url
(
r'^group_detail/$'
,
detail_group
),
url
(
r'^group_del_host/(\w+)/$'
,
group_del_host
),
url
(
r'^group_del_host/(\w+)/$'
,
group_del_host
),
url
(
r'^group_del/(\
d
+)/$'
,
group_del
),
url
(
r'^group_del/(\
w
+)/$'
,
group_del
),
url
(
r'^host_del/(\w+)/$'
,
host_del
),
url
(
r'^host_del/(\w+)/$'
,
host_del
),
url
(
r'^host_edit/$'
,
host_edit
),
url
(
r'^host_edit/$'
,
host_edit
),
url
(
r'^host_edit/batch/$'
,
batch_host_edit
),
url
(
r'^host_edit/batch/$'
,
batch_host_edit
),
...
...
jasset/views.py
View file @
6c10b06d
...
@@ -251,7 +251,15 @@ def list_idc(request):
...
@@ -251,7 +251,15 @@ def list_idc(request):
def
del_idc
(
request
,
offset
):
def
del_idc
(
request
,
offset
):
IDC
.
objects
.
filter
(
id
=
offset
)
.
delete
()
if
offset
==
'multi'
:
len_list
=
request
.
POST
.
get
(
"len_list"
)
for
i
in
range
(
int
(
len_list
)):
key
=
"id_list["
+
str
(
i
)
+
"]"
gid
=
request
.
POST
.
get
(
key
)
IDC
.
objects
.
filter
(
id
=
gid
)
.
delete
()
else
:
gid
=
int
(
offset
)
IDC
.
objects
.
filter
(
id
=
gid
)
.
delete
()
return
HttpResponseRedirect
(
'/jasset/idc_list/'
)
return
HttpResponseRedirect
(
'/jasset/idc_list/'
)
...
@@ -354,8 +362,18 @@ def group_del_host(request, offset):
...
@@ -354,8 +362,18 @@ def group_del_host(request, offset):
def
group_del
(
request
,
offset
):
def
group_del
(
request
,
offset
):
BisGroup
.
objects
.
filter
(
id
=
offset
)
.
delete
()
if
offset
==
'multi'
:
return
HttpResponseRedirect
(
'/jasset/group_list/'
)
len_list
=
request
.
POST
.
get
(
"len_list"
)
for
i
in
range
(
int
(
len_list
)):
key
=
"id_list["
+
str
(
i
)
+
"]"
gid
=
request
.
POST
.
get
(
key
)
BisGroup
.
objects
.
filter
(
id
=
gid
)
.
delete
()
else
:
gid
=
int
(
offset
)
BisGroup
.
objects
.
filter
(
id
=
gid
)
.
delete
()
return
HttpResponseRedirect
(
'/jasset/jgroup_list/'
)
def
host_search
(
request
):
def
host_search
(
request
):
...
...
templates/jasset/group_list.html
View file @
6c10b06d
...
@@ -38,7 +38,13 @@
...
@@ -38,7 +38,13 @@
{% endfor %}
{% endfor %}
</tbody>
</tbody>
</table>
</table>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<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' %}
{% include 'paginator.html' %}
</div>
</form>
</form>
</div>
</div>
</div>
</div>
...
@@ -46,4 +52,28 @@
...
@@ -46,4 +52,28 @@
</div>
</div>
</div>
</div>
<script>
function
del
(
form
)
{
var
checkboxes
=
document
.
getElementById
(
form
);
var
id_list
=
{};
var
j
=
0
;
for
(
var
i
=
0
;
i
<
checkboxes
.
elements
.
length
;
i
++
)
{
if
(
checkboxes
.
elements
[
i
].
type
==
"checkbox"
&&
checkboxes
.
elements
[
i
].
checked
==
true
&&
checkboxes
.
elements
[
i
].
value
!=
"checkall"
)
{
id_list
[
j
]
=
checkboxes
.
elements
[
i
].
value
;
j
++
;
}
}
if
(
confirm
(
"确定删除"
))
{
$
.
ajax
({
type
:
"POST"
,
url
:
"/jasset/group_del/multi/"
,
data
:
{
"id_list"
:
id_list
,
"len_list"
:
j
},
success
:
function
(
data
)
{
window
.
open
(
"/jasset/jgroup_list/"
,
"_self"
);
}
});
}
}
</script>
{% endblock %}
{% endblock %}
templates/jasset/host_list.html
View file @
6c10b06d
...
@@ -81,7 +81,13 @@
...
@@ -81,7 +81,13 @@
{% endfor %}
{% endfor %}
</tbody>
</tbody>
</table>
</table>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<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' %}
{% include 'paginator.html' %}
</div>
</form>
</form>
</div>
</div>
</div>
</div>
...
...
templates/jasset/host_search.html
View file @
6c10b06d
...
@@ -40,38 +40,7 @@
...
@@ -40,38 +40,7 @@
<input
type=
"button"
id=
"del_button"
class=
"btn btn-danger btn-sm"
name=
"del_button"
value=
"删除"
onclick=
"del('contents_form')"
/>
<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')"
/>
<input
type=
"button"
id=
"alter_button"
class=
"btn btn-warning btn-sm"
name=
"alter_button"
value=
"修改"
onclick=
"alter('contents_form')"
/>
</div>
</div>
<div
class=
"col-sm-6"
>
{% include 'paginator.html' %}
<div
class=
"dataTables_paginate paging_simple_numbers"
id=
"editable_paginate"
>
<ul
class=
"pagination"
style=
"margin-top: 0; float: right"
>
{% if contacts.has_previous %}
<li
class=
"paginate_button previous"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"?id={{ group_id }}&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 %}
{% 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 }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% else %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?keyword={{ keyword }}&page={{ page }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% endifequal %}
{% endfor %}
{% if contacts.has_next %}
<li
class=
"paginate_button next"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"?id={{ group_id }}&page={{ contacts.next_page_number }}"
>
Next
</a>
</li>
{% else %}
<li
class=
"paginate_button next disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"#"
>
Next
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</div>
</div>
<script>
<script>
...
...
templates/jasset/idc_list.html
View file @
6c10b06d
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<a
target=
"_blank"
href=
"/jasset/idc_add"
class=
"btn btn-sm btn-primary "
>
添加IDC
</a>
<a
target=
"_blank"
href=
"/jasset/idc_add"
class=
"btn btn-sm btn-primary "
>
添加IDC
</a>
</div>
</div>
<form
id=
"contents_form"
name=
"contents_form"
>
<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>
...
@@ -36,11 +37,42 @@
...
@@ -36,11 +37,42 @@
{% endfor %}
{% endfor %}
</tbody>
</tbody>
</table>
</table>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<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' %}
{% include 'paginator.html' %}
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function
del
(
form
)
{
var
checkboxes
=
document
.
getElementById
(
form
);
var
id_list
=
{};
var
j
=
0
;
for
(
var
i
=
0
;
i
<
checkboxes
.
elements
.
length
;
i
++
)
{
if
(
checkboxes
.
elements
[
i
].
type
==
"checkbox"
&&
checkboxes
.
elements
[
i
].
checked
==
true
&&
checkboxes
.
elements
[
i
].
value
!=
"checkall"
)
{
id_list
[
j
]
=
checkboxes
.
elements
[
i
].
value
;
j
++
;
}
}
if
(
confirm
(
"确定删除"
))
{
$
.
ajax
({
type
:
"POST"
,
url
:
"/jasset/idc_del/multi/"
,
data
:
{
"id_list"
:
id_list
,
"len_list"
:
j
},
success
:
function
(
data
)
{
window
.
open
(
"/jasset/idc_list/"
,
"_self"
);
}
});
}
}
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
templates/jlog/log_offline.html
View file @
6c10b06d
...
@@ -96,12 +96,16 @@
...
@@ -96,12 +96,16 @@
{% endfor %}
{% endfor %}
</tbody>
</tbody>
</table>
</table>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
</div>
{% include 'paginator.html' %}
{% include 'paginator.html' %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
templates/jlog/log_online.html
View file @
6c10b06d
...
@@ -96,12 +96,16 @@
...
@@ -96,12 +96,16 @@
{% endfor %}
{% endfor %}
</tbody>
</tbody>
</table>
</table>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
</div>
{% include 'paginator.html' %}
{% include 'paginator.html' %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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