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
665491a0
Commit
665491a0
authored
May 20, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep only "tx hash" input
parent
90a27495
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
TxBrowser.js
src/app/debugger/debuggerUI/TxBrowser.js
+12
-18
No files found.
src/app/debugger/debuggerUI/TxBrowser.js
View file @
665491a0
...
...
@@ -40,31 +40,28 @@ var css = csjs`
function
TxBrowser
()
{
this
.
event
=
new
EventManager
()
this
.
blockNumber
this
.
txNumber
this
.
state
=
{
txNumber
:
undefined
,
debugging
:
false
}
this
.
view
this
.
debugging
=
false
}
TxBrowser
.
prototype
.
submit
=
function
()
{
if
(
this
.
debugging
)
{
if
(
this
.
state
.
debugging
)
{
this
.
unload
()
}
else
{
this
.
event
.
trigger
(
'requestDebug'
,
[
this
.
blockNumber
,
this
.
txNumber
])
this
.
event
.
trigger
(
'requestDebug'
,
[
undefined
,
this
.
state
.
txNumber
])
}
yo
.
update
(
this
.
view
,
this
.
render
())
}
TxBrowser
.
prototype
.
updateBlockN
=
function
(
ev
)
{
this
.
blockNumber
=
ev
.
target
.
value
}
TxBrowser
.
prototype
.
updateTxN
=
function
(
ev
)
{
this
.
txNumber
=
ev
.
target
.
value
this
.
state
.
txNumber
=
ev
.
target
.
value
}
TxBrowser
.
prototype
.
load
=
function
(
txHash
,
tx
)
{
this
.
txNumber
=
txHash
this
.
state
.
txNumber
=
txHash
}
TxBrowser
.
prototype
.
unload
=
function
()
{
...
...
@@ -72,9 +69,7 @@ TxBrowser.prototype.unload = function () {
}
TxBrowser
.
prototype
.
setState
=
function
(
state
)
{
if
(
state
.
debugging
!==
undefined
)
this
.
debugging
=
state
.
debugging
if
(
state
.
blockNumber
!==
undefined
)
this
.
blockNumber
=
state
.
blockNumber
if
(
state
.
txNumber
!==
undefined
)
this
.
txNumber
=
state
.
txNumber
this
.
state
=
{...
this
.
state
,
...
state
}
if
(
this
.
view
)
{
yo
.
update
(
this
.
view
,
this
.
render
())
}
...
...
@@ -85,16 +80,15 @@ TxBrowser.prototype.render = function () {
var
view
=
yo
`<div class="
${
css
.
container
}
">
<div class="
${
css
.
txContainer
}
">
<div class="
${
css
.
txinputs
}
p-1 input-group">
<input value="
${
this
.
blockNumber
||
''
}
" class="form-control
${
css
.
txinput
}
" onkeyup=
${
function
()
{
self
.
updateBlockN
(
arguments
[
0
])
}
} type='text' placeholder=
${
'Block number'
}
/>
<input value="
${
this
.
txNumber
||
''
}
" class="form-control
${
css
.
txinput
}
" id='txinput' onkeyup=
${
function
()
{
self
.
updateTxN
(
arguments
[
0
])
}
} type='text' placeholder=
${
'Transaction index or hash'
}
/>
<input value="
${
this
.
state
.
txNumber
||
''
}
" class="form-control
${
css
.
txinput
}
" id='txinput' onkeyup=
${
function
()
{
self
.
updateTxN
(
arguments
[
0
])
}
} type='text' placeholder=
${
'Transaction hash'
}
/>
</div>
<div class="
${
css
.
txbuttons
}
btn-group p-1">
<button class='btn btn-primary btn-sm
${
css
.
txbutton
}
' id='load' title='
${
this
.
debugging
?
'Stop'
:
'Start'
}
debugging' onclick=
${
function
()
{
self
.
submit
()
}
}>
${
this
.
debugging
?
'Stop'
:
'Start'
}
debugging</button>
<button class='btn btn-primary btn-sm
${
css
.
txbutton
}
' id='load' title='
${
this
.
state
.
debugging
?
'Stop'
:
'Start'
}
debugging' onclick=
${
function
()
{
self
.
submit
()
}
}>
${
this
.
state
.
debugging
?
'Stop'
:
'Start'
}
debugging</button>
</div>
</div>
<span id='error'></span>
</div>`
if
(
this
.
debugging
)
{
if
(
this
.
state
.
debugging
)
{
view
.
querySelectorAll
(
'input'
).
forEach
(
element
=>
{
element
.
setAttribute
(
'disabled'
,
''
)
})
}
if
(
!
this
.
view
)
{
...
...
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