wwf
2 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx
@@ -1,7 +1,6 @@
import type { FC } from 'react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { RiEqualizer2Line } from '@remixicon/react'
import ModelSelector from '../model-selector'
import {
  useModelList,
@@ -14,6 +13,7 @@
} from '../declarations'
import { ModelTypeEnum } from '../declarations'
import Tooltip from '@/app/components/base/tooltip'
import { Settings01 } from '@/app/components/base/icons/src/vender/line/general'
import {
  PortalToFollowElem,
  PortalToFollowElemContent,
@@ -31,7 +31,6 @@
  rerankDefaultModel: DefaultModelResponse | undefined
  speech2textDefaultModel: DefaultModelResponse | undefined
  ttsDefaultModel: DefaultModelResponse | undefined
  notConfigured: boolean
}
const SystemModel: FC<SystemModelSelectorProps> = ({
  textGenerationDefaultModel,
@@ -39,7 +38,6 @@
  rerankDefaultModel,
  speech2textDefaultModel,
  ttsDefaultModel,
  notConfigured,
}) => {
  const { t } = useTranslation()
  const { notify } = useToastContext()
@@ -130,23 +128,23 @@
      }}
    >
      <PortalToFollowElemTrigger onClick={() => setOpen(v => !v)}>
        <Button
          className='relative'
          variant={notConfigured ? 'primary' : 'secondary'}
          size='small'
        >
          <RiEqualizer2Line className='mr-1 h-3.5 w-3.5' />
        <div className={`
          flex items-center px-2 h-6 text-xs text-gray-700 cursor-pointer bg-white rounded-md border-[0.5px] border-gray-200 shadow-xs
          hover:bg-gray-100 hover:shadow-none
          ${open && 'bg-gray-100 shadow-none'}
        `}>
          <Settings01 className='mr-1 w-3 h-3 text-gray-500' />
          {t('common.modelProvider.systemModelSettings')}
        </Button>
        </div>
      </PortalToFollowElemTrigger>
      <PortalToFollowElemContent className='z-[60]'>
        <div className='w-[360px] rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg pt-4 shadow-xl'>
      <PortalToFollowElemContent className='z-50'>
        <div className='pt-4 w-[360px] rounded-xl border-[0.5px] border-black/5 bg-white shadow-xl'>
          <div className='px-6 py-1'>
            <div className='flex h-8 items-center text-[13px] font-medium text-text-primary'>
            <div className='flex items-center h-8 text-[13px] font-medium text-gray-900'>
              {t('common.modelProvider.systemReasoningModel.key')}
              <Tooltip
                popupContent={
                  <div className='w-[261px] text-text-tertiary'>
                  <div className='w-[261px] text-gray-500'>
                    {t('common.modelProvider.systemReasoningModel.tip')}
                  </div>
                }
@@ -162,11 +160,11 @@
            </div>
          </div>
          <div className='px-6 py-1'>
            <div className='flex h-8 items-center text-[13px] font-medium text-text-primary'>
            <div className='flex items-center h-8 text-[13px] font-medium text-gray-900'>
              {t('common.modelProvider.embeddingModel.key')}
              <Tooltip
                popupContent={
                  <div className='w-[261px] text-text-tertiary'>
                  <div className='w-[261px] text-gray-500'>
                    {t('common.modelProvider.embeddingModel.tip')}
                  </div>
                }
@@ -182,11 +180,11 @@
            </div>
          </div>
          <div className='px-6 py-1'>
            <div className='flex h-8 items-center text-[13px] font-medium text-text-primary'>
            <div className='flex items-center h-8 text-[13px] font-medium text-gray-900'>
              {t('common.modelProvider.rerankModel.key')}
              <Tooltip
                popupContent={
                  <div className='w-[261px] text-text-tertiary'>
                  <div className='w-[261px] text-gray-500'>
                    {t('common.modelProvider.rerankModel.tip')}
                  </div>
                }
@@ -202,11 +200,11 @@
            </div>
          </div>
          <div className='px-6 py-1'>
            <div className='flex h-8 items-center text-[13px] font-medium text-text-primary'>
            <div className='flex items-center h-8 text-[13px] font-medium text-gray-900'>
              {t('common.modelProvider.speechToTextModel.key')}
              <Tooltip
                popupContent={
                  <div className='w-[261px] text-text-tertiary'>
                  <div className='w-[261px] text-gray-500'>
                    {t('common.modelProvider.speechToTextModel.tip')}
                  </div>
                }
@@ -222,11 +220,11 @@
            </div>
          </div>
          <div className='px-6 py-1'>
            <div className='flex h-8 items-center text-[13px] font-medium text-text-primary'>
            <div className='flex items-center h-8 text-[13px] font-medium text-gray-900'>
              {t('common.modelProvider.ttsModel.key')}
              <Tooltip
                popupContent={
                  <div className='w-[261px] text-text-tertiary'>
                  <div className='w-[261px] text-gray-500'>
                    {t('common.modelProvider.ttsModel.tip')}
                  </div>
                }