File tree 5 files changed +37
-12
lines changed 5 files changed +37
-12
lines changed Original file line number Diff line number Diff line change @@ -472,7 +472,12 @@ export default function MainAppPanel({
472
472
/>
473
473
< Route
474
474
path = "/plugins"
475
- element = { < Plugins experimentInfo = { experimentInfo } /> }
475
+ element = {
476
+ < Plugins
477
+ experimentInfo = { experimentInfo }
478
+ setLogsDrawerOpen = { setLogsDrawerOpen }
479
+ />
480
+ }
476
481
/>
477
482
< Route
478
483
path = "/plugins/:pluginName"
Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ import NewPluginModal from './NewPluginModal';
18
18
19
19
const fetcher = ( url ) => fetch ( url ) . then ( ( res ) => res . json ( ) ) ;
20
20
21
- export default function LocalPlugins ( { experimentInfo } ) {
21
+ export default function LocalPlugins ( {
22
+ experimentInfo,
23
+ setLogsDrawerOpen = null ,
24
+ } ) {
22
25
const [ newPluginModalOpen , setNewPluginModalOpen ] = useState ( false ) ;
23
26
24
27
const { data, error, isLoading, mutate } = useSWR (
@@ -77,6 +80,7 @@ export default function LocalPlugins({ experimentInfo }) {
77
80
download = { undefined }
78
81
experimentInfo = { experimentInfo }
79
82
machineType = { device }
83
+ setLogsDrawerOpen = { setLogsDrawerOpen }
80
84
/>
81
85
</ Grid >
82
86
) ) }
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ export default function PluginCard({
83
83
parentMutate,
84
84
experimentInfo = { } ,
85
85
machineType,
86
+ setLogsDrawerOpen = null ,
86
87
} ) {
87
88
const [ installing , setInstalling ] = useState ( null ) ;
88
89
@@ -134,7 +135,7 @@ export default function PluginCard({
134
135
{ /* {JSON.stringify(plugin)} */ }
135
136
< Typography
136
137
level = "title-lg"
137
- // startDecorator={getIcon(type)}
138
+ // startDecorator={getIcon(type)}
138
139
>
139
140
< b >
140
141
{ plugin . name }
@@ -239,18 +240,22 @@ export default function PluginCard({
239
240
experimentInfo ?. id ,
240
241
plugin . uniqueId ,
241
242
) ,
242
- ) . then ( async response => {
243
+ ) . then ( async ( response ) => {
243
244
if ( response . ok ) {
244
245
const responseBody = await response . json ( ) ;
245
246
console . log ( 'Response Body:' , responseBody ) ;
246
247
if ( responseBody ?. status == 'error' ) {
247
- /*if (setLogsDrawerOpen) {
248
+ alert (
249
+ `Failed to install plugin:\n${ responseBody ?. message } ` ,
250
+ ) ;
251
+ if ( setLogsDrawerOpen ) {
248
252
setLogsDrawerOpen ( true ) ;
249
- }*/
250
- alert ( `Failed to install plugin:\n${ responseBody ?. message } ` ) ;
253
+ }
251
254
}
252
255
} else {
253
- alert ( "Error: The API did not return a response. Plugin installation failed." ) ;
256
+ alert (
257
+ 'Error: The API did not return a response. Plugin installation failed.' ,
258
+ ) ;
254
259
}
255
260
} ) ;
256
261
setInstalling ( null ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ import PluginCard from './PluginCard';
22
22
23
23
const fetcher = ( url ) => fetch ( url ) . then ( ( res ) => res . json ( ) ) ;
24
24
25
- export default function PluginGallery ( { experimentInfo } ) {
25
+ export default function PluginGallery ( {
26
+ experimentInfo,
27
+ setLogsDrawerOpen = null ,
28
+ } ) {
26
29
const { data, error, isLoading, mutate } = useSWR (
27
30
chatAPI . Endpoints . Plugins . Gallery ( ) ,
28
31
fetcher ,
@@ -187,6 +190,7 @@ export default function PluginGallery({ experimentInfo }) {
187
190
experimentInfo = { experimentInfo }
188
191
parentMutate = { mutate }
189
192
machineType = { device }
193
+ setLogsDrawerOpen = { setLogsDrawerOpen }
190
194
/>
191
195
</ Grid >
192
196
) ) }
@@ -220,6 +224,7 @@ export default function PluginGallery({ experimentInfo }) {
220
224
experimentInfo = { experimentInfo }
221
225
parentMutate = { mutate }
222
226
machineType = { device }
227
+ setLogsDrawerOpen = { setLogsDrawerOpen }
223
228
/>
224
229
</ Box >
225
230
</ Grid >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import PluginGallery from './PluginGallery';
18
18
import LocalPlugins from './LocalPlugins' ;
19
19
import OneTimePopup from '../Shared/OneTimePopup' ;
20
20
21
- export default function Plugins ( { experimentInfo } ) {
21
+ export default function Plugins ( { experimentInfo, setLogsDrawerOpen = null } ) {
22
22
const { data : outdatedPlugins , mutate : outdatePluginsMutate } =
23
23
usePluginStatus ( experimentInfo ) ;
24
24
const [ installing , setInstalling ] = useState ( null ) ;
@@ -114,7 +114,10 @@ export default function Plugins({ experimentInfo }) {
114
114
< Sheet
115
115
sx = { { display : 'flex' , flexDirection : 'column' , height : '100%' } }
116
116
>
117
- < LocalPlugins experimentInfo = { experimentInfo } />
117
+ < LocalPlugins
118
+ experimentInfo = { experimentInfo }
119
+ setLogsDrawerOpen = { setLogsDrawerOpen }
120
+ />
118
121
</ Sheet >
119
122
</ TabPanel >
120
123
< TabPanel
@@ -128,7 +131,10 @@ export default function Plugins({ experimentInfo }) {
128
131
< Sheet
129
132
sx = { { display : 'flex' , flexDirection : 'column' , height : '100%' } }
130
133
>
131
- < PluginGallery experimentInfo = { experimentInfo } />
134
+ < PluginGallery
135
+ experimentInfo = { experimentInfo }
136
+ setLogsDrawerOpen = { setLogsDrawerOpen }
137
+ />
132
138
</ Sheet >
133
139
</ TabPanel >
134
140
</ Tabs >
You can’t perform that action at this time.
0 commit comments