From 1c6f4e6706e70c7e59adcc342d24d8bef6579dfd Mon Sep 17 00:00:00 2001 From: seb Date: Mon, 5 Oct 2026 19:04:13 +0200 Subject: [PATCH] u --- src/components/settings/SettingsDialog.jsx | 43 +++++++++++++++++-- src/components/settings/SettingsKeysPanel.jsx | 42 ++++++++++++++++-- 2 files changed, 77 insertions(+), 8 deletions(-) diff --git a/src/components/settings/SettingsDialog.jsx b/src/components/settings/SettingsDialog.jsx index 11931df..a762caf 100644 --- a/src/components/settings/SettingsDialog.jsx +++ b/src/components/settings/SettingsDialog.jsx @@ -8,6 +8,8 @@ import Tabs from '@mui/material/Tabs'; import NumbersIcon from '@mui/icons-material/Numbers'; import PrintOutlinedIcon from '@mui/icons-material/PrintOutlined'; import TuneIcon from '@mui/icons-material/Tune'; +import CloseIcon from '@mui/icons-material/Close'; +import IconButton from '@mui/material/IconButton'; import NumberSettingsPanel from './NumberSettingsPanel'; import PrinterSettingsPanel from './PrinterSettingsPanel'; import SettingsKeysPanel from './SettingsKeysPanel'; @@ -46,9 +48,42 @@ export default class SettingsDialog extends Component { const { open, onClose } = this.props; const { tab } = this.state; + const paperSx = { + height: '85vh', + minHeight: '85vh', + maxHeight: '85vh', + display: 'flex', + flexDirection: 'column', + }; + return ( - - Einstellungen + + + Einstellungen + + + + ))} - + {TABS.map((t) => ( diff --git a/src/components/settings/SettingsKeysPanel.jsx b/src/components/settings/SettingsKeysPanel.jsx index 2f83d12..a14f25d 100644 --- a/src/components/settings/SettingsKeysPanel.jsx +++ b/src/components/settings/SettingsKeysPanel.jsx @@ -28,6 +28,9 @@ const SETTABLE_KEYS = [ 'keys.tavily', 'keys.openrouter', 'keys.serper', + 'default-model', + 'systemprompt-prefix', + 'systemprompt-suffix', ]; const KEY_LABELS = { @@ -35,8 +38,21 @@ const KEY_LABELS = { 'keys.tavily': 'Tavily API-Key', 'keys.openrouter': 'OpenRouter API-Key', 'keys.serper': 'Serper API-Key', + 'default-model': 'Modellslug', + 'systemprompt-prefix': 'Prä Prompt', + 'systemprompt-suffix': 'Post Prompt', }; +const MULTILINE_KEYS = new Set([ + 'systemprompt-prefix', + 'systemprompt-suffix', +]); + +const EXCLUDED_KEYS = new Set([ + 'labelprinter.addr', + 'labelprinter.type', +]); + function keyLabel(key) { return KEY_LABELS[key] ?? key; } @@ -177,25 +193,43 @@ export default class SettingsKeysPanel extends Component { - {SETTABLE_KEYS.map((key) => { + {SETTABLE_KEYS.filter((k) => !EXCLUDED_KEYS.has(k)).map((key) => { const row = settings.find((s) => s.key === key); const draft = row ? drafts[row.key] : null; if (!row || !draft) return null; + const isMultiline = MULTILINE_KEYS.has(row.key); return ( - + {keyLabel(row.key)} - + this.handleChange(row.key, 'value', e.target.value)} + onKeyDown={(e) => { + if (!isMultiline && e.key === 'Enter') { + e.preventDefault(); + void this.handleSave(row.key); + } + }} autoComplete="off" /> - +