import React, { useCallback, useEffect, useState } from 'react'; import { useSettings } from '~/lib/hooks/useSettings'; import commit from '~/commit.json'; const versionHash = commit.commit; // Get the version hash from commit.json export default function DebugTab() { const { providers } = useSettings(); const [activeProviders, setActiveProviders] = useState([]); useEffect(() => { setActiveProviders( Object.entries(providers) .filter(([_key, provider]) => provider.settings.enabled) .map(([_key, provider]) => provider.name), ); }, [providers]); const handleCopyToClipboard = useCallback(() => { const debugInfo = { OS: navigator.platform, Browser: navigator.userAgent, ActiveFeatures: activeProviders, BaseURLs: { Ollama: process.env.REACT_APP_OLLAMA_URL, OpenAI: process.env.REACT_APP_OPENAI_URL, LMStudio: process.env.REACT_APP_LM_STUDIO_URL, }, Version: versionHash, }; navigator.clipboard.writeText(JSON.stringify(debugInfo, null, 2)).then(() => { alert('Debug information copied to clipboard!'); }); }, [providers]); return (

Debug Tab

System Information

OS: {navigator.platform}

Browser: {navigator.userAgent}

Active Features

Base URLs

Version Information

Version Hash: {versionHash}

); }