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
48ade37f
Commit
48ade37f
authored
Aug 16, 2017
by
serapath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX small terminal issues
parent
0fc681fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
20 deletions
+30
-20
terminal.js
src/app/panels/terminal.js
+30
-20
No files found.
src/app/panels/terminal.js
View file @
48ade37f
...
...
@@ -96,24 +96,24 @@ 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 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 = [{
...
...
@@ -239,8 +239,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 +337,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 +374,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