Merge remote-tracking branch 'upstream/master' into dashboard
This commit is contained in:
commit
a140e5b1d4
3 changed files with 31 additions and 18 deletions
|
|
@ -232,7 +232,9 @@ export default function SettingsPage() {
|
|||
>(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [automaticSuggestions, setAutomaticSuggestions] = useState(true);
|
||||
const [temperatureUnit, setTemperatureUnit] = useState<'C' | 'F'>('C');
|
||||
const [measureUnit, setMeasureUnit] = useState<'Imperial' | 'Metric'>(
|
||||
'Metric',
|
||||
);
|
||||
const [savingStates, setSavingStates] = useState<Record<string, boolean>>({});
|
||||
const [contextWindowSize, setContextWindowSize] = useState(2048);
|
||||
const [isCustomContextWindow, setIsCustomContextWindow] = useState(false);
|
||||
|
|
@ -334,7 +336,9 @@ export default function SettingsPage() {
|
|||
!predefinedContextSizes.includes(storedContextWindow),
|
||||
);
|
||||
|
||||
setTemperatureUnit(localStorage.getItem('temperatureUnit')! as 'C' | 'F');
|
||||
setMeasureUnit(
|
||||
localStorage.getItem('measureUnit')! as 'Imperial' | 'Metric',
|
||||
);
|
||||
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
|
@ -556,8 +560,8 @@ export default function SettingsPage() {
|
|||
localStorage.setItem('embeddingModel', value);
|
||||
} else if (key === 'ollamaContextWindow') {
|
||||
localStorage.setItem('ollamaContextWindow', value.toString());
|
||||
} else if (key === 'temperatureUnit') {
|
||||
localStorage.setItem('temperatureUnit', value.toString());
|
||||
} else if (key === 'measureUnit') {
|
||||
localStorage.setItem('measureUnit', value.toString());
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to save:', err);
|
||||
|
|
@ -735,22 +739,22 @@ export default function SettingsPage() {
|
|||
</div>
|
||||
<div className="flex flex-col space-y-1">
|
||||
<p className="text-black/70 dark:text-white/70 text-sm">
|
||||
Temperature Unit
|
||||
Measurement Units
|
||||
</p>
|
||||
<Select
|
||||
value={temperatureUnit ?? undefined}
|
||||
value={measureUnit ?? undefined}
|
||||
onChange={(e) => {
|
||||
setTemperatureUnit(e.target.value as 'C' | 'F');
|
||||
saveConfig('temperatureUnit', e.target.value);
|
||||
setMeasureUnit(e.target.value as 'Imperial' | 'Metric');
|
||||
saveConfig('measureUnit', e.target.value);
|
||||
}}
|
||||
options={[
|
||||
{
|
||||
label: 'Celsius',
|
||||
value: 'C',
|
||||
label: 'Metric',
|
||||
value: 'Metric',
|
||||
},
|
||||
{
|
||||
label: 'Fahrenheit',
|
||||
value: 'F',
|
||||
label: 'Imperial',
|
||||
value: 'Imperial',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue