OllaHub
Detectamos o Ollama, mas ele não está rodando.
'use client'; import { useOllamaCheck } from "@/hooks/use-ollama-check"; import { Hero } from "@/components/landing/hero"; import { InstallModal } from "@/components/modals/install-modal"; import { StoppedCard } from "@/components/landing/stopped-card"; import { WelcomeNotification } from "@/components/notifications/welcome-notification"; import { Loader2 } from "lucide-react"; import { useRouter } from "next/navigation"; import { useEffect } from "react"; export default function Home() { const { status, check } = useOllamaCheck(); const router = useRouter(); // Tentar iniciar Ollama automaticamente quando o componente montar useEffect(() => { const tryAutoStart = async () => { try { const { invoke } = await import("@tauri-apps/api/core"); await invoke('auto_start_ollama'); // Aguardar um pouco e verificar novamente setTimeout(() => { check(); }, 2000); } catch (error) { console.error('Erro ao tentar iniciar Ollama automaticamente:', error); } }; // Só tentar se estiver instalado mas não rodando if (status === 'installed_stopped') { tryAutoStart(); } }, [status, check]); const handleStart = () => { const setupComplete = localStorage.getItem("ollahub_setup_complete"); if (setupComplete) { router.push("/chat"); } else { router.push("/setup"); } }; if (status === 'checking') { return (
Detectamos o Ollama, mas ele não está rodando.