Update Supabase connection tests
Improve error handling for REST API and database connection tests.
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
@@ -24,6 +24,7 @@ const ProxyTypeSelector: React.FC<ProxyTypeSelectorProps> = ({
|
||||
<SelectItem value="thingproxy">thingproxy.freeboard.io</SelectItem>
|
||||
<SelectItem value="allorigins">allorigins.win</SelectItem>
|
||||
<SelectItem value="cors-anywhere">cors-anywhere.herokuapp.com</SelectItem>
|
||||
<SelectItem value="cloudflare">Cloudflare Workers 프록시</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p className="text-xs text-gray-500 mt-1">
|
||||
|
||||
Reference in New Issue
Block a user