fix: UI single model selection in router mode (#19767)
This commit is contained in:
Binary file not shown.
@@ -251,9 +251,6 @@
|
|||||||
return options.find((option) => option.id === activeId);
|
return options.find((option) => option.id === activeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.length === 1) {
|
|
||||||
return options[0];
|
|
||||||
}
|
|
||||||
// No selection - return undefined to show "Select model"
|
// No selection - return undefined to show "Select model"
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,6 +306,16 @@ class ModelsStore {
|
|||||||
const response = await ModelsService.listRouter();
|
const response = await ModelsService.listRouter();
|
||||||
this.routerModels = response.data;
|
this.routerModels = response.data;
|
||||||
await this.fetchModalitiesForLoadedModels();
|
await this.fetchModalitiesForLoadedModels();
|
||||||
|
|
||||||
|
const o = this.models.filter((option) => {
|
||||||
|
const modelProps = this.getModelProps(option.model);
|
||||||
|
|
||||||
|
return modelProps?.webui !== false;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (o.length === 1 && this.isModelLoaded(o[0].model)) {
|
||||||
|
this.selectModelById(o[0].id);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn('Failed to fetch router models:', error);
|
console.warn('Failed to fetch router models:', error);
|
||||||
this.routerModels = [];
|
this.routerModels = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user