diff --git a/web/src/components/Config.jsx b/web/src/components/Config.jsx index 3da9f16..22140c6 100644 --- a/web/src/components/Config.jsx +++ b/web/src/components/Config.jsx @@ -1,5 +1,5 @@ import { useState, useEffect, useCallback } from 'react' -import { User, Brain, RefreshCw, Globe, Wrench, Monitor } from 'lucide-react' +import { User, Brain, RefreshCw, Globe, Wrench } from 'lucide-react' import { useI18n, LANGUAGES } from '../i18n' import { getLayoutList } from '../i18n/keyboards' @@ -27,9 +27,7 @@ export default function Config({ api }) { const [profileForm, setProfileForm] = useState({}) const [providerForm, setProviderForm] = useState({}) const [toast, setToast] = useState(null) - const [terminalThemes, setTerminalThemes] = useState([]) - const [terminalSettings, setTerminalSettings] = useState({ font_size: 14, font_family: '', theme: 'default' }) - const [savingTerminal, setSavingTerminal] = useState(false) + const layouts = getLayoutList() @@ -43,19 +41,13 @@ export default function Config({ api }) { editor: d.profile?.preferences?.editor || '', shell: d.profile?.preferences?.shell || '', }) - if (d.terminal) { - setTerminalSettings({ - font_size: d.terminal.font_size || 14, - font_family: d.terminal.font_family || '', - theme: d.terminal.theme || 'default', - }) - } + }).catch(() => {}) api.getProviders().then(d => setProviders(d.providers || [])).catch(() => {}) api.getSkills().then(d => setSkillList(d.skills || [])).catch(() => {}) api.getUpdates().then(d => setUpdates(d.updates || [])).catch(() => {}) api.getTools().then(d => setTools(d.tools || [])).catch(() => {}) - api.getTerminalThemes().then(d => setTerminalThemes(d.themes || [])).catch(() => {}) + }, [api]) useEffect(() => { loadData() }, [loadData]) @@ -126,18 +118,6 @@ export default function Config({ api }) { } } - const handleSaveTerminalSettings = async () => { - setSavingTerminal(true) - try { - await api.saveTerminalSettings(terminalSettings) - showToast(t('config.saved')) - window.location.reload() - } catch (err) { - showToast(`${t('config.error')}: ${err.message}`) - } - setSavingTerminal(false) - } - const openProviderEdit = (p) => { setProviderForm({ name: p.name, @@ -213,13 +193,7 @@ export default function Config({ api }) { {activePanel === 'skills' && ( )} - {activePanel === 'terminal' && ( - - )} + @@ -470,102 +444,6 @@ function PanelSkills({ skillList, t }) { ) } -function PanelTerminal({ settings, setSettings, themes, saving, onSave, t }) { - const previewTheme = { - background: settings.theme === 'default' ? '#0A0A0C' : - settings.theme === 'monokai' ? '#272822' : - settings.theme === 'gruvbox' ? '#282828' : - settings.theme === 'nord' ? '#2E3440' : - settings.theme === 'solarized-dark' ? '#002B36' : - settings.theme === 'dracula' ? '#282A36' : '#0A0A0C', - foreground: settings.theme === 'default' ? '#EAE0E2' : - settings.theme === 'monokai' ? '#F8F8F2' : - settings.theme === 'gruvbox' ? '#EBDBB2' : - settings.theme === 'nord' ? '#D8DEE9' : - settings.theme === 'solarized-dark' ? '#839496' : - settings.theme === 'dracula' ? '#F8F8F2' : '#EAE0E2', - } - - return ( -
-
- {t('config.terminalTheme')} -
- {themes.map(th => ( -
setSettings(s => ({ ...s, theme: th.id }))} - > - {th.name} -
- ))} -
-
- -
- {t('config.fontSize')} -
- {[12, 14, 16, 18, 20, 24].map(size => ( -
setSettings(s => ({ ...s, font_size: size }))} - > - {size}px -
- ))} -
-
- -
- {t('config.fontFamily')} - -
- -
- {t('config.preview')} -
- ~/projects - git status -
- On branch - main -
- Type a command... - -
-
- -
- -
-
- ) -} - function FormInput({ label, value, onChange, type = 'text' }) { return (