release: bump version to 0.72.0
ci / backend (push) Has been cancelled
ci / frontend (push) Has been cancelled
ci / delivery (push) Has been cancelled
release / images (push) Has been cancelled

This commit is contained in:
linkong committed 2026-06-29 14:05:06 +08:00
1 parent 3265d22af5
commit 19d5ac0fee
60 files changed
+3702 -678

No files matched your search

@@ -117,6 +117,7 @@ export function AdminLayout({ children }: { children: ReactNode }) {
setCollapsed((value) => !value)
}}
aria-label={collapsed ? '展开菜单' : '折叠菜单'}
title={collapsed ? '展开菜单' : '折叠菜单'}
>
{collapsed ? <Menu size={18} /> : <X size={18} />}
</Button>
@@ -254,7 +255,7 @@ export function AdminLayout({ children }: { children: ReactNode }) {
) : null}
<main className="admin__content">
<header className="admin__topbar">
<Button size="icon" variant="ghost" className="admin__mobile-menu" onClick={() => setMobileNavOpen(true)} aria-label="打开导航">
<Button size="icon" variant="ghost" className="admin__mobile-menu" onClick={() => setMobileNavOpen(true)} aria-label="打开导航" title="打开导航">
<Menu size={18} />
</Button>
<div className="admin__search" onBlur={handleSearchBlur}>
+1 -1
View File
@@ -30,7 +30,7 @@ export function Dialog({ open, onOpenChange, title, description, children, foote
) : null}
</div>
<DialogPrimitive.Close asChild>
<Button size="icon" variant="ghost" aria-label="关闭">
<Button size="icon" variant="ghost" aria-label="关闭" title="关闭">
<X size={16} />
</Button>
</DialogPrimitive.Close>
+1 -1
View File
@@ -46,7 +46,7 @@ export function ToastProvider({ children }: { children: ReactNode }) {
{item.description}
</ToastPrimitive.Description>
) : null}
<ToastPrimitive.Close className="an-toast__close" aria-label="关闭通知">
<ToastPrimitive.Close className="an-toast__close" aria-label="关闭通知" title="关闭通知">
<X size={14} />
</ToastPrimitive.Close>
</ToastPrimitive.Root>
+2 -2
View File
@@ -410,8 +410,8 @@ export default function DataList() {
<CardHeader>
<CardTitle>数据概览</CardTitle>
<div className="an-segmented">
<button className={distributionDimension === 'source' ? 'is-active' : ''} onClick={() => setDistributionDimension('source')}>按数据源</button>
<button className={distributionDimension === 'type' ? 'is-active' : ''} onClick={() => setDistributionDimension('type')}>按类型</button>
<button type="button" className={distributionDimension === 'source' ? 'is-active' : ''} onClick={() => setDistributionDimension('source')}>按数据源</button>
<button type="button" className={distributionDimension === 'type' ? 'is-active' : ''} onClick={() => setDistributionDimension('type')}>按类型</button>
</div>
</CardHeader>
<CardContent>
+114 -47
View File
@@ -34,7 +34,7 @@ import Scrollbar from '../../components/Scrollbar/Scrollbar'
import { useWebSocket } from '../../hooks/useWebSocket'
import { AdminLayout } from '../components/layout/AdminLayout'
import { DataTable } from '../components/data-table/DataTable'
import { Button } from '../components/ui/button'
import { Button, type ButtonProps } from '../components/ui/button'
import { ConfirmDialog, Dialog } from '../components/ui/dialog'
import { Textarea } from '../components/ui/input'
import { AdminSwitch } from '../components/ui/switch'
@@ -177,7 +177,7 @@ interface PlaygroundActionResponse {
session?: PlaygroundThreadResponse['session']
}
const API_BASE_URL = (import.meta as any).env?.VITE_API_URL || '/api/v1'
const API_BASE_URL = import.meta.env.VITE_API_URL || '/api/v1'
function apiPath(path: string) {
if (path.startsWith('/api/')) return path
@@ -813,11 +813,43 @@ type FieldConfig = {
placeholder?: string
disabled?: boolean
help?: string
inputAction?: {
ariaLabel?: string
disabled?: boolean
icon?: ButtonProps['icon']
loading?: boolean
onClick: () => void
title: string
}
wide?: boolean
secretVisible?: boolean
onToggleSecret?: (visible: boolean) => void
}
function ConnectionTestInput({
action,
children,
}: {
action: NonNullable<FieldConfig['inputAction']>
children: ReactNode
}) {
return (
<div className="an-connection-test-input">
{children}
<Button
size="icon"
variant="subtle"
icon={action.icon || 'connect'}
title={action.title}
aria-label={action.ariaLabel || action.title}
disabled={action.disabled}
loading={action.loading}
onClick={action.onClick}
/>
</div>
)
}
const fieldLabels: Record<string, string> = {
key: '键',
label: '标签',
@@ -2298,19 +2330,37 @@ function FieldGrid({
return (
<label key={field.key} className={className} data-admin-search-target={searchTarget} data-admin-search-field={field.key} data-admin-search-text={searchText}>
<span>{field.label}</span>
<input
className="an-input"
type={field.type === 'number' ? 'number' : 'text'}
value={text(value, '')}
placeholder={field.placeholder}
disabled={field.disabled}
onChange={(event) => onDraftChange(setNestedDraftField(
draft,
record,
field.key,
field.type === 'number' ? Number(event.target.value) : event.target.value,
))}
/>
{field.inputAction ? (
<ConnectionTestInput action={{ ...field.inputAction, disabled: field.disabled || field.inputAction.disabled }}>
<input
className="an-input an-connection-test-input__control"
type={field.type === 'number' ? 'number' : 'text'}
value={text(value, '')}
placeholder={field.placeholder}
disabled={field.disabled}
onChange={(event) => onDraftChange(setNestedDraftField(
draft,
record,
field.key,
field.type === 'number' ? Number(event.target.value) : event.target.value,
))}
/>
</ConnectionTestInput>
) : (
<input
className="an-input"
type={field.type === 'number' ? 'number' : 'text'}
value={text(value, '')}
placeholder={field.placeholder}
disabled={field.disabled}
onChange={(event) => onDraftChange(setNestedDraftField(
draft,
record,
field.key,
field.type === 'number' ? Number(event.target.value) : event.target.value,
))}
/>
)}
{field.help ? <small>{field.help}</small> : null}
</label>
)
@@ -4761,7 +4811,21 @@ function ModuleConsole({ config }: { config: ModuleConfig }) {
{ value: 'anthropic-messages', label: 'Anthropic Messages' },
{ value: 'ollama-generate', label: 'Ollama Generate' },
] },
{ key: 'base_url', label: 'LLM 基础地址', wide: true },
{
key: 'base_url',
label: 'LLM 基础地址',
wide: true,
inputAction: activeGroup ? {
title: '测试 AI Provider 连通性',
icon: 'test',
loading: actionLoading,
onClick: () => void testConnection(
'AI Provider',
'/settings/integrations/ai-provider/connect',
sanitizeSecretDrafts(stripInternalFields(record), activeGroup.record, ['api_key', 'service_token'], revealedFor('ai_provider')),
),
} : undefined,
},
{ key: 'model', label: '默认模型' },
{
key: 'api_key',
@@ -4785,28 +4849,47 @@ function ModuleConsole({ config }: { config: ModuleConfig }) {
onToggleSecret: toggleActiveSecret('service_token', 'ai_provider'),
},
]
const webSearchDisabled = activeGroup?.key.startsWith('web_search:') && !Boolean(record.enabled)
const webFields: FieldConfig[] = [
{ key: 'provider', label: '搜索供应商' },
{ key: 'base_url', label: 'API 基础地址', wide: true },
{ key: 'enabled', label: '启用 WebSearch', type: 'boolean' },
{ key: 'provider', label: '搜索供应商', disabled: webSearchDisabled },
{
key: 'base_url',
label: 'API 基础地址',
wide: true,
disabled: webSearchDisabled,
inputAction: activeGroup ? {
title: '测试 Web Search 连通性',
icon: 'test',
loading: actionLoading,
disabled: webSearchDisabled,
onClick: () => void testConnection(
'Web Search',
'/settings/integrations/web-search/connect',
sanitizeSecretDrafts(stripInternalFields(record), activeGroup.record, ['api_key'], revealedFor('web_search')),
),
} : undefined,
},
{
key: 'api_key',
label: 'WebSearch API Key',
type: 'secret',
placeholder: '输入新的 WebSearch API Key',
disabled: webSearchDisabled,
secretVisible: Boolean(visibleSecretFields[secretFieldKey('api_key')]),
onToggleSecret: toggleActiveSecret('api_key', 'web_search'),
},
{ key: 'max_results', label: '最大结果数', type: 'number' },
{ key: 'timeout_seconds', label: '超时(秒)', type: 'number' },
{ key: 'endpoint_path', label: '接口路径' },
{ key: 'search_depth', label: '搜索深度' },
{ key: 'engine', label: 'SerpAPI 引擎' },
{ key: 'categories', label: 'SearXNG 分类' },
{ key: 'search_path', label: 'Firecrawl 搜索路径' },
{ key: 'scrape_path', label: 'Firecrawl 抓取路径' },
{ key: 'include_answer', label: '包含答案', type: 'boolean' },
{ key: 'include_raw_content', label: '包含原始内容', type: 'boolean' },
{ key: 'include_text', label: '包含正文', type: 'boolean' },
{ key: 'max_results', label: '最大结果数', type: 'number', disabled: webSearchDisabled },
{ key: 'timeout_seconds', label: '超时(秒)', type: 'number', disabled: webSearchDisabled },
{ key: 'endpoint_path', label: '接口路径', disabled: webSearchDisabled },
{ key: 'search_depth', label: '搜索深度', disabled: webSearchDisabled },
{ key: 'engine', label: 'SerpAPI 引擎', disabled: webSearchDisabled },
{ key: 'categories', label: 'SearXNG 分类', disabled: webSearchDisabled },
{ key: 'search_path', label: 'Firecrawl 搜索路径', disabled: webSearchDisabled },
{ key: 'scrape_path', label: 'Firecrawl 抓取路径', disabled: webSearchDisabled },
{ key: 'include_answer', label: '包含答案', type: 'boolean', disabled: webSearchDisabled },
{ key: 'include_raw_content', label: '包含原始内容', type: 'boolean', disabled: webSearchDisabled },
{ key: 'include_text', label: '包含正文', type: 'boolean', disabled: webSearchDisabled },
]
const ocrFields: FieldConfig[] = [
{ key: 'provider', label: 'OCR 供应商', type: 'select', options: [
@@ -4959,14 +5042,12 @@ function ModuleConsole({ config }: { config: ModuleConfig }) {
<>
<Button size="icon" variant="subtle" title={isActiveDefault ? '当前已是默认' : '设为默认'} aria-label={isActiveDefault ? '当前已是默认' : '设为默认'} onClick={() => void setActiveAsDefault()} loading={actionLoading} disabled={isActiveDefault}><CheckCircle2 size={15} /></Button>
<Button size="icon" variant="subtle" title="恢复默认配置" aria-label="恢复默认配置" onClick={restoreActiveDefaults}><Redo2 size={15} /></Button>
<Button size="icon" variant="subtle" icon="test" title="测试 Web Search 连通性" aria-label="测试 Web Search 连通性" onClick={() => void testConnection('Web Search', '/settings/integrations/web-search/connect', sanitizeSecretDrafts(stripInternalFields(record), activeGroup.record, ['api_key'], revealedFor('web_search')))} loading={actionLoading} />
</>
) : null}
{activeSection.key === 'integrations' ? (
<>
<Button size="icon" variant="subtle" title={isActiveDefault ? '当前已是默认' : '设为默认'} aria-label={isActiveDefault ? '当前已是默认' : '设为默认'} onClick={() => void setActiveAsDefault()} loading={actionLoading} disabled={isActiveDefault}><CheckCircle2 size={15} /></Button>
<Button size="icon" variant="subtle" title="恢复默认配置" aria-label="恢复默认配置" onClick={restoreActiveDefaults}><Redo2 size={15} /></Button>
<Button size="icon" variant="subtle" icon="test" title="测试 AI Provider 连通性" aria-label="测试 AI Provider 连通性" onClick={() => void testConnection('AI Provider', '/settings/integrations/ai-provider/connect', sanitizeSecretDrafts(stripInternalFields(record), activeGroup.record, ['api_key', 'service_token'], revealedFor('ai_provider')))} loading={actionLoading} />
</>
) : null}
{activeGroup?.key.startsWith('ocr:') ? (
@@ -6276,20 +6357,6 @@ function ModuleConsole({ config }: { config: ModuleConfig }) {
actions.push(<Button key="refresh-preset" variant="primary" onClick={() => void requestAction('刷新模型列表', 'post', `/settings/integrations/ai-provider/presets/${encodeURIComponent(id)}/refresh`, undefined, { refresh: false, successDescription: '模型预设已刷新,未保存 provider 表单。' })} loading={actionLoading}><RefreshCw size={15} />刷新模型</Button>)
}
if (config === configs.ai && endpointKey === 'integrations') {
const integrationKey = pick(selected, ['__title', 'key', 'provider'], '')
if (integrationKey === 'ai_provider') {
actions.push(
<Button key="connect-ai" size="icon" variant="subtle" icon="test" title="测试 AI Provider 连通性" aria-label="测试 AI Provider 连通性" onClick={() => void testConnection('AI Provider', '/settings/integrations/ai-provider/connect', cleanRecord(selected))} loading={actionLoading} />,
)
}
if (integrationKey === 'web_search') {
actions.push(
<Button key="connect-web" size="icon" variant="subtle" icon="test" title="测试 Web Search 连通性" aria-label="测试 Web Search 连通性" onClick={() => void testConnection('Web Search', '/settings/integrations/web-search/connect', cleanRecord(selected))} loading={actionLoading} />,
)
}
}
if (config === configs.ai && endpointKey === 'prompts' && id) {
actions.push(<Button key="reset-prompt" variant="danger" onClick={() => setConfirmAction({
title: '重置 Prompt',
@@ -7150,7 +7217,7 @@ const configs = {
{ key: 'prompts', label: '提示词', url: '/settings/ai-prompts', map: (payload) => dataArray(payload).map((row) => ({ ...row, __module: '提示词', __status: pick(row, ['source'], 'prompt') })) },
{ key: 'playground', label: 'Playground', url: '/ai/playground/session', map: (payload) => isObjectRecord(payload) ? [{ ...payload, __title: 'Playground 会话', __module: 'Playground', __status: 'saved' }] : [] },
],
actions: [makeAction('设置', <Settings2 size={15} />, `/admin/${'settings'}`)],
actions: [makeAction('设置', <Settings2 size={15} />, '/settings')],
detailTitle: 'AI 配置详情',
},
earthContent: {
@@ -7274,7 +7341,7 @@ const configs = {
detailTitle: '日志详情',
},
settings: {
title: '设置',
title: '系统设置',
description: '管理系统显示、通知策略、安全策略和 SMTP 邮件。',
listTitle: '设置分区',
listDescription: '仅展示系统设置分区;AI 集成和采集器调度分别在对应模块管理。',
+3 -3
View File
@@ -17,7 +17,7 @@ import {
import { adminRoutes, getVisibleAdminRoutes } from '../routes/manifest'
import type { AdminSearchTarget } from './types'
const API_BASE_URL = (import.meta as any).env?.VITE_API_URL || '/api/v1'
const API_BASE_URL = import.meta.env.VITE_API_URL || '/api/v1'
function apiPath(path: string) {
if (path.startsWith('/api/')) return path
@@ -88,7 +88,7 @@ const sectionTargets = [
{ key: 'collectors', label: '采集调度', terms: ['schedule', 'frequency'] },
{ key: 'collection_history', label: '采集历史 / 快照', terms: ['history', 'snapshot'] },
] },
{ routePath: '/settings', routeLabel: '设置', icon: Settings, sections: [
{ routePath: '/settings', routeLabel: '系统设置', icon: Settings, sections: [
{ key: 'system', label: '系统显示', terms: ['system', 'display'] },
{ key: 'notifications', label: '通知策略', terms: ['notification', 'email'] },
{ key: 'security', label: '安全策略', terms: ['security', 'password'] },
@@ -117,7 +117,7 @@ const fieldTargets = [
{ routePath: '/ai', routeLabel: 'AI', sectionKey: 'prompts', sectionLabel: '提示词', labels: ['System Prompt', '任务提示词', '重置 Prompt'] },
{ routePath: '/collection-management', routeLabel: '采集管理', sectionKey: 'collector_credentials', sectionLabel: '采集器', labels: ['凭证教程', '生成凭证教程', '采集器配置', '映射模板', '目标 Schema'] },
{ routePath: '/earth-content', routeLabel: '智能星球内容', sectionKey: 'tv', sectionLabel: '电视直播', labels: ['默认频道', '自动回退', '直播源', '频道', '主页地址'] },
{ routePath: '/settings', routeLabel: '设置', sectionKey: 'smtp', sectionLabel: 'SMTP 邮件', labels: ['主机', '端口', '用户名', '密码', '使用 TLS', '发件邮箱'] },
{ routePath: '/settings', routeLabel: '系统设置', sectionKey: 'smtp', sectionLabel: 'SMTP 邮件', labels: ['主机', '端口', '用户名', '密码', '使用 TLS', '发件邮箱'] },
]
const curatedDynamicLikeTargets = [
+26 -8
View File
@@ -117,8 +117,8 @@ body:has(.admin-theme-root[data-theme='dark']) .an-toast {
}
.admin {
min-height: 100vh;
height: 100vh;
min-height: 0;
height: 100%;
display: grid;
grid-template-columns: 236px minmax(0, 1fr);
background: var(--an-bg);
@@ -597,7 +597,7 @@ body:has(.admin-theme-root[data-theme='dark']) .an-toast {
.admin__content {
min-width: 0;
height: 100vh;
height: 100%;
display: grid;
grid-template-rows: 48px minmax(0, 1fr);
}
@@ -2038,7 +2038,7 @@ body:has(.admin-theme-root[data-theme='dark']) .an-toast {
font-size: calc(0.74rem * var(--hud-scale) * var(--brand-scale));
line-height: 1.3;
font-weight: 500;
letter-spacing: 0.01em;
letter-spacing: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@@ -2048,7 +2048,7 @@ body:has(.admin-theme-root[data-theme='dark']) .an-toast {
color: var(--hud-text-soft);
font-size: calc(0.6rem * var(--hud-scale) * var(--brand-scale));
line-height: 1.3;
letter-spacing: 0.08em;
letter-spacing: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@@ -2183,7 +2183,7 @@ body:has(.admin-theme-root[data-theme='dark']) .an-toast {
font-size: calc(0.62rem * var(--hud-scale));
font-weight: 700;
line-height: 1.35;
letter-spacing: 0.04em;
letter-spacing: 0;
}
.an-tv-earth-preview .tv-panel-tag--status {
@@ -2221,7 +2221,7 @@ body:has(.admin-theme-root[data-theme='dark']) .an-toast {
.an-tv-earth-preview .tv-panel-catalog {
font-size: calc(0.66rem * var(--hud-scale));
letter-spacing: 0.04em;
letter-spacing: 0;
text-transform: uppercase;
}
@@ -2371,6 +2371,24 @@ body:has(.admin-theme-root[data-theme='dark']) .an-toast {
outline: none;
}
.an-connection-test-input {
position: relative;
min-width: 0;
}
.an-connection-test-input__control {
padding-right: 38px;
}
.an-connection-test-input > .tui-button {
position: absolute;
top: 50%;
right: 4px;
width: 28px;
height: 24px;
transform: translateY(-50%);
}
.an-news-feed-list {
display: grid;
gap: 10px;
@@ -4066,7 +4084,7 @@ body:has(.admin-theme-root[data-theme='dark']) .an-toast {
}
.admin__content {
height: 100vh;
height: 100%;
}
.admin__topbar {