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
f140caa4
Commit
f140caa4
authored
Feb 01, 2018
by
ninabreznik
Committed by
yann300
Apr 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style terminal logs
parent
8d706105
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
42 deletions
+60
-42
txLogger.js
src/app/execution/txLogger.js
+60
-42
No files found.
src/app/execution/txLogger.js
View file @
f140caa4
...
@@ -17,13 +17,10 @@ var typeConversion = remixLib.execution.typeConversion
...
@@ -17,13 +17,10 @@ var typeConversion = remixLib.execution.typeConversion
var
css
=
csjs
`
var
css
=
csjs
`
.log {
.log {
display: flex;
display: flex;
align-items: end;
justify-content: space-between;
}
}
.caret {
.caret {
color:
${
styles
.
terminal
.
icon_Color
}
;
color:
${
styles
.
terminal
.
icon_Color
}
;
font-weight: bold;
font-size: 15px;
font-size: small;
cursor: pointer;
cursor: pointer;
float: left;
float: left;
}
}
...
@@ -50,8 +47,17 @@ var css = csjs`
...
@@ -50,8 +47,17 @@ var css = csjs`
.txTable, .tr, .td {
.txTable, .tr, .td {
border-collapse: collapse;
border-collapse: collapse;
font-size: 10px;
font-size: 10px;
color:
${
styles
.
terminal
.
text_Primary
}
;
}
border: 1px solid
${
styles
.
terminal
.
text_Secondary
}
;
.tr {
width: 70%;
border-bottom: 1px solid white;
display: flex;
justify-content: space-between;
}
.td:first-child {
min-width: 130px;
display: flex;
align-items: baseline;
}
}
#txTable {
#txTable {
margin-top: 1%;
margin-top: 1%;
...
@@ -68,14 +74,19 @@ var css = csjs`
...
@@ -68,14 +74,19 @@ var css = csjs`
.buttons {
.buttons {
display: flex;
display: flex;
}
}
.debug, .details {
.debug {
${
styles
.
terminal
.
button_Log_Debug
}
color:
${
styles
.
terminal
.
text_Title_TransactionLog
}
;
font-weight: bold;
cursor: pointer;
text-weight: bold;
margin-left: 5px;
margin-left: 5px;
width: 55px;
width: 55px;
min-width: 55px;
min-width: 55px;
min-height: 20px;
min-height: 20px;
max-height: 20px;
max-height: 20px;
font-size: 11px;
}
.debug:hover {
text-decoration: underline;
}
}
`
`
/**
/**
...
@@ -174,10 +185,10 @@ function renderKnownTransaction (self, data) {
...
@@ -174,10 +185,10 @@ function renderKnownTransaction (self, data) {
var
tx
=
yo
`
var
tx
=
yo
`
<span id="tx
${
data
.
tx
.
hash
}
">
<span id="tx
${
data
.
tx
.
hash
}
">
<div class="
${
css
.
log
}
">
<div class="
${
css
.
log
}
">
<i class="
${
css
.
caret
}
fa fa-caret-right" onclick=
${
txDetails
}
></i>
${
context
(
self
,
{
from
,
to
,
data
})}
${
context
(
self
,
{
from
,
to
,
data
})}
<div class=
${
css
.
buttons
}
>
<div class=
${
css
.
buttons
}
>
<button class=
${
css
.
details
}
onclick=
${
txDetails
}
>Details</button>
<div class=
${
css
.
debug
}
onclick=
${
debug
}
>[debug]</div>
<button class=
${
css
.
debug
}
onclick=
${
debug
}
>Debug</button>
</div>
</div>
</div>
</div>
</span>
</span>
...
@@ -224,8 +235,8 @@ function renderCall (self, data) {
...
@@ -224,8 +235,8 @@ function renderCall (self, data) {
var
input
=
data
.
tx
.
input
?
helper
.
shortenHexData
(
data
.
tx
.
input
)
:
''
var
input
=
data
.
tx
.
input
?
helper
.
shortenHexData
(
data
.
tx
.
input
)
:
''
var
tx
=
yo
`
var
tx
=
yo
`
<span id="tx
${
data
.
tx
.
hash
}
">
<span id="tx
${
data
.
tx
.
hash
}
">
<i class="
${
css
.
caret
}
fa fa-caret-right"></i>
<div class="
${
css
.
log
}
">
<div class="
${
css
.
log
}
">
<i class="
${
css
.
caret
}
fa fa-caret-right" onclick=
${
txDetails
}
></i>
<span class=
${
css
.
txLog
}
>
<span class=
${
css
.
txLog
}
>
<span class=
${
css
.
tx
}
>[call]</span>
<span class=
${
css
.
tx
}
>[call]</span>
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>from:</span>
${
from
}
</div>
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>from:</span>
${
from
}
</div>
...
@@ -234,8 +245,7 @@ function renderCall (self, data) {
...
@@ -234,8 +245,7 @@ function renderCall (self, data) {
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>return:</span>
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>return:</span>
</span>
</span>
<div class=
${
css
.
buttons
}
>
<div class=
${
css
.
buttons
}
>
<button class=
${
css
.
details
}
onclick=
${
txDetails
}
>Details</button>
<div class=
${
css
.
debug
}
onclick=
${
debug
}
>[debug]</div>
<button class=
${
css
.
debug
}
onclick=
${
debug
}
>Debug</button>
</div>
</div>
</div>
</div>
<div>
${
JSON
.
stringify
(
typeConversion
.
stringify
(
data
.
resolvedData
.
decodedReturnValue
),
null
,
'
\
t'
)}
</div>
<div>
${
JSON
.
stringify
(
typeConversion
.
stringify
(
data
.
resolvedData
.
decodedReturnValue
),
null
,
'
\
t'
)}
</div>
...
@@ -276,12 +286,11 @@ function renderUnknownTransaction (self, data) {
...
@@ -276,12 +286,11 @@ function renderUnknownTransaction (self, data) {
}
}
var
tx
=
yo
`
var
tx
=
yo
`
<span id="tx
${
data
.
tx
.
hash
}
">
<span id="tx
${
data
.
tx
.
hash
}
">
<i class="
${
css
.
caret
}
fa fa-caret-right"></i>
<i class="
${
css
.
caret
}
fa fa-caret-right"
onclick=
${
txDetails
}
></i>
<div class="
${
css
.
log
}
">
<div class="
${
css
.
log
}
">
${
context
(
self
,
{
from
,
to
,
data
})}
${
context
(
self
,
{
from
,
to
,
data
})}
<div class=
${
css
.
buttons
}
>
<div class=
${
css
.
buttons
}
>
<button class=
${
css
.
details
}
onclick=
${
txDetails
}
>Details</button>
<div class=
${
css
.
debug
}
onclick=
${
debug
}
>[debug]</div>
<button class=
${
css
.
debug
}
onclick=
${
debug
}
>Debug</button>
</div>
</div>
</div>
</div>
</span>
</span>
...
@@ -332,7 +341,6 @@ function context (self, opts) {
...
@@ -332,7 +341,6 @@ function context (self, opts) {
if
(
executionContext
.
getProvider
()
===
'vm'
)
{
if
(
executionContext
.
getProvider
()
===
'vm'
)
{
return
yo
`
return
yo
`
<div>
<div>
<i class="
${
css
.
caret
}
fa fa-caret-right"></i>
<span class=
${
css
.
txLog
}
>
<span class=
${
css
.
txLog
}
>
<span class=
${
css
.
tx
}
>[vm]</span>
<span class=
${
css
.
tx
}
>[vm]</span>
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>from:</span>
${
from
}
</div>
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>from:</span>
${
from
}
</div>
...
@@ -346,7 +354,6 @@ function context (self, opts) {
...
@@ -346,7 +354,6 @@ function context (self, opts) {
}
else
if
(
executionContext
.
getProvider
()
!==
'vm'
&&
data
.
resolvedData
)
{
}
else
if
(
executionContext
.
getProvider
()
!==
'vm'
&&
data
.
resolvedData
)
{
return
yo
`
return
yo
`
<div>
<div>
<i class="
${
css
.
caret
}
fa fa-caret-right"></i>
<span class=
${
css
.
txLog
}
>
<span class=
${
css
.
txLog
}
>
<span class='
${
css
.
tx
}
'>[block:
${
block
}
txIndex:
${
i
}
]</span>
<span class='
${
css
.
tx
}
'>[block:
${
block
}
txIndex:
${
i
}
]</span>
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>from:</span>
${
from
}
</div>
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>from:</span>
${
from
}
</div>
...
@@ -396,20 +403,22 @@ function createTable (opts) {
...
@@ -396,20 +403,22 @@ function createTable (opts) {
var
contractAddress
=
yo
`
var
contractAddress
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> contractAddress </td>
<td class="
${
css
.
td
}
"> contractAddress
<td class="
${
css
.
td
}
">
${
opts
.
contractAddress
}
${
copyToClipboard
(()
=>
opts
.
contractAddress
)}
${
copyToClipboard
(()
=>
opts
.
contractAddress
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
opts
.
contractAddress
}
</td>
</tr>
</tr>
`
`
if
(
opts
.
contractAddress
)
table
.
appendChild
(
contractAddress
)
if
(
opts
.
contractAddress
)
table
.
appendChild
(
contractAddress
)
var
from
=
yo
`
var
from
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
${
css
.
tableTitle
}
"> from </td>
<td class="
${
css
.
td
}
${
css
.
tableTitle
}
"> from
<td class="
${
css
.
td
}
">
${
opts
.
from
}
${
copyToClipboard
(()
=>
opts
.
from
)}
${
copyToClipboard
(()
=>
opts
.
from
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
opts
.
from
}
</td>
</tr>
</tr>
`
`
if
(
opts
.
from
)
table
.
appendChild
(
from
)
if
(
opts
.
from
)
table
.
appendChild
(
from
)
...
@@ -423,20 +432,22 @@ function createTable (opts) {
...
@@ -423,20 +432,22 @@ function createTable (opts) {
}
}
var
to
=
yo
`
var
to
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> to </td>
<td class="
${
css
.
td
}
"> to
<td class="
${
css
.
td
}
">
${
toHash
}
${
copyToClipboard
(()
=>
data
.
to
?
data
.
to
:
toHash
)}
${
copyToClipboard
(()
=>
data
.
to
?
data
.
to
:
toHash
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
toHash
}
</td>
</tr>
</tr>
`
`
if
(
opts
.
to
)
table
.
appendChild
(
to
)
if
(
opts
.
to
)
table
.
appendChild
(
to
)
var
gas
=
yo
`
var
gas
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> gas </td>
<td class="
${
css
.
td
}
"> gas
<td class="
${
css
.
td
}
">
${
opts
.
gas
}
gas
${
copyToClipboard
(()
=>
opts
.
gas
)}
${
copyToClipboard
(()
=>
opts
.
gas
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
opts
.
gas
}
gas
</td>
</tr>
</tr>
`
`
if
(
opts
.
gas
)
table
.
appendChild
(
gas
)
if
(
opts
.
gas
)
table
.
appendChild
(
gas
)
...
@@ -448,39 +459,43 @@ function createTable (opts) {
...
@@ -448,39 +459,43 @@ function createTable (opts) {
if
(
opts
.
transactionCost
)
{
if
(
opts
.
transactionCost
)
{
table
.
appendChild
(
yo
`
table
.
appendChild
(
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> transaction cost </td>
<td class="
${
css
.
td
}
"> transaction cost
<td class="
${
css
.
td
}
">
${
opts
.
transactionCost
}
gas
${
callWarning
}
${
copyToClipboard
(()
=>
opts
.
transactionCost
)}
${
copyToClipboard
(()
=>
opts
.
transactionCost
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
opts
.
transactionCost
}
gas
${
callWarning
}
</td>
</tr>`
)
</tr>`
)
}
}
if
(
opts
.
executionCost
)
{
if
(
opts
.
executionCost
)
{
table
.
appendChild
(
yo
`
table
.
appendChild
(
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> execution cost </td>
<td class="
${
css
.
td
}
"> execution cost
<td class="
${
css
.
td
}
">
${
opts
.
executionCost
}
gas
${
callWarning
}
${
copyToClipboard
(()
=>
opts
.
executionCost
)}
${
copyToClipboard
(()
=>
opts
.
executionCost
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
opts
.
executionCost
}
gas
${
callWarning
}
</td>
</tr>`
)
</tr>`
)
}
}
var
hash
=
yo
`
var
hash
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> hash </td>
<td class="
${
css
.
td
}
"> hash
<td class="
${
css
.
td
}
">
${
opts
.
hash
}
${
copyToClipboard
(()
=>
opts
.
hash
)}
${
copyToClipboard
(()
=>
opts
.
hash
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
opts
.
hash
}
</td>
</tr>
</tr>
`
`
if
(
opts
.
hash
)
table
.
appendChild
(
hash
)
if
(
opts
.
hash
)
table
.
appendChild
(
hash
)
var
input
=
yo
`
var
input
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> input </td>
<td class="
${
css
.
td
}
"> input
<td class="
${
css
.
td
}
">
${
opts
.
input
}
${
copyToClipboard
(()
=>
opts
.
input
)}
${
copyToClipboard
(()
=>
opts
.
input
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
opts
.
input
}
</td>
</tr>
</tr>
`
`
if
(
opts
.
input
)
table
.
appendChild
(
input
)
if
(
opts
.
input
)
table
.
appendChild
(
input
)
...
@@ -488,10 +503,11 @@ function createTable (opts) {
...
@@ -488,10 +503,11 @@ function createTable (opts) {
if
(
opts
[
'decoded input'
])
{
if
(
opts
[
'decoded input'
])
{
var
inputDecoded
=
yo
`
var
inputDecoded
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> decoded input </td>
<td class="
${
css
.
td
}
"> decoded input
<td class="
${
css
.
td
}
">
${
opts
[
'decoded input'
]}
${
copyToClipboard
(
opts
[
'decoded input'
])}
${
copyToClipboard
(
opts
[
'decoded input'
])}
</td>
</td>
<td class="
${
css
.
td
}
">
${
opts
[
'decoded input'
]}
</td>
</tr>`
</tr>`
table
.
appendChild
(
inputDecoded
)
table
.
appendChild
(
inputDecoded
)
}
}
...
@@ -511,12 +527,13 @@ function createTable (opts) {
...
@@ -511,12 +527,13 @@ function createTable (opts) {
}
}
var
logs
=
yo
`
var
logs
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> logs </td>
<td class="
${
css
.
td
}
"> logs
<td class="
${
css
.
td
}
" id="logs">
${
JSON
.
stringify
(
stringified
,
null
,
'
\
t'
)}
${
copyToClipboard
(()
=>
JSON
.
stringify
(
stringified
,
null
,
'
\
t'
))}
${
copyToClipboard
(()
=>
JSON
.
stringify
(
stringified
,
null
,
'
\
t'
))}
${
copyToClipboard
(()
=>
JSON
.
stringify
(
opts
.
logs
.
raw
||
'0'
))}
${
copyToClipboard
(()
=>
JSON
.
stringify
(
opts
.
logs
.
raw
||
'0'
))}
</td>
</td>
<td class="
${
css
.
td
}
" id="logs">
${
JSON
.
stringify
(
stringified
,
null
,
'
\
t'
)}
</td>
</tr>
</tr>
`
`
if
(
opts
.
logs
)
table
.
appendChild
(
logs
)
if
(
opts
.
logs
)
table
.
appendChild
(
logs
)
...
@@ -524,10 +541,11 @@ function createTable (opts) {
...
@@ -524,10 +541,11 @@ function createTable (opts) {
var
val
=
opts
.
val
!=
null
?
typeConversion
.
toInt
(
opts
.
val
)
:
0
var
val
=
opts
.
val
!=
null
?
typeConversion
.
toInt
(
opts
.
val
)
:
0
val
=
yo
`
val
=
yo
`
<tr class="
${
css
.
tr
}
">
<tr class="
${
css
.
tr
}
">
<td class="
${
css
.
td
}
"> value </td>
<td class="
${
css
.
td
}
"> value
<td class="
${
css
.
td
}
">
${
val
}
wei
${
copyToClipboard
(()
=>
`
${
val
}
wei`
)}
${
copyToClipboard
(()
=>
`
${
val
}
wei`
)}
</td>
</td>
<td class="
${
css
.
td
}
">
${
val
}
wei
</td>
</tr>
</tr>
`
`
if
(
opts
.
val
)
table
.
appendChild
(
val
)
if
(
opts
.
val
)
table
.
appendChild
(
val
)
...
...
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