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
6b95c7ed
Commit
6b95c7ed
authored
Jan 14, 2015
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产详情弹窗
parent
acf508f0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
185 additions
and
18 deletions
+185
-18
urls.py
jasset/urls.py
+8
-6
views.py
jasset/views.py
+6
-5
colorbox.css
static/css/colorbox.css
+50
-0
controls.png
static/css/images/controls.png
+0
-0
loading.gif
static/css/images/loading.gif
+0
-0
jquery.colorbox.js
static/js/jquery.colorbox.js
+0
-0
base.html
templates/base.html
+2
-1
css_js.html
templates/css_js.html
+34
-0
jadd.html
templates/jasset/jadd.html
+10
-4
jlist.html
templates/jasset/jlist.html
+9
-2
jlist_ip.html
templates/jasset/jlist_ip.html
+61
-0
link_css.html
templates/link_css.html
+2
-0
script.html
templates/script.html
+3
-0
No files found.
jasset/urls.py
View file @
6b95c7ed
...
...
@@ -4,10 +4,11 @@ from jasset.views import *
urlpatterns
=
patterns
(
''
,
url
(
r'^$'
,
index
),
url
(
r'host_add'
,
jadd_host
),
url
(
r'host_list'
,
jlist_host
),
url
(
r'idc_add'
,
jadd_idc
),
url
(
r'idc_list'
,
jlist_idc
),
url
(
r'group_add'
,
jadd_group
),
url
(
r'group_list'
,
jlist_group
),
url
(
r'host_add/$'
,
jadd_host
),
url
(
r'host_list/$'
,
jlist_host
),
url
(
r"(\d+.\d+.\d+.\d+)/$"
,
jlist_ip
),
url
(
r'idc_add/$'
,
jadd_idc
),
url
(
r'idc_list/$'
,
jlist_idc
),
url
(
r'group_add/$'
,
jadd_group
),
url
(
r'group_list/$'
,
jlist_group
),
)
\ No newline at end of file
jasset/views.py
View file @
6b95c7ed
# coding:utf-8
import
datetime
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.template
import
RequestContext
from
django.shortcuts
import
render_to_response
from
django.http
import
HttpResponseRedirect
from
django.core.paginator
import
Paginator
,
EmptyPage
from
models
import
IDC
,
Asset
,
BisGroup
...
...
@@ -73,7 +69,7 @@ def jlist_host(request):
header_title
,
path1
,
path2
=
'查看主机 | List Host'
,
'资产管理'
,
'查看主机'
posts
=
contact_list
=
Asset
.
objects
.
all
()
.
order_by
(
'ip'
)
print
posts
paginator
=
Paginator
(
contact_list
,
5
)
p
=
p
aginator
=
Paginator
(
contact_list
,
5
)
try
:
page
=
int
(
request
.
GET
.
get
(
'page'
,
'1'
))
except
ValueError
:
...
...
@@ -86,6 +82,11 @@ def jlist_host(request):
return
render_to_response
(
'jasset/jlist.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
jlist_ip
(
request
,
offset
):
header_title
,
path1
,
path2
=
'主机详细信息 | Host Detail.'
,
'资产管理'
,
'主机详情'
print
offset
post
=
contact_list
=
Asset
.
objects
.
get
(
ip
=
str
(
offset
))
return
render_to_response
(
'jasset/jlist_ip.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
jadd_idc
(
request
):
header_title
,
path1
,
path2
=
'添加IDC | Add IDC'
,
'资产管理'
,
'添加IDC'
...
...
static/css/colorbox.css
0 → 100755
View file @
6b95c7ed
/*
Colorbox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox
,
#cboxOverlay
,
#cboxWrapper
{
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
9999
;
overflow
:
hidden
;}
#cboxWrapper
{
max-width
:
none
;}
#cboxOverlay
{
position
:
fixed
;
width
:
100%
;
height
:
100%
;}
#cboxMiddleLeft
,
#cboxBottomLeft
{
clear
:
left
;}
#cboxContent
{
position
:
relative
;}
#cboxLoadedContent
{
overflow
:
auto
;
-webkit-overflow-scrolling
:
touch
;}
#cboxTitle
{
margin
:
0
;}
#cboxLoadingOverlay
,
#cboxLoadingGraphic
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;}
#cboxPrevious
,
#cboxNext
,
#cboxClose
,
#cboxSlideshow
{
cursor
:
pointer
;}
.cboxPhoto
{
float
:
left
;
margin
:
auto
;
border
:
0
;
display
:
block
;
max-width
:
none
;
-ms-interpolation-mode
:
bicubic
;}
.cboxIframe
{
width
:
100%
;
height
:
100%
;
display
:
block
;
border
:
0
;
padding
:
0
;
margin
:
0
;}
#colorbox
,
#cboxContent
,
#cboxLoadedContent
{
box-sizing
:
content-box
;
-moz-box-sizing
:
content-box
;
-webkit-box-sizing
:
content-box
;}
/*
User Style:
Change the following styles to modify the appearance of Colorbox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay
{
background
:
#fff
;
opacity
:
0.9
;
filter
:
alpha
(
opacity
=
90
);}
#colorbox
{
outline
:
0
;}
#cboxContent
{
margin-top
:
32px
;
overflow
:
visible
;
background
:
#000
;}
.cboxIframe
{
background
:
#fff
;}
#cboxError
{
padding
:
50px
;
border
:
1px
solid
#ccc
;}
#cboxLoadedContent
{
background
:
#000
;
padding
:
1px
;}
#cboxLoadingGraphic
{
background
:
url(images/loading.gif)
no-repeat
center
center
;}
#cboxLoadingOverlay
{
background
:
#000
;}
#cboxTitle
{
position
:
absolute
;
top
:
-22px
;
left
:
0
;
color
:
#000
;}
#cboxCurrent
{
position
:
absolute
;
top
:
-22px
;
right
:
205px
;
text-indent
:
-9999px
;}
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
#cboxPrevious
,
#cboxNext
,
#cboxSlideshow
,
#cboxClose
{
border
:
0
;
padding
:
0
;
margin
:
0
;
overflow
:
visible
;
text-indent
:
-9999px
;
width
:
20px
;
height
:
20px
;
position
:
absolute
;
top
:
-20px
;
background
:
url(images/controls.png)
no-repeat
0
0
;}
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
#cboxPrevious
:active
,
#cboxNext
:active
,
#cboxSlideshow
:active
,
#cboxClose
:active
{
outline
:
0
;}
#cboxPrevious
{
background-position
:
0px
0px
;
right
:
44px
;}
#cboxPrevious
:hover
{
background-position
:
0px
-25px
;}
#cboxNext
{
background-position
:
-25px
0px
;
right
:
22px
;}
#cboxNext
:hover
{
background-position
:
-25px
-25px
;}
#cboxClose
{
background-position
:
-50px
0px
;
right
:
0
;}
#cboxClose
:hover
{
background-position
:
-50px
-25px
;}
.cboxSlideshow_on
#cboxPrevious
,
.cboxSlideshow_off
#cboxPrevious
{
right
:
66px
;}
.cboxSlideshow_on
#cboxSlideshow
{
background-position
:
-75px
-25px
;
right
:
44px
;}
.cboxSlideshow_on
#cboxSlideshow
:hover
{
background-position
:
-100px
-25px
;}
.cboxSlideshow_off
#cboxSlideshow
{
background-position
:
-100px
0px
;
right
:
44px
;}
.cboxSlideshow_off
#cboxSlideshow
:hover
{
background-position
:
-75px
-25px
;}
static/css/images/controls.png
0 → 100755
View file @
6b95c7ed
503 Bytes
static/css/images/loading.gif
0 → 100755
View file @
6b95c7ed
6.1 KB
static/js/jquery.colorbox.js
0 → 100755
View file @
6b95c7ed
This diff is collapsed.
Click to expand it.
templates/base.html
View file @
6b95c7ed
...
...
@@ -10,6 +10,7 @@
<link
rel=
"shortcut icon"
href=
"/static/img/facio.ico"
type=
"image/x-icon"
>
{% include 'link_css.html' %}
{% include 'script.html' %}
</head>
...
...
@@ -26,7 +27,7 @@
</div>
</div>
{% include 'script.html' %}
<!--{% include 'script.html' %}-->
</body>
</html>
templates/css_js.html
0 → 100644
View file @
6b95c7ed
<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"
>
<link
href=
"/static/css/colorbox.css"
rel=
"stylesheet"
>
<!-- Mainly scripts -->
<script
src=
"/static/js/jquery-2.1.1.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<script
src=
"/static/js/plugins/metisMenu/jquery.metisMenu.js"
></script>
<script
src=
"/static/js/plugins/slimscroll/jquery.slimscroll.min.js"
></script>
<!-- Peity -->
<script
src=
"/static/js/plugins/peity/jquery.peity.min.js"
></script>
<!-- Custom and plugin javascript -->
<script
src=
"/static/js/inspinia.js"
></script>
<script
src=
"/static/js/plugins/pace/pace.min.js"
></script>
<!-- iCheck -->
<script
src=
"/static/js/plugins/iCheck/icheck.min.js"
></script>
<!-- Peity -->
<script
src=
"/static/js/demo/peity-demo.js"
></script>
<!-- pop windows -->
<script
src=
"/static/js/jquery.colorbox.js"
></script>
<script>
$
(
document
).
ready
(
function
(){
$
(
".iframe"
).
colorbox
({
iframe
:
true
,
width
:
"90%"
,
height
:
"90%"
});
});
</script>
\ No newline at end of file
templates/jasset/jadd.html
View file @
6b95c7ed
...
...
@@ -7,9 +7,9 @@
<div
class=
"ibox float-e-margins"
>
<div
class=
"text-center"
>
<span>
请选择添加内容:
</span>
<a
href=
"#"
class=
"btn btn-xs btn-primary"
id=
"
lightVersion
"
>
添加主机
</a>
<a
href=
"#"
class=
"btn btn-xs btn-primary"
id=
"
darkVersion
"
>
添加IDC
</a>
<a
href=
"#"
class=
"btn btn-xs btn-primary"
id=
"
leftVersion
"
>
添加业务组
</a>
<a
href=
"#"
class=
"btn btn-xs btn-primary"
id=
"
addhost
"
>
添加主机
</a>
<a
href=
"#"
class=
"btn btn-xs btn-primary"
id=
"
addidc
"
>
添加IDC
</a>
<a
href=
"#"
class=
"btn btn-xs btn-primary"
id=
"
addbis
"
>
添加业务组
</a>
</div>
<div
id=
"ibox-content"
class=
"ibox-title"
>
<h5>
填写主机基本信息
</h5>
...
...
@@ -31,8 +31,11 @@
</a>
</div>
</div>
<div
class=
"ibox-content"
name=
"addidc"
id=
"addidc"
onclick=
"show(this)"
>
addidc
</div>
<div
class=
"ibox-content"
>
<div
class=
"ibox-content"
id=
"addhost"
>
{% if emg %}
<div
class=
"alert alert-warning text-center"
>
{{ emg }}
</div>
{% endif %}
...
...
@@ -146,6 +149,9 @@ var showFlag={};
if
(
showFlag
.
j_type
==
"MAP"
){
document
.
getElementById
(
"a1"
).
style
.
display
=
""
;
}
else
if
(
showFlag
.
addidc
==
"addidc"
){
document
.
getElementById
(
"addidc"
).
style
.
display
=
""
;
}
else
{
document
.
getElementById
(
"a1"
).
style
.
display
=
"none"
;
}};
...
...
templates/jasset/jlist.html
View file @
6b95c7ed
...
...
@@ -47,9 +47,9 @@
<tbody>
{% for post in contacts.object_list %}
<tr
class=
"gradeX"
>
<td>
{{ post.ip }}
</td>
<td>
<a
class=
"iframe"
href=
"/jasset/{{ post.ip }}/"
>
{{ post.ip }}
</a>
</td>
<td>
{{ post.port }}
</td>
<td>
{{ post.login_type}}
</td>
<td>
{{ post.
get_
login_type}}
</td>
<td
class=
"center"
>
{{ post.idc.name }}
</td>
<td
class=
"center"
>
{% for group in post.bis_group.all %}
...
...
@@ -85,4 +85,10 @@
</div>
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
".iframe"
).
colorbox
({
iframe
:
true
,
width
:
"70%"
,
height
:
"70%"
});
});
</script>
{% endblock %}
\ No newline at end of file
templates/jasset/jlist_ip.html
0 → 100644
View file @
6b95c7ed
<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"
>
<link
href=
"/static/css/colorbox.css"
rel=
"stylesheet"
>
<!-- Mainly scripts -->
<script
src=
"/static/js/jquery-2.1.1.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<script
src=
"/static/js/plugins/metisMenu/jquery.metisMenu.js"
></script>
<script
src=
"/static/js/plugins/slimscroll/jquery.slimscroll.min.js"
></script>
<style
type=
"text/css"
>
body
{
background
:
#FFFFFF
;
}
</style>
</head>
<body>
<div
class=
"row"
>
<div
class=
"contact-box"
>
<h2
class=
"text-center"
>
{{ offset }}主机详情
</h2>
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<thead>
<tr>
<th>
IP地址
</th>
<th>
端口号
</th>
<th>
登录方式
</th>
<th>
所属IDC
</th>
<th>
所属业务组
</th>
<th>
添加时间
</th>
<th>
备注
</th>
</tr>
</thead>
<tbody>
<tr
class=
"gradeX"
>
<td>
<a
class=
"iframe"
href=
"/jasset/{{ post.ip }}/"
>
{{ post.ip }}
</a></td>
<td>
{{ post.port }}
</td>
<td>
{{ post.get_login_type}}
</td>
<td
class=
"center"
>
{{ post.idc.name }}
</td>
<td
class=
"center"
>
{% for group in post.bis_group.all %}
{{ group }}
{% endfor %}
</td>
<td
class=
"center"
>
{{ post.date_added }}
</td>
<td
class=
"center"
>
{{ post.comment }}
</td>
</tr>
</tbody>
</table>
<a>
是否激活: {{ post.is_active }}
</a>
</div>
</div>
</body>
</html>
\ No newline at end of file
templates/link_css.html
View file @
6b95c7ed
...
...
@@ -3,3 +3,4 @@
<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"
>
<link
href=
"/static/css/colorbox.css"
rel=
"stylesheet"
>
\ No newline at end of file
templates/script.html
View file @
6b95c7ed
...
...
@@ -26,3 +26,6 @@
<!--});-->
<!--</script>-->
<!-- pop windows -->
<script
src=
"/static/js/jquery.colorbox.js"
></script>
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