feat: add partner promotion feature for Zhipu GLM
- Add isPartner and partnerPromotionKey fields to Provider and ProviderPreset types - Display gold star badge on partner presets in selector - Show promotional message in API Key section for partners - Configure Zhipu GLM as official partner with 10% discount promotion - Support both Claude and Codex provider presets - Add i18n support for partner promotion messages (zh/en)
This commit is contained in:
@@ -15,6 +15,8 @@ interface ApiKeySectionProps {
|
||||
thirdParty: string;
|
||||
};
|
||||
disabled?: boolean;
|
||||
isPartner?: boolean;
|
||||
partnerPromotionKey?: string;
|
||||
}
|
||||
|
||||
export function ApiKeySection({
|
||||
@@ -27,6 +29,8 @@ export function ApiKeySection({
|
||||
websiteUrl,
|
||||
placeholder,
|
||||
disabled,
|
||||
isPartner,
|
||||
partnerPromotionKey,
|
||||
}: ApiKeySectionProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -57,7 +61,7 @@ export function ApiKeySection({
|
||||
/>
|
||||
{/* API Key 获取链接 */}
|
||||
{shouldShowLink && websiteUrl && (
|
||||
<div className="-mt-1 pl-1">
|
||||
<div className="space-y-2 -mt-1 pl-1">
|
||||
<a
|
||||
href={websiteUrl}
|
||||
target="_blank"
|
||||
@@ -68,6 +72,18 @@ export function ApiKeySection({
|
||||
defaultValue: "获取 API Key",
|
||||
})}
|
||||
</a>
|
||||
|
||||
{/* 合作伙伴促销信息 */}
|
||||
{isPartner && partnerPromotionKey && (
|
||||
<div className="rounded-md bg-blue-50 dark:bg-blue-950/30 p-2.5 border border-blue-200 dark:border-blue-800">
|
||||
<p className="text-xs leading-relaxed text-blue-700 dark:text-blue-300">
|
||||
💡{" "}
|
||||
{t(`providerForm.partnerPromotion.${partnerPromotionKey}`, {
|
||||
defaultValue: "",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user