feat: redesign settings page

This commit is contained in:
butterfly
2024-04-24 15:44:24 +08:00
parent f7074bba8c
commit c99086447e
55 changed files with 2603 additions and 1446 deletions

View File

@@ -1,5 +1,4 @@
import { LLMModel } from "../client/api";
import { isMacOS } from "../utils";
import { getClientConfig } from "../config/client";
import {
DEFAULT_INPUT_TEMPLATE,
@@ -8,6 +7,9 @@ import {
StoreKey,
} from "../constant";
import { createPersistStore } from "../utils/store";
import System from "@/app/icons/systemIcon.svg";
import Light from "@/app/icons/lightIcon.svg";
import Dark from "@/app/icons/darkIcon.svg";
export type ModelType = (typeof DEFAULT_MODELS)[number]["name"];
@@ -25,6 +27,21 @@ export enum Theme {
Light = "light",
}
export const ThemeConfig = {
[Theme.Auto]: {
icon: System,
title: "Follow System",
},
[Theme.Light]: {
icon: Light,
title: "Light model",
},
[Theme.Dark]: {
icon: Dark,
title: "Dark model",
},
};
export const DEFAULT_CONFIG = {
lastUpdate: Date.now(), // timestamp, to merge state
@@ -45,6 +62,8 @@ export const DEFAULT_CONFIG = {
customModels: "",
models: DEFAULT_MODELS as any as LLMModel[],
isMobileScreen: false,
modelConfig: {
model: "gpt-3.5-turbo" as ModelType,
temperature: 0.5,