Remove on-premise Supabase test code
Remove code related to on-premise Supabase testing.
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
|
||||
import React from "react";
|
||||
import { RefreshCcw } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert";
|
||||
|
||||
interface ServerStatusAlertProps {
|
||||
serverStatus: {
|
||||
checked: boolean;
|
||||
connected: boolean;
|
||||
message: string;
|
||||
};
|
||||
checkServerConnection: () => Promise<void>;
|
||||
}
|
||||
|
||||
const ServerStatusAlert: React.FC<ServerStatusAlertProps> = ({
|
||||
serverStatus,
|
||||
checkServerConnection,
|
||||
}) => {
|
||||
if (!serverStatus.checked || serverStatus.connected) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Alert variant="destructive" className="mb-6">
|
||||
<AlertTitle className="flex items-center">
|
||||
서버 연결 문제
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="ml-2 h-6 w-6 p-0"
|
||||
onClick={checkServerConnection}
|
||||
>
|
||||
<RefreshCcw className="h-4 w-4" />
|
||||
</Button>
|
||||
</AlertTitle>
|
||||
<AlertDescription>
|
||||
{serverStatus.message}
|
||||
<p className="mt-1 text-xs">회원가입을 시도하기 전에 서버 연결 문제를 해결해주세요.</p>
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
);
|
||||
};
|
||||
|
||||
export default ServerStatusAlert;
|
||||
@@ -1,66 +0,0 @@
|
||||
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { ArrowRight, Shield } from "lucide-react";
|
||||
import { TestResults } from "@/lib/supabase/tests/types";
|
||||
|
||||
interface TestResultProps {
|
||||
testResults: TestResults | null;
|
||||
}
|
||||
|
||||
const SupabaseConnectionStatus: React.FC<TestResultProps> = ({ testResults }) => {
|
||||
if (!testResults) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<details className="neuro-flat p-3 text-xs mb-4">
|
||||
<summary className="cursor-pointer text-gray-500 font-medium">고급 진단 정보</summary>
|
||||
<div className="mt-2 space-y-2">
|
||||
<div>
|
||||
<p className="font-medium">Supabase URL:</p>
|
||||
<p className="break-all bg-gray-100 p-1 rounded">{testResults?.url || '알 수 없음'}</p>
|
||||
</div>
|
||||
{testResults?.usingProxy && (
|
||||
<div>
|
||||
<p className="font-medium">CORS 프록시:</p>
|
||||
<div className="flex items-center gap-1">
|
||||
<Shield className="h-3 w-3 text-blue-500" />
|
||||
<p className="break-all text-blue-500">활성화됨 - {testResults.proxyUrl}</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<p className="font-medium">클라이언트 초기화:</p>
|
||||
<p>{testResults?.client ? '성공' : '실패'}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-medium">브라우저 정보:</p>
|
||||
<p className="break-all">{navigator.userAgent}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-medium">앱 버전:</p>
|
||||
<p>1.0.0</p>
|
||||
</div>
|
||||
{testResults && (
|
||||
<div className="border-t pt-2 mt-2">
|
||||
<p>REST API: {testResults.restApi ? '✅' : '❌'}</p>
|
||||
<p>인증: {testResults.auth ? '✅' : '❌'}</p>
|
||||
<p>데이터베이스: {testResults.database ? '✅' : '❌'}</p>
|
||||
</div>
|
||||
)}
|
||||
<div className="text-right pt-1">
|
||||
<Link
|
||||
to="/supabase-settings"
|
||||
className="inline-flex items-center text-neuro-income hover:underline"
|
||||
>
|
||||
<span>Supabase 설정 변경</span>
|
||||
<ArrowRight className="h-3 w-3 ml-1" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
};
|
||||
|
||||
export default SupabaseConnectionStatus;
|
||||
@@ -1,79 +0,0 @@
|
||||
|
||||
import React, { useState } from "react";
|
||||
import { RefreshCw } from "lucide-react";
|
||||
import { testSupabaseConnection } from "@/lib/supabase";
|
||||
import { useToast } from "@/hooks/useToast.wrapper";
|
||||
import { TestResults } from "@/lib/supabase/tests/types";
|
||||
|
||||
interface TestConnectionSectionProps {
|
||||
setLoginError: (error: string | null) => void;
|
||||
setTestResults: (results: TestResults) => void;
|
||||
}
|
||||
|
||||
const TestConnectionSection: React.FC<TestConnectionSectionProps> = ({
|
||||
setLoginError,
|
||||
setTestResults
|
||||
}) => {
|
||||
const [testLoading, setTestLoading] = useState(false);
|
||||
const { toast } = useToast();
|
||||
|
||||
const runConnectionTest = async () => {
|
||||
setTestLoading(true);
|
||||
setLoginError(null);
|
||||
try {
|
||||
const results = await testSupabaseConnection();
|
||||
setTestResults(results);
|
||||
|
||||
if (results.errors.length === 0) {
|
||||
toast({
|
||||
title: "연결 테스트 성공",
|
||||
description: "Supabase 서버 연결이 정상입니다.",
|
||||
});
|
||||
} else {
|
||||
toast({
|
||||
title: "연결 테스트 실패",
|
||||
description: `오류 발생: ${results.errors[0]}`,
|
||||
variant: "destructive"
|
||||
});
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error("연결 테스트 중 오류:", error);
|
||||
setLoginError(error.message || "테스트 실행 중 예상치 못한 오류가 발생했습니다.");
|
||||
|
||||
toast({
|
||||
title: "연결 테스트 오류",
|
||||
description: "테스트 실행 중 예상치 못한 오류가 발생했습니다.",
|
||||
variant: "destructive"
|
||||
});
|
||||
} finally {
|
||||
setTestLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="neuro-card p-4 mb-6">
|
||||
<h3 className="text-sm font-medium mb-2">Supabase 연결 진단</h3>
|
||||
<div className="flex justify-between items-center">
|
||||
<button
|
||||
onClick={runConnectionTest}
|
||||
disabled={testLoading}
|
||||
className="text-xs flex items-center text-neuro-income hover:underline"
|
||||
>
|
||||
{testLoading ? (
|
||||
<>
|
||||
<RefreshCw className="mr-1 h-3 w-3 animate-spin" />
|
||||
테스트 중...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<RefreshCw className="mr-1 h-3 w-3" />
|
||||
연결 테스트 실행
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TestConnectionSection;
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
// 서버 연결 상태 타입
|
||||
export interface ServerStatus {
|
||||
checked: boolean;
|
||||
connected: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
// 회원가입 응답 타입
|
||||
export interface SignUpResponse {
|
||||
error: any;
|
||||
user: any;
|
||||
redirectToSettings?: boolean;
|
||||
emailConfirmationRequired?: boolean;
|
||||
}
|
||||
|
||||
// 회원가입 폼 공통 props
|
||||
export interface RegisterFormCommonProps {
|
||||
serverStatus: ServerStatus;
|
||||
setRegisterError: React.Dispatch<React.SetStateAction<string | null>>;
|
||||
}
|
||||
Reference in New Issue
Block a user