mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-22 08:08:13 +00:00
Update logic
This commit is contained in:
parent
b76850b340
commit
ac04e3900d
@ -1,9 +1,11 @@
|
|||||||
import { Text } from '@status-im/components'
|
import { Text } from '@status-im/components'
|
||||||
import { useEffect, useState } from 'react'
|
|
||||||
import { FixedSizeList as List } from 'react-window'
|
import { FixedSizeList, FixedSizeList as List } from 'react-window'
|
||||||
import InfiniteLoader from 'react-window-infinite-loader'
|
import InfiniteLoader from 'react-window-infinite-loader'
|
||||||
import './scroller.css'
|
import './scroller.css'
|
||||||
import { Stack, XStack } from 'tamagui'
|
import { Stack, XStack } from 'tamagui'
|
||||||
|
import { exampleData } from './exampleData'
|
||||||
|
import { useEffect, useRef, useState } from 'react'
|
||||||
|
|
||||||
type DataType = {
|
type DataType = {
|
||||||
option: string
|
option: string
|
||||||
@ -15,7 +17,7 @@ interface RowProps {
|
|||||||
index: number
|
index: number
|
||||||
}
|
}
|
||||||
|
|
||||||
const Row: React.FC<RowProps> = ({ data, index }) => {
|
const Row = ({ data, index }: RowProps) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return <Text size={19}>Loading...</Text>
|
return <Text size={19}>Loading...</Text>
|
||||||
}
|
}
|
||||||
@ -37,675 +39,99 @@ const Row: React.FC<RowProps> = ({ data, index }) => {
|
|||||||
>
|
>
|
||||||
{index}
|
{index}
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack style={{ alignContent: 'flex-start', marginRight: '20px', minWidth: '110px' }}>
|
<Stack>{new Date(Date.now()).toLocaleDateString()}</Stack>
|
||||||
|
<Stack
|
||||||
|
style={{
|
||||||
|
alignContent: 'flex-start',
|
||||||
|
marginRight: '20px',
|
||||||
|
marginLeft: '20px',
|
||||||
|
minWidth: '110px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
{option}
|
{option}
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>{description}</Stack>
|
<Stack>{description}</Stack>
|
||||||
</XStack>
|
</XStack>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
const LogsTerminal = () => {
|
||||||
|
const [data, setData] = useState<DataType[]>([])
|
||||||
|
const [isScrolling, setIsScrolling] = useState(false)
|
||||||
|
const [loadedIndexes, setLoadedIndexes] = useState<{ [key: number]: boolean }>({})
|
||||||
|
const listRef = useRef<FixedSizeList | null>(null)
|
||||||
|
const [shouldAutoScroll, setShouldAutoScroll] = useState(true)
|
||||||
|
|
||||||
const LogsTerminal: React.FC = () => {
|
|
||||||
const [data, setData] = useState<(DataType | undefined)[]>([])
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const exampleData: DataType[] = [
|
const interval = setInterval(() => {
|
||||||
{
|
addNewLog()
|
||||||
option: '--config-file',
|
}, 2000)
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
return () => clearInterval(interval)
|
||||||
option: '--log-level',
|
}, [isScrolling])
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
useEffect(() => {
|
||||||
option: '--log-level',
|
if (listRef.current && shouldAutoScroll) {
|
||||||
description:
|
setTimeout(() => {
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
if (listRef.current) listRef.current.scrollToItem(data.length - 1, 'end')
|
||||||
},
|
}, 500)
|
||||||
{
|
}
|
||||||
option: '--config-file',
|
}, [data, shouldAutoScroll])
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
const loadMoreItems = async (startIndex: number, stopIndex: number) => {
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--config-file',
|
|
||||||
description: 'Loads the configuration from a TOML file.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: '--log-level',
|
|
||||||
description:
|
|
||||||
'Sets the log level for process and topics (e.g., DEBUG; TRACE:discv5,libp2p; REQUIRED:none; DISABLED:none) [INFO].',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
const initialData = [...exampleData, ...Array(500 - exampleData.length).fill(undefined)]
|
|
||||||
setData(initialData)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const isItemLoaded = (index: number): boolean => index < data.length && data[index] !== undefined
|
|
||||||
|
|
||||||
const loadMoreItems = (startIndex: number, stopIndex: number): Promise<void> => {
|
|
||||||
return new Promise<void>(resolve => {
|
return new Promise<void>(resolve => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setData(prevData => {
|
const newData = exampleData.slice(startIndex, stopIndex + 1)
|
||||||
const newData = [...prevData]
|
setData((prevData: DataType[]) => [...prevData, ...newData])
|
||||||
|
|
||||||
for (let i = startIndex; i <= stopIndex; i++) {
|
for (let i = startIndex; i <= stopIndex; i++) {
|
||||||
if (!newData[i]) {
|
setLoadedIndexes((prev: { [key: number]: boolean }) => ({ ...prev, [i]: true }))
|
||||||
newData[i] = { option: `Option ${i}`, description: `Description for ${i}` }
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return newData
|
|
||||||
})
|
|
||||||
resolve()
|
resolve()
|
||||||
}, 1000)
|
}, 5000)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isItemLoaded = (index: number) => !!loadedIndexes[index]
|
||||||
|
|
||||||
|
const addNewLog = () => {
|
||||||
|
if (!isScrolling) {
|
||||||
|
const newLog: DataType = {
|
||||||
|
option: `--new-option-${data.length + 1}`,
|
||||||
|
description: `New log entry ${data.length + 1} ${Math.random()}`,
|
||||||
|
}
|
||||||
|
|
||||||
|
const newIndex = data.length
|
||||||
|
setData(prevData => [...prevData, newLog])
|
||||||
|
setLoadedIndexes(prev => ({ ...prev, [newIndex]: true }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleScroll = ({ scrollTop, scrollHeight, clientHeight }: any) => {
|
||||||
|
if (scrollTop < scrollHeight - clientHeight) {
|
||||||
|
setIsScrolling(true)
|
||||||
|
setShouldAutoScroll(false)
|
||||||
|
} else {
|
||||||
|
setIsScrolling(false)
|
||||||
|
|
||||||
|
if (!shouldAutoScroll && scrollTop === scrollHeight - clientHeight) {
|
||||||
|
setShouldAutoScroll(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<InfiniteLoader
|
<InfiniteLoader
|
||||||
isItemLoaded={isItemLoaded}
|
|
||||||
itemCount={data.length}
|
itemCount={data.length}
|
||||||
|
isItemLoaded={isItemLoaded}
|
||||||
loadMoreItems={loadMoreItems}
|
loadMoreItems={loadMoreItems}
|
||||||
>
|
>
|
||||||
{({ onItemsRendered, ref }: any) => (
|
{({ onItemsRendered, ref }) => (
|
||||||
<List
|
<List
|
||||||
|
ref={(list: FixedSizeList | null) => {
|
||||||
|
listRef.current = list
|
||||||
|
ref(list)
|
||||||
|
}}
|
||||||
className="custom-scroll"
|
className="custom-scroll"
|
||||||
height={650}
|
height={650}
|
||||||
width={1100}
|
width={1100}
|
||||||
@ -713,7 +139,7 @@ const LogsTerminal: React.FC = () => {
|
|||||||
itemSize={20}
|
itemSize={20}
|
||||||
itemData={data}
|
itemData={data}
|
||||||
onItemsRendered={onItemsRendered}
|
onItemsRendered={onItemsRendered}
|
||||||
ref={ref}
|
onScroll={handleScroll}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: '25px',
|
borderRadius: '25px',
|
||||||
border: '1px solid #E7EAEE',
|
border: '1px solid #E7EAEE',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user