@@ -18,17 +18,37 @@ import { fxblox } from '@functionland/react-native-fula';
18
18
import { useLogger } from '../../hooks' ;
19
19
import { ActivityIndicator } from 'react-native' ;
20
20
import { copyToClipboard } from '../../utils/clipboard' ;
21
+ import { usePluginsStore } from '../../stores/usePluginsStore' ;
21
22
22
23
export const BloxLogsScreen = ( ) => {
23
24
const logger = useLogger ( ) ;
24
25
const [ selectedValue , setSelectedValue ] = React . useState < string > ( '' ) ;
25
26
const [ log , setLog ] = React . useState < string > ( '' ) ;
26
- const [ tailCount , setTailCount ] = React . useState < string > ( '30 ' ) ;
27
+ const [ tailCount , setTailCount ] = React . useState < string > ( '50 ' ) ;
27
28
const [ loadingLogs , setLoadingLogs ] = React . useState < boolean > ( false ) ;
28
29
const [ fulaIsReady ] = useUserProfileStore ( ( state ) => [ state . fulaIsReady ] ) ;
29
30
const [ showOtherInput , setShowOtherInput ] = React . useState < boolean > ( false ) ;
30
31
const { queueToast } = useToast ( ) ;
31
32
const { colors } = useFxTheme ( ) ;
33
+ const [ activePlugins , setActivePlugins ] = React . useState < string [ ] > ( [ ] ) ;
34
+ const { listActivePlugins } = usePluginsStore ( ) ;
35
+ const fetchActivePlugins = React . useCallback ( async ( ) => {
36
+ try {
37
+ const result = await listActivePlugins ( ) ;
38
+ if ( result . success ) {
39
+ setActivePlugins ( result . msg ) ;
40
+ } else {
41
+ console . error ( 'Failed to fetch active plugins:' , result . message ) ;
42
+ }
43
+ } catch ( error ) {
44
+ console . error ( 'Error fetching active plugins:' , error ) ;
45
+ }
46
+ } , [ listActivePlugins ] ) ;
47
+
48
+ React . useEffect ( ( ) => {
49
+ fetchActivePlugins ( ) ;
50
+ } , [ fetchActivePlugins ] ) ;
51
+
32
52
const sanitizeLogData = ( logString : string ) => {
33
53
// Regular expression to match non-printable characters except newlines
34
54
// This regex matches characters in the control characters range (0x00-0x1F and 0x7F-0x9F) except for newline (0x0A)
@@ -114,8 +134,14 @@ export const BloxLogsScreen = () => {
114
134
{ label : 'Select container name' , value : '' } ,
115
135
{ label : 'Go-Fula' , value : 'fula_go' } ,
116
136
{ label : 'Node' , value : 'fula_node' } ,
137
+ { label : 'IPFS' , value : 'ipfs_host' } ,
138
+ { label : 'IPFS Cluster' , value : 'ipfs_cluster' } ,
117
139
{ label : 'Fx' , value : 'fula_fxsupport' } ,
118
140
{ label : 'Service Logs' , value : 'MainService' } ,
141
+ ...activePlugins . map ( ( plugin ) => ( {
142
+ label : plugin ,
143
+ value : plugin ,
144
+ } ) ) ,
119
145
{ label : 'Other' , value : 'Other' } ,
120
146
] }
121
147
title = "Container Name"
0 commit comments