import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { invoke } from '@tauri-apps/api/core'; import { save as saveDialog } from '@tauri-apps/plugin-dialog'; import { open as openUrl } from '@tauri-apps/plugin-shell'; import { AppWindow, ChevronDown, Download, ExternalLink, Globe, HardDrive, Info, Scale, Sliders, Users } from 'lucide-react'; import { version as appVersion } from '../../../package.json'; import i18n from '../../i18n'; import { useAuthStore } from '../../store/authStore'; import type { LoggingMode } from '../../store/authStoreTypes'; import { IS_LINUX } from '../../utils/platform'; import { showToast } from '../../utils/toast'; import { AboutPsysonicBrandHeader } from '../AboutPsysonicLol'; import CustomSelect from '../CustomSelect'; import LicensesPanel from '../LicensesPanel'; import SettingsSubSection from '../SettingsSubSection'; import { BackupSection } from './BackupSection'; import { CONTRIBUTORS, MAINTAINERS } from '../../config/settingsCredits'; export function SystemTab() { const { t } = useTranslation(); const navigate = useNavigate(); const auth = useAuthStore(); const exportRuntimeLogs = async () => { const suggestedName = `psysonic-logs-${new Date().toISOString().replace(/[:.]/g, '-')}.log`; const selected = await saveDialog({ defaultPath: suggestedName, filters: [{ name: 'Log files', extensions: ['log', 'txt'] }], title: t('settings.loggingExport'), }); if (!selected || Array.isArray(selected)) return; try { const lines = await invoke('export_runtime_logs', { path: selected }); showToast(t('settings.loggingExportSuccess', { count: lines }), 3500, 'info'); } catch (e) { console.error(e); showToast(t('settings.loggingExportError'), 4500, 'error'); } }; return ( <> } >
i18n.changeLanguage(v)} options={[ { value: 'en', label: t('settings.languageEn') }, { value: 'de', label: t('settings.languageDe') }, { value: 'es', label: t('settings.languageEs') }, { value: 'fr', label: t('settings.languageFr') }, { value: 'nl', label: t('settings.languageNl') }, { value: 'nb', label: t('settings.languageNb') }, { value: 'ru', label: t('settings.languageRu') }, { value: 'zh', label: t('settings.languageZh') }, ]} />
{/* App-Verhalten (aus altem library/general Behavior-Block) */} } >
{t('settings.showTrayIcon')}
{t('settings.showTrayIconDesc')}
{t('settings.minimizeToTray')}
{t('settings.minimizeToTrayDesc')}
{IS_LINUX && ( <>
{t('settings.linuxWebkitSmoothScroll')}
{t('settings.linuxWebkitSmoothScrollDesc')}
)}
} > } >
{t('settings.loggingModeDesc')}
auth.setLoggingMode(v as LoggingMode)} options={[ { value: 'off', label: t('settings.loggingModeOff') }, { value: 'normal', label: t('settings.loggingModeNormal') }, { value: 'debug', label: t('settings.loggingModeDebug') }, ]} /> {auth.loggingMode === 'debug' && (
)}
} >

{t('settings.aboutDesc')}

{t('settings.aboutLicense')} {t('settings.aboutLicenseText')}
Stack {t('settings.aboutBuiltWith')}
{t('settings.aboutMaintainersLabel')}
{MAINTAINERS.map(m => (
{m.github}
))}
{t('settings.aboutReleaseNotesLabel')}
{t('settings.showChangelogOnUpdate')}
{t('settings.showChangelogOnUpdateDesc')}
} >
{[...CONTRIBUTORS].sort((a, b) => b.contributions.length - a.contributions.length).map(c => (
{c.github}
{ e.stopPropagation(); openUrl(`https://github.com/${c.github}`); }} onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.stopPropagation(); e.preventDefault(); openUrl(`https://github.com/${c.github}`); } }} > @{c.github} v{c.since} ยท {t('settings.aboutContributorsCount', { count: c.contributions.length })}
    {c.contributions.map(item =>
  • {item}
  • )}
))}
} > ); }