From f43c5c019fa38c389892edfaf64701f1bccae884 Mon Sep 17 00:00:00 2001 From: Hk-Gosuto Date: Fri, 8 Nov 2024 13:08:55 +0800 Subject: [PATCH] fix: build --- app/components/model-config.module.scss | 7 +++ app/components/model-config.tsx | 67 ++++++++++++++++++++++--- app/components/tts-config.tsx | 3 +- app/locales/cn.ts | 4 ++ app/locales/en.ts | 4 ++ 5 files changed, 76 insertions(+), 9 deletions(-) create mode 100644 app/components/model-config.module.scss diff --git a/app/components/model-config.module.scss b/app/components/model-config.module.scss new file mode 100644 index 000000000..40ba03f86 --- /dev/null +++ b/app/components/model-config.module.scss @@ -0,0 +1,7 @@ +.select-compress-model { + width: 60%; + select { + max-width: 100%; + white-space: normal; + } +} diff --git a/app/components/model-config.tsx b/app/components/model-config.tsx index a15c5ef2b..ede22755a 100644 --- a/app/components/model-config.tsx +++ b/app/components/model-config.tsx @@ -5,34 +5,48 @@ import Locale from "../locales"; import { InputRange } from "./input-range"; import { ListItem, Select } from "./ui-lib"; import { useAllModels } from "../utils/hooks"; +import { groupBy } from "lodash-es"; +import styles from "./model-config.module.scss"; +import { getModelProvider } from "../utils/model"; export function ModelConfigList(props: { modelConfig: ModelConfig; updateConfig: (updater: (config: ModelConfig) => void) => void; }) { const allModels = useAllModels(); + const groupModels = groupBy( + allModels.filter((v) => v.available), + "provider.providerName", + ); const value = `${props.modelConfig.model}@${props.modelConfig?.providerName}`; + const compressModelValue = `${props.modelConfig.compressModel}@${props.modelConfig?.compressProviderName}`; return ( <> @@ -159,6 +179,7 @@ export function ModelConfigList(props: { subTitle={Locale.Settings.InputTemplate.SubTitle} > @@ -175,6 +196,7 @@ export function ModelConfigList(props: { subTitle={Locale.Settings.HistoryCount.SubTitle} > + + + ); } diff --git a/app/components/tts-config.tsx b/app/components/tts-config.tsx index f86e3bc52..39ae85730 100644 --- a/app/components/tts-config.tsx +++ b/app/components/tts-config.tsx @@ -1,4 +1,4 @@ -import { PluginConfig, TTSConfig, TTSConfigValidator } from "../store"; +import { TTSConfig, TTSConfigValidator } from "../store"; import Locale from "../locales"; import { ListItem, Select } from "./ui-lib"; @@ -111,6 +111,7 @@ export function TTSConfigList(props: { subTitle={Locale.Settings.TTS.Speed.SubTitle} >