From 16b8c79a2b5a6afecd1ff1331c9a1533a25bf624 Mon Sep 17 00:00:00 2001 From: chanx <1243304602@qq.com> Date: Thu, 2 Jul 2026 17:49:52 +0800 Subject: [PATCH] Fix: hide model settings button and related functionality (#16563) --- .../setting-model/components/used-model.tsx | 53 ++++++++----------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/web/src/pages/user-setting/setting-model/components/used-model.tsx b/web/src/pages/user-setting/setting-model/components/used-model.tsx index fa8365c1e8..0e02a87b52 100644 --- a/web/src/pages/user-setting/setting-model/components/used-model.tsx +++ b/web/src/pages/user-setting/setting-model/components/used-model.tsx @@ -14,7 +14,6 @@ import { useEditInstanceModel, useFetchAddedProviders, useFetchInstanceModels, - useFetchProviderInstance, useFetchProviderInstances, useUpdateModelStatus, } from '@/hooks/use-llm-request'; @@ -25,13 +24,7 @@ import { } from '@/interfaces/database/llm'; import { IProviderModelItem } from '@/interfaces/request/llm'; import { cn } from '@/lib/utils'; -import { - ChevronsDown, - ChevronsUp, - Pencil, - Settings, - Trash2, -} from 'lucide-react'; +import { ChevronsDown, ChevronsUp, Pencil, Trash2 } from 'lucide-react'; import { useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { AddCustomModelDialog } from '../modal/provider-modal/components/add-custom-model-dialog'; @@ -204,8 +197,8 @@ function InstanceRow({ function InstanceModelList({ providerName, instanceName, - instance, - onEditInstance, + // instance, + // onEditInstance, }: { providerName: string; instanceName: string; @@ -220,25 +213,25 @@ function InstanceModelList({ // Lazily fetches the full instance details (incl. baseUrl) only when // the user opens the settings dialog — keeps the collapsed section // cheap and avoids the extra request for users who never click it. - const { refetch: fetchInstanceDetails } = useFetchProviderInstance( - providerName, - instanceName, - ); + // const { refetch: fetchInstanceDetails } = useFetchProviderInstance( + // providerName, + // instanceName, + // ); - const handleSettingsClick = useCallback(async () => { - let details: IProviderInstance = instance; - try { - const ret = await fetchInstanceDetails(); - if (ret.data) { - details = { ...instance, ...(ret.data as IProviderInstance) }; - } - } catch { - // Fall back to the list-level instance data if the show request - // fails (e.g. network error) — the modal still gets a usable - // baseline. - } - onEditInstance?.(providerName, details, models); - }, [fetchInstanceDetails, instance, models, onEditInstance, providerName]); + // const handleSettingsClick = useCallback(async () => { + // let details: IProviderInstance = instance; + // try { + // const ret = await fetchInstanceDetails(); + // if (ret.data) { + // details = { ...instance, ...(ret.data as IProviderInstance) }; + // } + // } catch { + // // Fall back to the list-level instance data if the show request + // // fails (e.g. network error) — the modal still gets a usable + // // baseline. + // } + // onEditInstance?.(providerName, details, models); + // }, [fetchInstanceDetails, instance, models, onEditInstance, providerName]); const modelTypes = useMemo(() => { const types = new Set(); @@ -265,9 +258,9 @@ function InstanceModelList({ ))} - + */} )}