fix: allow hidden models in admin workflow selectors
This commit is contained in:
parent
ce6873f8fe
commit
f83dc0aff3
@ -1560,14 +1560,14 @@ export function AdminSettingsClient() {
|
|||||||
const detailAgentModelOptions = useMemo(
|
const detailAgentModelOptions = useMemo(
|
||||||
() =>
|
() =>
|
||||||
(modelsData?.models || []).filter(
|
(modelsData?.models || []).filter(
|
||||||
(model) => !model.supportsImageGen && model.isEnabled && !model.isHidden
|
(model) => !model.supportsImageGen && model.isEnabled
|
||||||
),
|
),
|
||||||
[modelsData?.models]
|
[modelsData?.models]
|
||||||
);
|
);
|
||||||
const imageGenerationModelOptions = useMemo(
|
const imageGenerationModelOptions = useMemo(
|
||||||
() =>
|
() =>
|
||||||
(modelsData?.models || []).filter(
|
(modelsData?.models || []).filter(
|
||||||
(model) => model.supportsImageGen && model.isEnabled && !model.isHidden && !model.isSubModel
|
(model) => model.supportsImageGen && model.isEnabled && !model.isSubModel
|
||||||
),
|
),
|
||||||
[modelsData?.models]
|
[modelsData?.models]
|
||||||
);
|
);
|
||||||
@ -11726,6 +11726,7 @@ export function AdminSettingsClient() {
|
|||||||
{imageGenerationModelOptions.map((model) => (
|
{imageGenerationModelOptions.map((model) => (
|
||||||
<SelectItem key={model.id} value={model.id}>
|
<SelectItem key={model.id} value={model.id}>
|
||||||
{model.displayName}
|
{model.displayName}
|
||||||
|
{model.isHidden ? " · 前端隐藏" : ""}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
@ -11770,6 +11771,7 @@ export function AdminSettingsClient() {
|
|||||||
{detailAgentModelOptions.map((model) => (
|
{detailAgentModelOptions.map((model) => (
|
||||||
<SelectItem key={model.id} value={model.id}>
|
<SelectItem key={model.id} value={model.id}>
|
||||||
{model.displayName}
|
{model.displayName}
|
||||||
|
{model.isHidden ? " · 前端隐藏" : ""}
|
||||||
{model.supportsVision ? " · 多模态" : ""}
|
{model.supportsVision ? " · 多模态" : ""}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -1787,6 +1787,7 @@ interface AdminAiModelOption {
|
|||||||
supportsImageGen?: boolean;
|
supportsImageGen?: boolean;
|
||||||
isEnabled?: boolean;
|
isEnabled?: boolean;
|
||||||
isHidden?: boolean;
|
isHidden?: boolean;
|
||||||
|
isSubModel?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createAgentWorkflowSettingsStateFromPayload(
|
function createAgentWorkflowSettingsStateFromPayload(
|
||||||
@ -2099,7 +2100,7 @@ export function AgentWorkflowSettingsClient({
|
|||||||
(model) =>
|
(model) =>
|
||||||
model.supportsImageGen &&
|
model.supportsImageGen &&
|
||||||
model.isEnabled !== false &&
|
model.isEnabled !== false &&
|
||||||
model.isHidden !== true
|
model.isSubModel !== true
|
||||||
)
|
)
|
||||||
.sort((left, right) =>
|
.sort((left, right) =>
|
||||||
String(left.displayName || left.modelId || left.id).localeCompare(
|
String(left.displayName || left.modelId || left.id).localeCompare(
|
||||||
@ -2112,7 +2113,7 @@ export function AgentWorkflowSettingsClient({
|
|||||||
const workflowImageModelLabelById = useMemo(() => {
|
const workflowImageModelLabelById = useMemo(() => {
|
||||||
const entries: Array<[string, string]> = workflowImageModelOptions.map((model) => [
|
const entries: Array<[string, string]> = workflowImageModelOptions.map((model) => [
|
||||||
model.id,
|
model.id,
|
||||||
`${model.displayName}${model.modelId ? `(${model.modelId})` : ""}`,
|
`${model.displayName}${model.isHidden ? " · 前端隐藏" : ""}${model.modelId ? `(${model.modelId})` : ""}`,
|
||||||
]);
|
]);
|
||||||
return new Map<string, string>(entries);
|
return new Map<string, string>(entries);
|
||||||
}, [workflowImageModelOptions]);
|
}, [workflowImageModelOptions]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user