Skip to content

Commit 53e1d43

Browse files
authored
feat(provider): ✨ Add ZenMux promo banner (#73)
1 parent 7475476 commit 53e1d43

9 files changed

Lines changed: 157 additions & 0 deletions

File tree

src/renderer/App.css

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,83 @@
116116
}
117117
}
118118

119+
/* Provider ZenMux promotion banner */
120+
.provider-ad-banner {
121+
display: flex;
122+
align-items: center;
123+
justify-content: space-between;
124+
gap: 12px;
125+
padding: 10px 14px;
126+
border: 1px solid rgba(22, 119, 255, 0.22);
127+
border-radius: 12px;
128+
background:
129+
linear-gradient(135deg, rgba(22, 119, 255, 0.1), rgba(114, 46, 209, 0.08)),
130+
#ffffff;
131+
box-shadow: 0 6px 18px rgba(22, 119, 255, 0.08);
132+
}
133+
134+
.provider-ad-banner__content {
135+
display: flex;
136+
align-items: center;
137+
gap: 10px;
138+
min-width: 0;
139+
flex-wrap: wrap;
140+
}
141+
142+
.provider-ad-banner__brand {
143+
color: #0958d9;
144+
font-weight: 600;
145+
}
146+
147+
.provider-ad-banner__text {
148+
color: #5a6072;
149+
}
150+
151+
.provider-ad-banner__link {
152+
display: inline-flex;
153+
align-items: center;
154+
justify-content: center;
155+
flex-shrink: 0;
156+
min-height: 30px;
157+
padding: 3px 12px;
158+
border: 1px solid rgba(22, 119, 255, 0.28);
159+
border-radius: 999px;
160+
color: #0958d9;
161+
font-weight: 500;
162+
line-height: 1.4;
163+
text-decoration: none;
164+
background: rgba(255, 255, 255, 0.72);
165+
box-shadow: none;
166+
transition:
167+
border-color 0.2s ease,
168+
color 0.2s ease,
169+
background 0.2s ease;
170+
}
171+
172+
.provider-ad-banner__link:hover,
173+
.provider-ad-banner__link:focus {
174+
color: #1677ff;
175+
text-decoration: none;
176+
border-color: rgba(22, 119, 255, 0.45);
177+
background: rgba(22, 119, 255, 0.08);
178+
}
179+
180+
.provider-ad-banner__link:focus-visible {
181+
outline: 3px solid rgba(22, 119, 255, 0.22);
182+
outline-offset: 2px;
183+
}
184+
185+
@media (max-width: 720px) {
186+
.provider-ad-banner {
187+
align-items: flex-start;
188+
flex-direction: column;
189+
}
190+
191+
.provider-ad-banner__link {
192+
width: 100%;
193+
}
194+
}
195+
119196
/* Settings Tabs - tab栏固定,内容区域滚动 */
120197
.settings-tabs .ant-tabs-content-holder {
121198
flex: 1 1 auto;

src/renderer/components/Provider.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,26 @@ const Provider: React.FC<ProviderProps> = ({
490490
</Flex>
491491
</div>
492492

493+
<div className="provider-ad-banner">
494+
<div className="provider-ad-banner__content">
495+
<Typography.Text className="provider-ad-banner__brand">
496+
{t('ad_banner.title')}
497+
</Typography.Text>
498+
<Typography.Text className="provider-ad-banner__text">
499+
{t('ad_banner.description')}
500+
</Typography.Text>
501+
</div>
502+
<a
503+
className="provider-ad-banner__link"
504+
href="https://zenmux.ai/invite/9H70CU"
505+
target="_blank"
506+
rel="noreferrer"
507+
aria-label={t('ad_banner.cta_aria')}
508+
>
509+
{t('ad_banner.cta')}
510+
</a>
511+
</div>
512+
493513
<Divider variant="dashed" dashed plain={true}>
494514
{t('model_config.title')}
495515
</Divider>

src/renderer/components/__tests__/Provider.test.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ vi.mock('react-i18next', () => ({
2121
'model_config.id_placeholder': 'Model ID',
2222
'model_config.add_button': 'Add Model',
2323
'model_config.warning': 'Warning: Make sure the model ID matches the provider API',
24+
'ad_banner.title': 'ZenMux: reliable enterprise-grade LLM API service',
25+
'ad_banner.description': 'Get an extra 5–8% bonus on your first top-up',
26+
'ad_banner.cta': 'Get it now',
27+
'ad_banner.cta_aria': 'Get ZenMux enterprise-grade LLM API service',
2428
'actions.delete_provider': 'Delete Provider',
2529
'messages.update_success': 'Updated successfully',
2630
'messages.update_failed': 'Update failed',
@@ -160,6 +164,26 @@ describe('Provider', () => {
160164
expect(screen.getByText(/Protocol:.*openai/)).toBeInTheDocument()
161165
})
162166
})
167+
168+
it('should display ZenMux ad banner with external link', async () => {
169+
render(
170+
<Wrapper>
171+
<Provider providerId={1} />
172+
</Wrapper>
173+
)
174+
175+
await waitFor(() => {
176+
expect(screen.getByText('ZenMux: reliable enterprise-grade LLM API service')).toBeInTheDocument()
177+
})
178+
179+
expect(screen.getByText('Get an extra 5–8% bonus on your first top-up')).toBeInTheDocument()
180+
const adLink = screen.getByRole('link', {
181+
name: 'Get ZenMux enterprise-grade LLM API service'
182+
})
183+
expect(adLink).toHaveAttribute('href', 'https://zenmux.ai/invite/9H70CU')
184+
expect(adLink).toHaveAttribute('target', '_blank')
185+
expect(adLink).toHaveAttribute('rel', 'noreferrer')
186+
})
163187
})
164188

165189
describe('API Key Input', () => {

src/renderer/locales/ar-SA/provider.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"add_button": "إضافة نموذج",
1717
"warning": "ملاحظة: يرجى إضافة نماذج تدعم التعرف على الرؤية والتأكد من صحة معرف النموذج، وإلا لن يعمل النموذج بشكل صحيح!"
1818
},
19+
"ad_banner": {
20+
"title": "ZenMux: خدمة API موثوقة لنماذج اللغة الكبيرة على مستوى المؤسسات",
21+
"description": "احصل على هدية إضافية بنسبة 5–8% عند أول شحن",
22+
"cta": "احصل عليها",
23+
"cta_aria": "احصل على خدمة API المؤسسية لنماذج اللغة الكبيرة ZenMux"
24+
},
1925
"actions": {
2026
"delete_provider": "حذف المزود",
2127
"delete_model_title": "حذف",

src/renderer/locales/en-US/provider.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"add_button": "Add Model",
1717
"warning": "Note: Please add models that support vision recognition and ensure the Model ID is correct, otherwise the model will not work properly!"
1818
},
19+
"ad_banner": {
20+
"title": "ZenMux: reliable enterprise-grade LLM API service",
21+
"description": "Get an extra 5–8% bonus on your first top-up",
22+
"cta": "Get it now",
23+
"cta_aria": "Get ZenMux enterprise-grade LLM API service"
24+
},
1925
"actions": {
2026
"delete_provider": "Delete Provider",
2127
"delete_model_title": "Delete",

src/renderer/locales/fa-IR/provider.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"add_button": "افزودن مدل",
1717
"warning": "توجه: لطفاً مدل‌هایی که از تشخیص تصویر پشتیبانی می‌کنند اضافه کنید و مطمئن شوید که شناسه مدل صحیح است. در غیر این صورت مدل به درستی کار نخواهد کرد!"
1818
},
19+
"ad_banner": {
20+
"title": "ZenMux: سرویس API قابل اعتماد مدل‌های زبانی بزرگ در سطح سازمانی",
21+
"description": "برای اولین شارژ 5 تا 8٪ هدیه اضافه دریافت کنید",
22+
"cta": "دریافت کنید",
23+
"cta_aria": "دریافت سرویس API سازمانی مدل‌های زبانی بزرگ ZenMux"
24+
},
1925
"actions": {
2026
"delete_provider": "حذف ارائه‌دهنده",
2127
"delete_model_title": "حذف",

src/renderer/locales/ja-JP/provider.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"add_button": "モデルを追加",
1717
"warning": "注意: 視覚認識に対応しているモデルを追加し、モデルIDが正確であることを確認してください。さもなければモデルは正常に動作しません!"
1818
},
19+
"ad_banner": {
20+
"title": "ZenMux:信頼できるエンタープライズ向け大規模モデルAPIサービス",
21+
"description": "初回チャージで5~8%の追加特典をプレゼント",
22+
"cta": "今すぐ入手",
23+
"cta_aria": "ZenMux のエンタープライズ向け大規模モデルAPIサービスを入手"
24+
},
1925
"actions": {
2026
"delete_provider": "プロバイダーを削除",
2127
"delete_model_title": "削除",

src/renderer/locales/ru-RU/provider.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"add_button": "Добавить модель",
1717
"warning": "Примечание: Пожалуйста, добавьте модели, поддерживающие визуальное распознавание, и убедитесь, что ID модели указан правильно. В противном случае модель не будет работать должным образом!"
1818
},
19+
"ad_banner": {
20+
"title": "ZenMux: надежный корпоративный API-сервис больших моделей",
21+
"description": "Получите дополнительный бонус 5–8% при первом пополнении",
22+
"cta": "Получить",
23+
"cta_aria": "Получить корпоративный API-сервис больших моделей ZenMux"
24+
},
1925
"actions": {
2026
"delete_provider": "Удалить провайдера",
2127
"delete_model_title": "Удалить",

src/renderer/locales/zh-CN/provider.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"add_button": "添加模型",
1717
"warning": "注意:请添加支持视觉识别的模型,并确保模型ID正确,否则模型将无法正常使用!"
1818
},
19+
"ad_banner": {
20+
"title": "ZenMux:可靠的企业级大模型API服务",
21+
"description": "首充可获5~8%额外赠送",
22+
"cta": "点击获取",
23+
"cta_aria": "点击获取 ZenMux 企业级大模型API服务"
24+
},
1925
"actions": {
2026
"delete_provider": "删除服务商",
2127
"delete_model_title": "删除",

0 commit comments

Comments
 (0)