Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
haoqu.ma
/
gotty
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ba1aa690
authored
Aug 23, 2017
by
Iwasaki Yudai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use libapps utf8 decoder
1 parent
248f51b2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
js/dist/gotty-bundle.js
js/src/webtty.ts
js/typings/libapps/index.d.ts
server/asset.go
js/dist/gotty-bundle.js
View file @
ba1aa69
This diff could not be displayed because it is too large.
js/src/webtty.ts
View file @
ba1aa69
import
{
lib
}
from
"libapps"
export
const
protocols
=
[
"webtty"
];
export
const
protocols
=
[
"webtty"
];
export
const
msgInputUnknown
=
'0'
;
export
const
msgInputUnknown
=
'0'
;
...
@@ -62,6 +64,8 @@ export class WebTTY {
...
@@ -62,6 +64,8 @@ export class WebTTY {
let
pingTimer
:
number
;
let
pingTimer
:
number
;
let
reconnectTimeout
:
number
;
let
reconnectTimeout
:
number
;
const
decoder
=
new
lib
.
UTF8Decoder
()
const
setup
=
()
=>
{
const
setup
=
()
=>
{
connection
.
onOpen
(()
=>
{
connection
.
onOpen
(()
=>
{
const
termInfo
=
this
.
term
.
info
();
const
termInfo
=
this
.
term
.
info
();
...
@@ -104,11 +108,7 @@ export class WebTTY {
...
@@ -104,11 +108,7 @@ export class WebTTY {
const
payload
=
data
.
slice
(
1
);
const
payload
=
data
.
slice
(
1
);
switch
(
data
[
0
])
{
switch
(
data
[
0
])
{
case
msgOutput
:
case
msgOutput
:
this
.
term
.
output
(
this
.
term
.
output
(
decoder
.
decode
(
atob
(
payload
)));
decodeURIComponent
(
Array
.
prototype
.
map
.
call
(
atob
(
payload
),
function
(
c
)
{
return
'%'
+
(
'00'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
);
}).
join
(
''
))
);
break
;
break
;
case
msgPong
:
case
msgPong
:
break
;
break
;
...
...
js/typings/libapps/index.d.ts
View file @
ba1aa69
...
@@ -44,4 +44,8 @@ export declare namespace lib {
...
@@ -44,4 +44,8 @@ export declare namespace lib {
export
var
Storage
:
{
export
var
Storage
:
{
Memory
:
Memory
Memory
:
Memory
}
}
export
class
UTF8Decoder
{
decode
(
str
:
string
)
}
}
}
server/asset.go
View file @
ba1aa69
This diff could not be displayed because it is too large.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment