import { Info, Zap } from "lucide-react" import { useState } from "react" import { useTranslation } from "react-i18next" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Separator } from "@/components/ui/separator" import { Switch } from "@/components/ui/switch" import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip" import { GpuStatus } from "@/features/video-compiler/components/gpu-status" import { useUserSettings } from "../../hooks/use-user-settings" /** * Типы прокси-серверов */ const PROXY_TYPES = ["http", "https", "socks5"] as const type ProxyType = (typeof PROXY_TYPES)[number] /** * Вкладка настроек производительности * Содержит настройки GPU ускорения и прокси-сервера */ export function PerformanceSettingsTab() { const { t } = useTranslation() const { // GPU настройки gpuAccelerationEnabled = true, preferredGpuEncoder = "auto", // Прокси настройки proxyEnabled = false, proxyType = "http", proxyHost = "", proxyPort = "", proxyUsername = "", proxyPassword = "", // Дополнительные настройки производительности maxConcurrentJobs = 2, renderQuality = "high", backgroundRenderingEnabled = true, renderDelay = 5, // Методы обновления handleGpuAccelerationChange, handlePreferredGpuEncoderChange, handleProxyEnabledChange, handleProxyTypeChange, handleProxyHostChange, handleProxyPortChange, handleProxyUsernameChange, handleProxyPasswordChange, handleMaxConcurrentJobsChange, handleRenderQualityChange, handleBackgroundRenderingChange, handleRenderDelayChange, } = useUserSettings() // Локальное состояние для управления видимостью пароля const [showPassword, setShowPassword] = useState(false) return (
{/* GPU Ускорение */}
{gpuAccelerationEnabled && (
{/* Компонент статуса GPU */} {/* Выбор предпочитаемого GPU кодировщика */}
)}
{/* Настройки рендеринга */}
{/* Качество рендеринга */}
{/* Фоновый рендеринг с предпросмотром */}

{t("dialogs.userSettings.performance.backgroundRenderingDesc")}

{/* Задержка начала рендеринга */} {backgroundRenderingEnabled && (

{t("dialogs.userSettings.performance.renderDelayTooltip")}

{t("dialogs.userSettings.performance.startAfter")} handleRenderDelayChange(Number(e.target.value))} className="w-20" min="1" max="60" /> {t("dialogs.userSettings.performance.seconds")}
)} {/* Максимальное количество параллельных задач */}
{/* Прокси-сервер */}
{proxyEnabled && (
{/* Тип прокси */}
{/* Хост и порт */}
handleProxyHostChange(e.target.value)} placeholder="proxy.example.com" />
handleProxyPortChange(e.target.value)} placeholder="8080" type="number" />
{/* Аутентификация */}
handleProxyUsernameChange(e.target.value)} placeholder={t("dialogs.userSettings.performance.usernamePlaceholder")} />
handleProxyPasswordChange(e.target.value)} placeholder={t("dialogs.userSettings.performance.passwordPlaceholder")} />
{/* Настройки прокси для медиа */}

{t("dialogs.userSettings.performance.autoProxyMediaDesc")}

)}
) }