Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aaPanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Kulya
aaPanel
Commits
2ab75d9f
Commit
2ab75d9f
authored
Jul 13, 2019
by
jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix webshell can't log in
parent
b10f6e3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
15 deletions
+24
-15
public.js
BTPanel/static/js/public.js
+24
-15
No files found.
BTPanel/static/js/public.js
View file @
2ab75d9f
...
...
@@ -1622,19 +1622,23 @@ function scroll_handle(e){
var
scrollTop
=
this
.
scrollTop
;
$
(
this
).
find
(
"
thead
"
).
css
({
"
transform
"
:
"
translateY(
"
+
scrollTop
+
"
px)
"
,
"
position
"
:
"
relative
"
,
"
z-index
"
:
"
1
"
});
}
var
clipboard
,
interval
,
socket
,
gterm
,
ssh_login
;
var
clipboard
,
interval
,
socket
,
gterm
,
ssh_login
;
var
pdata_socket
=
{
x_http_token
:
document
.
getElementById
(
"
request_token_head
"
).
getAttribute
(
'
token
'
)
}
function
ssh_login_def
()
{
var
pdata
=
{
ssh_user
:
$
(
"
input[name='ssh_user']
"
).
val
(),
ssh_passwd
:
$
(
"
input[name='ssh_passwd']
"
).
val
()
}
if
(
!
pdata
.
ssh_user
||
!
pdata
.
ssh_passwd
)
{
pdata_socket
[
'
data
'
]
=
{};
pdata_socket
[
'
data
'
][
'
ssh_user
'
]
=
$
(
"
input[name='ssh_user']
"
).
val
();
pdata_socket
[
'
data
'
][
'
ssh_passwd
'
]
=
$
(
"
input[name='ssh_passwd']
"
).
val
();
if
(
!
pdata_socket
.
ssh_user
||
!
pdata_socket
.
ssh_passwd
)
{
layer
.
msg
(
'
The SSH username and password cannot be empty!
'
);
return
;
}
layer
.
close
(
ssh_login
);
socket
.
emit
(
'
webssh
'
,
pdata
);
socket
.
emit
(
'
webssh
'
,
pdata
_socket
);
gterm
.
focus
();
}
...
...
@@ -1697,7 +1701,8 @@ function web_shell() {
}
term
.
on
(
'
data
'
,
function
(
data
)
{
socket
.
emit
(
'
webssh
'
,
data
);
pdata_socket
[
'
data
'
]
=
data
;
socket
.
emit
(
'
webssh
'
,
pdata_socket
);
});
...
...
@@ -1729,8 +1734,10 @@ function web_shell() {
setTimeout
(
function
()
{
$
(
'
.terminal
'
).
detach
().
appendTo
(
'
#term
'
);
$
(
"
#term
"
).
show
();
socket
.
emit
(
'
webssh
'
,
"
\
u0015
"
);
socket
.
emit
(
'
webssh
'
,
"
\n
"
);
pdata_socket
[
'
data
'
]
=
"
\
u0015
"
socket
.
emit
(
'
webssh
'
,
pdata_socket
);
pdata_socket
[
'
data
'
]
=
"
\n
"
socket
.
emit
(
'
webssh
'
,
pdata_socket
);
term
.
focus
();
// 鼠标右键事件
...
...
@@ -1821,7 +1828,8 @@ function web_shell() {
if
(
$
(
this
).
text
().
indexOf
(
'
Alt
'
)
!=
-
1
)
{
ptext
+=
"
\n
"
;
}
socket
.
emit
(
'
webssh
'
,
ptext
);
pdata_socket
[
'
data
'
]
=
ptext
;
socket
.
emit
(
'
webssh
'
,
pdata_socket
);
term
.
focus
();
})
$
(
"
textarea[name='ssh_copy']
"
).
keydown
(
function
(
e
)
{
...
...
@@ -1857,8 +1865,9 @@ function shell_to_baidu() {
}
function
shell_paste_text
(){
socket
.
emit
(
'
webssh
'
,
getCookie
(
'
ssh_selection
'
));
function
shell_paste_text
()
{
pdata_socket
[
'
data
'
]
=
getCookie
(
'
ssh_selection
'
)
socket
.
emit
(
'
webssh
'
,
pdata_socket
);
remove_ssh_menu
();
gterm
.
focus
();
}
...
...
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