Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions electron/shared/providers/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const PROVIDER_DEFINITIONS: ProviderDefinition[] = [
id: 'google',
name: 'Google',
icon: '🔷',
invertIconInDark: false,
placeholder: 'AIza...',
model: 'Gemini',
requiresApiKey: true,
Expand Down Expand Up @@ -84,8 +85,9 @@ export const PROVIDER_DEFINITIONS: ProviderDefinition[] = [
},
{
id: 'ark',
name: 'ByteDance Ark',
name: '火山方舟',
icon: 'A',
invertIconInDark: false,
placeholder: 'your-ark-api-key',
model: 'Doubao',
requiresApiKey: true,
Expand All @@ -109,7 +111,7 @@ export const PROVIDER_DEFINITIONS: ProviderDefinition[] = [
},
{
id: 'moonshot',
name: 'Moonshot (CN)',
name: 'Moonshot',
icon: '🌙',
placeholder: 'sk-...',
model: 'Kimi',
Expand Down Expand Up @@ -140,8 +142,9 @@ export const PROVIDER_DEFINITIONS: ProviderDefinition[] = [
},
{
id: 'siliconflow',
name: 'SiliconFlow (CN)',
name: 'SiliconFlow',
icon: '🌊',
invertIconInDark: false,
placeholder: 'sk-...',
model: 'Multi-Model',
requiresApiKey: true,
Expand All @@ -165,6 +168,7 @@ export const PROVIDER_DEFINITIONS: ProviderDefinition[] = [
id: 'minimax-portal',
name: 'MiniMax (Global)',
icon: '☁️',
invertIconInDark: false,
placeholder: 'sk-...',
model: 'MiniMax',
requiresApiKey: false,
Expand All @@ -185,8 +189,9 @@ export const PROVIDER_DEFINITIONS: ProviderDefinition[] = [
},
{
id: 'minimax-portal-cn',
name: 'MiniMax (CN)',
name: 'MiniMax',
icon: '☁️',
invertIconInDark: false,
placeholder: 'sk-...',
model: 'MiniMax',
requiresApiKey: false,
Expand All @@ -209,6 +214,7 @@ export const PROVIDER_DEFINITIONS: ProviderDefinition[] = [
id: 'qwen-portal',
name: 'Qwen',
icon: '☁️',
invertIconInDark: false,
placeholder: 'sk-...',
model: 'Qwen',
requiresApiKey: false,
Expand Down
1 change: 1 addition & 0 deletions electron/shared/providers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface ProviderTypeInfo {
id: ProviderType;
name: string;
icon: string;
invertIconInDark?: boolean;
placeholder: string;
model?: string;
requiresApiKey: boolean;
Expand Down
2 changes: 1 addition & 1 deletion electron/utils/device-oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class DeviceOAuthManager extends EventEmitter {
const existing = await providerService.getAccount(accountId);
const nameMap: Record<OAuthProviderType, string> = {
'minimax-portal': 'MiniMax (Global)',
'minimax-portal-cn': 'MiniMax (CN)',
'minimax-portal-cn': 'MiniMax',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change correctly aligns the provider name, this nameMap duplicates information that is already present in PROVIDER_DEFINITIONS. To improve maintainability and avoid potential inconsistencies, consider refactoring to remove this map. You could instead retrieve the provider name directly from the definitions using getProviderDefinition from ./provider-registry when constructing nextAccount.

'qwen-portal': 'Qwen',
};
const nextAccount: ProviderAccount = {
Expand Down
2 changes: 0 additions & 2 deletions resources/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# 更新说明

- 问题修复&体验优化
6 changes: 1 addition & 5 deletions src/assets/providers/ark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/providers/google.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/providers/minimax.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/providers/qwen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/providers/siliconflow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/settings/ModelsSettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export function ModelsSettingsSection() {
};

return (
<div className="flex min-h-0 flex-col gap-8">
<div className="flex min-h-0 flex-col gap-4">
<Card className="surface-muted rounded-3xl border border-transparent shadow-none">
<CardHeader className="p-0 pb-3 flex flex-row items-center justify-between gap-4">
<CardTitle className="flex items-center gap-2 text-2xl font-normal tracking-tight">
Expand All @@ -215,7 +215,7 @@ export function ModelsSettingsSection() {
</Button>
</div>
</CardHeader>
<CardContent className="space-y-4 px-0">
<CardContent className="space-y-4 px-0 pb-0">
{loading || !snapshot ? (
<div className="flex items-center justify-center py-10 text-muted-foreground">
<Loader2 className="h-5 w-5 animate-spin" />
Expand Down
Loading
Loading