Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
37cbe817
Commit
37cbe817
authored
Jan 17, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logs and some fixes
parent
f00d3b38
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
10 deletions
+44
-10
UserOp.tsx
ui/pages/UserOp.tsx
+17
-4
TxLogs.tsx
ui/tx/TxLogs.tsx
+21
-4
UserOpsListItem.tsx
ui/userOps/UserOpsListItem.tsx
+3
-1
UserOpsTableItem.tsx
ui/userOps/UserOpsTableItem.tsx
+3
-1
No files found.
ui/pages/UserOp.tsx
View file @
37cbe817
...
@@ -2,6 +2,7 @@ import { inRange } from 'lodash';
...
@@ -2,6 +2,7 @@ import { inRange } from 'lodash';
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
Log
}
from
'
types/api/log
'
;
import
type
{
TokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
type
{
TokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
type
{
RoutedTab
}
from
'
ui/shared/Tabs/types
'
;
import
type
{
RoutedTab
}
from
'
ui/shared/Tabs/types
'
;
...
@@ -11,10 +12,11 @@ import useIsMobile from 'lib/hooks/useIsMobile';
...
@@ -11,10 +12,11 @@ import useIsMobile from 'lib/hooks/useIsMobile';
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
{
USER_OP
}
from
'
stubs/userOps
'
;
import
{
USER_OP
}
from
'
stubs/userOps
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
UserOpEntity
from
'
ui/shared/entities/userOp/UserOpEntity
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
RoutedTabs
from
'
ui/shared/Tabs/RoutedTabs
'
;
import
RoutedTabs
from
'
ui/shared/Tabs/RoutedTabs
'
;
import
TabsSkeleton
from
'
ui/shared/Tabs/TabsSkeleton
'
;
import
TabsSkeleton
from
'
ui/shared/Tabs/TabsSkeleton
'
;
import
TxLogs
from
'
ui/tx/TxLogs
'
;
import
TxTokenTransfer
from
'
ui/tx/TxTokenTransfer
'
;
import
TxTokenTransfer
from
'
ui/tx/TxTokenTransfer
'
;
import
UserOpCallData
from
'
ui/userOp/UserOpCallData
'
;
import
UserOpCallData
from
'
ui/userOp/UserOpCallData
'
;
import
UserOpDetails
from
'
ui/userOp/UserOpDetails
'
;
import
UserOpDetails
from
'
ui/userOp/UserOpDetails
'
;
...
@@ -50,6 +52,17 @@ const BlockPageContent = () => {
...
@@ -50,6 +52,17 @@ const BlockPageContent = () => {
}
}
},
[
userOpQuery
.
data
]);
},
[
userOpQuery
.
data
]);
const
filterLogsByLogIndex
=
React
.
useCallback
((
log
:
Log
)
=>
{
if
(
!
userOpQuery
.
data
)
{
return
true
;
}
else
{
if
(
inRange
(
log
.
index
,
userOpQuery
.
data
.
user_logs_start_index
,
userOpQuery
.
data
.
user_logs_start_index
+
userOpQuery
.
data
.
user_logs_count
))
{
return
true
;
}
return
false
;
}
},
[
userOpQuery
.
data
]);
const
tabs
:
Array
<
RoutedTab
>
=
React
.
useMemo
(()
=>
([
const
tabs
:
Array
<
RoutedTab
>
=
React
.
useMemo
(()
=>
([
{
id
:
'
index
'
,
title
:
'
Details
'
,
component
:
<
UserOpDetails
query=
{
userOpQuery
}
/>
},
{
id
:
'
index
'
,
title
:
'
Details
'
,
component
:
<
UserOpDetails
query=
{
userOpQuery
}
/>
},
{
{
...
@@ -58,9 +71,9 @@ const BlockPageContent = () => {
...
@@ -58,9 +71,9 @@ const BlockPageContent = () => {
component
:
<
TxTokenTransfer
txHash=
{
userOpQuery
.
data
?.
transaction_hash
}
tokenTransferFilter=
{
filterTokenTransfersByLogIndex
}
/>,
component
:
<
TxTokenTransfer
txHash=
{
userOpQuery
.
data
?.
transaction_hash
}
tokenTransferFilter=
{
filterTokenTransfersByLogIndex
}
/>,
},
},
{
id
:
'
call_data
'
,
title
:
'
Call data
'
,
component
:
<
UserOpCallData
rawCallData=
{
userOpQuery
.
data
?.
call_data
}
/>
},
{
id
:
'
call_data
'
,
title
:
'
Call data
'
,
component
:
<
UserOpCallData
rawCallData=
{
userOpQuery
.
data
?.
call_data
}
/>
},
// { id: 'logs', title: 'Logs', component: <UserOpLogs txHash={ userOpQuery.data?.transaction_hash }/> }
{
id
:
'
logs
'
,
title
:
'
Logs
'
,
component
:
<
TxLogs
txHash=
{
userOpQuery
.
data
?.
transaction_hash
}
logsFilter=
{
filterLogsByLogIndex
}
/>
},
// { id: 'raw', title: 'Raw', component: <UserOpRaw txHash={ userOpQuery.data?.transaction_hash }/> }
// { id: 'raw', title: 'Raw', component: <UserOpRaw txHash={ userOpQuery.data?.transaction_hash }/> }
].
filter
(
Boolean
)),
[
userOpQuery
,
filterTokenTransfersByLogIndex
]);
].
filter
(
Boolean
)),
[
userOpQuery
,
filterTokenTransfersByLogIndex
,
filterLogsByLogIndex
]);
if
(
!
hash
)
{
if
(
!
hash
)
{
throw
new
Error
(
'
User operation not found
'
,
{
cause
:
{
status
:
404
}
});
throw
new
Error
(
'
User operation not found
'
,
{
cause
:
{
status
:
404
}
});
...
@@ -83,7 +96,7 @@ const BlockPageContent = () => {
...
@@ -83,7 +96,7 @@ const BlockPageContent = () => {
};
};
},
[
appProps
.
referrer
]);
},
[
appProps
.
referrer
]);
const
titleSecondRow
=
<
HashStringShortenDynamic
hash=
{
hash
}
/>;
const
titleSecondRow
=
<
UserOpEntity
hash=
{
hash
}
noLink
noCopy=
{
false
}
fontWeight=
{
500
}
fontFamily=
"heading"
iconSize=
"lg"
/>;
return
(
return
(
<>
<>
...
...
ui/tx/TxLogs.tsx
View file @
37cbe817
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
Log
}
from
'
types/api/log
'
;
import
{
SECOND
}
from
'
lib/consts
'
;
import
{
SECOND
}
from
'
lib/consts
'
;
import
{
LOG
}
from
'
stubs/log
'
;
import
{
LOG
}
from
'
stubs/log
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
...
@@ -13,8 +15,13 @@ import TxPendingAlert from 'ui/tx/TxPendingAlert';
...
@@ -13,8 +15,13 @@ import TxPendingAlert from 'ui/tx/TxPendingAlert';
import
TxSocketAlert
from
'
ui/tx/TxSocketAlert
'
;
import
TxSocketAlert
from
'
ui/tx/TxSocketAlert
'
;
import
useFetchTxInfo
from
'
ui/tx/useFetchTxInfo
'
;
import
useFetchTxInfo
from
'
ui/tx/useFetchTxInfo
'
;
const
TxLogs
=
()
=>
{
type
Props
=
{
const
txInfo
=
useFetchTxInfo
({
updateDelay
:
5
*
SECOND
});
txHash
?:
string
;
logsFilter
?:
(
log
:
Log
)
=>
boolean
;
}
const
TxLogs
=
({
txHash
,
logsFilter
}:
Props
)
=>
{
const
txInfo
=
useFetchTxInfo
({
updateDelay
:
5
*
SECOND
,
txHash
});
const
{
data
,
isPlaceholderData
,
isError
,
pagination
}
=
useQueryWithPages
({
const
{
data
,
isPlaceholderData
,
isError
,
pagination
}
=
useQueryWithPages
({
resourceName
:
'
tx_logs
'
,
resourceName
:
'
tx_logs
'
,
pathParams
:
{
hash
:
txInfo
.
data
?.
hash
},
pathParams
:
{
hash
:
txInfo
.
data
?.
hash
},
...
@@ -32,7 +39,17 @@ const TxLogs = () => {
...
@@ -32,7 +39,17 @@ const TxLogs = () => {
return
<
DataFetchAlert
/>;
return
<
DataFetchAlert
/>;
}
}
if
(
!
data
?.
items
.
length
)
{
let
items
:
Array
<
Log
>
=
[];
if
(
data
?.
items
)
{
if
(
isPlaceholderData
)
{
items
=
data
?.
items
;
}
else
{
items
=
logsFilter
?
data
.
items
.
filter
(
logsFilter
)
:
data
.
items
;
}
}
if
(
!
items
.
length
)
{
return
<
Text
as=
"span"
>
There are no logs for this transaction.
</
Text
>;
return
<
Text
as=
"span"
>
There are no logs for this transaction.
</
Text
>;
}
}
...
@@ -43,7 +60,7 @@ const TxLogs = () => {
...
@@ -43,7 +60,7 @@ const TxLogs = () => {
<
Pagination
ml=
"auto"
{
...
pagination
}
/>
<
Pagination
ml=
"auto"
{
...
pagination
}
/>
</
ActionBar
>
</
ActionBar
>
)
}
)
}
{
data
?.
items
.
map
((
item
,
index
)
=>
<
LogItem
key=
{
index
}
{
...
item
}
type=
"transaction"
isLoading=
{
isPlaceholderData
}
/>)
}
{
items
.
map
((
item
,
index
)
=>
<
LogItem
key=
{
index
}
{
...
item
}
type=
"transaction"
isLoading=
{
isPlaceholderData
}
/>)
}
</
Box
>
</
Box
>
);
);
};
};
...
...
ui/userOps/UserOpsListItem.tsx
View file @
37cbe817
...
@@ -27,7 +27,7 @@ const UserOpsListItem = ({ item, isLoading }: Props) => {
...
@@ -27,7 +27,7 @@ const UserOpsListItem = ({ item, isLoading }: Props) => {
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
User op hash
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
User op hash
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Value
>
<
UserOpEntity
hash=
{
item
.
hash
}
noCopy=
{
false
}
isLoading=
{
isLoading
}
/>
<
UserOpEntity
hash=
{
item
.
hash
}
isLoading=
{
isLoading
}
fontWeight=
"700"
noIcon
/>
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Age
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Age
</
ListItemMobileGrid
.
Label
>
...
@@ -53,6 +53,7 @@ const UserOpsListItem = ({ item, isLoading }: Props) => {
...
@@ -53,6 +53,7 @@ const UserOpsListItem = ({ item, isLoading }: Props) => {
<
TxEntity
<
TxEntity
hash=
{
item
.
transaction_hash
}
hash=
{
item
.
transaction_hash
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
noIcon
/>
/>
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
...
@@ -63,6 +64,7 @@ const UserOpsListItem = ({ item, isLoading }: Props) => {
...
@@ -63,6 +64,7 @@ const UserOpsListItem = ({ item, isLoading }: Props) => {
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
fontSize=
"sm"
fontSize=
"sm"
lineHeight=
{
5
}
lineHeight=
{
5
}
noIcon
/>
/>
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
...
...
ui/userOps/UserOpsTableItem.tsx
View file @
37cbe817
...
@@ -23,7 +23,7 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
...
@@ -23,7 +23,7 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
return
(
return
(
<
Tr
>
<
Tr
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
UserOpEntity
hash=
{
item
.
hash
}
noCopy=
{
false
}
isLoading=
{
isLoading
}
/>
<
UserOpEntity
hash=
{
item
.
hash
}
isLoading=
{
isLoading
}
noIcon
fontWeight=
{
700
}
/>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_secondary"
display=
"inline-block"
><
span
>
{
timeAgo
}
</
span
></
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_secondary"
display=
"inline-block"
><
span
>
{
timeAgo
}
</
span
></
Skeleton
>
...
@@ -43,6 +43,7 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
...
@@ -43,6 +43,7 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
hash=
{
item
.
transaction_hash
}
hash=
{
item
.
transaction_hash
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
truncation=
"constant"
truncation=
"constant"
noIcon
/>
/>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
...
@@ -51,6 +52,7 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
...
@@ -51,6 +52,7 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
fontSize=
"sm"
fontSize=
"sm"
lineHeight=
{
5
}
lineHeight=
{
5
}
noIcon
/>
/>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
isNumeric
>
<
Td
verticalAlign=
"middle"
isNumeric
>
...
...
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