mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 12:14:19 +00:00
fix(ui): improve providers badge readability and albb preset
This commit is contained in:
1 parent
8811e5320f
commit
3b38f1ac90
4 files changed
+45
-13
No files matched your search
@@ -77,7 +77,7 @@ const RAW_PROVIDER_PRESET_DEFINITIONS: readonly ProviderPresetDefinition[] = [
|
|||||||
name: 'Alibaba Coding Plan',
|
name: 'Alibaba Coding Plan',
|
||||||
description: 'Alibaba Cloud Coding Plan via Anthropic-compatible endpoint',
|
description: 'Alibaba Cloud Coding Plan via Anthropic-compatible endpoint',
|
||||||
baseUrl: 'https://coding-intl.dashscope.aliyuncs.com/apps/anthropic',
|
baseUrl: 'https://coding-intl.dashscope.aliyuncs.com/apps/anthropic',
|
||||||
defaultProfileName: 'alibaba-plan',
|
defaultProfileName: 'albb',
|
||||||
defaultModel: 'qwen3-coder-plus',
|
defaultModel: 'qwen3-coder-plus',
|
||||||
apiKeyPlaceholder: 'sk-sp-...',
|
apiKeyPlaceholder: 'sk-sp-...',
|
||||||
apiKeyHint: 'Get your Coding Plan key from Alibaba Cloud Model Studio',
|
apiKeyHint: 'Get your Coding Plan key from Alibaba Cloud Model Studio',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ describe('provider-presets', () => {
|
|||||||
const preset = getPresetById('alibaba-coding-plan');
|
const preset = getPresetById('alibaba-coding-plan');
|
||||||
expect(preset?.id).toBe('alibaba-coding-plan');
|
expect(preset?.id).toBe('alibaba-coding-plan');
|
||||||
expect(preset?.baseUrl).toBe('https://coding-intl.dashscope.aliyuncs.com/apps/anthropic');
|
expect(preset?.baseUrl).toBe('https://coding-intl.dashscope.aliyuncs.com/apps/anthropic');
|
||||||
expect(preset?.defaultProfileName).toBe('alibaba-plan');
|
expect(preset?.defaultProfileName).toBe('albb');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('resolves alibaba alias to Alibaba Coding Plan preset', () => {
|
it('resolves alibaba alias to Alibaba Coding Plan preset', () => {
|
||||||
|
|||||||
@@ -36,10 +36,12 @@ import { useCliproxyUpdateCheck } from '@/hooks/use-cliproxy';
|
|||||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
|
||||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
interface SidebarBadge {
|
interface SidebarBadge {
|
||||||
text: string;
|
icon?: string;
|
||||||
icon: string;
|
icons?: string[];
|
||||||
|
text?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SidebarChildItem {
|
interface SidebarChildItem {
|
||||||
@@ -79,7 +81,13 @@ function buildNavGroups(t: (key: string) => string): SidebarGroupDef[] {
|
|||||||
path: '/providers',
|
path: '/providers',
|
||||||
icon: Key,
|
icon: Key,
|
||||||
label: t('nav.apiProfiles'),
|
label: t('nav.apiProfiles'),
|
||||||
badge: { text: 'Featured', icon: '/icons/openrouter.svg' },
|
badge: {
|
||||||
|
icons: [
|
||||||
|
'/icons/openrouter.svg',
|
||||||
|
'/assets/providers/alibabacloud-color.svg',
|
||||||
|
'/icons/ollama.svg',
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/cliproxy',
|
path: '/cliproxy',
|
||||||
@@ -229,14 +237,38 @@ export function AppSidebar() {
|
|||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<span
|
<span
|
||||||
className={`group-data-[collapsible=icon]:hidden ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded transition-colors ${
|
className={cn(
|
||||||
|
'group-data-[collapsible=icon]:hidden ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded transition-colors',
|
||||||
isRouteActive(item.path)
|
isRouteActive(item.path)
|
||||||
? 'bg-sidebar-accent-foreground/20 text-sidebar-accent-foreground border border-sidebar-accent-foreground/30'
|
? 'bg-white/92 border border-white/65 shadow-sm'
|
||||||
: 'bg-accent/15 text-accent border border-accent/30 group-hover/menu-item:bg-sidebar-accent-foreground/20 group-hover/menu-item:text-sidebar-accent-foreground group-hover/menu-item:border-sidebar-accent-foreground/30'
|
: 'bg-accent/15 text-accent border border-accent/30 group-hover/menu-item:bg-sidebar-accent-foreground/20 group-hover/menu-item:text-sidebar-accent-foreground group-hover/menu-item:border-sidebar-accent-foreground/30'
|
||||||
}`}
|
)}
|
||||||
>
|
>
|
||||||
<img src={item.badge.icon} alt="" className="w-3 h-3" />
|
{(item.badge.icons && item.badge.icons.length > 0
|
||||||
<span className="hidden sm:inline">{item.badge.text}</span>
|
? item.badge.icons
|
||||||
|
: item.badge.icon
|
||||||
|
? [item.badge.icon]
|
||||||
|
: []
|
||||||
|
).map((iconPath) => (
|
||||||
|
<span
|
||||||
|
key={iconPath}
|
||||||
|
className={cn(
|
||||||
|
'inline-flex h-4 w-4 items-center justify-center rounded-[3px] border',
|
||||||
|
isRouteActive(item.path)
|
||||||
|
? 'bg-white border-black/10'
|
||||||
|
: 'bg-background/80 border-border/40 group-hover/menu-item:bg-white/90'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={iconPath}
|
||||||
|
alt=""
|
||||||
|
className="h-3 w-3 object-contain"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
{item.badge.text && (
|
||||||
|
<span className="hidden sm:inline">{item.badge.text}</span>
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent side="right">
|
<TooltipContent side="right">
|
||||||
|
|||||||
+3
-3
@@ -32,7 +32,7 @@ const resources = {
|
|||||||
system: 'System',
|
system: 'System',
|
||||||
health: 'Health',
|
health: 'Health',
|
||||||
settings: 'Settings',
|
settings: 'Settings',
|
||||||
openrouterTooltip: 'Featured: OpenRouter + Alibaba Coding Plan',
|
openrouterTooltip: 'Featured: OpenRouter + Alibaba Coding Plan + Ollama',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
profiles: 'Profiles',
|
profiles: 'Profiles',
|
||||||
@@ -1179,7 +1179,7 @@ const resources = {
|
|||||||
system: '系统',
|
system: '系统',
|
||||||
health: '健康',
|
health: '健康',
|
||||||
settings: '设置',
|
settings: '设置',
|
||||||
openrouterTooltip: '精选:OpenRouter + Alibaba Coding Plan',
|
openrouterTooltip: '精选:OpenRouter + Alibaba Coding Plan + Ollama',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
profiles: '配置',
|
profiles: '配置',
|
||||||
@@ -2283,7 +2283,7 @@ const resources = {
|
|||||||
system: 'Hệ thống',
|
system: 'Hệ thống',
|
||||||
health: 'Sức khỏe',
|
health: 'Sức khỏe',
|
||||||
settings: 'Cài đặt',
|
settings: 'Cài đặt',
|
||||||
openrouterTooltip: 'Nổi bật: OpenRouter + Alibaba Coding Plan',
|
openrouterTooltip: 'Nổi bật: OpenRouter + Alibaba Coding Plan + Ollama',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
profiles: 'Hồ sơ',
|
profiles: 'Hồ sơ',
|
||||||
|
|||||||
Reference in new issue
Block a user