Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
2296a951
Commit
2296a951
authored
Aug 16, 2017
by
yann300
Committed by
GitHub
Aug 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #694 from serapath-contribution/master
FIX small terminal issues
parents
0fc681fc
6dda7c10
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
36 deletions
+12
-36
terminal.js
src/app/panels/terminal.js
+12
-36
No files found.
src/app/panels/terminal.js
View file @
2296a951
...
...
@@ -96,41 +96,7 @@ var css = csjs`
}
`
var
currentError
window
.
addEventListener
(
'error'
,
function
(
event
)
{
currentError
=
new
Error
(
event
.
message
)
currentError
.
timeStamp
=
event
.
timeStamp
currentError
.
isTrusted
=
event
.
isTrusted
currentError
.
filename
=
event
.
filename
currentError
.
lineno
=
event
.
lineno
currentError
.
colno
=
event
.
colno
currentError
.
error
=
event
.
error
currentError
.
type
=
event
.
type
})
window
.
onerror
=
function
(
msg
,
url
,
lineno
,
col
,
error
)
{
if
(
!
error
)
error
=
currentError
var
val
=
{
msg
:
msg
,
url
:
url
,
lineno
:
lineno
,
col
:
col
,
error
:
error
}
console
.
error
(
val
)
}
var
KONSOLES
=
[]
// var KONSOLES = [{
// error: console.error.bind(console),
// info: console.info.bind(console),
// log: console.log.bind(console)
// }]
// console.error = broadcast('error')
// console.info = broadcast('info')
// console.log = broadcast('log')
//
// function broadcast (mode) {
// return function broadcastMode () {
// var args = arguments
// KONSOLES.forEach(function (api) { api[mode].apply(api, args) })
// }
// }
function
register
(
api
)
{
KONSOLES
.
push
(
api
)
}
...
...
@@ -239,8 +205,7 @@ class Terminal {
delete
self
.
scroll2bottom
// @TODO: delete new message indicator
}
else
{
// self.scroll2bottom = function () { }
// @TODO: the reattach is not working
self
.
scroll2bottom
=
function
()
{
}
// @TODO: while in stopped mode: show indicator about new lines getting logged
}
}
...
...
@@ -338,6 +303,7 @@ class Terminal {
var
args
=
[].
slice
.
call
(
arguments
)
var
types
=
args
.
map
(
type
)
var
values
=
javascriptserialize
.
apply
(
null
,
args
).
map
(
function
(
val
,
idx
)
{
if
(
typeof
args
[
idx
]
===
'string'
)
val
=
args
[
idx
]
if
(
types
[
idx
]
===
'element'
)
val
=
jsbeautify
.
html
(
val
)
var
pattern
=
'.{1,'
+
self
.
data
.
lineLength
+
'}'
var
lines
=
val
.
match
(
new
RegExp
(
pattern
,
'g'
))
...
...
@@ -374,6 +340,16 @@ class Terminal {
})
})
}
info
()
{
var
self
=
this
var
args
=
[...
arguments
].
map
(
x
=>
({
type
:
'info'
,
value
:
x
}))
self
.
log
.
apply
(
self
,
args
)
}
error
()
{
var
self
=
this
var
args
=
[...
arguments
].
map
(
x
=>
({
type
:
'error'
,
value
:
x
}))
self
.
log
.
apply
(
self
,
args
)
}
scroll2bottom
()
{
var
self
=
this
setTimeout
(
function
()
{
...
...
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