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
5a563ab7
Commit
5a563ab7
authored
Jan 05, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add jump to exception action
parent
df0dcbd9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
2 deletions
+64
-2
ButtonNavigator.js
src/ui/ButtonNavigator.js
+52
-1
StepManager.js
src/ui/StepManager.js
+12
-1
No files found.
src/ui/ButtonNavigator.js
View file @
5a563ab7
...
...
@@ -4,7 +4,7 @@ var style = require('./styles/basicStyles')
var
ui
=
require
(
'../helpers/ui'
)
var
yo
=
require
(
'yo-yo'
)
function
ButtonNavigator
(
_traceManager
)
{
function
ButtonNavigator
(
_
parent
,
_
traceManager
)
{
this
.
event
=
new
EventManager
()
this
.
intoBackDisabled
=
true
this
.
overBackDisabled
=
true
...
...
@@ -14,6 +14,42 @@ function ButtonNavigator (_traceManager) {
this
.
jumpOutDisabled
=
true
this
.
traceManager
=
_traceManager
this
.
currentCall
=
null
this
.
revertionPoint
=
null
_parent
.
event
.
register
(
'indexChanged'
,
this
,
(
index
)
=>
{
if
(
index
<
0
)
return
if
(
_parent
.
currentStepIndex
!==
index
)
return
this
.
traceManager
.
buildCallsPath
(
index
,
(
error
,
callsPath
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
resetWarning
(
this
)
}
else
{
this
.
currentCall
=
callsPath
[
callsPath
.
length
-
1
]
if
(
this
.
currentCall
.
reverted
)
{
this
.
revertionPoint
=
this
.
currentCall
.
return
this
.
view
.
querySelector
(
'#reverted'
).
style
.
display
=
'block'
this
.
view
.
querySelector
(
'#reverted #outofgas'
).
style
.
display
=
this
.
currentCall
.
outOfGas
?
'block'
:
'none'
this
.
view
.
querySelector
(
'#reverted #parenthasthrown'
).
style
.
display
=
'none'
}
else
{
var
k
=
callsPath
.
length
-
2
while
(
k
>
0
)
{
var
parent
=
callsPath
[
k
]
if
(
parent
.
reverted
)
{
this
.
revertionPoint
=
parent
.
return
this
.
view
.
querySelector
(
'#reverted'
).
style
.
display
=
'block'
this
.
view
.
querySelector
(
'#reverted #parenthasthrown'
).
style
.
display
=
parent
?
'block'
:
'none'
this
.
view
.
querySelector
(
'#reverted #outofgas'
).
style
.
display
=
'none'
return
}
k
--
}
resetWarning
(
this
)
}
}
})
})
this
.
view
}
...
...
@@ -35,6 +71,13 @@ ButtonNavigator.prototype.render = function () {
</button>
<button id='jumpout' title='jump out' class='fa fa-share' style=
${
ui
.
formatCss
(
style
.
button
)}
onclick=
${
function
()
{
self
.
event
.
trigger
(
'jumpOut'
)
}
} disabled=
${
this
.
jumpOutDisabled
}
>
</button>
<div id='reverted' style="display:none">
<span>State changes made during this call were reverted.</span>
<span id='outofgas' style="display:none">This call ran out of gas</span>
<span id='parenthasthrown' style="display:none">The parent call has trown an exception</span>
<button id='jumptoexception' title='jump to exception' class='fa fa-exclamation-triangle' style=
${
ui
.
formatCss
(
style
.
button
)}
onclick=
${
function
()
{
self
.
event
.
trigger
(
'jumpToException'
,
[
self
.
revertionPoint
])
}
} disabled=
${
this
.
jumpOutDisabled
}
>
</button>
</div>
</div>`
if
(
!
this
.
view
)
{
this
.
view
=
view
...
...
@@ -49,6 +92,7 @@ ButtonNavigator.prototype.reset = function () {
this
.
overForwardDisabled
=
true
this
.
nextCallDisabled
=
true
this
.
jumpOutDisabled
=
true
resetWarning
(
this
)
}
ButtonNavigator
.
prototype
.
stepChanged
=
function
(
step
)
{
...
...
@@ -84,6 +128,7 @@ ButtonNavigator.prototype.updateAll = function () {
this
.
updateDisabled
(
'intoforward'
,
this
.
intoForwardDisabled
)
this
.
updateDisabled
(
'nextcall'
,
this
.
nextCallDisabled
)
this
.
updateDisabled
(
'jumpout'
,
this
.
jumpOutDisabled
)
this
.
updateDisabled
(
'jumptoexception'
,
this
.
jumpOutDisabled
)
}
ButtonNavigator
.
prototype
.
updateDisabled
=
function
(
id
,
disabled
)
{
...
...
@@ -94,4 +139,10 @@ ButtonNavigator.prototype.updateDisabled = function (id, disabled) {
}
}
function
resetWarning
(
self
)
{
self
.
view
.
querySelector
(
'#reverted #outofgas'
).
style
.
display
=
'none'
self
.
view
.
querySelector
(
'#reverted #parenthasthrown'
).
style
.
display
=
'none'
self
.
view
.
querySelector
(
'#reverted'
).
style
.
display
=
'none'
}
module
.
exports
=
ButtonNavigator
src/ui/StepManager.js
View file @
5a563ab7
...
...
@@ -26,7 +26,7 @@ function StepManager (_parent, _traceManager) {
self
.
sliderMoved
(
step
)
})
this
.
buttonNavigator
=
new
ButtonNavigator
(
this
.
traceManager
)
this
.
buttonNavigator
=
new
ButtonNavigator
(
_parent
,
this
.
traceManager
)
this
.
buttonNavigator
.
event
.
register
(
'stepIntoBack'
,
this
,
function
()
{
self
.
stepIntoBack
()
})
...
...
@@ -45,6 +45,9 @@ function StepManager (_parent, _traceManager) {
this
.
buttonNavigator
.
event
.
register
(
'jumpOut'
,
this
,
function
()
{
self
.
jumpOut
()
})
this
.
buttonNavigator
.
event
.
register
(
'jumpToException'
,
this
,
function
(
exceptionIndex
)
{
self
.
jumpTo
(
exceptionIndex
)
})
}
StepManager
.
prototype
.
render
=
function
()
{
...
...
@@ -71,6 +74,14 @@ StepManager.prototype.newTraceAvailable = function () {
this
.
init
()
}
StepManager
.
prototype
.
jumpTo
=
function
(
step
)
{
if
(
!
this
.
traceManager
.
inRange
(
step
))
{
return
}
this
.
slider
.
setValue
(
step
)
this
.
changeState
(
step
)
}
StepManager
.
prototype
.
sliderMoved
=
function
(
step
)
{
if
(
!
this
.
traceManager
.
inRange
(
step
))
{
return
...
...
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