|
@@ -32,6 +32,7 @@ import { UPDATE_URL } from "../constant";
|
|
import { SearchService, usePromptStore } from "../store/prompt";
|
|
import { SearchService, usePromptStore } from "../store/prompt";
|
|
import { requestUsage } from "../requests";
|
|
import { requestUsage } from "../requests";
|
|
import { ErrorBoundary } from "./error";
|
|
import { ErrorBoundary } from "./error";
|
|
|
|
+import { InputRange } from "./input-range";
|
|
|
|
|
|
function SettingItem(props: {
|
|
function SettingItem(props: {
|
|
title: string;
|
|
title: string;
|
|
@@ -274,8 +275,7 @@ export function Settings(props: { closeSettings: () => void }) {
|
|
title={Locale.Settings.FontSize.Title}
|
|
title={Locale.Settings.FontSize.Title}
|
|
subTitle={Locale.Settings.FontSize.SubTitle}
|
|
subTitle={Locale.Settings.FontSize.SubTitle}
|
|
>
|
|
>
|
|
- <input
|
|
|
|
- type="range"
|
|
|
|
|
|
+ <InputRange
|
|
title={`${config.fontSize ?? 14}px`}
|
|
title={`${config.fontSize ?? 14}px`}
|
|
value={config.fontSize}
|
|
value={config.fontSize}
|
|
min="12"
|
|
min="12"
|
|
@@ -287,7 +287,7 @@ export function Settings(props: { closeSettings: () => void }) {
|
|
(config.fontSize = Number.parseInt(e.currentTarget.value)),
|
|
(config.fontSize = Number.parseInt(e.currentTarget.value)),
|
|
)
|
|
)
|
|
}
|
|
}
|
|
- ></input>
|
|
|
|
|
|
+ ></InputRange>
|
|
</SettingItem>
|
|
</SettingItem>
|
|
|
|
|
|
<SettingItem title={Locale.Settings.TightBorder}>
|
|
<SettingItem title={Locale.Settings.TightBorder}>
|
|
@@ -407,8 +407,7 @@ export function Settings(props: { closeSettings: () => void }) {
|
|
title={Locale.Settings.HistoryCount.Title}
|
|
title={Locale.Settings.HistoryCount.Title}
|
|
subTitle={Locale.Settings.HistoryCount.SubTitle}
|
|
subTitle={Locale.Settings.HistoryCount.SubTitle}
|
|
>
|
|
>
|
|
- <input
|
|
|
|
- type="range"
|
|
|
|
|
|
+ <InputRange
|
|
title={config.historyMessageCount.toString()}
|
|
title={config.historyMessageCount.toString()}
|
|
value={config.historyMessageCount}
|
|
value={config.historyMessageCount}
|
|
min="0"
|
|
min="0"
|
|
@@ -420,7 +419,7 @@ export function Settings(props: { closeSettings: () => void }) {
|
|
(config.historyMessageCount = e.target.valueAsNumber),
|
|
(config.historyMessageCount = e.target.valueAsNumber),
|
|
)
|
|
)
|
|
}
|
|
}
|
|
- ></input>
|
|
|
|
|
|
+ ></InputRange>
|
|
</SettingItem>
|
|
</SettingItem>
|
|
|
|
|
|
<SettingItem
|
|
<SettingItem
|
|
@@ -467,8 +466,7 @@ export function Settings(props: { closeSettings: () => void }) {
|
|
title={Locale.Settings.Temperature.Title}
|
|
title={Locale.Settings.Temperature.Title}
|
|
subTitle={Locale.Settings.Temperature.SubTitle}
|
|
subTitle={Locale.Settings.Temperature.SubTitle}
|
|
>
|
|
>
|
|
- <input
|
|
|
|
- type="range"
|
|
|
|
|
|
+ <InputRange
|
|
value={config.modelConfig.temperature?.toFixed(1)}
|
|
value={config.modelConfig.temperature?.toFixed(1)}
|
|
min="0"
|
|
min="0"
|
|
max="2"
|
|
max="2"
|
|
@@ -482,7 +480,7 @@ export function Settings(props: { closeSettings: () => void }) {
|
|
)),
|
|
)),
|
|
);
|
|
);
|
|
}}
|
|
}}
|
|
- ></input>
|
|
|
|
|
|
+ ></InputRange>
|
|
</SettingItem>
|
|
</SettingItem>
|
|
<SettingItem
|
|
<SettingItem
|
|
title={Locale.Settings.MaxTokens.Title}
|
|
title={Locale.Settings.MaxTokens.Title}
|
|
@@ -508,8 +506,7 @@ export function Settings(props: { closeSettings: () => void }) {
|
|
title={Locale.Settings.PresencePenlty.Title}
|
|
title={Locale.Settings.PresencePenlty.Title}
|
|
subTitle={Locale.Settings.PresencePenlty.SubTitle}
|
|
subTitle={Locale.Settings.PresencePenlty.SubTitle}
|
|
>
|
|
>
|
|
- <input
|
|
|
|
- type="range"
|
|
|
|
|
|
+ <InputRange
|
|
value={config.modelConfig.presence_penalty?.toFixed(1)}
|
|
value={config.modelConfig.presence_penalty?.toFixed(1)}
|
|
min="-2"
|
|
min="-2"
|
|
max="2"
|
|
max="2"
|
|
@@ -523,7 +520,7 @@ export function Settings(props: { closeSettings: () => void }) {
|
|
)),
|
|
)),
|
|
);
|
|
);
|
|
}}
|
|
}}
|
|
- ></input>
|
|
|
|
|
|
+ ></InputRange>
|
|
</SettingItem>
|
|
</SettingItem>
|
|
</List>
|
|
</List>
|
|
</div>
|
|
</div>
|