1- import { createResource , createSignal , For , Show , type Component } from 'solid-js'
2- import SetupStepInstall from './SetupStepInstall.jsx'
3- import SetupStepConfigure from './SetupStepConfigure.jsx'
4- import SetupStepVerify from './SetupStepVerify.jsx'
5- import SetupStepLocalConfigure from './SetupStepLocalConfigure.jsx'
6- import { getAgentKey , getHealth } from '../services/api.js'
1+ import { createResource , createSignal , For , Show , type Component } from 'solid-js' ;
2+ import SetupStepInstall from './SetupStepInstall.jsx' ;
3+ import SetupStepConfigure from './SetupStepConfigure.jsx' ;
4+ import SetupStepVerify from './SetupStepVerify.jsx' ;
5+ import SetupStepLocalConfigure from './SetupStepLocalConfigure.jsx' ;
6+ import { getAgentKey , getHealth } from '../services/api.js' ;
77
8- interface StepDef { n : number ; label : string }
8+ interface StepDef {
9+ n : number ;
10+ label : string ;
11+ }
912
1013const CLOUD_STEPS : StepDef [ ] = [
1114 { n : 1 , label : 'Install' } ,
1215 { n : 2 , label : 'Configure' } ,
1316 { n : 3 , label : 'Activate' } ,
14- ]
17+ ] ;
1518
1619const LOCAL_STEPS : StepDef [ ] = [
1720 { n : 1 , label : 'Configure' } ,
1821 { n : 2 , label : 'Verify' } ,
19- ]
22+ ] ;
2023
21- const SetupModal : Component < { open : boolean ; agentName : string ; apiKey ?: string | null ; onClose : ( ) => void ; onDone ?: ( ) => void } > = ( props ) => {
22- const [ step , setStep ] = createSignal ( 1 )
24+ const SetupModal : Component < {
25+ open : boolean ;
26+ agentName : string ;
27+ apiKey ?: string | null ;
28+ onClose : ( ) => void ;
29+ onDone ?: ( ) => void ;
30+ } > = ( props ) => {
31+ const [ step , setStep ] = createSignal ( 1 ) ;
2332
24- const [ healthData ] = createResource ( ( ) => props . open , ( open ) => open ? getHealth ( ) : null )
25- const isLocal = ( ) => ( healthData ( ) as { mode ?: string } ) ?. mode === 'local'
33+ const [ healthData ] = createResource (
34+ ( ) => props . open ,
35+ ( open ) => ( open ? getHealth ( ) : null ) ,
36+ ) ;
37+ const isLocal = ( ) => ( healthData ( ) as { mode ?: string } ) ?. mode === 'local' ;
2638
2739 const [ apiKeyData ] = createResource (
2840 ( ) => ( props . open ? props . agentName : null ) ,
2941 ( n ) => ( n ? getAgentKey ( n ) : null ) ,
30- )
42+ ) ;
3143
3244 const endpoint = ( ) => {
33- const custom = apiKeyData ( ) ?. pluginEndpoint
34- if ( custom ) return custom
35- const host = window . location . hostname
36- if ( host === 'app.manifest.build' ) return null
37- return `${ window . location . origin } /otlp`
38- }
45+ const custom = apiKeyData ( ) ?. pluginEndpoint ;
46+ if ( custom ) return custom ;
47+ const host = window . location . hostname ;
48+ if ( host === 'app.manifest.build' ) return null ;
49+ return `${ window . location . origin } /otlp` ;
50+ } ;
3951
40- const steps = ( ) => isLocal ( ) ? LOCAL_STEPS : CLOUD_STEPS
41- const totalSteps = ( ) => steps ( ) . length
52+ const steps = ( ) => ( isLocal ( ) ? LOCAL_STEPS : CLOUD_STEPS ) ;
53+ const totalSteps = ( ) => steps ( ) . length ;
4254
4355 return (
4456 < Show when = { props . open } >
45- < div class = "modal-overlay setup-modal__overlay" onClick = { ( e ) => { if ( e . target === e . currentTarget ) props . onClose ( ) ; } } >
57+ < div
58+ class = "modal-overlay setup-modal__overlay"
59+ onClick = { ( e ) => {
60+ if ( e . target === e . currentTarget ) props . onClose ( ) ;
61+ } }
62+ >
4663 < div class = "modal-card" style = "max-width: 600px;" >
4764 < div style = "display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--gap-sm);" >
4865 < div class = "modal-card__title" > Set up your agent</ div >
@@ -51,14 +68,35 @@ const SetupModal: Component<{ open: boolean; agentName: string; apiKey?: string
5168 onClick = { ( ) => props . onClose ( ) }
5269 aria-label = "Close"
5370 >
54- < svg width = "16" height = "16" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke-width = "2" stroke-linecap = "round" stroke-linejoin = "round" > < path d = "M18 6 6 18" /> < path d = "m6 6 12 12" /> </ svg >
71+ < svg
72+ width = "16"
73+ height = "16"
74+ viewBox = "0 0 24 24"
75+ fill = "none"
76+ stroke = "currentColor"
77+ stroke-width = "2"
78+ stroke-linecap = "round"
79+ stroke-linejoin = "round"
80+ >
81+ < path d = "M18 6 6 18" />
82+ < path d = "m6 6 12 12" />
83+ </ svg >
5584 </ button >
5685 </ div >
5786 < p class = "modal-card__desc" >
58- < Show when = { isLocal ( ) } fallback = {
59- < > Follow these steps to send telemetry from your agent to Manifest. Once your first messages arrive, < strong > your dashboard populates automatically</ strong > .</ >
60- } >
61- < > Your local server is running. Configure the OpenClaw plugin and verify that telemetry data is flowing.</ >
87+ < Show
88+ when = { isLocal ( ) }
89+ fallback = {
90+ < >
91+ Follow these steps to send telemetry from your agent to Manifest. Once your first
92+ messages arrive, < strong > your dashboard updates on its own</ strong > .
93+ </ >
94+ }
95+ >
96+ < >
97+ Your local server is running. Configure the OpenClaw plugin and verify that
98+ telemetry data is flowing.
99+ </ >
62100 </ Show >
63101 </ p >
64102
@@ -80,7 +118,16 @@ const SetupModal: Component<{ open: boolean; agentName: string; apiKey?: string
80118 >
81119 < div class = "modal-stepper__circle" >
82120 < Show when = { step ( ) > s . n } fallback = { s . n } >
83- < svg width = "14" height = "14" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke-width = "3" > < polyline points = "20 6 9 17 4 12" /> </ svg >
121+ < svg
122+ width = "14"
123+ height = "14"
124+ viewBox = "0 0 24 24"
125+ fill = "none"
126+ stroke = "currentColor"
127+ stroke-width = "3"
128+ >
129+ < polyline points = "20 6 9 17 4 12" />
130+ </ svg >
84131 </ Show >
85132 </ div >
86133 < span class = "modal-stepper__label" > { s . label } </ span >
@@ -130,26 +177,29 @@ const SetupModal: Component<{ open: boolean; agentName: string; apiKey?: string
130177 >
131178 Back
132179 </ button >
133- < Show when = { step ( ) < totalSteps ( ) } fallback = {
134- < button
135- class = "setup-modal__next"
136- onClick = { ( ) => { props . onDone ?.( ) ; props . onClose ( ) ; } }
137- >
138- Done
139- </ button >
140- } >
141- < button
142- class = "setup-modal__next"
143- onClick = { ( ) => setStep ( ( s ) => s + 1 ) }
144- >
180+ < Show
181+ when = { step ( ) < totalSteps ( ) }
182+ fallback = {
183+ < button
184+ class = "setup-modal__next"
185+ onClick = { ( ) => {
186+ props . onDone ?.( ) ;
187+ props . onClose ( ) ;
188+ } }
189+ >
190+ Done
191+ </ button >
192+ }
193+ >
194+ < button class = "setup-modal__next" onClick = { ( ) => setStep ( ( s ) => s + 1 ) } >
145195 Next
146196 </ button >
147197 </ Show >
148198 </ div >
149199 </ div >
150200 </ div >
151201 </ Show >
152- )
153- }
202+ ) ;
203+ } ;
154204
155- export default SetupModal
205+ export default SetupModal ;
0 commit comments