From 0a0e03dc68adabaa3098f53b1381dae4d2e192dc Mon Sep 17 00:00:00 2001 From: jialin Date: Tue, 17 Mar 2026 17:29:38 +0800 Subject: [PATCH] fix: open the advanced when configured --- .../scroll-spy-tabs/use-scroll-active-change.ts | 1 + src/pages/maas-provider/forms/index.tsx | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/pages/_components/scroll-spy-tabs/use-scroll-active-change.ts b/src/pages/_components/scroll-spy-tabs/use-scroll-active-change.ts index e37c7cdd..51e5f831 100644 --- a/src/pages/_components/scroll-spy-tabs/use-scroll-active-change.ts +++ b/src/pages/_components/scroll-spy-tabs/use-scroll-active-change.ts @@ -30,6 +30,7 @@ const useScrollActiveChange = (options: { return { activeKey, collapseKeys, + setCollapseKeys, handleActiveChange, handleOnCollapseChange, updateActiveKey diff --git a/src/pages/maas-provider/forms/index.tsx b/src/pages/maas-provider/forms/index.tsx index 800ea80c..d7730322 100644 --- a/src/pages/maas-provider/forms/index.tsx +++ b/src/pages/maas-provider/forms/index.tsx @@ -51,6 +51,7 @@ const ProviderForm: React.FC = forwardRef((props, ref) => { const { activeKey, collapseKeys, + setCollapseKeys, handleActiveChange, handleOnCollapseChange, updateActiveKey @@ -147,6 +148,14 @@ const ProviderForm: React.FC = forwardRef((props, ref) => { const customConfigYaml = json2Yaml( _.omit(currentData.config, ['type', 'openaiCustomUrl']) || {} ); + + const customConfig = + _.omit(currentData.config, ['type', 'openaiCustomUrl']) || {}; + + if (Object.keys(customConfig).length > 0) { + setCollapseKeys((prev) => [...new Set([...prev, TABKeysMap.ADVANCED])]); + } + form.setFieldsValue({ ...currentData, models: (currentData.models || []).map((item) => ({