fix: open the advanced when configured
This commit is contained in:
@@ -30,6 +30,7 @@ const useScrollActiveChange = (options: {
|
|||||||
return {
|
return {
|
||||||
activeKey,
|
activeKey,
|
||||||
collapseKeys,
|
collapseKeys,
|
||||||
|
setCollapseKeys,
|
||||||
handleActiveChange,
|
handleActiveChange,
|
||||||
handleOnCollapseChange,
|
handleOnCollapseChange,
|
||||||
updateActiveKey
|
updateActiveKey
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ const ProviderForm: React.FC<ProviderFormProps> = forwardRef((props, ref) => {
|
|||||||
const {
|
const {
|
||||||
activeKey,
|
activeKey,
|
||||||
collapseKeys,
|
collapseKeys,
|
||||||
|
setCollapseKeys,
|
||||||
handleActiveChange,
|
handleActiveChange,
|
||||||
handleOnCollapseChange,
|
handleOnCollapseChange,
|
||||||
updateActiveKey
|
updateActiveKey
|
||||||
@@ -147,6 +148,14 @@ const ProviderForm: React.FC<ProviderFormProps> = forwardRef((props, ref) => {
|
|||||||
const customConfigYaml = json2Yaml(
|
const customConfigYaml = json2Yaml(
|
||||||
_.omit(currentData.config, ['type', 'openaiCustomUrl']) || {}
|
_.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({
|
form.setFieldsValue({
|
||||||
...currentData,
|
...currentData,
|
||||||
models: (currentData.models || []).map((item) => ({
|
models: (currentData.models || []).map((item) => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user