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
db86daf8
Commit
db86daf8
authored
Feb 11, 2015
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard等
parent
a42d053c
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
234 additions
and
58 deletions
+234
-58
urls.py
jasset/urls.py
+4
-3
views.py
jasset/views.py
+9
-3
urls.py
jumpserver/urls.py
+1
-1
views.py
jumpserver/views.py
+8
-2
foot_script.html
templates/foot_script.html
+4
-10
head_script.html
templates/head_script.html
+0
-2
index.html
templates/index.html
+66
-0
group_detail.html
templates/jasset/group_detail.html
+0
-1
group_list.html
templates/jasset/group_list.html
+3
-3
host_list.html
templates/jasset/host_list.html
+2
-2
host_search.html
templates/jasset/host_search.html
+79
-2
idc_detail.html
templates/jasset/idc_detail.html
+1
-2
idc_list.html
templates/jasset/idc_list.html
+2
-2
jlist_ip.html
templates/jasset/jlist_ip.html
+54
-24
nav.html
templates/nav.html
+1
-1
No files found.
jasset/urls.py
View file @
db86daf8
...
@@ -11,16 +11,16 @@ urlpatterns = patterns('',
...
@@ -11,16 +11,16 @@ urlpatterns = patterns('',
url
(
r"^(\d+.\d+.\d+.\d+)/$"
,
jlist_ip
),
url
(
r"^(\d+.\d+.\d+.\d+)/$"
,
jlist_ip
),
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/
(\d+)
$'
,
detail_idc
),
url
(
r'^idc_detail/$'
,
detail_idc
),
url
(
r'^idc_del/(\d+)/$'
,
del_idc
),
url
(
r'^idc_del/(\d+)/$'
,
del_idc
),
url
(
r'^group_add/$'
,
add_group
),
url
(
r'^group_add/$'
,
add_group
),
url
(
r'^group_edit/$'
,
edit_group
),
url
(
r'^group_edit/$'
,
edit_group
),
url
(
r'^group_list/$'
,
list_group
),
url
(
r'^group_list/$'
,
list_group
),
url
(
r'^group_detail/
(\d+)/
$'
,
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/(\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/$'
,
host_edit
),
url
(
r'^host_edit/batch/$'
,
batch_host_edit
),
url
(
r'^host_edit/batch/$'
,
batch_host_edit
),
url
(
r'^test/$'
,
test
),
url
(
r'^test/$'
,
test
),
)
)
\ No newline at end of file
jasset/views.py
View file @
db86daf8
...
@@ -9,6 +9,7 @@ from django.core.paginator import Paginator, EmptyPage, InvalidPage
...
@@ -9,6 +9,7 @@ from django.core.paginator import Paginator, EmptyPage, InvalidPage
from
models
import
IDC
,
Asset
,
BisGroup
from
models
import
IDC
,
Asset
,
BisGroup
from
juser.models
import
UserGroup
from
juser.models
import
UserGroup
from
connect
import
PyCrypt
,
KEY
from
connect
import
PyCrypt
,
KEY
from
jlog.models
import
Log
from
jumpserver.views
import
jasset_group_add
,
jasset_host_edit
,
pages
from
jumpserver.views
import
jasset_group_add
,
jasset_host_edit
,
pages
cryptor
=
PyCrypt
(
KEY
)
cryptor
=
PyCrypt
(
KEY
)
...
@@ -174,13 +175,14 @@ def host_del(request, offset):
...
@@ -174,13 +175,14 @@ def host_del(request, offset):
return
HttpResponseRedirect
(
'/jasset/host_list/'
)
return
HttpResponseRedirect
(
'/jasset/host_list/'
)
def
host_edit
(
request
,
offset
):
def
host_edit
(
request
):
actives
=
{
1
:
u'激活'
,
0
:
u'禁用'
}
actives
=
{
1
:
u'激活'
,
0
:
u'禁用'
}
login_types
=
{
'L'
:
'LDAP'
,
'S'
:
'SSH_KEY'
,
'P'
:
'PASSWORD'
,
'M'
:
'MAP'
}
login_types
=
{
'L'
:
'LDAP'
,
'S'
:
'SSH_KEY'
,
'P'
:
'PASSWORD'
,
'M'
:
'MAP'
}
header_title
,
path1
,
path2
=
u'修改主机 | Edit Host'
,
u'资产管理'
,
u'修改主机'
header_title
,
path1
,
path2
=
u'修改主机 | Edit Host'
,
u'资产管理'
,
u'修改主机'
groups
,
e_group
=
[],
[]
groups
,
e_group
=
[],
[]
eidc
=
IDC
.
objects
.
all
()
eidc
=
IDC
.
objects
.
all
()
egroup
=
BisGroup
.
objects
.
filter
(
type
=
'A'
)
egroup
=
BisGroup
.
objects
.
filter
(
type
=
'A'
)
offset
=
request
.
GET
.
get
(
'id'
)
for
g
in
Asset
.
objects
.
get
(
id
=
int
(
offset
))
.
bis_group
.
all
():
for
g
in
Asset
.
objects
.
get
(
id
=
int
(
offset
))
.
bis_group
.
all
():
e_group
.
append
(
g
)
e_group
.
append
(
g
)
post
=
Asset
.
objects
.
get
(
id
=
int
(
offset
))
post
=
Asset
.
objects
.
get
(
id
=
int
(
offset
))
...
@@ -228,7 +230,9 @@ def host_edit(request, offset):
...
@@ -228,7 +230,9 @@ 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'主机详情'
login_types
=
{
'L'
:
'LDAP'
,
'S'
:
'SSH_KEY'
,
'P'
:
'PASSWORD'
,
'M'
:
'MAP'
}
post
=
contact_list
=
Asset
.
objects
.
get
(
ip
=
str
(
offset
))
post
=
contact_list
=
Asset
.
objects
.
get
(
ip
=
str
(
offset
))
log
=
Log
.
objects
.
filter
(
host
=
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
))
...
@@ -309,9 +313,10 @@ def edit_group(request):
...
@@ -309,9 +313,10 @@ def edit_group(request):
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
))
def
detail_group
(
request
,
offset
):
def
detail_group
(
request
):
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'
}
offset
=
request
.
GET
.
get
(
'id'
)
group_name
=
BisGroup
.
objects
.
get
(
id
=
offset
)
.
name
group_name
=
BisGroup
.
objects
.
get
(
id
=
offset
)
.
name
b
=
BisGroup
.
objects
.
get
(
id
=
offset
)
b
=
BisGroup
.
objects
.
get
(
id
=
offset
)
posts
=
contact_list
=
Asset
.
objects
.
filter
(
bis_group
=
b
)
.
order_by
(
'ip'
)
posts
=
contact_list
=
Asset
.
objects
.
filter
(
bis_group
=
b
)
.
order_by
(
'ip'
)
...
@@ -328,9 +333,10 @@ def detail_group(request, offset):
...
@@ -328,9 +333,10 @@ def detail_group(request, offset):
return
render_to_response
(
'jasset/group_detail.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jasset/group_detail.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
def
detail_idc
(
request
,
offset
):
def
detail_idc
(
request
):
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'
}
offset
=
request
.
GET
.
get
(
'id'
)
idc_name
=
IDC
.
objects
.
get
(
id
=
offset
)
.
name
idc_name
=
IDC
.
objects
.
get
(
id
=
offset
)
.
name
b
=
IDC
.
objects
.
get
(
id
=
offset
)
b
=
IDC
.
objects
.
get
(
id
=
offset
)
posts
=
contact_list
=
Asset
.
objects
.
filter
(
idc
=
b
)
.
order_by
(
'ip'
)
posts
=
contact_list
=
Asset
.
objects
.
filter
(
idc
=
b
)
.
order_by
(
'ip'
)
...
...
jumpserver/urls.py
View file @
db86daf8
...
@@ -5,7 +5,7 @@ urlpatterns = patterns('',
...
@@ -5,7 +5,7 @@ urlpatterns = patterns('',
# Examples:
# Examples:
# url(r'^$', 'jumpserver.views.home', name='home'),
# url(r'^$', 'jumpserver.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
# url(r'^blog/', include('blog.urls')),
(
r'^$'
,
'jumpserver.views.
base
'
),
(
r'^$'
,
'jumpserver.views.
index
'
),
(
r'^skin_config/$'
,
'jumpserver.views.skin_config'
),
(
r'^skin_config/$'
,
'jumpserver.views.skin_config'
),
(
r'^base/$'
,
'jumpserver.views.base'
),
(
r'^base/$'
,
'jumpserver.views.base'
),
(
r'^login/$'
,
'jumpserver.views.login'
),
(
r'^login/$'
,
'jumpserver.views.login'
),
...
...
jumpserver/views.py
View file @
db86daf8
...
@@ -7,6 +7,7 @@ from django.http import HttpResponseRedirect
...
@@ -7,6 +7,7 @@ from django.http import HttpResponseRedirect
from
django.core.paginator
import
Paginator
,
EmptyPage
,
InvalidPage
from
django.core.paginator
import
Paginator
,
EmptyPage
,
InvalidPage
from
juser.models
import
User
from
juser.models
import
User
from
jlog.models
import
Log
from
jasset.models
import
Asset
,
BisGroup
,
IDC
from
jasset.models
import
Asset
,
BisGroup
,
IDC
...
@@ -14,8 +15,13 @@ def md5_crypt(string):
...
@@ -14,8 +15,13 @@ def md5_crypt(string):
return
hashlib
.
new
(
"md5"
,
string
)
.
hexdigest
()
return
hashlib
.
new
(
"md5"
,
string
)
.
hexdigest
()
def
base
(
request
):
def
index
(
request
):
return
render_to_response
(
'base.html'
)
path1
,
path2
=
u'仪表盘'
,
'Dashboard'
users
=
User
.
objects
.
all
()
hosts
=
Asset
.
objects
.
all
()
online_host
=
Log
.
objects
.
filter
(
is_finished
=
0
)
online_user
=
online_host
.
distinct
()
return
render_to_response
(
'index.html'
,
locals
())
def
skin_config
(
request
):
def
skin_config
(
request
):
...
...
templates/foot_script.html
View file @
db86daf8
...
@@ -8,8 +8,6 @@
...
@@ -8,8 +8,6 @@
<script
src=
"/static/js/inspinia.js"
></script>
<script
src=
"/static/js/inspinia.js"
></script>
<script
src=
"/static/js/plugins/pace/pace.min.js"
></script>
<script
src=
"/static/js/plugins/pace/pace.min.js"
></script>
<!-- iCheck box -->
<!-- Peity -->
<!-- Peity -->
<script
src=
"/static/js/plugins/peity/jquery.peity.min.js"
></script>
<script
src=
"/static/js/plugins/peity/jquery.peity.min.js"
></script>
...
@@ -19,17 +17,14 @@
...
@@ -19,17 +17,14 @@
<script
src=
"/static/js/base.js"
></script>
<script
src=
"/static/js/base.js"
></script>
<!-- pop windows layer-->
<!-- pop windows layer-->
<script
src=
"/static/js/layer/layer.min.js"
></script>
<!-- active menu -->
<!-- active menu -->
<script>
<script>
var
str
=
document
.
location
.
pathname
.
split
(
"/"
)[
1
];
var
str
=
document
.
location
.
pathname
.
split
(
"/"
)[
1
];
var
str1
=
document
.
location
.
pathname
.
split
(
"/"
)[
2
];
var
str1
=
document
.
location
.
pathname
.
split
(
"/"
)[
2
];
$
(
"#"
+
str
).
addClass
(
'active'
);
$
(
"#"
+
str
).
addClass
(
'active'
);
$
(
"#"
+
str1
).
addClass
(
'active'
);
if
(
$
(
"#"
+
str1
).
length
>
0
)
{
$
(
"#"
+
str1
).
addClass
(
'active'
);
}
</script>
</script>
<!--<script>-->
<!--$(document).ready(function(){-->
<!--$(".iframe").colorbox({iframe:true, width:"70%", height:"80%"});-->
<!--});-->
<!--</script>-->
\ No newline at end of file
templates/head_script.html
View file @
db86daf8
...
@@ -5,5 +5,3 @@
...
@@ -5,5 +5,3 @@
<!-- validator js -->
<!-- validator js -->
<script
src=
"/static/js/validator/jquery.validator.js"
></script>
<script
src=
"/static/js/validator/jquery.validator.js"
></script>
<script
src=
"/static/js/validator/zh_CN.js"
></script>
<script
src=
"/static/js/validator/zh_CN.js"
></script>
<script
src=
"/static/js/layer/layer.min.js"
></script>
templates/index.html
0 → 100644
View file @
db86daf8
{% extends 'base.html' %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"col-lg-3"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<span
class=
"label label-success pull-right"
>
Monthly
</span>
<h5>
用户总数
</h5>
</div>
<div
class=
"ibox-content"
>
<h1
class=
"no-margins"
>
{{ users.count}}
</h1>
<div
class=
"stat-percent font-bold text-success"
>
98%
<i
class=
"fa fa-bolt"
></i></div>
<small>
All user
</small>
</div>
</div>
</div>
<div
class=
"col-lg-3"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<span
class=
"label label-info pull-right"
>
Annual
</span>
<h5>
主机总数
</h5>
</div>
<div
class=
"ibox-content"
>
<h1
class=
"no-margins"
>
{{ hosts.count }}
</h1>
<div
class=
"stat-percent font-bold text-info"
>
20%
<i
class=
"fa fa-level-up"
></i></div>
<small>
All host
</small>
</div>
</div>
</div>
<div
class=
"col-lg-3"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<span
class=
"label label-primary pull-right"
>
Today
</span>
<h5>
在线用户
</h5>
</div>
<div
class=
"ibox-content"
>
<h1
class=
"no-margins"
>
{{ online_user.count }}
</h1>
<div
class=
"stat-percent font-bold text-navy"
>
44%
<i
class=
"fa fa-level-up"
></i></div>
<small>
Online user
</small>
</div>
</div>
</div>
<div
class=
"col-lg-3"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<span
class=
"label label-danger pull-right"
>
Low value
</span>
<h5>
已连接服务器
</h5>
</div>
<div
class=
"ibox-content"
>
<h1
class=
"no-margins"
>
{{ online_host.count }}
</h1>
<div
class=
"stat-percent font-bold text-danger"
>
38%
<i
class=
"fa fa-level-down"
></i></div>
<small>
Connect host
</small>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
templates/jasset/group_detail.html
View file @
db86daf8
...
@@ -106,7 +106,6 @@
...
@@ -106,7 +106,6 @@
<script>
<script>
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
(
".iframe"
).
colorbox
({
iframe
:
true
,
width
:
"70%"
,
height
:
"70%"
});
$
(
'#editable'
).
editableTableWidget
();
$
(
'#editable'
).
editableTableWidget
();
});
});
...
...
templates/jasset/group_list.html
View file @
db86daf8
...
@@ -32,11 +32,11 @@
...
@@ -32,11 +32,11 @@
<tr
class=
"gradeX"
>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
{{ post.id }}
</td>
<td
class=
"text-center"
>
{{ post.id }}
</td>
<td
class=
"text-center"
>
{{ post.name }}
</td>
<td
class=
"text-center"
>
{{ post.name }}
</td>
<td
class=
"text-center"
>
<a
href=
"/jasset/group_detail/{{ post.id }}"
>
{{ post.asset_set.count }}
</a>
</td>
<td
class=
"text-center"
>
<a
href=
"/jasset/group_detail/
?id=
{{ post.id }}"
>
{{ post.asset_set.count }}
</a>
</td>
<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/
?id=
{{ 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_edit/
?id=
{{ 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/host_list.html
View file @
db86daf8
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
<td
class=
"text-center"
name=
"j_comment"
>
{{ post.comment }}
</td>
<td
class=
"text-center"
name=
"j_comment"
>
{{ post.comment }}
</td>
<td
class=
"text-center"
data-editable=
'false'
>
<td
class=
"text-center"
data-editable=
'false'
>
<a
value=
"/jasset/{{ post.ip }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
value=
"/jasset/{{ post.ip }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/jasset/host_edit/{{ post.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"/jasset/host_edit/
?id=
{{ post.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"/jasset/host_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
<a
href=
"/jasset/host_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
</td>
</tr>
</tr>
...
@@ -124,7 +124,7 @@
...
@@ -124,7 +124,7 @@
var
url
=
$
(
this
).
attr
(
"value"
);
var
url
=
$
(
this
).
attr
(
"value"
);
$
.
layer
({
$
.
layer
({
type
:
2
,
type
:
2
,
title
:
'
iframe父子操作
'
,
title
:
'
JumpServer主机详情
'
,
maxmin
:
true
,
maxmin
:
true
,
shift
:
'top'
,
shift
:
'top'
,
border
:
[
2
,
0.3
,
'#1AB394'
],
border
:
[
2
,
0.3
,
'#1AB394'
],
...
...
templates/jasset/host_search.html
View file @
db86daf8
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
<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>
<td
class=
"text-center"
data-editable=
'false'
>
<td
class=
"text-center"
data-editable=
'false'
>
<a
href
=
"/jasset/{{ post.ip }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
value
=
"/jasset/{{ post.ip }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/jasset/host_edit/{{ post.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"/jasset/host_edit/
?id=
{{ post.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"/jasset/host_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
<a
href=
"/jasset/host_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
</td>
</tr>
</tr>
...
@@ -62,3 +62,80 @@
...
@@ -62,3 +62,80 @@
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
'#editable'
).
editableTableWidget
();
});
$
(
".iframe"
).
on
(
'click'
,
function
(){
var
url
=
$
(
this
).
attr
(
"value"
);
$
.
layer
({
type
:
2
,
title
:
'JumpServer主机详情'
,
maxmin
:
true
,
shift
:
'top'
,
border
:
[
2
,
0.3
,
'#1AB394'
],
shade
:
[
0.5
,
'#000000'
],
shadeClose
:
true
,
area
:
[
'800px'
,
'600px'
],
iframe
:
{
src
:
url
}
});
});
function
alter
(
form
)
{
selectData
=
GetTableDataBox
();
if
(
selectData
[
1
]
!=
0
)
{
$
.
ajax
({
type
:
"post"
,
url
:
"/jasset/host_edit/batch/"
,
data
:
{
"editable"
:
selectData
[
0
],
"len_table"
:
selectData
[
1
]},
success
:
function
(
data
)
{
alert
(
"修改成功"
);
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
}
});
}
}
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/host_del/multi/"
,
data
:
{
"id_list"
:
id_list
,
"len_list"
:
j
},
success
:
function
(
data
)
{
window
.
open
(
"/jasset/host_list/"
,
"_self"
);
}
});
}
}
function
host_search
(){
$
.
ajax
({
type
:
"GET"
,
url
:
"/jasset/search/"
,
data
:
$
(
"#search_form"
).
serialize
(),
success
:
function
(
data
)
{
$
(
"#contents_form"
).
html
(
data
);
}
});
}
$
(
"#search_input"
).
keydown
(
function
(
e
){
if
(
e
.
keyCode
==
13
){
host_search
()
}
})
</script>
templates/jasset/idc_detail.html
View file @
db86daf8
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
<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>
<td
class=
"text-center"
data-editable=
'false'
>
<td
class=
"text-center"
data-editable=
'false'
>
<a
href=
"/jasset/{{ post.ip }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/jasset/
?id=
{{ post.ip }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/jasset/host_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
<a
href=
"/jasset/host_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
</td>
</tr>
</tr>
...
@@ -105,7 +105,6 @@
...
@@ -105,7 +105,6 @@
<script>
<script>
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
(
".iframe"
).
colorbox
({
iframe
:
true
,
width
:
"70%"
,
height
:
"70%"
});
$
(
'#editable'
).
editableTableWidget
();
$
(
'#editable'
).
editableTableWidget
();
});
});
...
...
templates/jasset/idc_list.html
View file @
db86daf8
...
@@ -32,10 +32,10 @@
...
@@ -32,10 +32,10 @@
<tr
class=
"gradeX"
>
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
{{ post.id }}
</td>
<td
class=
"text-center"
>
{{ post.id }}
</td>
<td
class=
"text-center"
>
{{ post.name }}
</td>
<td
class=
"text-center"
>
{{ post.name }}
</td>
<td
class=
"text-center"
>
<a
href=
"/jasset/idc_detail/{{ post.id }}"
>
{{ post.asset_set.count }}
</a>
</td>
<td
class=
"text-center"
>
<a
href=
"/jasset/idc_detail/
?id=
{{ post.id }}"
>
{{ post.asset_set.count }}
</a>
</td>
<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/
idc_detail/
{{ post.id }}"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/jasset/
?id=
{{ post.id }}"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"/jasset/idc_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
<a
href=
"/jasset/idc_del/{{ post.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
</td>
</tr>
</tr>
...
...
templates/jasset/jlist_ip.html
View file @
db86daf8
{% load mytags %}
<html>
<html>
<head>
<head>
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
{% include 'link_css.html' %}
<link
href=
"/static/font-awesome/css/font-awesome.css"
rel=
"stylesheet"
>
{% include 'head_script.html' %}
<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"
>
<style
type=
"text/css"
>
body
body
...
@@ -24,7 +15,7 @@
...
@@ -24,7 +15,7 @@
<body>
<body>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"contact-box"
>
<div
class=
"contact-box"
>
<h
2
class=
"text-center"
>
{{ offset }}主机详情
</h2
>
<h
3
class=
"text-center"
>
{{ offset }}主机详情
</h3
>
<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>
...
@@ -39,22 +30,60 @@
...
@@ -39,22 +30,60 @@
</thead>
</thead>
<tbody>
<tbody>
<tr
class=
"gradeX"
>
<tr
class=
"gradeX"
>
<td>
<a
class=
"iframe"
href=
"/jasset/{{ post.ip }}/"
>
{{ post.ip }}
</a></td>
<td>
<a
id=
"ip"
class=
"iframe"
href=
"/jasset/{{ post.ip }}/"
>
{{ post.ip }}
</a></td>
<td>
{{ post.port }}
</td>
<td>
{{ post.port }}
</td>
<td>
{{ post.get_login_type}}
</td>
<td>
{{ login_types|get_item:post.login_type }}
</td>
<td
class=
"center"
>
{{ post.idc.name }}
</td>
<td
class=
"text-center"
>
{{ post.idc.name }}
</td>
<td
class=
"center"
>
<td
class=
"text-center"
>
{% for group in post.bis_group.all|filter_private %} {{ group }} {% endfor %}
</td>
{% for group in post.bis_group.all %}
<td
class=
"text-center"
>
{{ post.date_added|date:"Y-m-d H:i:s" }}
</td>
{{ group }}
<td
class=
"text-center"
>
{{ post.comment }}
</td>
{% endfor %}
</td>
<td
class=
"center"
>
{{ post.date_added }}
</td>
<td
class=
"center"
>
{{ post.comment }}
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<a>
是否激活: {{ post.is_active }}
</a>
<!--<a> 是否激活: {{ post.is_active }}</a>-->
<h3
class=
"text-center"
>
最近一周登录详情
</h3>
<table
class=
"table table-striped table-bordered table-hover "
>
<thead>
<tr>
<th
class=
"text-center"
>
用户名
</th>
<th
class=
"text-center"
>
登录时间
</th>
<th
class=
"text-center"
>
退出时间
</th>
<th
class=
"text-center"
>
详情
</th>
</tr>
</thead>
<tbody>
{% for l in log %}
<tr
class=
"gradeX"
>
<td
class=
"text-center"
id=
"username"
>
{{ l.user }}
</td>
<td
class=
"text-center"
id=
"start_time"
>
{{ l.start_time|date:"Y-m-d H:i:s" }}
</td>
<td
class=
"text-center"
id=
"end_time"
>
{{ l.end_time|date:"Y-m-d H:i:s" }}
</td>
<td
class=
"text-center"
>
<a
class=
"log_command text-success"
href=
"/jlog/history/?id={{ l.id }}"
>
命令统计
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</body>
<script
src=
"/static/js/bootstrap-dialog.js"
></script>
<script>
$
(
'.log_command'
).
on
(
'click'
,
function
(){
var
url
=
$
(
this
).
attr
(
'href'
);
var
username
=
$
(
'#username'
)[
0
].
innerText
;
var
ip
=
$
(
'#ip'
)[
0
].
innerText
;
var
start_time
=
$
(
'#start_time'
)[
0
].
innerText
;
var
end_time
=
$
(
'#end_time'
)[
0
].
innerText
;
var
div_username
=
' 登录用户名: '
+
'<span class="text-info">'
+
username
+
''
+
'</span>'
;
var
div_ip
=
' 登录主机: '
+
'<span class="text-info">'
+
ip
+
'</span>'
;
var
div_time
=
' 开始时间: '
+
'<span class="text-info">'
+
start_time
+
'</span>'
+
' 结束时间: '
+
'<span class="text-info">'
+
end_time
+
'</span>'
var
title
=
div_username
+
div_ip
+
div_time
$
.
ajax
({
url
:
url
,
success
:
function
(
data
){
BootstrapDialog
.
show
({
title
:
title
,
message
:
data
});
}});
return
false
;
})
</script>
</html>
</html>
\ No newline at end of file
templates/nav.html
View file @
db86daf8
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</ul>
</ul>
</li>
</li>
<li
id=
"jasset"
>
<li
id=
"jasset"
>
<a
href=
"mailbox.html"
><i
class=
"fa fa-cube"
></i>
<span
class=
"nav-label"
>
资产管理
</span><span
class=
"fa arrow"
></span></a>
<a><i
class=
"fa fa-cube"
></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=
"host_add"
><a
href=
"/jasset/host_add/"
>
添加资产
</a></li>
<li
id=
"host_add"
><a
href=
"/jasset/host_add/"
>
添加资产
</a></li>
<li
id=
"host_list"
><a
href=
"/jasset/host_list/"
>
查看资产
&
nbsp
&
nbsp
</span><span
class=
"label label-info pull-right"
>
16/18
</span></a></li>
<li
id=
"host_list"
><a
href=
"/jasset/host_list/"
>
查看资产
&
nbsp
&
nbsp
</span><span
class=
"label label-info pull-right"
>
16/18
</span></a></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