mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-01 00:14:59 +00:00
fix(gallery): show a fake image if no there is no icon (#2111)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
34c3f563fd
commit
ac56ac2b2d
1 changed files with 23 additions and 17 deletions
|
@ -8,6 +8,10 @@ import (
|
||||||
"github.com/go-skynet/LocalAI/pkg/gallery"
|
"github.com/go-skynet/LocalAI/pkg/gallery"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
NoImage = "https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg"
|
||||||
|
)
|
||||||
|
|
||||||
func DoneProgress(uid string) string {
|
func DoneProgress(uid string) string {
|
||||||
return elem.Div(
|
return elem.Div(
|
||||||
attrs.Props{},
|
attrs.Props{},
|
||||||
|
@ -197,7 +201,10 @@ func ListModels(models []*gallery.GalleryModel) string {
|
||||||
|
|
||||||
elems := []elem.Node{}
|
elems := []elem.Node{}
|
||||||
|
|
||||||
if m.Icon != "" {
|
if m.Icon == "" {
|
||||||
|
m.Icon = NoImage
|
||||||
|
}
|
||||||
|
|
||||||
elems = append(elems,
|
elems = append(elems,
|
||||||
|
|
||||||
elem.Div(attrs.Props{
|
elem.Div(attrs.Props{
|
||||||
|
@ -214,7 +221,6 @@ func ListModels(models []*gallery.GalleryModel) string {
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
}
|
|
||||||
|
|
||||||
elems = append(elems, descriptionDiv(m), actionDiv(m))
|
elems = append(elems, descriptionDiv(m), actionDiv(m))
|
||||||
modelsElements = append(modelsElements,
|
modelsElements = append(modelsElements,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue