ソースを参照

fix: edit load balancing not pass id (#8370)

Joel 7 ヶ月 前
コミット
9d80d7def7

+ 1 - 0
web/app/components/header/account-setting/model-provider-page/model-modal/model-load-balancing-entry-modal.tsx

@@ -214,6 +214,7 @@ const ModelLoadBalancingEntryModal: FC<ModelModalProps> = ({
           ...value,
           ...getSecretValues(value),
         },
+        entry?.id,
       )
       if (res.status === ValidatedStatus.Success) {
         // notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })

+ 2 - 2
web/app/components/header/account-setting/model-provider-page/utils.ts

@@ -56,14 +56,14 @@ export const validateCredentials = async (predefined: boolean, provider: string,
   }
 }
 
-export const validateLoadBalancingCredentials = async (predefined: boolean, provider: string, v: FormValue): Promise<{
+export const validateLoadBalancingCredentials = async (predefined: boolean, provider: string, v: FormValue, id?: string): Promise<{
   status: ValidatedStatus
   message?: string
 }> => {
   const { __model_name, __model_type, ...credentials } = v
   try {
     const res = await validateModelLoadBalancingCredentials({
-      url: `/workspaces/current/model-providers/${provider}/models/load-balancing-configs/credentials-validate`,
+      url: `/workspaces/current/model-providers/${provider}/models/load-balancing-configs/${id ? `${id}/` : ''}credentials-validate`,
       body: {
         model: __model_name,
         model_type: __model_type,