From 141e4e02761801d0b17cd531fa6083cdb22750c1 Mon Sep 17 00:00:00 2001 From: liuzhenghua <1090179900@qq.com> Date: Sun, 4 Aug 2024 14:32:24 +0000 Subject: [PATCH] fix: restore xinference secret field (#6941) Co-authored-by: liuzhenghua-jk --- .../model_runtime/model_providers/xinference/xinference.yaml | 4 ++-- .../account-setting/model-provider-page/model-modal/Form.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/core/model_runtime/model_providers/xinference/xinference.yaml b/api/core/model_runtime/model_providers/xinference/xinference.yaml index aca076b6e1..be9073c1ca 100644 --- a/api/core/model_runtime/model_providers/xinference/xinference.yaml +++ b/api/core/model_runtime/model_providers/xinference/xinference.yaml @@ -33,7 +33,7 @@ model_credential_schema: label: zh_Hans: 服务器URL en_US: Server url - type: text-input + type: secret-input required: true placeholder: zh_Hans: 在此输入Xinference的服务器地址,如 http://192.168.1.100:9997 @@ -51,7 +51,7 @@ model_credential_schema: label: zh_Hans: API密钥 en_US: API key - type: text-input + type: secret-input required: false placeholder: zh_Hans: 在此输入您的API密钥 diff --git a/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx b/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx index c93c41eba2..6bf7f389fc 100644 --- a/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx +++ b/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx @@ -114,7 +114,7 @@ const Form: FC = ({ validated={validatedSuccess} placeholder={placeholder?.[language] || placeholder?.en_US} disabled={disabed} - type={formSchema.type === FormTypeEnum.textNumber ? 'number' : formSchema.type === FormTypeEnum.secretInput ? 'password' : 'text'} + type={formSchema.type === FormTypeEnum.textNumber ? 'number' : 'text'} {...(formSchema.type === FormTypeEnum.textNumber ? { min: (formSchema as CredentialFormSchemaNumberInput).min, max: (formSchema as CredentialFormSchemaNumberInput).max } : {})} /> {fieldMoreInfo?.(formSchema)}