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
d9455e3f
Commit
d9455e3f
authored
9 years ago
by
Tad Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix wss issue when using https #37
parent
d9b4f550
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
v1.4.10
v1.4.7
v1.4.4
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
views.py
jumpserver/views.py
+2
-2
exec_cmd.html
templates/exec_cmd.html
+7
-1
web_terminal.html
templates/jlog/web_terminal.html
+6
-1
No files found.
jumpserver/views.py
View file @
d9455e3f
...
...
@@ -344,7 +344,7 @@ def download(request):
def
exec_cmd
(
request
):
role
=
request
.
GET
.
get
(
'role'
)
check_assets
=
request
.
GET
.
get
(
'check_assets'
,
''
)
web_terminal_uri
=
'
ws://
%
s/exec?role=
%
s'
%
(
WEB_SOCKET_HOST
,
role
)
web_terminal_uri
=
'
%
s/exec?role=
%
s'
%
(
WEB_SOCKET_HOST
,
role
)
return
my_render
(
'exec_cmd.html'
,
locals
(),
request
)
...
...
@@ -356,7 +356,7 @@ def web_terminal(request):
if
asset
:
print
asset
hostname
=
asset
.
hostname
web_terminal_uri
=
'
ws://
%
s/terminal?id=
%
s&role=
%
s'
%
(
WEB_SOCKET_HOST
,
asset_id
,
role_name
)
web_terminal_uri
=
'
%
s/terminal?id=
%
s&role=
%
s'
%
(
WEB_SOCKET_HOST
,
asset_id
,
role_name
)
return
render_to_response
(
'jlog/web_terminal.html'
,
locals
())
This diff is collapsed.
Click to expand it.
templates/exec_cmd.html
View file @
d9455e3f
...
...
@@ -23,7 +23,13 @@
<script
type=
"text/javascript"
>
var
wsUri
=
"{{ web_terminal_uri }}"
;
//请求的websocket url
var
protocol
=
"ws://"
;
if
(
window
.
location
.
protocol
==
'https:'
)
{
protocol
=
'wss://'
;
}
var
wsUri
=
protocol
+
"{{ web_terminal_uri }}"
;
//请求的websocket url
var
ws
=
new
WebSocket
(
wsUri
);
function
createSystemMessage
(
message
)
{
...
...
This diff is collapsed.
Click to expand it.
templates/jlog/web_terminal.html
View file @
d9455e3f
...
...
@@ -43,7 +43,12 @@
}
WSSHClient
.
prototype
.
connect
=
function
(
options
)
{
var
endpoint
=
'{{ web_terminal_uri }}'
;
var
protocol
=
"ws://"
;
if
(
window
.
location
.
protocol
==
'https:'
)
{
protocol
=
'wss://'
;
}
var
endpoint
=
protocol
+
'{{ web_terminal_uri }}'
;
if
(
window
.
WebSocket
)
{
this
.
_connection
=
new
WebSocket
(
endpoint
);
...
...
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