From 64326a86d51f0668575be51f41a90154ae7bf8df Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 14 Jun 2026 19:52:31 +0800 Subject: [PATCH] refactor: homepage - remove demo section, adapt for token relay station, move providers to bottom --- .../home/components/sections/hero.tsx | 239 +++--------------- web/default/src/i18n/locales/en.json | 8 + web/default/src/i18n/locales/zh.json | 8 + 3 files changed, 45 insertions(+), 210 deletions(-) diff --git a/web/default/src/features/home/components/sections/hero.tsx b/web/default/src/features/home/components/sections/hero.tsx index 0c5f6f8d7..ab1fd4a8e 100644 --- a/web/default/src/features/home/components/sections/hero.tsx +++ b/web/default/src/features/home/components/sections/hero.tsx @@ -21,11 +21,8 @@ import { Link } from '@tanstack/react-router' import { ArrowDown, ArrowRight, - BarChart3, Check, Copy, - Shield, - Zap, } from 'lucide-react' import { useTranslation } from 'react-i18next' import { cn } from '@/lib/utils' @@ -39,7 +36,7 @@ interface HeroProps { const providers = [ 'OpenAI', 'Claude', 'Gemini', 'Mistral', 'DeepSeek', - 'Llama', 'Qwen', 'Cohere', 'Groq', 'Perplexity', + 'Codex', 'Qwen', 'Cohere', 'Groq', 'Perplexity', ] const jsCode = `import OpenAI from 'openai'; @@ -64,7 +61,7 @@ client = OpenAI( ) response = client.chat.completions.create( - model="gpt-4o", + model="claude-sonnet-4-20250514", messages=[ {"role": "user", "content": "Hello!"} ] @@ -74,7 +71,7 @@ const curlCode = `curl https://your-gateway.com/v1/chat/completions \\ -H "Authorization: Bearer sk-your-api-key" \\ -H "Content-Type: application/json" \\ -d '{ - "model": "gpt-4o", + "model": "deepseek-chat", "messages": [{"role": "user", "content": "Hello!"}] }'` @@ -87,17 +84,10 @@ export function Hero(props: HeroProps) { const [activeSection, setActiveSection] = useState(0) const [activeTab, setActiveTab] = useState('javascript') const [copied, setCopied] = useState(false) - const [demoState, setDemoState] = useState<'idle' | 'running' | 'done'>('idle') - const [demoStep, setDemoStep] = useState(0) - - const serverAddress = - (status?.server_address as string | undefined) || - `${window.location.origin}` const sections = [ { id: 'hero', ref: useRef(null) }, { id: 'code', ref: useRef(null) }, - { id: 'demo', ref: useRef(null) }, ] // Scroll spy @@ -136,22 +126,6 @@ export function Hero(props: HeroProps) { setTimeout(() => setCopied(false), 2000) }, [activeTab]) - const handleDemo = useCallback(() => { - if (demoState === 'running') return - setDemoState('running') - setDemoStep(0) - const steps = [ - { step: 1, delay: 600 }, - { step: 2, delay: 1200 }, - { step: 3, delay: 2000 }, - { step: 4, delay: 2800 }, - ] - steps.forEach(({ step, delay }) => { - setTimeout(() => setDemoStep(step), delay) - }) - setTimeout(() => setDemoState('done'), 3200) - }, [demoState]) - const tabCodeMap: Record = { javascript: jsCode, python: pythonCode, @@ -164,13 +138,6 @@ export function Hero(props: HeroProps) { { key: 'curl', label: 'cURL' }, ] - const stepLabels = [ - t('Connecting'), - t('Authenticating'), - t('Processing'), - t('Complete'), - ] - return (
{/* Subtle dot grid */} @@ -196,7 +163,7 @@ export function Hero(props: HeroProps) { {/* Section navigation dots (desktop only) */}
- {[0, 1, 2].map((i) => ( + {[0, 1].map((i) => (
- {/* ── Provider logos marquee ── */} -
-

- {t('Supported providers')} -

-
-
- {[...providers, ...providers].map((name, i) => ( - - {name} - - ))} -
- {/* Fade edges */} -
-
-
-
- {/* ── Section 2: Code Demo ── */}

- {t('Quick Integration')} + {t('Token Relay Station')}

- {t('Drop-in Replacement')} + {t('Multi-model Access')}

- {t('Route, monitor, and manage LLM traffic through a single gateway. Switch providers in seconds.')} + {t('Supports Codex, Claude, GPT, DeepSeek, Gemini, Qwen and more. One API key to access all models, with automatic failover and load balancing.')}

    {[ - t('OpenAI-compatible API interface'), - t('Zero code changes required'), - t('Automatic model routing'), - t('Real-time request monitoring'), + t('Supports Codex, Claude, GPT, DeepSeek and more'), + t('Unified API, zero code changes required'), + t('Automatic model routing and failover'), + t('Real-time usage tracking and cost control'), ].map((feature) => (
  • @@ -377,151 +322,25 @@ export function Hero(props: HeroProps) {
- {/* ── Section 3: Interactive Demo ── */} -
-
- {/* Left: Text content */} -
-

- {t('Try it Live')} -

-

- {t('See it in Action')} -

-

- {t('Route, monitor, and manage LLM traffic through a single gateway. Switch providers in seconds.')} -

-
    - {[ - { icon: Zap, text: t('Automatic model routing') }, - { icon: Shield, text: t('OpenAI-compatible API interface') }, - { icon: BarChart3, text: t('Real-time request monitoring') }, - ].map(({ icon: Icon, text }) => ( -
  • -
    - -
    - {text} -
  • - ))} -
-
- - {/* Right: Interactive card */} -
-
-

API Request

-

Simulated gateway call

-
-
- {/* Input area */} -
-
- -
- sk-•••••••••••••••••••••••••••••• -
-
-
- -
- {serverAddress}/v1/chat/completions -
-
-
- - {/* Send button */} - - - {/* Animated steps */} - {(demoState === 'running' || demoState === 'done') && ( -
- {stepLabels.map((label, i) => { - const stepNum = i + 1 - const isActive = demoStep >= stepNum - const isCurrent = demoStep === stepNum && demoState === 'running' - return ( -
-
- {isActive ? ( - stepNum === 4 ? ( - - ) : ( - {stepNum} - ) - ) : ( - {stepNum} - )} -
- - {label} - - {isCurrent && ( -
-
-
- )} -
- ) - })} -
- )} - - {/* Result */} - {demoState === 'done' && ( -
-
- - 200 OK - 142ms -
-
-
{'{'}
-
- "model" - {': '} - "gpt-4o", -
-
- "usage" - {': '} - {'{ "prompt_tokens": 12, "completion_tokens": 47 }'} -
-
{'}'}
-
-
- )} -
+ {name} + + ))}
+ {/* Fade edges */} +
+
diff --git a/web/default/src/i18n/locales/en.json b/web/default/src/i18n/locales/en.json index 91125fcd5..310d04511 100644 --- a/web/default/src/i18n/locales/en.json +++ b/web/default/src/i18n/locales/en.json @@ -4595,6 +4595,14 @@ "OpenAI-compatible API interface": "OpenAI-compatible API interface", "Processing": "Processing", "Quick Integration": "Quick Integration", + "Token Relay Station": "Token Relay Station", + "Multi-model Access": "Multi-model Access", + "Token relay station supporting Codex, Claude, GPT, DeepSeek and more. Unified API, unified billing, unified management.": "Token relay station supporting Codex, Claude, GPT, DeepSeek and more. Unified API, unified billing, unified management.", + "Supports Codex, Claude, GPT, DeepSeek, Gemini, Qwen and more. One API key to access all models, with automatic failover and load balancing.": "Supports Codex, Claude, GPT, DeepSeek, Gemini, Qwen and more. One API key to access all models, with automatic failover and load balancing.", + "Supports Codex, Claude, GPT, DeepSeek and more": "Supports Codex, Claude, GPT, DeepSeek and more", + "Unified API, zero code changes required": "Unified API, zero code changes required", + "Automatic model routing and failover": "Automatic model routing and failover", + "Real-time usage tracking and cost control": "Real-time usage tracking and cost control", "Real-time request monitoring": "Real-time request monitoring", "Search documents...": "Search documents...", "Select a document to start reading": "Select a document to start reading", diff --git a/web/default/src/i18n/locales/zh.json b/web/default/src/i18n/locales/zh.json index 4b228e84b..e59c2f8f3 100644 --- a/web/default/src/i18n/locales/zh.json +++ b/web/default/src/i18n/locales/zh.json @@ -4595,6 +4595,14 @@ "OpenAI-compatible API interface": "兼容 OpenAI 的 API 接口", "Processing": "处理中", "Quick Integration": "快速集成", + "Token Relay Station": "Token 中转站", + "Multi-model Access": "多模型接入", + "Token relay station supporting Codex, Claude, GPT, DeepSeek and more. Unified API, unified billing, unified management.": "Token 中转站,支持 Codex、Claude、GPT、DeepSeek 等模型接入。统一接口,统一计费,统一管理。", + "Supports Codex, Claude, GPT, DeepSeek, Gemini, Qwen and more. One API key to access all models, with automatic failover and load balancing.": "支持 Codex、Claude、GPT、DeepSeek、Gemini、通义千问等模型。一个 API Key 访问所有模型,自动故障转移与负载均衡。", + "Supports Codex, Claude, GPT, DeepSeek and more": "支持 Codex、Claude、GPT、DeepSeek 等接入", + "Unified API, zero code changes required": "统一接口,零代码改动即可使用", + "Automatic model routing and failover": "自动模型路由与故障转移", + "Real-time usage tracking and cost control": "实时用量追踪与成本控制", "Real-time request monitoring": "实时请求监控", "Search documents...": "搜索文档...", "Select a document to start reading": "选择文档开始阅读",