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
fcb3fd71
Commit
fcb3fd71
authored
Mar 21, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #139 from jumpserver/issue_52_bugfix
Issue 52 bugfix: 修复录像播放,web terminal hang住bug
parents
b6af8368
1103ee8f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
requirements.txt
install/requirements.txt
+0
-0
run_server.py
run_server.py
+5
-5
webterminal.js
static/js/webterminal.js
+4
-4
log_online.html
templates/jlog/log_online.html
+1
-1
static.jinja2
templates/jlog/static.jinja2
+0
-0
No files found.
install/requirements.txt
View file @
fcb3fd71
run_server.py
View file @
fcb3fd71
...
...
@@ -10,7 +10,6 @@ import os.path
import
threading
import
re
import
functools
from
django.core.signals
import
request_started
,
request_finished
import
tornado.ioloop
...
...
@@ -371,9 +370,10 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
vim_data
=
self
.
term
.
deal_command
(
self
.
term
.
vim_data
)[
0
:
200
]
if
len
(
data
)
>
0
:
TtyLog
(
log
=
self
.
log
,
datetime
=
datetime
.
datetime
.
now
(),
cmd
=
vim_data
)
.
save
()
vim_data
=
self
.
term
.
deal_command
(
self
.
term
.
vim_data
)[
0
:
200
]
if
len
(
vim_data
)
>
0
:
TtyLog
(
log
=
self
.
log
,
datetime
=
datetime
.
datetime
.
now
(),
cmd
=
self
.
term
.
deal_command
(
self
.
term
.
data
)[
0
:
200
]
)
.
save
()
cmd
=
vim_data
)
.
save
()
self
.
term
.
vim_data
=
''
self
.
term
.
data
=
''
self
.
term
.
input_mode
=
False
...
...
@@ -412,7 +412,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
if
self
.
term
.
vim_flag
:
self
.
term
.
vim_data
+=
recv
try
:
self
.
write_message
(
json
.
dumps
({
'data'
:
data
}
))
self
.
write_message
(
data
.
decode
(
'utf-8'
,
'replace'
))
now_timestamp
=
time
.
time
()
self
.
log_time_f
.
write
(
'
%
s
%
s
\n
'
%
(
round
(
now_timestamp
-
pre_timestamp
,
4
),
len
(
data
)))
self
.
log_file_f
.
write
(
data
)
...
...
@@ -460,7 +460,7 @@ def main():
}
tornado_app
=
tornado
.
web
.
Application
(
[
(
r'/monitor'
,
MonitorHandler
),
(
r'/
ws/
monitor'
,
MonitorHandler
),
(
r'/ws/terminal'
,
WebTerminalHandler
),
(
r'/kill'
,
WebTerminalKillHandler
),
(
r'/ws/exec'
,
ExecHandler
),
...
...
static/js/webterminal.js
View file @
fcb3fd71
/**
* Created by liuzheng on 3/3/16.
*/
...
...
@@ -35,13 +36,12 @@ WSSHClient.prototype.connect = function (options) {
};
this
.
_connection
.
onmessage
=
function
(
evt
)
{
try
{
options
.
onData
(
evt
.
data
);
}
catch
(
e
)
{
var
data
=
JSON
.
parse
(
evt
.
data
.
toString
());
if
(
data
.
error
!==
undefined
)
{
options
.
onError
(
data
.
error
);
}
else
{
options
.
onData
(
data
.
data
);
}
};
this
.
_connection
.
onclose
=
function
(
evt
)
{
...
...
templates/jlog/log_online.html
View file @
fcb3fd71
...
...
@@ -136,7 +136,7 @@
var
protocol
=
'ws://'
;
}
var
endpoint
=
protocol
+
document
.
URL
.
match
(
RegExp
(
'//(.*?)/'
))[
1
]
+
'/monitor'
;
var
endpoint
=
protocol
+
document
.
URL
.
match
(
RegExp
(
'//(.*?)/'
))[
1
]
+
'/
ws/
monitor'
;
var
file_path
=
obj
.
attr
(
'file_path'
);
var
socket
=
new
WebSocket
(
endpoint
+
'?file_path='
+
file_path
);
...
...
templates/jlog/static.jinja2
View file @
fcb3fd71
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