import React from "react"; import { Button } from "@/components/ui/button"; import { Copy, Terminal } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { copyToClipboard } from "@/utils/copyUtils"; import { useLanguage } from "@/contexts/LanguageContext"; interface ManualInstallTabProps { serverToken: string; currentPocketBaseUrl: string; formData: { serverName: string; osType: string; checkInterval: string; }; serverId: string; onDialogClose: () => void; } export const ManualInstallTab: React.FC = ({ serverToken, currentPocketBaseUrl, formData, serverId, onDialogClose, }) => { const { t } = useLanguage(); const getManualInstallSteps = () => { const scriptUrl = "https://cdn.checkcle.io/scripts/server-agent.sh"; return [ { title: t('downloadScript'), command: `curl -L -o server-agent.sh "${scriptUrl}"` }, { title: t('makeExecutable'), command: `chmod +x server-agent.sh` }, { title: t('runInstall'), command: `SERVER_TOKEN="${serverToken}" POCKETBASE_URL="${currentPocketBaseUrl}" SERVER_NAME="${formData.serverName}" AGENT_ID="${serverId}" sudo bash server-agent.sh` } ]; }; return ( {t('manualInstallTitle')} {t('manualInstallDesc')}
{t('serverName')}: {formData.serverName}
{t('agentId')}: {serverId}
{t('osType')}: {formData.osType}
{t('checkInterval')}: {formData.checkInterval}s
{getManualInstallSteps().map((step, index) => (
{index + 1} {step.title}
                  {step.command}
                
))}

{t('prerequisites')}

  • {t('prereqRoot')}
  • {t('prereqCurl')}
  • {t('prereqInternet')}

{t('afterInstall')}

{t('agentWillStart')}

); };