From 427a31ba21182b57ca76de60695ce647df1aaa8e Mon Sep 17 00:00:00 2001 From: john Date: Mon, 20 Jul 2026 07:37:37 +0800 Subject: [PATCH] feat: clarify image generation output controls --- src/admin/AdminNav.tsx | 2 +- src/admin/pages/AssetGatewayPage.tsx | 24 ++++++++++++++++-------- src/admin/pages/DashboardPage.tsx | 2 +- src/index.css | 5 +++++ src/types.ts | 2 ++ 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/admin/AdminNav.tsx b/src/admin/AdminNav.tsx index 122bf45..99f7155 100644 --- a/src/admin/AdminNav.tsx +++ b/src/admin/AdminNav.tsx @@ -37,7 +37,7 @@ const NAV_SECTIONS: NavSection[] = [ { to: '/skills', label: '技能' }, { to: '/policies', label: '策略' }, { to: '/providers', label: '统一模型中心' }, - { to: '/asset-gateway', label: '资产能力' }, + { to: '/asset-gateway', label: '图片生成' }, { to: '/blocked-words', label: '违禁词管理' }, ], }, diff --git a/src/admin/pages/AssetGatewayPage.tsx b/src/admin/pages/AssetGatewayPage.tsx index 628f0b8..57886d0 100644 --- a/src/admin/pages/AssetGatewayPage.tsx +++ b/src/admin/pages/AssetGatewayPage.tsx @@ -41,6 +41,11 @@ export function AssetGatewayPage() { const [message, setMessage] = useState(null); const [error, setError] = useState(null); const activeKeys = useMemo(() => keys.filter((key) => key.status === 'active'), [keys]); + const orderedPlugins = useMemo(() => config?.plugins.slice().sort((left, right) => { + if (left.pluginId === 'asset-generate') return -1; + if (right.pluginId === 'asset-generate') return 1; + return left.pluginId.localeCompare(right.pluginId); + }) ?? [], [config]); const load = useCallback(async () => { setLoading(true); @@ -108,16 +113,16 @@ export function AssetGatewayPage() { return (
-

资产能力

-

可插拔图片、素材与处理能力。默认关闭,不会影响现有聊天或页面生成流程。

+

图片生成

+

分别控制正文图片、页面头图、卡片封面和信息流缩略图;未勾选的 AI 图片项不会执行。

{error &&

{error}

} {message &&

{message}

}
OPTIONAL CAPABILITY
-

资产能力 Gateway

-

关闭时所有调用自动降级为现有流程;配置保留,现有聊天和页面生成不受影响。

+

图片与素材能力总开关

+

关闭时不调用图片模型;页面仍保留现有无图样式和基础缩略图流程。

- {config.plugins.map((plugin) => { + {orderedPlugins.map((plugin) => { const draft = drafts[plugin.pluginId] ?? draftFromPlugin(plugin); const selectedKey = activeKeys.find((key) => key.id === draft.llmProviderKeyId); const visual = pluginVisuals[plugin.pluginId] ?? { icon: '✦', accent: 'blue' }; @@ -165,7 +170,7 @@ export function AssetGatewayPage() { :
确定性处理 · 不调用 LLM
} {plugin.pluginId === 'asset-generate' && plugin.purposeCatalog?.length ? (
- image_make 生效范围 + AI 图片输出项
{plugin.purposeCatalog.map((purpose) => ( ))}
-

信息流缩略图仍由 MindSpace 从封面源图派生,不会重复调用生图模型。

+

页面头图最多生成一次;卡片封面和信息流缩略图复用同一张主图裁剪。关闭某项后,该位置不使用 AI 图片;基础页面缩略图仍保留。

) : null}
diff --git a/src/admin/pages/DashboardPage.tsx b/src/admin/pages/DashboardPage.tsx index 300f5a5..34c00f4 100644 --- a/src/admin/pages/DashboardPage.tsx +++ b/src/admin/pages/DashboardPage.tsx @@ -9,7 +9,7 @@ const QUICK_LINKS = [ { to: '/users', label: '用户管理', desc: '创建账号、启用禁用' }, { to: '/billing/recharge', label: '充值', desc: '为用户账户充值' }, { to: '/providers', label: '统一模型中心', desc: 'Provider、执行器模型与启动控制' }, - { to: '/asset-gateway', label: '资产能力', desc: '可插拔素材插件、Provider 与专属 LLM 选择' }, + { to: '/asset-gateway', label: '图片生成', desc: '配置正文图、页面头图、卡片封面与信息流缩略图' }, { to: '/mindspace', label: 'MindSpace 配置', desc: '公开页上限与空间发布参数' }, { to: '/memory-v2', label: 'Memory V2', desc: '长期记忆 backend 与前置路由开关' }, { to: '/skill-runtime', label: 'Skill Runtime', desc: 'H5 manifest 关键词路由开关' }, diff --git a/src/index.css b/src/index.css index 8b09409..df124b7 100644 --- a/src/index.css +++ b/src/index.css @@ -1111,6 +1111,11 @@ body, line-height: 1.45; } +.asset-purpose-grid small { + color: var(--color-text-muted); + line-height: 1.35; +} + .asset-purpose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); diff --git a/src/types.ts b/src/types.ts index b8801e1..00c98d1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -213,6 +213,8 @@ export type AssetPluginConfig = { id: string; label: string; presetId: string; + strategy?: 'generate' | 'derive'; + sourcePurpose?: string | null; }>; };