fix: use alibaba cloud icon for qwen provider
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import GPUStackLogo from '@/assets/images/small-logo-200x200.png';
|
||||
import ai360 from '@/assets/providers-logo/ai360.svg';
|
||||
import qwen from '@/assets/providers-logo/alibabacloud.svg';
|
||||
import azure from '@/assets/providers-logo/azureai.svg';
|
||||
import baichuan from '@/assets/providers-logo/baichuan.svg';
|
||||
import baiduCloud from '@/assets/providers-logo/baiducloud.svg';
|
||||
@@ -26,7 +27,6 @@ import triton from '@/assets/providers-logo/nvidia.svg';
|
||||
import ollama from '@/assets/providers-logo/ollama.svg';
|
||||
import openai from '@/assets/providers-logo/openai.svg';
|
||||
import openrouter from '@/assets/providers-logo/openrouter.svg';
|
||||
import qwen from '@/assets/providers-logo/qwen.svg';
|
||||
import spark from '@/assets/providers-logo/spark.svg';
|
||||
import stepfun from '@/assets/providers-logo/stepfun.svg';
|
||||
import togetherai from '@/assets/providers-logo/together.svg';
|
||||
|
||||
@@ -12,7 +12,9 @@ import ProviderLogo from '../components/provider-logo';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { maasProviderOptions } from '../config/providers';
|
||||
import { FormData } from '../config/types';
|
||||
import providerTypeStyles from '../styles/provider-type.less';
|
||||
import ProviderConfigs from './provider-configs';
|
||||
|
||||
const Basic: React.FC<{
|
||||
onAPIKeyBlur?: (e: any) => void;
|
||||
}> = ({ onAPIKeyBlur }) => {
|
||||
@@ -38,6 +40,20 @@ const Basic: React.FC<{
|
||||
);
|
||||
};
|
||||
|
||||
const renderLogoPrefix = () => {
|
||||
const hasProvider = maasProviderOptions.some(
|
||||
(option) => option.value === providerType
|
||||
);
|
||||
if (hasProvider) {
|
||||
return (
|
||||
<div style={{ display: 'flex', alignItems: 'end', height: '100%' }}>
|
||||
<ProviderLogo provider={providerType as string} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item<FormData>
|
||||
@@ -73,9 +89,10 @@ const Basic: React.FC<{
|
||||
filterOption: filterOption
|
||||
}}
|
||||
required
|
||||
className={providerTypeStyles.providerType}
|
||||
prefix={renderLogoPrefix()}
|
||||
options={maasProviderOptions}
|
||||
optionRender={optionRender}
|
||||
labelRender={optionRender}
|
||||
label={intl.formatMessage({
|
||||
id: 'common.table.type'
|
||||
})}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
.providerType {
|
||||
:global {
|
||||
.ant-select-prefix {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
:global(input.ant-select-input) {
|
||||
padding-top: 6px !important;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user