mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00
feat(models-ui): minor visual enhancements (#2109)
Show image if present, URL, tags, and better display buttons Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
3411e072ca
commit
d344daf129
3 changed files with 96 additions and 28 deletions
|
@ -26,8 +26,9 @@ func RegisterUIRoutes(app *fiber.App,
|
|||
models, _ := gallery.AvailableGalleryModels(appConfig.Galleries, appConfig.ModelPath)
|
||||
|
||||
summary := fiber.Map{
|
||||
"Title": "LocalAI API - Models",
|
||||
"Models": template.HTML(elements.ListModels(models)),
|
||||
"Title": "LocalAI - Models",
|
||||
"Models": template.HTML(elements.ListModels(models)),
|
||||
"Repositories": appConfig.Galleries,
|
||||
// "ApplicationConfig": appConfig,
|
||||
}
|
||||
|
||||
|
@ -49,7 +50,10 @@ func RegisterUIRoutes(app *fiber.App,
|
|||
|
||||
filteredModels := []*gallery.GalleryModel{}
|
||||
for _, m := range models {
|
||||
if strings.Contains(m.Name, form.Search) {
|
||||
if strings.Contains(m.Name, form.Search) ||
|
||||
strings.Contains(m.Description, form.Search) ||
|
||||
strings.Contains(m.Gallery.Name, form.Search) ||
|
||||
strings.Contains(strings.Join(m.Tags, ","), form.Search) {
|
||||
filteredModels = append(filteredModels, m)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue