From 0675a9b84940d53168f8da04b67f1658b0027afc Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Tue, 24 Dec 2024 06:56:26 +0000 Subject: [PATCH] fix style --- .../provider/(list)/ProviderGrid/index.tsx | 2 +- .../(main)/settings/provider/ProviderMenu/Item.tsx | 2 +- .../slices/modelList/selectors/modelProvider.ts | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/app/(main)/settings/provider/(list)/ProviderGrid/index.tsx b/src/app/(main)/settings/provider/(list)/ProviderGrid/index.tsx index 4c754a950286b..8d26a0240da2b 100644 --- a/src/app/(main)/settings/provider/(list)/ProviderGrid/index.tsx +++ b/src/app/(main)/settings/provider/(list)/ProviderGrid/index.tsx @@ -33,7 +33,7 @@ const useStyles = createStyles(({ css, responsive, token }) => ({ })); const List = memo(() => { - const { styles, theme } = useStyles(); + const { styles } = useStyles(); const enabledList = useUserStore(modelProviderSelectors.enabledModelProviderList, isEqual); const disabledList = useUserStore(modelProviderSelectors.disabledModelProviderList, isEqual); diff --git a/src/app/(main)/settings/provider/ProviderMenu/Item.tsx b/src/app/(main)/settings/provider/ProviderMenu/Item.tsx index ec5b685b6344f..1043f0571db95 100644 --- a/src/app/(main)/settings/provider/ProviderMenu/Item.tsx +++ b/src/app/(main)/settings/provider/ProviderMenu/Item.tsx @@ -51,7 +51,7 @@ const ProviderItem = memo(({ id, name }) => { href={`/settings/provider/${id}`} > - + {name} diff --git a/src/store/user/slices/modelList/selectors/modelProvider.ts b/src/store/user/slices/modelList/selectors/modelProvider.ts index 283d372212e86..f099c45cd9f99 100644 --- a/src/store/user/slices/modelList/selectors/modelProvider.ts +++ b/src/store/user/slices/modelList/selectors/modelProvider.ts @@ -96,6 +96,11 @@ const modelProviderListForModelSelect = (s: UserStore): ModelProviderCard[] => chatModels: provider.chatModels.filter((model) => model.enabled), })); +const enabledModelProviderList = (s: UserStore): ModelProviderCard[] => + modelProviderList(s).filter((s) => s.enabled); +const disabledModelProviderList = (s: UserStore): ModelProviderCard[] => + modelProviderList(s).filter((s) => !s.enabled); + const getModelCardById = (id: string) => (s: UserStore) => { const list = modelProviderList(s); @@ -122,26 +127,27 @@ const modelMaxToken = (id: string) => (s: UserStore) => getModelCardById(id)(s)? export const modelProviderSelectors = { defaultModelProviderList, + disabledModelProviderList, + enabledModelProviderList, + getDefaultEnabledModelsById, getDefaultModelCardById, getEnableModelsById, getModelCardById, - getModelCardsById, isModelEnabledFiles, isModelEnabledFunctionCall, isModelEnabledUpload, + isModelEnabledVision, - isModelHasMaxToken, + isModelHasMaxToken, isProviderEnabled, modelMaxToken, modelProviderList, - modelProviderListForModelSelect, - remoteProviderModelCards, serverProviderModelCards, };