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
1a3541e5
Commit
1a3541e5
authored
Dec 09, 2015
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
d337b929
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
62 deletions
+49
-62
urls.py
jasset/urls.py
+0
-4
views.py
jasset/views.py
+1
-2
asset_cu_list.html
templates/jasset/asset_cu_list.html
+1
-55
asset_list.html
templates/jasset/asset_list.html
+1
-1
asset_update_status.html
templates/jasset/asset_update_status.html
+46
-0
No files found.
jasset/urls.py
View file @
1a3541e5
...
...
@@ -12,15 +12,11 @@ urlpatterns = patterns('',
url
(
r'^asset_edit/$'
,
asset_edit
),
url
(
r'^asset_update/$'
,
asset_update
),
url
(
r'^asset_update_batch/$'
,
asset_update_batch
),
# url(r'^search/$', host_search),
# url(r"^show_all_ajax/$", show_all_ajax),
url
(
r'^group_add/$'
,
group_add
),
url
(
r'^group_list/$'
,
group_list
),
url
(
r'^group_edit/$'
,
group_edit
),
url
(
r'^group_list/$'
,
group_list
),
# url(r'^group_del_host/$', group_del_host),
url
(
r'^asset_edit_batch/$'
,
asset_edit_batch
),
# url(r'^host_edit_common/batch/$', host_edit_common_batch),
url
(
r'^idc_add/$'
,
idc_add
),
url
(
r'^idc_list/$'
,
idc_list
),
url
(
r'^idc_edit/$'
,
idc_edit
),
...
...
jasset/views.py
View file @
1a3541e5
...
...
@@ -294,7 +294,6 @@ def asset_list(request):
asset_find
=
asset_find
.
filter
(
idc__name__contains
=
idc_name
)
if
group_name
:
print
asset_find
,
type
(
asset_find
)
asset_find
=
asset_find
.
filter
(
group__name__contains
=
group_name
)
if
asset_type
:
...
...
@@ -413,7 +412,7 @@ def asset_edit_batch(request):
if
alert_list
:
recode_name
=
unicode
(
name
)
+
' - '
+
u'批量'
AssetRecord
.
objects
.
create
(
asset
=
asset
,
username
=
recode_name
,
content
=
alert_list
)
return
HttpResponse
(
'ok'
)
return
my_render
(
'jasset/asset_update_status.html'
,
locals
(),
request
)
return
my_render
(
'jasset/asset_edit_batch.html'
,
locals
(),
request
)
...
...
templates/jasset/asset_cu_list.html
View file @
1a3541e5
...
...
@@ -24,61 +24,7 @@
<div
class=
"ibox-content"
>
<form
id=
"asset_form"
>
<div
class=
"col-sm-7"
style=
"padding-left: 0px"
>
<label>
<select
name=
"idc"
class=
"form-control m-b input-sm"
onchange=
"change_info()"
>
<option
value=
""
>
机房
</option>
{% for idc in idc_all %}
{% ifequal idc.name idc_name %}
<option
value=
"{{idc.name}}"
selected
>
{{ idc.name }}
</option>
{% else %}
<option
value=
"{{idc.name}}"
>
{{ idc.name }}
</option>
{% endifequal %}
{% endfor %}
</select>
</label>
<label>
<select
name=
"group"
class=
"form-control m-b input-sm"
onchange=
"change_info()"
>
<option
value=
""
>
主机组
</option>
{% for asset_group in asset_group_all %}
{% ifequal asset_group.name group_name %}
<option
value=
"{{ asset_group.name }}"
selected
>
{{ asset_group.name }}
</option>
{% else %}
<option
value=
"{{ asset_group.name }}"
>
{{ asset_group.name }}
</option>
{% endifequal %}
{% endfor %}
</select>
</label>
<label>
<select
name=
"asset_type"
class=
"form-control m-b input-sm"
onchange=
"change_info()"
>
<option
value=
""
>
资产类型
</option>
{% for type in asset_types %}
{% ifequal type.0|int2str asset_type %}
<option
value=
"{{ type.0 }}"
selected
>
{{ type.1 }}
</option>
{% else %}
<option
value=
"{{ type.0 }}"
>
{{ type.1 }}
</option>
{% endifequal %}
{% endfor %}
</select>
</label>
<label>
<select
name=
"status"
class=
"form-control m-b input-sm"
onchange=
"change_info()"
>
<option
value=
""
>
资产状态
</option>
{% for s in asset_status %}
{% ifequal s.0|int2str status %}
<option
value=
"{{ s.0 }}"
selected
>
{{ s.1 }}
</option>
{% else %}
<option
value=
"{{ s.0 }}"
>
{{ s.1 }}
</option>
{% endifequal %}
{% endfor %}
</select>
</label>
</div>
<div
class=
"col-sm-4"
style=
"padding-right: 0"
>
<div
class=
"col-sm-4 col-sm-offset-8"
style=
"padding-right: 0"
>
<div
class=
"input-group inline-group"
>
<input
type=
"text"
class=
"form-control m-b input-sm"
id=
"search_input"
name=
"keyword"
value=
"{{ keyword }}"
placeholder=
"Search"
>
<input
type=
"text"
style=
"display: none"
>
...
...
templates/jasset/asset_list.html
View file @
1a3541e5
...
...
@@ -301,7 +301,7 @@
return
false
;
}
var
url
=
$
(
this
).
attr
(
"value"
)
+
'?asset_id_all='
+
asset_id_all
;
layer
.
open
({
parent
.
layer
.
open
({
type
:
2
,
title
:
'JumpServer - 批量修改主机'
,
maxmin
:
true
,
...
...
templates/jasset/asset_update_status.html
0 → 100644
View file @
1a3541e5
<html>
<head>
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
href=
"/static/font-awesome/css/font-awesome.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/plugins/iCheck/custom.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/animate.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/style.css"
rel=
"stylesheet"
>
<script
src=
"/static/js/jquery-2.1.1.js"
></script>
<style>
body
{
background
:
#ffffff
;}
</style>
</head>
{% load bootstrap %}
{% block content %}
<body
onload=
"closeWindow();"
>
<div>
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
<div
class=
"ibox-content"
>
<h2
id=
"jumpTo"
class=
"text-center text-info"
></h2>
</div>
</div>
</div>
</div>
<script
type=
"text/javascript"
>
var
time
=
2
;
function
closeWindow
(){
window
.
setTimeout
(
'closeWindow()'
,
1000
);
if
(
time
>
0
){
document
.
getElementById
(
"jumpTo"
).
innerHTML
=
"修改成功, <font color=red>"
+
time
+
"</font>秒后关闭当前窗口"
;
time
--
;
}
else
{
window
.
parent
.
location
.
reload
();
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
parent
.
layer
.
close
(
index
);
}
}
</script>
{% endblock content %}
</body>
</html>
\ No newline at end of file
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