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
de58e92d
Commit
de58e92d
authored
Feb 03, 2015
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加组修改,组内删除主机并不删除真实机
parent
6c70d5bf
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
131 additions
and
78 deletions
+131
-78
urls.py
jasset/urls.py
+3
-1
views.py
jasset/views.py
+52
-9
views.py
jumpserver/views.py
+0
-1
base.js
static/js/base.js
+14
-0
head_script.html
templates/head_script.html
+0
-44
group_add.html
templates/jasset/group_add.html
+38
-3
group_detail.html
templates/jasset/group_detail.html
+8
-6
group_list.html
templates/jasset/group_list.html
+1
-0
idc_detail.html
templates/jasset/idc_detail.html
+13
-12
nav.html
templates/nav.html
+1
-1
nav_li_profile.html
templates/nav_li_profile.html
+1
-1
No files found.
jasset/urls.py
View file @
de58e92d
...
@@ -13,8 +13,10 @@ urlpatterns = patterns('',
...
@@ -13,8 +13,10 @@ urlpatterns = patterns('',
url
(
r'^idc_detail/(\d+)$'
,
idc_detail
),
url
(
r'^idc_detail/(\d+)$'
,
idc_detail
),
url
(
r'^idc_del/(\d+)/$'
,
idc_del
),
url
(
r'^idc_del/(\d+)/$'
,
idc_del
),
url
(
r'^group_add/$'
,
jadd_group
),
url
(
r'^group_add/$'
,
jadd_group
),
url
(
r'^group_edit/(\d+)/$'
,
group_edit
),
url
(
r'^group_list/$'
,
jlist_group
),
url
(
r'^group_list/$'
,
jlist_group
),
url
(
r'^group_detail/(\d)/$'
,
group_detail
),
url
(
r'^group_detail/(\d+)/$'
,
group_detail
),
url
(
r'^group_del_host/(\w+)/$'
,
group_del_host
),
url
(
r'^group_del/(\d+)/$'
,
group_del
),
url
(
r'^group_del/(\d+)/$'
,
group_del
),
url
(
r'^host_del/(\w+)/$'
,
host_del
),
url
(
r'^host_del/(\w+)/$'
,
host_del
),
url
(
r'^host_edit/(\d+)$'
,
host_edit
),
url
(
r'^host_edit/(\d+)$'
,
host_edit
),
...
...
jasset/views.py
View file @
de58e92d
...
@@ -163,7 +163,6 @@ def jlist_host(request):
...
@@ -163,7 +163,6 @@ def jlist_host(request):
def
host_del
(
request
,
offset
):
def
host_del
(
request
,
offset
):
print
offset
if
offset
==
'multi'
:
if
offset
==
'multi'
:
len_list
=
request
.
POST
.
get
(
"len_list"
)
len_list
=
request
.
POST
.
get
(
"len_list"
)
for
i
in
range
(
int
(
len_list
)):
for
i
in
range
(
int
(
len_list
)):
...
@@ -197,13 +196,11 @@ def host_edit(request, offset):
...
@@ -197,13 +196,11 @@ def host_edit(request, offset):
j_active
=
request
.
POST
.
get
(
'j_active'
)
j_active
=
request
.
POST
.
get
(
'j_active'
)
j_comment
=
request
.
POST
.
get
(
'j_comment'
)
j_comment
=
request
.
POST
.
get
(
'j_comment'
)
j_idc
=
IDC
.
objects
.
get
(
name
=
j_idc
)
j_idc
=
IDC
.
objects
.
get
(
name
=
j_idc
)
print
j_group
for
group
in
j_group
:
for
group
in
j_group
:
c
=
BisGroup
.
objects
.
get
(
name
=
group
)
c
=
BisGroup
.
objects
.
get
(
name
=
group
)
groups
.
append
(
c
)
groups
.
append
(
c
)
a
=
Asset
.
objects
.
get
(
id
=
int
(
offset
))
a
=
Asset
.
objects
.
get
(
id
=
int
(
offset
))
if
j_type
==
'M'
:
if
j_type
==
'M'
:
j_user
=
request
.
POST
.
get
(
'j_user'
)
j_user
=
request
.
POST
.
get
(
'j_user'
)
j_password
=
cryptor
.
encrypt
(
request
.
POST
.
get
(
'j_password'
))
j_password
=
cryptor
.
encrypt
(
request
.
POST
.
get
(
'j_password'
))
...
@@ -211,7 +208,7 @@ def host_edit(request, offset):
...
@@ -211,7 +208,7 @@ def host_edit(request, offset):
a
.
port
=
j_port
a
.
port
=
j_port
a
.
login_type
=
j_type
a
.
login_type
=
j_type
a
.
idc
=
j_idc
a
.
idc
=
j_idc
a
.
is_active
=
j_active
a
.
is_active
=
int
(
j_active
)
a
.
comment
=
j_comment
a
.
comment
=
j_comment
a
.
username
=
j_user
a
.
username
=
j_user
a
.
password
=
j_password
a
.
password
=
j_password
...
@@ -220,7 +217,7 @@ def host_edit(request, offset):
...
@@ -220,7 +217,7 @@ def host_edit(request, offset):
a
.
port
=
j_port
a
.
port
=
j_port
a
.
idc
=
j_idc
a
.
idc
=
j_idc
a
.
login_type
=
j_type
a
.
login_type
=
j_type
a
.
is_active
=
j_active
a
.
is_active
=
int
(
j_active
)
a
.
comment
=
j_comment
a
.
comment
=
j_comment
a
.
save
()
a
.
save
()
...
@@ -234,7 +231,6 @@ def host_edit(request, offset):
...
@@ -234,7 +231,6 @@ def host_edit(request, offset):
def
jlist_ip
(
request
,
offset
):
def
jlist_ip
(
request
,
offset
):
header_title
,
path1
,
path2
=
u'主机详细信息 | Host Detail.'
,
u'资产管理'
,
u'主机详情'
header_title
,
path1
,
path2
=
u'主机详细信息 | Host Detail.'
,
u'资产管理'
,
u'主机详情'
print
offset
post
=
contact_list
=
Asset
.
objects
.
get
(
ip
=
str
(
offset
))
post
=
contact_list
=
Asset
.
objects
.
get
(
ip
=
str
(
offset
))
return
render_to_response
(
'jasset/jlist_ip.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jasset/jlist_ip.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
...
@@ -244,8 +240,6 @@ def jadd_idc(request):
...
@@ -244,8 +240,6 @@ def jadd_idc(request):
if
request
.
method
==
'POST'
:
if
request
.
method
==
'POST'
:
j_idc
=
request
.
POST
.
get
(
'j_idc'
)
j_idc
=
request
.
POST
.
get
(
'j_idc'
)
j_comment
=
request
.
POST
.
get
(
'j_comment'
)
j_comment
=
request
.
POST
.
get
(
'j_comment'
)
print
j_idc
,
j_comment
if
IDC
.
objects
.
filter
(
name
=
j_idc
):
if
IDC
.
objects
.
filter
(
name
=
j_idc
):
emg
=
u'该IDC已存在!'
emg
=
u'该IDC已存在!'
return
render_to_response
(
'jasset/idc_add.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jasset/idc_add.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
...
@@ -269,16 +263,22 @@ def idc_del(request, offset):
...
@@ -269,16 +263,22 @@ def idc_del(request, offset):
def
jadd_group
(
request
):
def
jadd_group
(
request
):
header_title
,
path1
,
path2
=
u'添加主机组 | Add Group'
,
u'资产管理'
,
u'添加主机组'
header_title
,
path1
,
path2
=
u'添加主机组 | Add Group'
,
u'资产管理'
,
u'添加主机组'
posts
=
Asset
.
objects
.
all
()
if
request
.
method
==
'POST'
:
if
request
.
method
==
'POST'
:
j_group
=
request
.
POST
.
get
(
'j_group'
)
j_group
=
request
.
POST
.
get
(
'j_group'
)
j_hosts
=
request
.
POST
.
getlist
(
'j_hosts'
)
j_comment
=
request
.
POST
.
get
(
'j_comment'
)
j_comment
=
request
.
POST
.
get
(
'j_comment'
)
if
BisGroup
.
objects
.
filter
(
name
=
j_group
):
if
BisGroup
.
objects
.
filter
(
name
=
j_group
):
emg
=
u'该主机组已存在!'
emg
=
u'该主机组已存在!'
return
render_to_response
(
'jasset/group_add.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jasset/group_add.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
else
:
else
:
smg
=
u'主机组
%
s添加成功'
%
j_group
BisGroup
.
objects
.
create
(
name
=
j_group
,
comment
=
j_comment
,
type
=
'A'
)
BisGroup
.
objects
.
create
(
name
=
j_group
,
comment
=
j_comment
,
type
=
'A'
)
group
=
BisGroup
.
objects
.
get
(
name
=
j_group
)
for
host
in
j_hosts
:
g
=
Asset
.
objects
.
get
(
id
=
host
)
group
.
asset_set
.
add
(
g
)
smg
=
u'主机组
%
s添加成功'
%
j_group
return
render_to_response
(
'jasset/group_add.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jasset/group_add.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
...
@@ -289,6 +289,28 @@ def jlist_group(request):
...
@@ -289,6 +289,28 @@ def jlist_group(request):
return
render_to_response
(
'jasset/group_list.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jasset/group_list.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
group_edit
(
request
,
offset
):
header_title
,
path1
,
path2
=
u'编辑主机组 | Edit Group'
,
u'资产管理'
,
u'编辑主机组'
group
=
BisGroup
.
objects
.
get
(
id
=
offset
)
all
=
Asset
.
objects
.
all
()
eposts
=
contact_list
=
Asset
.
objects
.
filter
(
bis_group
=
group
)
.
order_by
(
'ip'
)
posts
=
[
g
for
g
in
all
if
g
not
in
eposts
]
if
request
.
method
==
'POST'
:
j_group
=
request
.
POST
.
get
(
'j_group'
)
j_hosts
=
request
.
POST
.
getlist
(
'j_hosts'
)
j_comment
=
request
.
POST
.
get
(
'j_comment'
)
group
=
BisGroup
.
objects
.
get
(
name
=
j_group
)
group
.
asset_set
.
clear
()
for
host
in
j_hosts
:
g
=
Asset
.
objects
.
get
(
id
=
host
)
group
.
asset_set
.
add
(
g
)
smg
=
u'主机组
%
s修改成功'
%
j_group
return
HttpResponseRedirect
(
'/jasset/group_detail/
%
s'
%
offset
)
return
render_to_response
(
'jasset/group_add.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
group_detail
(
request
,
offset
):
def
group_detail
(
request
,
offset
):
header_title
,
path1
,
path2
=
u'主机组详情 | Group Detail'
,
u'资产管理'
,
u'主机组详情'
header_title
,
path1
,
path2
=
u'主机组详情 | Group Detail'
,
u'资产管理'
,
u'主机组详情'
login_types
=
{
'L'
:
'LDAP'
,
'S'
:
'SSH_KEY'
,
'P'
:
'PASSWORD'
,
'M'
:
'MAP'
}
login_types
=
{
'L'
:
'LDAP'
,
'S'
:
'SSH_KEY'
,
'P'
:
'PASSWORD'
,
'M'
:
'MAP'
}
...
@@ -327,6 +349,27 @@ def idc_detail(request, offset):
...
@@ -327,6 +349,27 @@ def idc_detail(request, offset):
return
render_to_response
(
'jasset/idc_detail.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jasset/idc_detail.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
group_del_host
(
request
,
offset
):
if
request
.
method
==
'POST'
:
group_name
=
request
.
POST
.
get
(
'group_name'
)
print
group_name
if
offset
==
'group'
:
group
=
BisGroup
.
objects
.
get
(
name
=
group_name
)
elif
offset
==
'idc'
:
group
=
IDC
.
objects
.
get
(
name
=
group_name
)
len_list
=
request
.
POST
.
get
(
"len_list"
)
for
i
in
range
(
int
(
len_list
)):
key
=
"id_list["
+
str
(
i
)
+
"]"
print
key
jid
=
request
.
POST
.
get
(
key
)
print
jid
g
=
Asset
.
objects
.
get
(
id
=
jid
)
print
g
group
.
asset_set
.
remove
(
g
)
print
'ok'
return
HttpResponseRedirect
(
'/jasset/
%
s_detail/
%
s'
%
(
offset
,
group
.
id
))
def
group_del
(
request
,
offset
):
def
group_del
(
request
,
offset
):
BisGroup
.
objects
.
filter
(
id
=
offset
)
.
delete
()
BisGroup
.
objects
.
filter
(
id
=
offset
)
.
delete
()
return
HttpResponseRedirect
(
'/jasset/group_list/'
)
return
HttpResponseRedirect
(
'/jasset/group_list/'
)
...
...
jumpserver/views.py
View file @
de58e92d
...
@@ -32,7 +32,6 @@ def jasset_group_add(name, comment, type):
...
@@ -32,7 +32,6 @@ def jasset_group_add(name, comment, type):
def
jasset_host_edit
(
j_id
,
j_ip
,
j_idc
,
j_port
,
j_type
,
j_group
,
j_active
,
j_comment
):
def
jasset_host_edit
(
j_id
,
j_ip
,
j_idc
,
j_port
,
j_type
,
j_group
,
j_active
,
j_comment
):
print
'ok'
groups
=
[]
groups
=
[]
is_active
=
{
u'是'
:
'1'
,
u'否'
:
'2'
}
is_active
=
{
u'是'
:
'1'
,
u'否'
:
'2'
}
login_types
=
{
'LDAP'
:
'L'
,
'SSH_KEY'
:
'S'
,
'PASSWORD'
:
'P'
,
'MAP'
:
'M'
}
login_types
=
{
'LDAP'
:
'L'
,
'SSH_KEY'
:
'S'
,
'PASSWORD'
:
'P'
,
'MAP'
:
'M'
}
...
...
static/js/base.js
View file @
de58e92d
...
@@ -59,3 +59,17 @@ function GetTableDataBox() {
...
@@ -59,3 +59,17 @@ function GetTableDataBox() {
return
returnData
;
return
returnData
;
}
}
function
move
(
from
,
to
)
{
$
(
"#"
+
from
+
" option"
).
each
(
function
()
{
if
(
$
(
this
).
prop
(
"selected"
)
==
true
)
{
$
(
"#"
+
to
).
append
(
this
);
}
});
}
function
move_all
(
from
,
to
)
{
$
(
"#"
+
from
).
children
().
each
(
function
()
{
$
(
"#"
+
to
).
append
(
this
);
});
}
templates/head_script.html
View file @
de58e92d
<script
src=
"/static/js/jquery-2.1.1.js"
></script>
<script
src=
"/static/js/jquery-2.1.1.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<script
src=
"/static/js/base.js"
></script>
<script
src=
"/static/js/base.js"
></script>
<!--<script>-->
<!--$(document).ready(function(){-->
<!--$('.i-checks').iCheck({-->
<!--checkboxClass: 'icheckbox_square-green',-->
<!--radioClass: 'iradio_square-green'-->
<!--});-->
<!--});-->
<!--function selectAll(){-->
<!--var checklist = document.getElementsByName ("selected");-->
<!--if(document.getElementById("select_all").checked)-->
<!--{-->
<!--for(var i=0;i<checklist.length;i++)-->
<!--{-->
<!--checklist[i].checked = 1;-->
<!--}-->
<!--}else{-->
<!--for(var j=0;j<checklist.length;j++)-->
<!--{-->
<!--checklist[j].checked = 0;-->
<!--}-->
<!--}-->
<!--}-->
<!--function move(from, to) {-->
<!--$("#"+from+" option").each(function(){-->
<!--if ( $(this).prop("selected") == true ) {-->
<!--$("#"+to).append(this);-->
<!--}-->
<!--});-->
<!--}-->
<!--function move_all(from, to){-->
<!--$("#"+from).children().each(function(){-->
<!--$("#"+to).append(this);-->
<!--});-->
<!--}-->
</script>
<!-- pop windows -->
<!-- pop windows -->
<script
src=
"/static/js/jquery.colorbox.js"
></script>
<script
src=
"/static/js/jquery.colorbox.js"
></script>
...
...
templates/jasset/group_add.html
View file @
de58e92d
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<div
class=
"col-lg-10"
>
<div
class=
"col-lg-10"
>
<div
class=
"panel-options"
>
<div
class=
"panel-options"
>
<ul
class=
"nav nav-tabs"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
data-toggle=
"tab"
href=
"#tab-1"
class=
"text-center"
><i
class=
"fa fa-laptop"
></i>
添加主机组
</a></li>
<li
class=
"active"
><a
data-toggle=
"tab"
href=
"#tab-1"
class=
"text-center"
><i
class=
"fa fa-laptop"
></i>
{{ path2 }}
</a></li>
<li><a
href=
"/jasset/idc_add"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
添加IDC
</a></li>
<li><a
href=
"/jasset/idc_add"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
添加IDC
</a></li>
</ul>
</ul>
</div>
</div>
...
@@ -24,7 +24,34 @@
...
@@ -24,7 +24,34 @@
{% endif %}
{% endif %}
<form
id=
"assetForm"
method=
"post"
class=
"form-horizontal"
>
<form
id=
"assetForm"
method=
"post"
class=
"form-horizontal"
>
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
主机组名
</label>
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
主机组名
</label>
<div
class=
"col-sm-8"
><input
type=
"text"
value=
"{{ j_group }}"
placeholder=
"网站"
name=
"j_group"
class=
"form-control"
></div>
<div
class=
"col-sm-8"
><input
type=
"text"
value=
"{{ group.name }}"
placeholder=
"网站"
name=
"j_group"
class=
"form-control"
></div>
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<label
for=
"groups"
class=
"col-lg-2 control-label"
>
主机
</label>
<div
class=
"col-sm-3"
>
<select
id=
"groups"
size=
"12"
class=
"form-control m-b"
multiple
>
{% for post in posts %}
<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-white"
onclick=
"move('groups', 'groups_selected')"
><i
class=
"fa fa-chevron-right"
></i></button>
<button
type=
"button"
class=
"btn btn-white"
onclick=
"move('groups_selected', 'groups')"
><i
class=
"fa fa-chevron-left"
></i>
</button>
</div>
</div>
<div
class=
"col-sm-3"
>
<div>
<select
id=
"groups_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>
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"hr-line-dashed"
></div>
...
@@ -36,7 +63,7 @@
...
@@ -36,7 +63,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-5"
>
<div
class=
"col-sm-4 col-sm-offset-5"
>
<button
class=
"btn btn-white"
type=
"submit"
>
重置
</button>
<button
class=
"btn btn-white"
type=
"submit"
>
重置
</button>
<button
class=
"btn btn-primary"
type=
"submit"
>
提交
</button>
<button
class=
"btn btn-primary"
type=
"submit"
onclick=
"on_submit('groups_selected') "
>
提交
</button>
</div>
</div>
</div>
</div>
</form>
</form>
...
@@ -63,6 +90,13 @@
...
@@ -63,6 +90,13 @@
form
.
submit
();
form
.
submit
();
}
}
});
});
function
on_submit
(
id
){
$
(
'#'
+
id
+
' option'
).
each
(
function
(){
$
(
this
).
prop
(
'selected'
,
true
)
})
}
</script>
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
templates/jasset/group_detail.html
View file @
de58e92d
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<th
class=
"text-center"
>
端口号
</th>
<th
class=
"text-center"
>
端口号
</th>
<th
class=
"text-center"
name=
"j_type"
>
登录方式
</th>
<th
class=
"text-center"
name=
"j_type"
>
登录方式
</th>
<th
class=
"text-center"
name=
"j_idc"
>
所属IDC
</th>
<th
class=
"text-center"
name=
"j_idc"
>
所属IDC
</th>
<th
class=
"text-center"
>
所属业务组
</th>
<th
class=
"text-center"
id=
"j_group_name"
value=
"{{ group_name }}"
>
所属业务组
</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_time"
>
添加时间
</th>
<th
class=
"text-center"
name=
"j_comment"
>
备注
</th>
<th
class=
"text-center"
name=
"j_comment"
>
备注
</th>
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<td
class=
"text-center"
name=
"j_port"
>
{{ post.port }}
</td>
<td
class=
"text-center"
name=
"j_port"
>
{{ post.port }}
</td>
<td
class=
"text-center"
name=
"j_type"
>
{{ login_types|get_item:post.login_type }}
</td>
<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_idc"
>
{{ post.idc.name }}
</td>
<td
class=
"text-center"
name=
"j_group"
>
{% for group in post.bis_group.all %} {{ group }} {% endfor %}
</td>
<td
class=
"text-center"
name=
"j_group"
>
{% for group in post.bis_group.all
|filter_private
%} {{ group }} {% endfor %}
</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"
>
{{ 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>
...
@@ -128,6 +128,8 @@
...
@@ -128,6 +128,8 @@
function
del
(
form
)
{
function
del
(
form
)
{
var
checkboxes
=
document
.
getElementById
(
form
);
var
checkboxes
=
document
.
getElementById
(
form
);
var
id_list
=
{};
var
id_list
=
{};
var
group_name
=
$
(
'#j_group_name'
).
attr
(
"value"
);
console
.
log
(
group_name
);
var
j
=
0
;
var
j
=
0
;
for
(
var
i
=
0
;
i
<
checkboxes
.
elements
.
length
;
i
++
)
{
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"
)
{
if
(
checkboxes
.
elements
[
i
].
type
==
"checkbox"
&&
checkboxes
.
elements
[
i
].
checked
==
true
&&
checkboxes
.
elements
[
i
].
value
!=
"checkall"
)
{
...
@@ -135,13 +137,13 @@
...
@@ -135,13 +137,13 @@
j
++
;
j
++
;
}
}
}
}
if
(
confirm
(
"确定删除"
))
{
if
(
confirm
(
"确定
从主机组中
删除"
))
{
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
url
:
"/jasset/
host_del
/"
,
url
:
"/jasset/
group_del_host/group
/"
,
data
:
{
"id_list"
:
id_list
,
"len_list"
:
j
},
data
:
{
"id_list"
:
id_list
,
"len_list"
:
j
,
"group_name"
:
group_name
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
window
.
open
(
window
.
location
.
pathname
,
"_self"
);
}
}
});
});
}
}
...
...
templates/jasset/group_list.html
View file @
de58e92d
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
<td
class=
"text-center"
>
{{ post.comment }}
</td>
<td
class=
"text-center"
>
{{ post.comment }}
</td>
<td
class=
"text-center"
>
<td
class=
"text-center"
>
<a
href=
"/jasset/group_detail/{{ post.id }}"
class=
"btn btn-xs btn-info"
>
详情
</a>
<a
href=
"/jasset/group_detail/{{ post.id }}"
class=
"btn btn-xs btn-info"
>
详情
</a>
<a
href=
"/jasset/group_edit/{{ post.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"/jasset/group_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
<a
href=
"/jasset/group_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
</td>
</tr>
</tr>
...
...
templates/jasset/idc_detail.html
View file @
de58e92d
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<th
class=
"text-center"
name=
"j_ip"
>
IP地址
</th>
<th
class=
"text-center"
name=
"j_ip"
>
IP地址
</th>
<th
class=
"text-center"
>
端口号
</th>
<th
class=
"text-center"
>
端口号
</th>
<th
class=
"text-center"
name=
"j_type"
>
登录方式
</th>
<th
class=
"text-center"
name=
"j_type"
>
登录方式
</th>
<th
class=
"text-center"
name=
"j_idc
"
>
所属IDC
</th>
<th
class=
"text-center"
id=
"j_group_name"
value=
"{{ idc_name }}
"
>
所属IDC
</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"
name=
"j_time"
>
添加时间
</th>
<th
class=
"text-center"
name=
"j_time"
>
添加时间
</th>
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<td
class=
"text-center"
name=
"j_port"
>
{{ post.port }}
</td>
<td
class=
"text-center"
name=
"j_port"
>
{{ post.port }}
</td>
<td
class=
"text-center"
name=
"j_type"
>
{{ login_types|get_item:post.login_type }}
</td>
<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_idc"
>
{{ post.idc.name }}
</td>
<td
class=
"text-center"
name=
"j_group"
>
{% for group in post.bis_group.all %} {{ group }} {% endfor %}
</td>
<td
class=
"text-center"
name=
"j_group"
>
{% for group in post.bis_group.all
|filter_private
%} {{ group }} {% endfor %}
</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"
>
{{ 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>
...
@@ -111,21 +111,24 @@
...
@@ -111,21 +111,24 @@
function
alter
(
form
)
{
function
alter
(
form
)
{
selectData
=
GetTableDataBox
();
selectData
=
GetTableDataBox
();
if
(
selectData
[
1
]
!=
0
){
if
(
selectData
[
1
]
!=
0
)
{
$
.
ajax
({
$
.
ajax
({
type
:
"post"
,
type
:
"post"
,
url
:
"/jasset/host_edit/batch/"
,
url
:
"/jasset/host_edit/batch/"
,
data
:
{
"editable"
:
selectData
[
0
],
"len_table"
:
selectData
[
1
]},
data
:
{
"editable"
:
selectData
[
0
],
"len_table"
:
selectData
[
1
]},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
alert
(
"修改成功"
);
alert
(
"修改成功"
);
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
}
}
});
});
}
}
}
function
del
(
form
)
{
function
del
(
form
)
{
var
checkboxes
=
document
.
getElementById
(
form
);
var
checkboxes
=
document
.
getElementById
(
form
);
var
id_list
=
{};
var
id_list
=
{};
var
group_name
=
$
(
'#j_group_name'
).
attr
(
"value"
);
console
.
log
(
group_name
);
var
j
=
0
;
var
j
=
0
;
for
(
var
i
=
0
;
i
<
checkboxes
.
elements
.
length
;
i
++
)
{
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"
)
{
if
(
checkboxes
.
elements
[
i
].
type
==
"checkbox"
&&
checkboxes
.
elements
[
i
].
checked
==
true
&&
checkboxes
.
elements
[
i
].
value
!=
"checkall"
)
{
...
@@ -133,18 +136,17 @@
...
@@ -133,18 +136,17 @@
j
++
;
j
++
;
}
}
}
}
if
(
confirm
(
"确定删除"
))
{
if
(
confirm
(
"确定
从该IDC中
删除"
))
{
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
url
:
"/jasset/
host_del
/"
,
url
:
"/jasset/
group_del_host/idc
/"
,
data
:
{
"id_list"
:
id_list
,
"len_list"
:
j
},
data
:
{
"id_list"
:
id_list
,
"len_list"
:
j
,
"group_name"
:
group_name
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
window
.
open
(
window
.
location
.
pathname
,
"_self"
);
}
}
});
});
}
}
}
}
}
</script>
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
templates/nav.html
View file @
de58e92d
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<li
id=
"jlog"
>
<li
id=
"jlog"
>
<a
href=
"#"
><i
class=
"fa fa-files-o"
></i>
<span
class=
"nav-label"
>
日志审计
</span><span
class=
"fa arrow"
></span></a>
<a
href=
"#"
><i
class=
"fa fa-files-o"
></i>
<span
class=
"nav-label"
>
日志审计
</span><span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
>
<ul
class=
"nav nav-second-level"
>
<li
id=
"log_list"
><a
href=
"/jlog/"
>
查看日志
</a></li>
<li
id=
"log_list"
><a
href=
"/jlog
b
/"
>
查看日志
</a></li>
<li
id=
"log_detail"
><a
href=
"/jlog/log_detail/"
>
日志分析
</a></li>
<li
id=
"log_detail"
><a
href=
"/jlog/log_detail/"
>
日志分析
</a></li>
</ul>
</ul>
</li>
</li>
...
...
templates/nav_li_profile.html
View file @
de58e92d
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</ul>
</ul>
</div>
</div>
<div
class=
"logo-element"
>
<div
class=
"logo-element"
>
J
S+
J
umpServer
</div>
</div>
</li>
</li>
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