Update Supabase connection tests

Improve error handling for REST API and database connection tests.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 12:55:36 +00:00
parent b30fb33384
commit 5fd4c183eb
5 changed files with 82 additions and 18 deletions

View File

@@ -8,24 +8,25 @@ interface ProxyRecommendationAlertProps {
}
const ProxyRecommendationAlert: React.FC<ProxyRecommendationAlertProps> = ({ errors }) => {
const hasProxyRecommendation = errors.some(err =>
err.includes('프록시 사용 시 정상 작동합니다') ||
err.includes('프록시를 선택해보세요')
const hasCorsError = errors.some(err =>
err.includes('CORS') ||
err.includes('Failed to fetch') ||
err.includes('프록시 사용시 정상 작동') ||
err.includes('프록시를 활성화')
);
if (!hasProxyRecommendation || errors.length === 0) return null;
const recommendationMessage = errors.find(err =>
err.includes('프록시 사용 시 정상 작동합니다') ||
err.includes('프록시를 선택해보세요')
);
if (!hasCorsError || errors.length === 0) return null;
return (
<Alert className="bg-amber-50 border-amber-200 mt-3">
<AlertCircle className="h-4 w-4 text-amber-600" />
<AlertTitle className="text-amber-800 text-xs font-medium"> </AlertTitle>
<AlertTitle className="text-amber-800 text-xs font-medium">CORS </AlertTitle>
<AlertDescription className="text-amber-700 text-xs">
{recommendationMessage}
<p>HTTP URL에 .</p>
<ul className="list-disc pl-4 mt-1">
<li className="mt-1">CORS .</li>
<li className="mt-1"> HTTPS URL로 .</li>
</ul>
</AlertDescription>
</Alert>
);