feat(website): drop hash-based router
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { siChromewebstore, siGithub } from 'simple-icons'
|
||||
|
||||
import CodeEditor from '@/components/CodeEditor'
|
||||
import { Heading } from '@/components/Heading'
|
||||
import { useLanguage } from '@/i18n/context'
|
||||
|
||||
export default function ChromeExtension() {
|
||||
@@ -22,7 +23,9 @@ export default function ChromeExtension() {
|
||||
<div className="space-y-8 mt-8">
|
||||
{/* Features */}
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">{isZh ? '核心特性' : 'Key Features'}</h2>
|
||||
<Heading id="key-features" level={2} className="text-2xl font-bold mb-4">
|
||||
{isZh ? '核心特性' : 'Key Features'}
|
||||
</Heading>
|
||||
<div className="grid md:grid-cols-3 gap-4">
|
||||
<div className="p-4 bg-gray-50 dark:bg-gray-800 rounded-lg">
|
||||
<h3 className="font-semibold mb-2">🔓 {isZh ? '多页任务' : 'Multi-Page Tasks'}</h3>
|
||||
@@ -57,7 +60,9 @@ export default function ChromeExtension() {
|
||||
|
||||
{/* Install */}
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">{isZh ? '获取扩展' : 'Get the Extension'}</h2>
|
||||
<Heading id="get-the-extension" level={2} className="text-2xl font-bold mb-4">
|
||||
{isZh ? '获取扩展' : 'Get the Extension'}
|
||||
</Heading>
|
||||
<div className="flex flex-wrap gap-3">
|
||||
<a
|
||||
href={chromeWebStoreUrl}
|
||||
@@ -86,9 +91,13 @@ export default function ChromeExtension() {
|
||||
|
||||
{/* Relationship with PageAgent.js */}
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">
|
||||
<Heading
|
||||
id="how-it-relates-to-page-agent-js"
|
||||
level={2}
|
||||
className="text-2xl font-bold mb-4"
|
||||
>
|
||||
{isZh ? '与 PageAgent.js 的关系' : 'How It Relates to PageAgent.js'}
|
||||
</h2>
|
||||
</Heading>
|
||||
<div className="p-5 bg-gray-50 dark:bg-gray-800 rounded-lg space-y-3 text-gray-600 dark:text-gray-300">
|
||||
<p>
|
||||
{isZh
|
||||
@@ -105,9 +114,9 @@ export default function ChromeExtension() {
|
||||
|
||||
{/* Third-party Integration */}
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">
|
||||
<Heading id="third-party-integration" level={2} className="text-2xl font-bold mb-4">
|
||||
{isZh ? '第三方接入' : 'Third-Party Integration'}
|
||||
</h2>
|
||||
</Heading>
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-4">
|
||||
{isZh
|
||||
? '通过页面 JavaScript 调用 `window.PAGE_AGENT_EXT`,你的应用可以发起跨页面任务并控制浏览器行为。'
|
||||
@@ -145,7 +154,9 @@ localStorage.setItem('PageAgentExtUserAuthToken', '<your-token-from-extension>')
|
||||
|
||||
{/* API Reference */}
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">{isZh ? 'API 参考' : 'API Reference'}</h2>
|
||||
<Heading id="api-reference" level={2} className="text-2xl font-bold mb-4">
|
||||
{isZh ? 'API 参考' : 'API Reference'}
|
||||
</Heading>
|
||||
|
||||
{/* AI Assistant Instructions */}
|
||||
<section className="p-4 bg-purple-50 dark:bg-purple-900/20 rounded-lg">
|
||||
@@ -170,9 +181,9 @@ localStorage.setItem('PageAgentExtUserAuthToken', '<your-token-from-extension>')
|
||||
</section>
|
||||
|
||||
{/* TypeScript Declaration */}
|
||||
<h2 className="text-2xl font-bold mb-4">
|
||||
<Heading id="typescript-declaration" level={2} className="text-2xl font-bold mb-4">
|
||||
{isZh ? 'TypeScript 类型声明' : 'TypeScript Declaration'}
|
||||
</h2>
|
||||
</Heading>
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-4">
|
||||
{isZh
|
||||
? '推荐把 `execute` 的类型声明加入你的项目,获得完整类型提示。'
|
||||
@@ -304,11 +315,15 @@ window.PAGE_AGENT_EXT.stop()`
|
||||
|
||||
{/* Integration Guide */}
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">
|
||||
<Heading
|
||||
id="integrate-multipageagent-into-your-extension"
|
||||
level={2}
|
||||
className="text-2xl font-bold mb-4"
|
||||
>
|
||||
{isZh
|
||||
? '将 MultiPageAgent 集成你自己的插件'
|
||||
: 'Integrate MultiPageAgent into Your Extension'}
|
||||
</h2>
|
||||
</Heading>
|
||||
<p>@TODO</p>
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-4">
|
||||
{isZh
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import CodeEditor from '@/components/CodeEditor'
|
||||
import { Heading } from '@/components/Heading'
|
||||
import { useLanguage } from '@/i18n/context'
|
||||
|
||||
export default function Instructions() {
|
||||
@@ -16,9 +17,9 @@ export default function Instructions() {
|
||||
|
||||
{/* System Instructions */}
|
||||
<section className="mb-12">
|
||||
<h2 className="text-3xl font-bold mb-6">
|
||||
<Heading id="system-instructions" level={2} className="text-3xl font-bold mb-6">
|
||||
{isZh ? '系统级指导 (System Instructions)' : 'System Instructions'}
|
||||
</h2>
|
||||
</Heading>
|
||||
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-6">
|
||||
{isZh
|
||||
@@ -46,9 +47,9 @@ Guidelines:
|
||||
|
||||
{/* Page Instructions */}
|
||||
<section className="mb-12">
|
||||
<h2 className="text-3xl font-bold mb-6">
|
||||
<Heading id="page-instructions" level={2} className="text-3xl font-bold mb-6">
|
||||
{isZh ? '页面级指导 (Page Instructions)' : 'Page Instructions'}
|
||||
</h2>
|
||||
</Heading>
|
||||
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-6">
|
||||
{isZh
|
||||
@@ -90,7 +91,9 @@ This is the product listing page.
|
||||
|
||||
{/* How It Works */}
|
||||
<section className="mb-12">
|
||||
<h2 className="text-3xl font-bold mb-6">{isZh ? '工作原理' : 'How It Works'}</h2>
|
||||
<Heading id="how-it-works" level={2} className="text-3xl font-bold mb-6">
|
||||
{isZh ? '工作原理' : 'How It Works'}
|
||||
</Heading>
|
||||
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-4">
|
||||
{isZh
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import BetaNotice from '@/components/BetaNotice'
|
||||
import CodeEditor from '@/components/CodeEditor'
|
||||
import { Heading } from '@/components/Heading'
|
||||
import { useLanguage } from '@/i18n/context'
|
||||
|
||||
export default function CustomTools() {
|
||||
@@ -17,7 +18,9 @@ export default function CustomTools() {
|
||||
|
||||
<div className="space-y-8">
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">{isZh ? '工具注册' : 'Tool Registration'}</h2>
|
||||
<Heading id="tool-registration" level={2} className="text-2xl font-bold mb-4">
|
||||
{isZh ? '工具注册' : 'Tool Registration'}
|
||||
</Heading>
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-4">
|
||||
{isZh
|
||||
? '每个自定义工具需要定义四个核心属性:name、description、input schema 和 execute 函数。'
|
||||
@@ -55,7 +58,9 @@ const pageAgent = new PageAgent({customTools})
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">{isZh ? '页面过滤器' : 'Page Filter'}</h2>
|
||||
<Heading id="page-filter" level={2} className="text-2xl font-bold mb-4">
|
||||
{isZh ? '页面过滤器' : 'Page Filter'}
|
||||
</Heading>
|
||||
|
||||
<BetaNotice />
|
||||
|
||||
@@ -89,7 +94,9 @@ const pageAgent = new PageAgent({customTools})
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-4">{isZh ? '最佳实践' : 'Best Practices'}</h2>
|
||||
<Heading id="best-practices" level={2} className="text-2xl font-bold mb-4">
|
||||
{isZh ? '最佳实践' : 'Best Practices'}
|
||||
</Heading>
|
||||
<div className="space-y-4">
|
||||
<div className="p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-lg">
|
||||
<h3 className="text-lg font-semibold text-yellow-900 dark:text-yellow-300 mb-2">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import CodeEditor from '@/components/CodeEditor'
|
||||
import { Heading } from '@/components/Heading'
|
||||
import { useLanguage } from '@/i18n/context'
|
||||
|
||||
export default function DataMasking() {
|
||||
@@ -15,7 +16,9 @@ export default function DataMasking() {
|
||||
</p>
|
||||
|
||||
<section className="mb-12">
|
||||
<h2 className="text-3xl font-bold mb-6">{isZh ? '接口定义' : 'API Definition'}</h2>
|
||||
<Heading id="api-definition" level={2} className="text-3xl font-bold mb-6">
|
||||
{isZh ? '接口定义' : 'API Definition'}
|
||||
</Heading>
|
||||
|
||||
<CodeEditor
|
||||
className="mb-6"
|
||||
@@ -30,9 +33,9 @@ export default function DataMasking() {
|
||||
</section>
|
||||
|
||||
<section className="mb-12">
|
||||
<h2 className="text-3xl font-bold mb-6">
|
||||
<Heading id="common-masking-patterns" level={2} className="text-3xl font-bold mb-6">
|
||||
{isZh ? '常用脱敏规则' : 'Common Masking Patterns'}
|
||||
</h2>
|
||||
</Heading>
|
||||
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-6">
|
||||
{isZh
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Fragment } from 'react'
|
||||
|
||||
import CodeEditor from '@/components/CodeEditor'
|
||||
import { Heading } from '@/components/Heading'
|
||||
import { useLanguage } from '@/i18n/context'
|
||||
|
||||
const BASELINE = new Set([
|
||||
@@ -63,7 +64,9 @@ export default function Models() {
|
||||
|
||||
{/* Models Section */}
|
||||
<section className="mb-10">
|
||||
<h2 className="text-2xl font-semibold mb-3">{isZh ? '已测试模型' : 'Tested Models'}</h2>
|
||||
<Heading id="tested-models" level={2} className="text-2xl font-semibold mb-3">
|
||||
{isZh ? '已测试模型' : 'Tested Models'}
|
||||
</Heading>
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400 mb-4">
|
||||
{isZh
|
||||
? '推荐使用 ToolCall 能力强的轻量级模型。'
|
||||
@@ -141,7 +144,9 @@ export default function Models() {
|
||||
|
||||
{/* Configuration Section */}
|
||||
<section className="mb-10">
|
||||
<h2 className="text-2xl font-semibold mb-4">{isZh ? '配置方式' : 'Configuration'}</h2>
|
||||
<Heading id="configuration" level={2} className="text-2xl font-semibold mb-4">
|
||||
{isZh ? '配置方式' : 'Configuration'}
|
||||
</Heading>
|
||||
<CodeEditor
|
||||
code={`// OpenAI-compatible services (e.g., Alibaba Bailian)
|
||||
const pageAgent = new PageAgent({
|
||||
@@ -163,9 +168,9 @@ const pageAgent = new PageAgent({
|
||||
|
||||
{/* Free Testing API Section */}
|
||||
<section className="mb-10">
|
||||
<h2 className="text-2xl font-semibold mb-4">
|
||||
<Heading id="free-testing-api" level={2} className="text-2xl font-semibold mb-4">
|
||||
{isZh ? '免费测试接口' : 'Free Testing API'}
|
||||
</h2>
|
||||
</Heading>
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400 mb-4">
|
||||
{isZh
|
||||
? '以下免费测试接口仅供 PageAgent.js 和 PageAgent Extension 的技术评估使用。有速率限制,可能随时变更。请勿用于生产环境。'
|
||||
@@ -215,7 +220,9 @@ LLM_API_KEY="NA"`}
|
||||
|
||||
{/* Ollama Section */}
|
||||
<section className="mb-10">
|
||||
<h2 className="text-2xl font-semibold mb-4">Ollama</h2>
|
||||
<Heading id="ollama" level={2} className="text-2xl font-semibold mb-4">
|
||||
Ollama
|
||||
</Heading>
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400 mb-4">
|
||||
{isZh
|
||||
? '已在 Ollama 0.15 + qwen3:14b (RTX3090 24GB) 上测试通过。'
|
||||
|
||||
Reference in New Issue
Block a user