@@ -2,16 +2,19 @@ import { useSelector, useDispatch } from 'react-redux';
22import { selectConfig , setConfigField , selectProviders , selectProvidersLoading , selectProvidersError , selectProviderById } from '@/lib/docker-compose/slice' ;
33import type { DockerComposeConfig , ConfigProfile , RuntimeProvider } from '@/lib/docker-compose/types' ;
44import { REGISTRIES } from '@/lib/docker-compose/types' ;
5+ import type { RootState } from '@/lib/store' ;
56import { Label } from '@/components/ui/label' ;
67import { Input } from '@/components/ui/input' ;
78import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from '@/components/ui/select' ;
89import { Checkbox } from '@/components/ui/checkbox' ;
910import { Badge } from '@/components/ui/badge' ;
1011import { RadioGroup , RadioGroupItem } from '@/components/ui/radio-group' ;
12+ import { HttpsConfigPanel } from '@/components/docker-compose/HttpsConfigPanel' ;
1113import { Settings , Loader2 , AlertCircle } from 'lucide-react' ;
1214import { useTranslation } from 'react-i18next' ;
1315import { NAVIGATION_LINKS } from '@/config/navigationLinks' ;
14- import { useEffect , useMemo } from 'react' ;
16+ import { useCallback , useEffect , useMemo } from 'react' ;
17+ import { validateConfig } from '@/lib/docker-compose/validation' ;
1518
1619export function ConfigForm ( ) {
1720 const { t } = useTranslation ( ) ;
@@ -21,14 +24,14 @@ export function ConfigForm() {
2124 const providersLoading = useSelector ( selectProvidersLoading ) ;
2225 const providersError = useSelector ( selectProvidersError ) ;
2326
24- const updateConfig = < K extends keyof DockerComposeConfig > ( field : K , value : DockerComposeConfig [ K ] ) => {
27+ const updateConfig = useCallback ( < K extends keyof DockerComposeConfig > ( field : K , value : DockerComposeConfig [ K ] ) => {
2528 dispatch ( setConfigField ( { field, value } ) ) ;
26- } ;
29+ } , [ dispatch ] ) ;
2730
2831 // Get current provider from state
29- const currentProvider = useMemo ( ( ) => {
30- return selectProviderById ( { dockerCompose : { config , providers , isLoading : false , error : null , providersLoading , providersError } } , config . anthropicApiProvider ) ;
31- } , [ config . anthropicApiProvider , providers , providersLoading , providersError ] ) ;
32+ const currentProvider = useSelector ( ( state : RootState ) =>
33+ selectProviderById ( state , config . anthropicApiProvider )
34+ ) ;
3235
3336 // Initialize provider if not set and providers are loaded
3437 useEffect ( ( ) => {
@@ -40,6 +43,11 @@ export function ConfigForm() {
4043 }
4144 } , [ providersLoading , providers , config . anthropicApiProvider , updateConfig ] ) ;
4245
46+ const validationMap = useMemo ( ( ) => {
47+ const entries = validateConfig ( config ) . map ( ( error ) => [ error . field , error . message ] as const ) ;
48+ return Object . fromEntries ( entries ) ;
49+ } , [ config ] ) ;
50+
4351 return (
4452 < div className = "space-y-6 p-6 sm:p-8" >
4553 { /* Header */ }
@@ -219,6 +227,14 @@ export function ConfigForm() {
219227 </ div >
220228 </ div >
221229
230+ { config . profile === 'full-custom' && (
231+ < HttpsConfigPanel
232+ config = { config }
233+ updateConfig = { updateConfig }
234+ validationErrors = { validationMap }
235+ />
236+ ) }
237+
222238 { /* AI Provider Configuration */ }
223239 < div className = "space-y-4" >
224240 < h3 className = "text-lg font-semibold" > { t ( 'configForm.aiProviderConfig' ) } </ h3 >
0 commit comments