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
6d5cfc50
Commit
6d5cfc50
authored
Jun 17, 2021
by
yann300
Committed by
joseph izang
Aug 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use hexHighlight
parent
676837b3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
12 deletions
+15
-12
dropdown-panel.tsx
...mix-ui/debugger-ui/src/lib/vm-debugger/dropdown-panel.tsx
+9
-7
memory-panel.tsx
...remix-ui/debugger-ui/src/lib/vm-debugger/memory-panel.tsx
+1
-1
stack-panel.tsx
.../remix-ui/debugger-ui/src/lib/vm-debugger/stack-panel.tsx
+1
-1
step-detail.tsx
.../remix-ui/debugger-ui/src/lib/vm-debugger/step-detail.tsx
+1
-1
index.ts
libs/remix-ui/debugger-ui/src/types/index.ts
+3
-2
No files found.
libs/remix-ui/debugger-ui/src/lib/vm-debugger/dropdown-panel.tsx
View file @
6d5cfc50
...
@@ -7,7 +7,7 @@ import './styles/dropdown-panel.css'
...
@@ -7,7 +7,7 @@ import './styles/dropdown-panel.css'
export
const
DropdownPanel
=
(
props
:
DropdownPanelProps
)
=>
{
export
const
DropdownPanel
=
(
props
:
DropdownPanelProps
)
=>
{
const
[
calldataObj
,
dispatch
]
=
useReducer
(
reducer
,
initialState
)
const
[
calldataObj
,
dispatch
]
=
useReducer
(
reducer
,
initialState
)
const
{
dropdownName
,
dropdownMessage
,
calldata
,
header
,
loading
,
extractFunc
,
formatSelfFunc
,
registerEvent
,
triggerEvent
,
loadMoreEvent
,
loadMoreCompletedEvent
,
headStyle
,
bodyStyle
}
=
props
const
{
dropdownName
,
dropdownMessage
,
calldata
,
header
,
loading
,
extractFunc
,
formatSelfFunc
,
registerEvent
,
triggerEvent
,
loadMoreEvent
,
loadMoreCompletedEvent
,
headStyle
,
bodyStyle
,
hexHighlight
}
=
props
const
extractDataDefault
:
ExtractFunc
=
(
item
,
parent
?)
=>
{
const
extractDataDefault
:
ExtractFunc
=
(
item
,
parent
?)
=>
{
const
ret
:
ExtractData
=
{}
const
ret
:
ExtractData
=
{}
...
@@ -35,14 +35,16 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
...
@@ -35,14 +35,16 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
}
}
const
formatSelfDefault
=
(
key
:
string
|
number
,
data
:
ExtractData
)
=>
{
const
formatSelfDefault
=
(
key
:
string
|
number
,
data
:
ExtractData
)
=>
{
let
value
let
value
if
(
typeof
(
data
.
self
)
===
'string'
)
{
if
(
hexHighlight
&&
typeof
(
data
.
self
)
===
'string'
)
{
const
isHex
=
data
.
self
.
startsWith
(
'0x'
)
||
hexHighlight
if
(
isHex
)
{
let
regex
=
/^
(
0+
)(
.*
)
/g
let
regex
=
/^
(
0+
)(
.*
)
/g
let
split
=
regex
.
exec
(
data
.
self
.
replace
(
'0x'
,
''
))
let
split
=
regex
.
exec
(
data
.
self
.
replace
(
'0x'
,
''
))
if
(
split
&&
split
[
1
]
&&
split
[
2
])
{
if
(
split
&&
split
[
1
])
{
split
[
1
]
=
data
.
self
.
indexOf
(
'0x'
)
===
0
?
'0x'
+
split
[
1
]
:
split
[
1
]
value
=
(<
span
><
span
className=
"m-0 label_value"
>
0x
</
span
><
span
className=
"m-0 label_value"
>
{
split
[
1
]
}
</
span
>
{
split
[
2
]
&&
<
span
className=
"m-0 label_value font-weight-bold text-dark"
>
{
split
[
2
]
}
</
span
>
}
</
span
>)
value
=
(<
span
><
span
className=
"m-0 label_value"
>
{
split
[
1
]
}
</
span
><
span
className=
"m-0 label_value font-weight-bold text-dark"
>
{
split
[
2
]
}
</
span
></
span
>)
}
else
value
=
(<
span
><
span
className=
"m-0 label_value"
>
0x
</
span
><
span
className=
"m-0 label_value font-weight-bold text-dark"
>
{
data
.
self
.
replace
(
'0x'
,
''
)
}
</
span
></
span
>)
}
}
else
value
=
<
span
className=
"m-0 label_value"
>
{
data
.
self
}
</
span
>
}
else
value
=
data
.
self
}
else
value
=
<
span
className=
"m-0 label_value"
>
{
data
.
self
}
</
span
>
return
(
return
(
<
div
className=
"d-flex mr-1 flex-row label_item"
>
<
div
className=
"d-flex mr-1 flex-row label_item"
>
<
label
className=
"small font-weight-bold mb-0 pr-1 label_key"
>
{
key
}
:
</
label
>
<
label
className=
"small font-weight-bold mb-0 pr-1 label_key"
>
{
key
}
:
</
label
>
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/memory-panel.tsx
View file @
6d5cfc50
...
@@ -3,7 +3,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
...
@@ -3,7 +3,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
export
const
MemoryPanel
=
({
calldata
})
=>
{
export
const
MemoryPanel
=
({
calldata
})
=>
{
return
(
return
(
<
DropdownPanel
bodyStyle=
{
{
fontFamily
:
'monospace'
}
}
dropdownName=
'Memory'
calldata=
{
calldata
||
{}
}
/>
<
DropdownPanel
hexHighlight=
{
true
}
bodyStyle=
{
{
fontFamily
:
'monospace'
}
}
dropdownName=
'Memory'
calldata=
{
calldata
||
{}
}
/>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/stack-panel.tsx
View file @
6d5cfc50
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
export
const
StackPanel
=
({
calldata
})
=>
{
export
const
StackPanel
=
({
calldata
})
=>
{
return
(
return
(
<
div
id=
'stackpanel'
>
<
div
id=
'stackpanel'
>
<
DropdownPanel
bodyStyle=
{
{
fontFamily
:
'monospace'
}
}
dropdownName=
'Stack'
calldata=
{
calldata
||
{}
}
/>
<
DropdownPanel
hexHighlight=
{
true
}
bodyStyle=
{
{
fontFamily
:
'monospace'
}
}
dropdownName=
'Stack'
calldata=
{
calldata
||
{}
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/step-detail.tsx
View file @
6d5cfc50
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
export
const
StepDetail
=
({
stepDetail
})
=>
{
export
const
StepDetail
=
({
stepDetail
})
=>
{
return
(
return
(
<
div
id=
'stepdetail'
data
-
id=
'stepdetail'
>
<
div
id=
'stepdetail'
data
-
id=
'stepdetail'
>
<
DropdownPanel
dropdownName=
'Step details'
calldata=
{
stepDetail
||
{}
}
/>
<
DropdownPanel
hexHighlight=
{
false
}
dropdownName=
'Step details'
calldata=
{
stepDetail
||
{}
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/types/index.ts
View file @
6d5cfc50
...
@@ -28,8 +28,9 @@ export interface DropdownPanelProps {
...
@@ -28,8 +28,9 @@ export interface DropdownPanelProps {
triggerEvent
?:
Function
,
triggerEvent
?:
Function
,
loadMoreEvent
?:
string
,
loadMoreEvent
?:
string
,
loadMoreCompletedEvent
?:
string
,
loadMoreCompletedEvent
?:
string
,
bodyStyle
?:
React
.
CSSProperties
bodyStyle
?:
React
.
CSSProperties
,
headStyle
?:
React
.
CSSProperties
headStyle
?:
React
.
CSSProperties
,
hexHighlight
?:
boolean
// highlight non zero value of hex value
}
}
export
type
FormatSelfFunc
=
(
key
:
string
|
number
,
data
:
ExtractData
)
=>
JSX
.
Element
export
type
FormatSelfFunc
=
(
key
:
string
|
number
,
data
:
ExtractData
)
=>
JSX
.
Element
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