Chore/model icon url (#9218)

Co-authored-by: takatost <takatost@gmail.com>
Co-authored-by: jyong <718720800@qq.com>
This commit is contained in:
zxhlyh 2024-10-11 12:33:34 +08:00 committed by GitHub
parent 1c1e008dcf
commit d498f4e55e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 6 deletions

View File

@ -126,13 +126,12 @@ class ModelProviderIconApi(Resource):
Get model provider icon
"""
@setup_required
@login_required
@account_initialization_required
def get(self, provider: str, icon_type: str, lang: str):
model_provider_service = ModelProviderService()
icon, mimetype = model_provider_service.get_model_provider_icon(
provider=provider, icon_type=icon_type, lang=lang
provider=provider,
icon_type=icon_type,
lang=lang,
)
return send_file(io.BytesIO(icon), mimetype=mimetype)

View File

@ -26,7 +26,7 @@ const ModelIcon: FC<ModelIconProps> = ({
return (
<img
alt='model-icon'
src={`${provider.icon_small[language] || provider.icon_small.en_US}?_token=${localStorage.getItem('console_token')}`}
src={`${provider.icon_small[language] || provider.icon_small.en_US}`}
className={`w-4 h-4 ${className}`}
/>
)

View File

@ -16,7 +16,7 @@ const ProviderIcon: FC<ProviderIconProps> = ({
return (
<img
alt='provider-icon'
src={`${provider.icon_large[language] || provider.icon_large.en_US}?_token=${localStorage.getItem('console_token')}`}
src={`${provider.icon_large[language] || provider.icon_large.en_US}`}
className={`w-auto h-6 ${className}`}
/>
)