mirror of
https://github.com/mudler/LocalAI.git
synced 2026-04-18 13:58:07 -04:00
fix(ui): show also concrete backends in the backend list
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
@@ -74,9 +74,11 @@ export default function Backends() {
|
||||
const filteredBackends = (() => {
|
||||
let result = allBackends
|
||||
|
||||
// Show only meta backends unless "Show all" is toggled
|
||||
// Hide concrete variants that are aliased by a meta backend unless
|
||||
// "Show all" is toggled. Standalone backends (no meta referencing them)
|
||||
// stay visible even when they don't declare capabilities themselves.
|
||||
if (!showAllBackends) {
|
||||
result = result.filter(b => b.isMeta)
|
||||
result = result.filter(b => b.isMeta || !b.isAlias)
|
||||
}
|
||||
|
||||
// Hide development backends unless toggled on
|
||||
|
||||
@@ -824,6 +824,19 @@ func RegisterUIAPIRoutes(app *echo.Echo, cl *config.ModelConfigLoader, ml *model
|
||||
})
|
||||
}
|
||||
|
||||
// Collect concrete backend names that are referenced by any meta backend's
|
||||
// CapabilitiesMap. These are the per-capability variants the UI hides by
|
||||
// default behind "Show all" (the meta backend is the preferred entry).
|
||||
aliasedByMeta := make(map[string]bool)
|
||||
for _, b := range backends {
|
||||
if !b.IsMeta() {
|
||||
continue
|
||||
}
|
||||
for _, concreteName := range b.CapabilitiesMap {
|
||||
aliasedByMeta[concreteName] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Use the BackendManager's list to determine installed status.
|
||||
// In standalone mode this checks the local filesystem; in distributed
|
||||
// mode it aggregates from all healthy worker nodes.
|
||||
@@ -940,6 +953,7 @@ func RegisterUIAPIRoutes(app *echo.Echo, cl *config.ModelConfigLoader, ml *model
|
||||
"jobID": jobID,
|
||||
"isDeletion": isDeletionOp,
|
||||
"isMeta": b.IsMeta(),
|
||||
"isAlias": aliasedByMeta[b.Name],
|
||||
"isDevelopment": b.IsDevelopment(devSuffix),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user