@@ -18,23 +18,20 @@ interface ServerConnectionDialogProps {
1818}
1919
2020export function ServerConnectionDialog ( { open, onOpenChange } : ServerConnectionDialogProps ) {
21- const { serverUrl, baseEndpoint , isConnecting, connectionError, connect } = useAppStore ( ) ;
21+ const { serverUrl, isConnecting, connectionError, connect } = useAppStore ( ) ;
2222 const [ url , setUrl ] = useState ( serverUrl || 'localhost:8080' ) ;
23- const [ endpoint , setEndpoint ] = useState ( baseEndpoint || 'api/v1' ) ;
2423
25- // Update local state when serverUrl/baseEndpoint changes (e.g., from localStorage)
26- // Only update if the dialog is just opened or if the store values change externally
24+ // Update local state when serverUrl changes (e.g., from localStorage)
2725 useEffect ( ( ) => {
2826 if ( open ) {
2927 setUrl ( serverUrl || '' ) ;
30- setEndpoint ( baseEndpoint || '' ) ;
3128 }
32- } , [ open , serverUrl , baseEndpoint ] ) ;
29+ } , [ open , serverUrl ] ) ;
3330
3431 const handleConnect = async ( ) => {
3532 if ( ! url . trim ( ) ) return ;
3633
37- const success = await connect ( url . trim ( ) , endpoint . trim ( ) ) ;
34+ const success = await connect ( url . trim ( ) ) ;
3835 if ( success ) {
3936 onOpenChange ( false ) ;
4037 }
@@ -56,7 +53,7 @@ export function ServerConnectionDialog({ open, onOpenChange }: ServerConnectionD
5653 </ div >
5754 < div >
5855 < DialogTitle > Connect to SOVD Server</ DialogTitle >
59- < DialogDescription > Enter the URL and base endpoint of your SOVD server</ DialogDescription >
56+ < DialogDescription > Enter the URL of your SOVD server</ DialogDescription >
6057 </ div >
6158 </ div >
6259 </ DialogHeader >
@@ -68,32 +65,15 @@ export function ServerConnectionDialog({ open, onOpenChange }: ServerConnectionD
6865 </ label >
6966 < Input
7067 id = "server-url"
71- placeholder = "192.168.1.100:8080 or http://localhost:3000 "
68+ placeholder = "192.168.1.100:8080 or http://localhost:8080 "
7269 value = { url }
7370 onChange = { ( e ) => setUrl ( e . target . value ) }
7471 onKeyDown = { handleKeyDown }
7572 disabled = { isConnecting }
7673 aria-invalid = { ! ! connectionError }
7774 />
7875 < p className = "text-xs text-muted-foreground" >
79- You can enter just IP:port or a full URL with protocol
80- </ p >
81- </ div >
82-
83- < div className = "space-y-2" >
84- < label htmlFor = "base-endpoint" className = "text-sm font-medium" >
85- Base Endpoint
86- </ label >
87- < Input
88- id = "base-endpoint"
89- placeholder = "e.g. api/v1 (optional)"
90- value = { endpoint }
91- onChange = { ( e ) => setEndpoint ( e . target . value ) }
92- onKeyDown = { handleKeyDown }
93- disabled = { isConnecting }
94- />
95- < p className = "text-xs text-muted-foreground" >
96- The path prefix for SOVD entities (leave empty for root)
76+ Enter IP:port or a full URL. The API path (/api/v1) is added automatically.
9777 </ p >
9878 </ div >
9979
0 commit comments