fix: 访问前台跳转+暗色背景+英文+白字修复
This commit is contained in:
1 parent
177e345539
commit
f0c5606ad9
9 files changed
+3063
-293
No files matched your search
@@ -160,7 +160,7 @@ const AdminLayout: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleVisitFrontend = () => {
|
const handleVisitFrontend = () => {
|
||||||
const url = window.location.origin + window.location.pathname + '#/portal';
|
const url = window.location.origin + window.location.pathname + '#/chat';
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -391,7 +391,7 @@ const Agents: React.FC = () => {
|
|||||||
<table className="admin-table">
|
<table className="admin-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Agent</th>
|
<th>智能体</th>
|
||||||
<th>类型</th>
|
<th>类型</th>
|
||||||
<th>来源</th>
|
<th>来源</th>
|
||||||
<th>状态</th>
|
<th>状态</th>
|
||||||
@@ -535,7 +535,7 @@ const Agents: React.FC = () => {
|
|||||||
<div style={{ fontWeight: 600, marginBottom: 12 }}>⚙️ Agent 配置</div>
|
<div style={{ fontWeight: 600, marginBottom: 12 }}>⚙️ Agent 配置</div>
|
||||||
|
|
||||||
<div className="form-group" style={{ gridColumn: '1 / -1' }}>
|
<div className="form-group" style={{ gridColumn: '1 / -1' }}>
|
||||||
<label className="form-label">System Prompt</label>
|
<label className="form-label">系统提示词</label>
|
||||||
<textarea className="admin-form-input"
|
<textarea className="admin-form-input"
|
||||||
value={form.system_prompt}
|
value={form.system_prompt}
|
||||||
onChange={e => setForm(f => ({ ...f, system_prompt: e.target.value }))}
|
onChange={e => setForm(f => ({ ...f, system_prompt: e.target.value }))}
|
||||||
@@ -555,13 +555,13 @@ const Agents: React.FC = () => {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label className="form-label">Temperature</label>
|
<label className="form-label">温度参数</label>
|
||||||
<input className="admin-form-input" type="number" step="0.1" min="0" max="2"
|
<input className="admin-form-input" type="number" step="0.1" min="0" max="2"
|
||||||
value={form.temperature}
|
value={form.temperature}
|
||||||
onChange={e => setForm(f => ({ ...f, temperature: e.target.value }))} />
|
onChange={e => setForm(f => ({ ...f, temperature: e.target.value }))} />
|
||||||
</div>
|
</div>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label className="form-label">Max Tokens</label>
|
<label className="form-label">最大令牌数</label>
|
||||||
<input className="admin-form-input" type="number"
|
<input className="admin-form-input" type="number"
|
||||||
value={form.max_tokens}
|
value={form.max_tokens}
|
||||||
onChange={e => setForm(f => ({ ...f, max_tokens: e.target.value }))} />
|
onChange={e => setForm(f => ({ ...f, max_tokens: e.target.value }))} />
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ const CodeExec: React.FC = () => {
|
|||||||
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '20px', marginBottom: '24px' }}>
|
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '20px', marginBottom: '24px' }}>
|
||||||
{/* Left: Code Editor */}
|
{/* Left: Code Editor */}
|
||||||
<div style={{
|
<div style={{
|
||||||
background: '#1E1E2E', borderRadius: '12px', border: '1px solid #313244',
|
background: '#F8F9FC', borderRadius: '12px', border: '1px solid #313244',
|
||||||
overflow: 'hidden', display: 'flex', flexDirection: 'column',
|
overflow: 'hidden', display: 'flex', flexDirection: 'column',
|
||||||
}}>
|
}}>
|
||||||
{/* Editor header */}
|
{/* Editor header */}
|
||||||
@@ -315,7 +315,7 @@ const CodeExec: React.FC = () => {
|
|||||||
style={{
|
style={{
|
||||||
padding: '6px 16px', borderRadius: '6px', border: 'none',
|
padding: '6px 16px', borderRadius: '6px', border: 'none',
|
||||||
background: executing ? '#45475A' : '#6C63FF',
|
background: executing ? '#45475A' : '#6C63FF',
|
||||||
color: '#fff', cursor: executing ? 'not-allowed' : 'pointer',
|
color: '#1A1F36', cursor: executing ? 'not-allowed' : 'pointer',
|
||||||
fontSize: '13px', fontWeight: 600, whiteSpace: 'nowrap',
|
fontSize: '13px', fontWeight: 600, whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -333,7 +333,7 @@ const CodeExec: React.FC = () => {
|
|||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
style={{
|
style={{
|
||||||
flex: 1, minHeight: '320px', padding: '16px', border: 'none',
|
flex: 1, minHeight: '320px', padding: '16px', border: 'none',
|
||||||
background: '#1E1E2E', color: '#CDD6F4', fontFamily: "'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace",
|
background: '#F8F9FC', color: '#CDD6F4', fontFamily: "'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace",
|
||||||
fontSize: '13px', lineHeight: 1.6, resize: 'vertical',
|
fontSize: '13px', lineHeight: 1.6, resize: 'vertical',
|
||||||
outline: 'none', tabSize: 4,
|
outline: 'none', tabSize: 4,
|
||||||
}}
|
}}
|
||||||
@@ -412,7 +412,7 @@ const CodeExec: React.FC = () => {
|
|||||||
{/* Output content */}
|
{/* Output content */}
|
||||||
<div ref={outputRef} style={{
|
<div ref={outputRef} style={{
|
||||||
flex: 1, minHeight: '320px', padding: '16px', overflow: 'auto',
|
flex: 1, minHeight: '320px', padding: '16px', overflow: 'auto',
|
||||||
background: '#1E1E2E',
|
background: '#F8F9FC',
|
||||||
}}>
|
}}>
|
||||||
{executing ? (
|
{executing ? (
|
||||||
<div style={{ color: '#6C7086', fontSize: '13px', fontFamily: 'monospace' }}>
|
<div style={{ color: '#6C7086', fontSize: '13px', fontFamily: 'monospace' }}>
|
||||||
@@ -672,7 +672,7 @@ const CodeExec: React.FC = () => {
|
|||||||
<label style={{ display: 'block', marginBottom: '6px', fontSize: '13px', color: '#374151', fontWeight: 500 }}>代码预览</label>
|
<label style={{ display: 'block', marginBottom: '6px', fontSize: '13px', color: '#374151', fontWeight: 500 }}>代码预览</label>
|
||||||
<pre style={{
|
<pre style={{
|
||||||
margin: 0, padding: '12px', borderRadius: '6px',
|
margin: 0, padding: '12px', borderRadius: '6px',
|
||||||
background: '#1E1E2E', color: '#CDD6F4', fontSize: '12px',
|
background: '#F8F9FC', color: '#CDD6F4', fontSize: '12px',
|
||||||
fontFamily: 'monospace', lineHeight: 1.5, maxHeight: '150px', overflow: 'auto',
|
fontFamily: 'monospace', lineHeight: 1.5, maxHeight: '150px', overflow: 'auto',
|
||||||
}}>
|
}}>
|
||||||
{detailTask.code_preview || '(无)'}
|
{detailTask.code_preview || '(无)'}
|
||||||
@@ -697,7 +697,7 @@ const CodeExec: React.FC = () => {
|
|||||||
<label style={{ display: 'block', marginBottom: '6px', fontSize: '13px', color: '#374151', fontWeight: 500 }}>stdout</label>
|
<label style={{ display: 'block', marginBottom: '6px', fontSize: '13px', color: '#374151', fontWeight: 500 }}>stdout</label>
|
||||||
<pre style={{
|
<pre style={{
|
||||||
margin: 0, padding: '12px', borderRadius: '6px',
|
margin: 0, padding: '12px', borderRadius: '6px',
|
||||||
background: '#1E1E2E', color: '#CDD6F4', fontSize: '12px',
|
background: '#F8F9FC', color: '#CDD6F4', fontSize: '12px',
|
||||||
fontFamily: 'monospace', lineHeight: 1.5, maxHeight: '300px', overflow: 'auto',
|
fontFamily: 'monospace', lineHeight: 1.5, maxHeight: '300px', overflow: 'auto',
|
||||||
whiteSpace: 'pre-wrap', wordBreak: 'break-all',
|
whiteSpace: 'pre-wrap', wordBreak: 'break-all',
|
||||||
}}>
|
}}>
|
||||||
@@ -710,7 +710,7 @@ const CodeExec: React.FC = () => {
|
|||||||
<label style={{ display: 'block', marginBottom: '6px', fontSize: '13px', color: '#EF4444', fontWeight: 500 }}>stderr</label>
|
<label style={{ display: 'block', marginBottom: '6px', fontSize: '13px', color: '#EF4444', fontWeight: 500 }}>stderr</label>
|
||||||
<pre style={{
|
<pre style={{
|
||||||
margin: 0, padding: '12px', borderRadius: '6px',
|
margin: 0, padding: '12px', borderRadius: '6px',
|
||||||
background: '#1E1E2E', color: '#F38BA8', fontSize: '12px',
|
background: '#F8F9FC', color: '#F38BA8', fontSize: '12px',
|
||||||
fontFamily: 'monospace', lineHeight: 1.5, maxHeight: '300px', overflow: 'auto',
|
fontFamily: 'monospace', lineHeight: 1.5, maxHeight: '300px', overflow: 'auto',
|
||||||
whiteSpace: 'pre-wrap', wordBreak: 'break-all',
|
whiteSpace: 'pre-wrap', wordBreak: 'break-all',
|
||||||
}}>
|
}}>
|
||||||
@@ -733,7 +733,7 @@ const CodeExec: React.FC = () => {
|
|||||||
{toast && (
|
{toast && (
|
||||||
<div style={{
|
<div style={{
|
||||||
position: 'fixed', top: '20px', right: '20px', zIndex: 2000,
|
position: 'fixed', top: '20px', right: '20px', zIndex: 2000,
|
||||||
padding: '12px 24px', borderRadius: '8px', color: '#fff',
|
padding: '12px 24px', borderRadius: '8px', color: '#1A1F36',
|
||||||
background: toast.type === 'success' ? '#10B981' : '#EF4444',
|
background: toast.type === 'success' ? '#10B981' : '#EF4444',
|
||||||
boxShadow: '0 4px 12px rgba(0,0,0,0.15)', fontSize: '14px',
|
boxShadow: '0 4px 12px rgba(0,0,0,0.15)', fontSize: '14px',
|
||||||
}}>
|
}}>
|
||||||
|
|||||||
@@ -144,12 +144,12 @@
|
|||||||
.method-put { background: rgba(250,173,20,0.2); color: #faad14; }
|
.method-put { background: rgba(250,173,20,0.2); color: #faad14; }
|
||||||
.method-delete { background: rgba(255,77,79,0.2); color: #ff4d4f; }
|
.method-delete { background: rgba(255,77,79,0.2); color: #ff4d4f; }
|
||||||
|
|
||||||
.dev-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }
|
.dev-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; z-index: 1000; }
|
||||||
.dev-modal { background: #1a1a2e; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 24px; width: 500px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
|
.dev-modal { background: #FFFFFF; border: 1px solid rgba(0,0,0,0.10); border-radius: 12px; padding: 24px; width: 500px; max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
|
||||||
.dev-modal h3 { margin: 0 0 16px; color: rgba(255,255,255,0.85); }
|
.dev-modal h3 { margin: 0 0 16px; color: #1A1F36; }
|
||||||
.dev-form-group { margin-bottom: 14px; }
|
.dev-form-group { margin-bottom: 14px; }
|
||||||
.dev-form-group label { display: block; font-size: 13px; color: rgba(255,255,255,0.55); margin-bottom: 4px; }
|
.dev-form-group label { display: block; font-size: 13px; color: #5A6480; margin-bottom: 4px; }
|
||||||
.dev-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
|
.dev-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
|
||||||
|
|
||||||
.dev-muted { color: rgba(255,255,255,0.35); font-size: 12px; }
|
.dev-muted { color: #8892B0; font-size: 12px; }
|
||||||
.dev-test-result { margin: 12px 0; padding: 12px; border-radius: 8px; font-size: 14px; }
|
.dev-test-result { margin: 12px 0; padding: 12px; border-radius: 8px; font-size: 14px; }
|
||||||
@@ -134,7 +134,7 @@ export default function AdminDeveloperTools() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteWebhook = async (id: string) => {
|
const handleDeleteWebhook = async (id: string) => {
|
||||||
if (!confirm('Delete this webhook?')) return;
|
if (!confirm('确定删除此 Webhook?')) return;
|
||||||
try {
|
try {
|
||||||
await api(`/admin/developer-tools/webhooks/${id}`, { method: 'DELETE' });
|
await api(`/admin/developer-tools/webhooks/${id}`, { method: 'DELETE' });
|
||||||
loadWebhooks();
|
loadWebhooks();
|
||||||
@@ -232,7 +232,7 @@ export default function AdminDeveloperTools() {
|
|||||||
|
|
||||||
<table className="dev-table">
|
<table className="dev-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>Event</th><th>Status</th><th>Response Code</th><th>Response Time</th><th>Attempts</th><th>Time</th><th>Error</th></tr>
|
<tr><th>事件</th><th>状态</th><th>响应码</th><th>响应时间</th><th>尝试次数</th><th>时间</th><th>错误</th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{deliveries.items.map(d => (
|
{deliveries.items.map(d => (
|
||||||
@@ -265,7 +265,7 @@ export default function AdminDeveloperTools() {
|
|||||||
</div>
|
</div>
|
||||||
<table className="dev-table">
|
<table className="dev-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>Name</th><th>URL</th><th>Events</th><th>Status</th><th>Deliveries</th><th>Success Rate</th><th>Last Triggered</th><th>Actions</th></tr>
|
<tr><th>名称</th><th>地址</th><th>事件</th><th>状态</th><th>投递数</th><th>成功率</th><th>最后触发</th><th>操作</th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{webhooks.items.map(w => (
|
{webhooks.items.map(w => (
|
||||||
@@ -305,15 +305,15 @@ export default function AdminDeveloperTools() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Supported Events Info */}
|
{/* 支持的事件 Info */}
|
||||||
{webhookEvents.length > 0 && (
|
{webhookEvents.length > 0 && (
|
||||||
<div style={{ marginTop: '20px', padding: '16px', background: 'rgba(0,0,0,0.02)', borderRadius: '8px' }}>
|
<div style={{ marginTop: '20px', padding: '16px', background: 'rgba(0,0,0,0.02)', borderRadius: '8px' }}>
|
||||||
<h4 style={{ margin: '0 0 12px', color: 'rgba(255,255,255,0.85)' }}>Supported Events</h4>
|
<h4 style={{ margin: '0 0 12px', color: '#1A1F36' }}>支持的事件</h4>
|
||||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))', gap: '8px' }}>
|
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))', gap: '8px' }}>
|
||||||
{webhookEvents.map(ev => (
|
{webhookEvents.map(ev => (
|
||||||
<div key={ev.value} style={{ padding: '8px 12px', background: 'rgba(0,0,0,0.04)', borderRadius: '6px' }}>
|
<div key={ev.value} style={{ padding: '8px 12px', background: 'rgba(0,0,0,0.04)', borderRadius: '6px' }}>
|
||||||
<code style={{ color: '#69b1ff' }}>{ev.value}</code>
|
<code style={{ color: '#69b1ff' }}>{ev.value}</code>
|
||||||
<div style={{ fontSize: '12px', color: 'rgba(255,255,255,0.45)', marginTop: '2px' }}>{ev.desc}</div>
|
<div style={{ fontSize: '12px', color: '#8892B0', marginTop: '2px' }}>{ev.desc}</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -326,7 +326,7 @@ export default function AdminDeveloperTools() {
|
|||||||
{showWebhookModal && (
|
{showWebhookModal && (
|
||||||
<div className="dev-modal-overlay" onClick={() => setShowWebhookModal(false)}>
|
<div className="dev-modal-overlay" onClick={() => setShowWebhookModal(false)}>
|
||||||
<div className="dev-modal" onClick={e => e.stopPropagation()}>
|
<div className="dev-modal" onClick={e => e.stopPropagation()}>
|
||||||
<h3>New Webhook</h3>
|
<h3>新建 Webhook</h3>
|
||||||
<div className="dev-form-group">
|
<div className="dev-form-group">
|
||||||
<label>Name</label>
|
<label>Name</label>
|
||||||
<input className="dev-input" value={webhookForm.name} onChange={e => setWebhookForm({ ...webhookForm, name: e.target.value })} placeholder="My Webhook" />
|
<input className="dev-input" value={webhookForm.name} onChange={e => setWebhookForm({ ...webhookForm, name: e.target.value })} placeholder="My Webhook" />
|
||||||
@@ -351,7 +351,7 @@ export default function AdminDeveloperTools() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="dev-modal-actions">
|
<div className="dev-modal-actions">
|
||||||
<button className="dev-btn" onClick={() => setShowWebhookModal(false)}>Cancel</button>
|
<button className="dev-btn" onClick={() => setShowWebhookModal(false)}>Cancel</button>
|
||||||
<button className="dev-btn primary" onClick={handleCreateWebhook} disabled={!webhookForm.name || !webhookForm.url}>Create</button>
|
<button className="dev-btn primary" onClick={handleCreateWebhook} disabled={!webhookForm.name || !webhookForm.url}>创建</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -377,8 +377,8 @@ export default function AdminDeveloperTools() {
|
|||||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: '16px' }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: '16px' }}>
|
||||||
<div>
|
<div>
|
||||||
<h3 style={{ margin: '0 0 4px' }}>{pkg.name} <span className="dev-badge badge-active">v{pkg.version}</span></h3>
|
<h3 style={{ margin: '0 0 4px' }}>{pkg.name} <span className="dev-badge badge-active">v{pkg.version}</span></h3>
|
||||||
<p style={{ margin: '0', color: 'rgba(255,255,255,0.55)' }}>{pkg.description}</p>
|
<p style={{ margin: '0', color: '#5A6480' }}>{pkg.description}</p>
|
||||||
<p style={{ margin: '4px 0 0', fontSize: '13px', color: 'rgba(255,255,255,0.4)' }}>Requires: {pkg.min_version}</p>
|
<p style={{ margin: '4px 0 0', fontSize: '13px', color: '#8892B0' }}>Requires: {pkg.min_version}</p>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', gap: '8px' }}>
|
<div style={{ display: 'flex', gap: '8px' }}>
|
||||||
<a href={pkg.download_url} target="_blank" rel="noopener noreferrer" className="dev-btn primary">Download</a>
|
<a href={pkg.download_url} target="_blank" rel="noopener noreferrer" className="dev-btn primary">Download</a>
|
||||||
@@ -388,7 +388,7 @@ export default function AdminDeveloperTools() {
|
|||||||
|
|
||||||
{/* Install Command */}
|
{/* Install Command */}
|
||||||
<div style={{ marginBottom: '16px' }}>
|
<div style={{ marginBottom: '16px' }}>
|
||||||
<label style={{ fontSize: '13px', color: 'rgba(255,255,255,0.5)', marginBottom: '4px', display: 'block' }}>Installation</label>
|
<label style={{ fontSize: '13px', color: '#5A6480', marginBottom: '4px', display: 'block' }}>安装方式</label>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
||||||
<code style={{ flex: 1, padding: '10px 14px', background: 'rgba(0,0,0,0.3)', borderRadius: '8px', fontFamily: 'monospace', fontSize: '14px' }}>
|
<code style={{ flex: 1, padding: '10px 14px', background: 'rgba(0,0,0,0.3)', borderRadius: '8px', fontFamily: 'monospace', fontSize: '14px' }}>
|
||||||
{pkg.install_cmd}
|
{pkg.install_cmd}
|
||||||
@@ -397,9 +397,9 @@ export default function AdminDeveloperTools() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Features */}
|
{/* 功能特性 */}
|
||||||
<div style={{ marginBottom: '16px' }}>
|
<div style={{ marginBottom: '16px' }}>
|
||||||
<label style={{ fontSize: '13px', color: 'rgba(255,255,255,0.5)', marginBottom: '8px', display: 'block' }}>Features</label>
|
<label style={{ fontSize: '13px', color: '#5A6480', marginBottom: '8px', display: 'block' }}>功能特性</label>
|
||||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>
|
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>
|
||||||
{pkg.features.map(f => (
|
{pkg.features.map(f => (
|
||||||
<span key={f} style={{ padding: '4px 12px', background: 'rgba(82,196,26,0.15)', borderRadius: '16px', fontSize: '13px', color: '#52c41a', border: '1px solid rgba(82,196,26,0.3)' }}>
|
<span key={f} style={{ padding: '4px 12px', background: 'rgba(82,196,26,0.15)', borderRadius: '16px', fontSize: '13px', color: '#52c41a', border: '1px solid rgba(82,196,26,0.3)' }}>
|
||||||
@@ -411,7 +411,7 @@ export default function AdminDeveloperTools() {
|
|||||||
|
|
||||||
{/* Code Example */}
|
{/* Code Example */}
|
||||||
<div>
|
<div>
|
||||||
<label style={{ fontSize: '13px', color: 'rgba(255,255,255,0.5)', marginBottom: '4px', display: 'block' }}>Quick Start Example</label>
|
<label style={{ fontSize: '13px', color: '#5A6480', marginBottom: '4px', display: 'block' }}>快速开始示例</label>
|
||||||
<div style={{ position: 'relative' }}>
|
<div style={{ position: 'relative' }}>
|
||||||
<pre style={{ padding: '16px', background: 'rgba(0,0,0,0.4)', borderRadius: '8px', overflow: 'auto', fontSize: '13px', lineHeight: '1.6', maxHeight: '400px' }}>
|
<pre style={{ padding: '16px', background: 'rgba(0,0,0,0.4)', borderRadius: '8px', overflow: 'auto', fontSize: '13px', lineHeight: '1.6', maxHeight: '400px' }}>
|
||||||
<code>{pkg.code_example}</code>
|
<code>{pkg.code_example}</code>
|
||||||
@@ -431,14 +431,14 @@ export default function AdminDeveloperTools() {
|
|||||||
<div>
|
<div>
|
||||||
<div style={{ marginBottom: '16px', padding: '12px 16px', background: 'rgba(22,119,255,0.1)', borderRadius: '8px', border: '1px solid rgba(22,119,255,0.3)' }}>
|
<div style={{ marginBottom: '16px', padding: '12px 16px', background: 'rgba(22,119,255,0.1)', borderRadius: '8px', border: '1px solid rgba(22,119,255,0.3)' }}>
|
||||||
<strong style={{ color: '#69b1ff' }}>Base URL:</strong>
|
<strong style={{ color: '#69b1ff' }}>Base URL:</strong>
|
||||||
<code style={{ marginLeft: '8px', color: 'rgba(255,255,255,0.8)' }}>http://210.16.161.218:18080</code>
|
<code style={{ marginLeft: '8px', color: '#1A1F36' }}>http://210.16.161.218:18080</code>
|
||||||
<span style={{ marginLeft: '16px', color: 'rgba(255,255,255,0.4)' }}>API Version: v1</span>
|
<span style={{ marginLeft: '16px', color: '#8892B0' }}>API Version: v1</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{docSections.map(section => {
|
{docSections.map(section => {
|
||||||
const isExpanded = expandedSection === section.section;
|
const isExpanded = expandedSection === section.section;
|
||||||
return (
|
return (
|
||||||
<div key={section.section} style={{ marginBottom: '8px', borderRadius: '8px', overflow: 'hidden', border: '1px solid rgba(255,255,255,0.1)' }}>
|
<div key={section.section} style={{ marginBottom: '8px', borderRadius: '8px', overflow: 'hidden', border: '1px solid rgba(0,0,0,0.08)' }}>
|
||||||
{/* Section Header */}
|
{/* Section Header */}
|
||||||
<div
|
<div
|
||||||
onClick={() => setExpandedSection(isExpanded ? null : section.section)}
|
onClick={() => setExpandedSection(isExpanded ? null : section.section)}
|
||||||
@@ -448,16 +448,16 @@ export default function AdminDeveloperTools() {
|
|||||||
<span style={{ fontSize: '18px' }}>
|
<span style={{ fontSize: '18px' }}>
|
||||||
{section.icon === 'lock' ? '🔒' : section.icon === 'chat' ? '💬' : section.icon === 'book' ? '📚' : section.icon === 'robot' ? '🤖' : section.icon === 'workflow' ? '🔄' : section.icon === 'storage' ? '💾' : section.icon === 'webhook' ? '🔗' : '📋'}
|
{section.icon === 'lock' ? '🔒' : section.icon === 'chat' ? '💬' : section.icon === 'book' ? '📚' : section.icon === 'robot' ? '🤖' : section.icon === 'workflow' ? '🔄' : section.icon === 'storage' ? '💾' : section.icon === 'webhook' ? '🔗' : '📋'}
|
||||||
</span>
|
</span>
|
||||||
<strong style={{ color: 'rgba(255,255,255,0.85)' }}>{section.section}</strong>
|
<strong style={{ color: '#1A1F36' }}>{section.section}</strong>
|
||||||
<span style={{ color: 'rgba(255,255,255,0.4)', fontSize: '13px' }}>{section.endpoints.length} endpoints</span>
|
<span style={{ color: '#8892B0', fontSize: '13px' }}>{section.endpoints.length} endpoints</span>
|
||||||
</div>
|
</div>
|
||||||
<span style={{ color: 'rgba(255,255,255,0.4)' }}>{isExpanded ? '▼' : '▶'}</span>
|
<span style={{ color: '#8892B0' }}>{isExpanded ? '▼' : '▶'}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Section Content */}
|
{/* Section Content */}
|
||||||
{isExpanded && (
|
{isExpanded && (
|
||||||
<div style={{ background: 'rgba(0,0,0,0.2)' }}>
|
<div style={{ background: 'rgba(0,0,0,0.2)' }}>
|
||||||
<p style={{ padding: '8px 16px', margin: '0', color: 'rgba(255,255,255,0.5)', fontSize: '13px' }}>{section.description}</p>
|
<p style={{ padding: '8px 16px', margin: '0', color: '#5A6480', fontSize: '13px' }}>{section.description}</p>
|
||||||
{section.endpoints.map(ep => {
|
{section.endpoints.map(ep => {
|
||||||
const epKey = `${section.section}-${ep.path}`;
|
const epKey = `${section.section}-${ep.path}`;
|
||||||
const isEpExpanded = expandedEndpoint === epKey;
|
const isEpExpanded = expandedEndpoint === epKey;
|
||||||
@@ -468,28 +468,28 @@ export default function AdminDeveloperTools() {
|
|||||||
style={{ padding: '10px 16px', cursor: 'pointer', display: 'flex', alignItems: 'center', gap: '12px' }}
|
style={{ padding: '10px 16px', cursor: 'pointer', display: 'flex', alignItems: 'center', gap: '12px' }}
|
||||||
>
|
>
|
||||||
{methodBadge(ep.method)}
|
{methodBadge(ep.method)}
|
||||||
<code style={{ color: 'rgba(255,255,255,0.7)', fontSize: '13px' }}>{ep.path}</code>
|
<code style={{ color: '#5A6480', fontSize: '13px' }}>{ep.path}</code>
|
||||||
<span style={{ color: 'rgba(255,255,255,0.5)', fontSize: '13px' }}>{ep.title}</span>
|
<span style={{ color: '#5A6480', fontSize: '13px' }}>{ep.title}</span>
|
||||||
<span style={{ marginLeft: 'auto', color: 'rgba(255,255,255,0.3)' }}>{isEpExpanded ? '▼' : '▶'}</span>
|
<span style={{ marginLeft: 'auto', color: '#8892B0' }}>{isEpExpanded ? '▼' : '▶'}</span>
|
||||||
</div>
|
</div>
|
||||||
{isEpExpanded && (
|
{isEpExpanded && (
|
||||||
<div style={{ padding: '0 16px 16px 16px' }}>
|
<div style={{ padding: '0 16px 16px 16px' }}>
|
||||||
<p style={{ color: 'rgba(255,255,255,0.55)', margin: '4px 0 12px', fontSize: '13px' }}>{ep.description}</p>
|
<p style={{ color: '#5A6480', margin: '4px 0 12px', fontSize: '13px' }}>{ep.description}</p>
|
||||||
|
|
||||||
{/* Parameters */}
|
{/* 参数 */}
|
||||||
{ep.params.length > 0 && (
|
{ep.params.length > 0 && (
|
||||||
<div style={{ marginBottom: '12px' }}>
|
<div style={{ marginBottom: '12px' }}>
|
||||||
<label style={{ fontSize: '12px', color: 'rgba(255,255,255,0.4)', display: 'block', marginBottom: '6px' }}>Parameters</label>
|
<label style={{ fontSize: '12px', color: '#8892B0', display: 'block', marginBottom: '6px' }}>参数</label>
|
||||||
<table className="dev-table" style={{ fontSize: '13px' }}>
|
<table className="dev-table" style={{ fontSize: '13px' }}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
<tr><th>名称</th><th>类型</th><th>必填</th><th>描述</th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{ep.params.map(p => (
|
{ep.params.map(p => (
|
||||||
<tr key={p.name}>
|
<tr key={p.name}>
|
||||||
<td className="mono-text">{p.name}</td>
|
<td className="mono-text">{p.name}</td>
|
||||||
<td>{p.type}</td>
|
<td>{p.type}</td>
|
||||||
<td>{p.required ? <span style={{ color: '#ff4d4f' }}>Yes</span> : <span style={{ color: 'rgba(255,255,255,0.4)' }}>No</span>}</td>
|
<td>{p.required ? <span style={{ color: '#ff4d4f' }}>是</span> : <span style={{ color: '#8892B0' }}>否</span>}</td>
|
||||||
<td>{p.desc}</td>
|
<td>{p.desc}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
@@ -498,20 +498,20 @@ export default function AdminDeveloperTools() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Example Request */}
|
{/* 请求示例 */}
|
||||||
{ep.example_request && (
|
{ep.example_request && (
|
||||||
<div style={{ marginBottom: '12px' }}>
|
<div style={{ marginBottom: '12px' }}>
|
||||||
<label style={{ fontSize: '12px', color: 'rgba(255,255,255,0.4)', display: 'block', marginBottom: '4px' }}>Example Request</label>
|
<label style={{ fontSize: '12px', color: '#8892B0', display: 'block', marginBottom: '4px' }}>请求示例</label>
|
||||||
<pre style={{ padding: '10px 14px', background: 'rgba(0,0,0,0.3)', borderRadius: '6px', fontSize: '12px', overflow: 'auto' }}>
|
<pre style={{ padding: '10px 14px', background: 'rgba(0,0,0,0.3)', borderRadius: '6px', fontSize: '12px', overflow: 'auto' }}>
|
||||||
<code>{ep.example_request}</code>
|
<code>{ep.example_request}</code>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Example Response */}
|
{/* 响应示例 */}
|
||||||
{ep.example_response && (
|
{ep.example_response && (
|
||||||
<div>
|
<div>
|
||||||
<label style={{ fontSize: '12px', color: 'rgba(255,255,255,0.4)', display: 'block', marginBottom: '4px' }}>Example Response</label>
|
<label style={{ fontSize: '12px', color: '#8892B0', display: 'block', marginBottom: '4px' }}>响应示例</label>
|
||||||
<pre style={{ padding: '10px 14px', background: 'rgba(0,0,0,0.3)', borderRadius: '6px', fontSize: '12px', overflow: 'auto' }}>
|
<pre style={{ padding: '10px 14px', background: 'rgba(0,0,0,0.3)', borderRadius: '6px', fontSize: '12px', overflow: 'auto' }}>
|
||||||
<code>{ep.example_response}</code>
|
<code>{ep.example_response}</code>
|
||||||
</pre>
|
</pre>
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user