File tree Expand file tree Collapse file tree 1 file changed +22
-16
lines changed Expand file tree Collapse file tree 1 file changed +22
-16
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ import (
8
8
"github.com/go-skynet/LocalAI/pkg/gallery"
9
9
)
10
10
11
+ const (
12
+ NoImage = "https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg"
13
+ )
14
+
11
15
func DoneProgress (uid string ) string {
12
16
return elem .Div (
13
17
attrs.Props {},
@@ -197,24 +201,26 @@ func ListModels(models []*gallery.GalleryModel) string {
197
201
198
202
elems := []elem.Node {}
199
203
200
- if m .Icon != "" {
201
- elems = append (elems ,
204
+ if m .Icon == "" {
205
+ m .Icon = NoImage
206
+ }
207
+
208
+ elems = append (elems ,
202
209
203
- elem .Div (attrs.Props {
204
- "class" : "flex justify-center items-center" ,
210
+ elem .Div (attrs.Props {
211
+ "class" : "flex justify-center items-center" ,
212
+ },
213
+ elem .A (attrs.Props {
214
+ "href" : "#!" ,
215
+ // "class": "justify-center items-center",
205
216
},
206
- elem .A (attrs.Props {
207
- "href" : "#!" ,
208
- // "class": "justify-center items-center",
209
- },
210
- elem .Img (attrs.Props {
211
- // "class": "rounded-t-lg object-fit object-center h-96",
212
- "class" : "rounded-t-lg max-h-48 max-w-96 object-cover mt-3" ,
213
- "src" : m .Icon ,
214
- }),
215
- ),
216
- ))
217
- }
217
+ elem .Img (attrs.Props {
218
+ // "class": "rounded-t-lg object-fit object-center h-96",
219
+ "class" : "rounded-t-lg max-h-48 max-w-96 object-cover mt-3" ,
220
+ "src" : m .Icon ,
221
+ }),
222
+ ),
223
+ ))
218
224
219
225
elems = append (elems , descriptionDiv (m ), actionDiv (m ))
220
226
modelsElements = append (modelsElements ,
You can’t perform that action at this time.
0 commit comments