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
7207fc98
Commit
7207fc98
authored
Jun 15, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
csv export logs
parent
0c8394f3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
resources.ts
lib/api/resources.ts
+3
-0
address.ts
types/client/address.ts
+1
-1
AddressLogs.tsx
ui/address/AddressLogs.tsx
+8
-5
CsvExport.tsx
ui/pages/CsvExport.tsx
+5
-0
No files found.
lib/api/resources.ts
View file @
7207fc98
...
@@ -479,6 +479,9 @@ export const RESOURCES = {
...
@@ -479,6 +479,9 @@ export const RESOURCES = {
csv_export_token_transfers
:
{
csv_export_token_transfers
:
{
path
:
'
/token-transfers-csv
'
,
path
:
'
/token-transfers-csv
'
,
},
},
csv_export_logs
:
{
path
:
'
/logs-csv
'
,
},
};
};
export
type
ResourceName
=
keyof
typeof
RESOURCES
;
export
type
ResourceName
=
keyof
typeof
RESOURCES
;
...
...
types/client/address.ts
View file @
7207fc98
export
type
CsvExportType
=
'
transactions
'
|
'
internal-transactions
'
|
'
token-transfers
'
;
export
type
CsvExportType
=
'
transactions
'
|
'
internal-transactions
'
|
'
token-transfers
'
|
'
logs
'
;
ui/address/AddressLogs.tsx
View file @
7207fc98
...
@@ -10,11 +10,13 @@ import DataListDisplay from 'ui/shared/DataListDisplay';
...
@@ -10,11 +10,13 @@ import DataListDisplay from 'ui/shared/DataListDisplay';
import
LogItem
from
'
ui/shared/logs/LogItem
'
;
import
LogItem
from
'
ui/shared/logs/LogItem
'
;
import
Pagination
from
'
ui/shared/Pagination
'
;
import
Pagination
from
'
ui/shared/Pagination
'
;
import
AddressCsvExportLink
from
'
./AddressCsvExportLink
'
;
const
AddressLogs
=
({
scrollRef
}:
{
scrollRef
?:
React
.
RefObject
<
HTMLDivElement
>
})
=>
{
const
AddressLogs
=
({
scrollRef
}:
{
scrollRef
?:
React
.
RefObject
<
HTMLDivElement
>
})
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
hash
=
getQueryParamString
(
router
.
query
.
hash
);
const
hash
=
getQueryParamString
(
router
.
query
.
hash
);
const
{
data
,
isPlaceholderData
,
isError
,
pagination
,
isPaginationVisible
}
=
useQueryWithPages
({
const
{
data
,
isPlaceholderData
,
isError
,
pagination
}
=
useQueryWithPages
({
resourceName
:
'
address_logs
'
,
resourceName
:
'
address_logs
'
,
pathParams
:
{
hash
},
pathParams
:
{
hash
},
scrollRef
,
scrollRef
,
...
@@ -28,11 +30,12 @@ const AddressLogs = ({ scrollRef }: {scrollRef?: React.RefObject<HTMLDivElement>
...
@@ -28,11 +30,12 @@ const AddressLogs = ({ scrollRef }: {scrollRef?: React.RefObject<HTMLDivElement>
},
},
});
});
const
actionBar
=
isPaginationVisible
?
(
const
actionBar
=
(
<
ActionBar
mt=
{
-
6
}
showShadow
>
<
ActionBar
mt=
{
-
6
}
showShadow
justifyContent=
{
{
base
:
'
space-between
'
,
lg
:
'
end
'
}
}
>
<
Pagination
ml=
"auto"
{
...
pagination
}
/>
<
AddressCsvExportLink
address=
{
hash
}
isLoading=
{
pagination
.
isLoading
}
type=
"logs"
/>
<
Pagination
ml=
{
{
base
:
0
,
lg
:
8
}
}
{
...
pagination
}
/>
</
ActionBar
>
</
ActionBar
>
)
:
null
;
);
const
content
=
data
?.
items
?
data
.
items
.
map
((
item
,
index
)
=>
<
LogItem
key=
{
index
}
{
...
item
}
type=
"address"
isLoading=
{
isPlaceholderData
}
/>)
:
null
;
const
content
=
data
?.
items
?
data
.
items
.
map
((
item
,
index
)
=>
<
LogItem
key=
{
index
}
{
...
item
}
type=
"address"
isLoading=
{
isPlaceholderData
}
/>)
:
null
;
...
...
ui/pages/CsvExport.tsx
View file @
7207fc98
...
@@ -39,6 +39,11 @@ const EXPORT_TYPES: Record<CsvExportType, ExportTypeEntity> = {
...
@@ -39,6 +39,11 @@ const EXPORT_TYPES: Record<CsvExportType, ExportTypeEntity> = {
resource
:
'
csv_export_token_transfers
'
,
resource
:
'
csv_export_token_transfers
'
,
fileNameTemplate
:
'
token_transfers
'
,
fileNameTemplate
:
'
token_transfers
'
,
},
},
logs
:
{
text
:
'
logs
'
,
resource
:
'
csv_export_logs
'
,
fileNameTemplate
:
'
logs
'
,
},
};
};
const
isCorrectExportType
=
(
type
:
string
):
type
is
CsvExportType
=>
Object
.
keys
(
EXPORT_TYPES
).
includes
(
type
);
const
isCorrectExportType
=
(
type
:
string
):
type
is
CsvExportType
=>
Object
.
keys
(
EXPORT_TYPES
).
includes
(
type
);
...
...
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