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