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
691271c7
Commit
691271c7
authored
Mar 12, 2015
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugs
parent
fd490bd6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
1 deletion
+40
-1
views.py
jasset/views.py
+8
-1
views.py
jlog/views.py
+10
-0
group_list.html
templates/jasset/group_list.html
+11
-0
idc_list.html
templates/jasset/idc_list.html
+11
-0
No files found.
jasset/views.py
View file @
691271c7
...
@@ -149,7 +149,6 @@ def list_host(request):
...
@@ -149,7 +149,6 @@ def list_host(request):
Q
(
bis_group__name__contains
=
keyword
)
|
Q
(
comment__contains
=
keyword
))
.
distinct
()
.
order_by
(
'ip'
)
Q
(
bis_group__name__contains
=
keyword
)
|
Q
(
comment__contains
=
keyword
))
.
distinct
()
.
order_by
(
'ip'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
return
render_to_response
(
'jasset/host_list.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
else
:
else
:
posts
=
Asset
.
objects
.
all
()
.
order_by
(
'ip'
)
posts
=
Asset
.
objects
.
all
()
.
order_by
(
'ip'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
...
@@ -253,6 +252,10 @@ def add_idc(request):
...
@@ -253,6 +252,10 @@ def add_idc(request):
def
list_idc
(
request
):
def
list_idc
(
request
):
header_title
,
path1
,
path2
=
u'查看IDC'
,
u'资产管理'
,
u'查看IDC'
header_title
,
path1
,
path2
=
u'查看IDC'
,
u'资产管理'
,
u'查看IDC'
keyword
=
request
.
GET
.
get
(
'keyword'
,
''
)
if
keyword
:
posts
=
IDC
.
objects
.
filter
(
Q
(
name__contains
=
keyword
)
|
Q
(
comment__contains
=
keyword
))
else
:
posts
=
IDC
.
objects
.
all
()
.
order_by
(
'id'
)
posts
=
IDC
.
objects
.
all
()
.
order_by
(
'id'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
return
render_to_response
(
'jasset/idc_list.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
return
render_to_response
(
'jasset/idc_list.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
...
@@ -323,6 +326,10 @@ def add_group(request):
...
@@ -323,6 +326,10 @@ def add_group(request):
def
list_group
(
request
):
def
list_group
(
request
):
header_title
,
path1
,
path2
=
u'查看主机组'
,
u'资产管理'
,
u'查看主机组'
header_title
,
path1
,
path2
=
u'查看主机组'
,
u'资产管理'
,
u'查看主机组'
keyword
=
request
.
GET
.
get
(
'keyword'
,
''
)
if
keyword
:
posts
=
BisGroup
.
objects
.
filter
(
Q
(
name__contains
=
keyword
)
|
Q
(
comment__contains
=
keyword
))
else
:
posts
=
BisGroup
.
objects
.
filter
(
type
=
'A'
)
.
order_by
(
'id'
)
posts
=
BisGroup
.
objects
.
filter
(
type
=
'A'
)
.
order_by
(
'id'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
...
...
jlog/views.py
View file @
691271c7
...
@@ -20,6 +20,11 @@ def log_list_online(request):
...
@@ -20,6 +20,11 @@ def log_list_online(request):
header_title
,
path1
,
path2
=
u'查看日志'
,
u'查看日志'
,
u'在线用户'
header_title
,
path1
,
path2
=
u'查看日志'
,
u'查看日志'
,
u'在线用户'
keyword
=
request
.
GET
.
get
(
'keyword'
)
keyword
=
request
.
GET
.
get
(
'keyword'
)
web_socket_host
=
CONF
.
get
(
'websocket'
,
'web_socket_host'
)
web_socket_host
=
CONF
.
get
(
'websocket'
,
'web_socket_host'
)
if
keyword
:
posts
=
contact_list
=
Log
.
objects
.
filter
(
Q
(
user__contains
=
keyword
)
|
Q
(
host__contains
=
keyword
))
\
.
filter
(
is_finished
=
0
)
.
order_by
(
'-start_time'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
else
:
posts
=
Log
.
objects
.
filter
(
is_finished
=
0
)
.
order_by
(
'-start_time'
)
posts
=
Log
.
objects
.
filter
(
is_finished
=
0
)
.
order_by
(
'-start_time'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
...
@@ -30,6 +35,11 @@ def log_list_offline(request):
...
@@ -30,6 +35,11 @@ def log_list_offline(request):
header_title
,
path1
,
path2
=
u'查看日志'
,
u'查看日志'
,
u'历史记录'
header_title
,
path1
,
path2
=
u'查看日志'
,
u'查看日志'
,
u'历史记录'
keyword
=
request
.
GET
.
get
(
'keyword'
)
keyword
=
request
.
GET
.
get
(
'keyword'
)
web_socket_host
=
CONF
.
get
(
'websocket'
,
'web_socket_host'
)
web_socket_host
=
CONF
.
get
(
'websocket'
,
'web_socket_host'
)
if
keyword
:
posts
=
contact_list
=
Log
.
objects
.
filter
(
Q
(
user__contains
=
keyword
)
|
Q
(
host__contains
=
keyword
))
\
.
filter
(
is_finished
=
1
)
.
order_by
(
'-start_time'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
else
:
posts
=
Log
.
objects
.
filter
(
is_finished
=
1
)
.
order_by
(
'-start_time'
)
posts
=
Log
.
objects
.
filter
(
is_finished
=
1
)
.
order_by
(
'-start_time'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
...
...
templates/jasset/group_list.html
View file @
691271c7
...
@@ -9,6 +9,17 @@
...
@@ -9,6 +9,17 @@
<div
class=
"ibox-content"
>
<div
class=
"ibox-content"
>
<div
class=
""
>
<div
class=
""
>
<a
target=
"_blank"
href=
"/jasset/jgroup_add"
class=
"btn btn-sm btn-primary "
>
添加主机组
</a>
<a
target=
"_blank"
href=
"/jasset/jgroup_add"
class=
"btn btn-sm btn-primary "
>
添加主机组
</a>
<form
id=
"search_form"
method=
"get"
action=
""
class=
"pull-right mail-search"
>
<div
class=
"input-group"
>
<input
type=
"text"
class=
"form-control input-sm"
id=
"search_input"
name=
"keyword"
placeholder=
"Search"
>
<input
type=
"text"
style=
"display: none"
>
<div
class=
"input-group-btn"
>
<button
id=
'search_btn'
type=
"submit"
class=
"btn btn-sm btn-primary"
>
Search
</button>
</div>
</div>
</form>
</div>
</div>
<form
id=
"contents_form"
name=
"contents_form"
>
<form
id=
"contents_form"
name=
"contents_form"
>
...
...
templates/jasset/idc_list.html
View file @
691271c7
...
@@ -9,6 +9,17 @@
...
@@ -9,6 +9,17 @@
<div
class=
"ibox-content"
>
<div
class=
"ibox-content"
>
<div
class=
""
>
<div
class=
""
>
<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>
<form
id=
"search_form"
method=
"get"
action=
""
class=
"pull-right mail-search"
>
<div
class=
"input-group"
>
<input
type=
"text"
class=
"form-control input-sm"
id=
"search_input"
name=
"keyword"
placeholder=
"Search"
>
<input
type=
"text"
style=
"display: none"
>
<div
class=
"input-group-btn"
>
<button
id=
'search_btn'
type=
"submit"
class=
"btn btn-sm btn-primary"
>
Search
</button>
</div>
</div>
</form>
</div>
</div>
<form
id=
"contents_form"
name=
"contents_form"
>
<form
id=
"contents_form"
name=
"contents_form"
>
...
...
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