feat(*): 创作配置 - 支持 Midjourney、多图保存与自定义公告

Co-authored-by: ddcat666 <26564566+ddcat666@users.noreply.github.com>
This commit is contained in:
DAO-QIN
2026-10-04 10:43:31 +08:00
committed by ddcat666
parent 002a45f0c3
commit 853c7d2ce7
107 changed files with 9261 additions and 408 deletions

View File

@@ -14,7 +14,7 @@ import type { ModelChannel } from "@/stores/use-config-store";
import { defaultPriceTier, normalizeUpstreamModelKey, priceTierPayloadFromForm } from "./channel-model-price-tier-form";
import { PriceTierFields } from "./channel-model-price-tier-fields";
import { ChannelModelTagsEditor } from "./channel-model-tags-editor";
import { changeChannelModelCapability, editorSectionForField, initialChannelModelValues, validateChannelModelPrices, validateChannelModelProtocol, type ChannelModelFormValues as FormValues, type EditorSection } from "./channel-model-editor-form";
import { changeChannelModelCapability, editorSectionForField, initialChannelModelValues, updateChannelModelUpstreamCapabilities, validateChannelModelPrices, validateChannelModelProtocol, type ChannelModelFormValues as FormValues, type EditorSection } from "./channel-model-editor-form";
export function ChannelModelEditor({
channel,
@@ -77,6 +77,13 @@ export function ChannelModelEditor({
} else if (changed.protocol) {
form.setFieldValue("capabilityConfig", modelCapability === "audio" ? undefined : defaultModelCapabilityConfig(changed.protocol, providerModelKey.trim() || modelKey.trim()));
setConfigurationChanged(true);
} else if (changed.providerModelKey !== undefined || changed.modelKey !== undefined) {
const values = form.getFieldsValue(true);
const next = updateChannelModelUpstreamCapabilities(values);
if (next !== values) {
form.setFieldValue("capabilityConfig", next.capabilityConfig);
setConfigurationChanged(true);
}
}
};
@@ -333,6 +340,7 @@ export function ChannelModelEditor({
model={providerModelKey || modelKey}
protocol={form.getFieldValue("protocol")}
section="references"
workflows={protocols.find((item) => item.value === modelProtocol)?.workflows}
value={capabilityConfig}
onChange={(next) => {
dirtyRef.current = true;
@@ -351,6 +359,7 @@ export function ChannelModelEditor({
model={providerModelKey || modelKey}
protocol={form.getFieldValue("protocol")}
section="protocol"
workflows={protocols.find((item) => item.value === modelProtocol)?.workflows}
value={capabilityConfig}
onChange={(next) => {
dirtyRef.current = true;