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
55c5230e
Commit
55c5230e
authored
10 years ago
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hehe
parent
da4d6b85
master
auditor_jym
audits
dev
dev_beta
dev_beta_db
gengmei
lagacy-0.4.0
node_service
password
rbac
restrict_access
test
v52
wph
1.5.2
1.5.1
1.5.0
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
1.0.0
0.3.3
0.3.2
0.3.2-rc2
0.3.1
0.3.0-beta
0.2.1
0.2.0
v1.4.10
v1.4.7
v1.4.4
No related merge requests found
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
23 deletions
+26
-23
views.py
jlog/views.py
+5
-4
views.py
jperm/views.py
+8
-7
jumpserver.conf
jumpserver.conf
+1
-1
nohup.out
nohup.out
+0
-0
log_online.html
templates/jlog/log_online.html
+4
-4
log_search.html
templates/jlog/log_search.html
+3
-3
perm_apply.html
templates/jperm/perm_apply.html
+4
-4
nohup.out
websocket/nohup.out
+1
-0
No files found.
jlog/views.py
View file @
55c5230e
...
...
@@ -60,6 +60,7 @@ def get_user_log(ret_list):
@require_login
def
log_list
(
request
,
offset
):
header_title
,
path1
,
path2
=
u'查看日志'
,
u'查看日志'
,
u'在线用户'
keyword
=
request
.
GET
.
get
(
'keyword'
,
''
)
web_socket_host
=
CONF
.
get
(
'websocket'
,
'web_socket_host'
)
posts
=
get_user_log
(
get_user_info
(
request
,
offset
))
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
...
...
@@ -72,15 +73,14 @@ def log_kill(request):
pid
=
request
.
GET
.
get
(
'id'
,
''
)
log
=
Log
.
objects
.
filter
(
pid
=
pid
)
if
log
:
pid
=
log
.
pid
log
=
log
.
first
()
dept_name
=
log
.
dept_name
deptname
=
get_session_user_info
(
request
)[
4
]
if
is_group_admin
(
request
)
and
dept_name
!=
deptname
:
return
httperror
(
request
,
'Kill失败, 您无权操作!'
)
os
.
kill
(
int
(
pid
),
9
)
Log
.
objects
.
filter
(
pid
=
pid
)
.
update
(
is_finished
=
1
,
end_time
=
datetime
.
now
())
return
HttpResponseRedirect
(
'jlog/log_offline.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
Log
.
objects
.
filter
(
pid
=
pid
)
.
update
(
is_finished
=
1
,
end_time
=
datetime
.
datetime
.
now
())
return
render_to_response
(
'jlog/log_offline.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
@require_login
...
...
@@ -109,6 +109,7 @@ def log_history(request):
@require_login
def
log_search
(
request
):
offset
=
request
.
GET
.
get
(
'env'
,
''
)
keyword
=
request
.
GET
.
get
(
'keyword'
,
''
)
posts
=
get_user_log
(
get_user_info
(
request
,
offset
))
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
posts
,
request
)
return
render_to_response
(
'jlog/log_search.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
This diff is collapsed.
Click to expand it.
jperm/views.py
View file @
55c5230e
...
...
@@ -635,13 +635,14 @@ def cmd_detail(request):
@require_login
def
perm_apply
(
request
):
header_title
,
path1
,
path2
=
u'主机权限申请'
,
u'权限管理'
,
u'申请主机'
user_id
=
request
.
session
.
get
(
'user_id'
)
username
=
User
.
objects
.
get
(
id
=
user_id
)
.
username
dept_id
=
get_user_dept
(
request
)
deptname
=
DEPT
.
objects
.
get
(
id
=
dept_id
)
.
name
dept
=
DEPT
.
objects
.
get
(
id
=
dept_id
)
posts
=
Asset
.
objects
.
filter
(
dept
=
dept
)
egroup
=
dept
.
bisgroup_set
.
all
()
user_id
,
username
=
get_session_user_info
(
request
)[
0
:
2
]
dept_id
,
deptname
,
dept
=
get_session_user_info
(
request
)[
3
:
6
]
perm_host
=
user_perm_asset_api
(
username
)
all_host
=
Asset
.
objects
.
filter
(
dept
=
dept
)
perm_group
=
user_perm_group_api
(
username
)
all_group
=
dept
.
bisgroup_set
.
all
()
posts
=
[
g
for
g
in
all_host
if
g
not
in
perm_host
]
egroup
=
[
d
for
d
in
all_group
if
d
not
in
perm_group
]
dept_da
=
User
.
objects
.
filter
(
dept_id
=
dept_id
,
role
=
'DA'
)
if
request
.
method
==
'POST'
:
...
...
This diff is collapsed.
Click to expand it.
jumpserver.conf
View file @
55c5230e
...
...
@@ -22,7 +22,7 @@ root_pw = secret234
[
websocket
]
web_socket_host
=
192
.
168
.
8
.
220
:
3000
web_socket_host
=
192
.
168
.
173
.
129
:
3000
[
web
]
...
...
This diff is collapsed.
Click to expand it.
nohup.out
View file @
55c5230e
This diff is collapsed.
Click to expand it.
templates/jlog/log_online.html
View file @
55c5230e
...
...
@@ -155,7 +155,7 @@
if
(
option
==
'new'
)
{
tag
.
append
(
'<p style="margin: 2px">'
+
escapeString
(
obj
.
content
)
+
'</p>'
);
}
else
if
(
option
==
'exist'
)
{
tag
.
append
(
'<
span style="margin: 0">'
+
exsit_message
+
'</span
>'
);
tag
.
append
(
'<
pre>'
+
exsit_message
+
'</pre
>'
);
}
tag
.
animate
({
scrollTop
:
tag
[
0
].
scrollHeight
},
1
);
});
...
...
@@ -204,12 +204,12 @@
})
function
cut
(
num
){
var
g_url
=
"/jlog/log_kill/"
+
num
;
console
.
log
(
g_url
);
var
g_url
=
"/jlog/log_kill/?id="
+
num
;
$
.
ajax
({
type
:
"GET"
,
url
:
g_url
,
success
:
window
.
open
(
"/jlog/log_list/online/"
,
"_self"
)
success
:
window
.
open
(
"/jlog/log_list/online/"
,
"_self"
)
// error: window.open(g_url, "_self")
});
}
...
...
This diff is collapsed.
Click to expand it.
templates/jlog/log_search.html
View file @
55c5230e
...
...
@@ -16,9 +16,9 @@
{% for post in contacts.object_list %}
<tr
class=
"gradeX"
>
<td
class=
"text-center"
id=
"username"
>
{{ post.user }}
</td>
<td
class=
"text-center"
id=
"
ip
"
>
{{ post.dept_name }}
</td>
<td
class=
"text-center"
id=
"
ip
"
>
{{ post.host }}
</td>
<td
class=
"text-center"
id=
"ip"
>
{{ post.remote_ip }}
</td>
<td
class=
"text-center"
id=
"
dept_name
"
>
{{ post.dept_name }}
</td>
<td
class=
"text-center"
id=
"
host
"
>
{{ post.host }}
</td>
<td
class=
"text-center"
id=
"
remote_
ip"
>
{{ post.remote_ip }}
</td>
<td
class=
"text-center"
><a
href=
"/jlog/history/?id={{ post.id }}"
class=
"log_command"
>
命令统计
</td>
<td
class=
"text-center"
id=
"start_time"
>
{{ post.start_time|date:"Y-m-d H:i:s"}}
</td>
<td
class=
"text-center"
id=
"end_time"
>
{{ post.end_time|date:"Y-m-d H:i:s" }}
</td>
...
...
This diff is collapsed.
Click to expand it.
templates/jperm/perm_apply.html
View file @
55c5230e
...
...
@@ -36,17 +36,17 @@
{% endif %}
<form
id=
"assetForm"
method=
"post"
class=
"form-horizontal"
>
{% csrf_token %}
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
申请人
</label>
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
申请人
<
span
class=
"red-fonts"
>
*
</span><
/label>
<div
class=
"col-sm-8"
><input
type=
"text"
name=
"applyer"
value=
"{{ username }}"
class=
"form-control"
readonly=
"readonly"
></div>
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
所在部门
</label>
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
所在部门
<
span
class=
"red-fonts"
>
*
</span><
/label>
<div
class=
"col-sm-8"
><input
type=
"text"
name=
"dept"
value=
"{{ deptname }}"
class=
"form-control"
readonly=
"readonly"
></div>
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
部门管理员
</label>
<div
class=
"form-group"
><label
class=
"col-sm-2 control-label"
>
部门管理员
<
span
class=
"red-fonts"
>
*
</span><
/label>
<div
class=
"radio"
>
{% for da in dept_da %}
<label><input
type=
"radio"
value=
"{{ da.id }}"
id=
"da"
name=
"da"
>
{{ da }}
</label>
...
...
@@ -56,7 +56,7 @@
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<label
for=
"group"
class=
"col-lg-2 control-label"
>
主机组
<
span
class=
"red-fonts"
>
*
</span><
/label>
<label
for=
"group"
class=
"col-lg-2 control-label"
>
主机组
</label>
<div
class=
"col-sm-8"
>
<select
id=
"group"
name=
"group"
class=
"form-control m-b"
multiple
size=
"10"
>
{% for g in egroup %}
...
...
This diff is collapsed.
Click to expand it.
websocket/nohup.out
View file @
55c5230e
listening on *:3000
This diff is collapsed.
Click to expand it.
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