Browse Source

image

tags/v1.22.6.2
lewis 3 years ago
parent
commit
f3c0de9fce
5 changed files with 9 additions and 3 deletions
  1. +5
    -0
      models/cloudbrain_image.go
  2. +1
    -0
      routers/repo/cloudbrain.go
  3. +1
    -1
      web_src/js/components/images/Images.vue
  4. +1
    -1
      web_src/js/components/images/selectGrampusImages.vue
  5. +1
    -1
      web_src/js/features/images.js

+ 5
- 0
models/cloudbrain_image.go View File

@@ -68,6 +68,7 @@ type SearchImageOptions struct {
IncludeCustom bool IncludeCustom bool
IncludeOwnerOnly bool IncludeOwnerOnly bool
Topics string Topics string
CloudbrainType int
ListOptions ListOptions
SearchOrderBy SearchOrderBy
} }
@@ -411,6 +412,10 @@ func SearchImageCondition(opts *SearchImageOptions) builder.Cond {


} }


if opts.CloudbrainType > 0 {
cond = cond.And(builder.Eq{"cloudbrain_type": opts.CloudbrainType})
}

return cond return cond
} }




+ 1
- 0
routers/repo/cloudbrain.go View File

@@ -1037,6 +1037,7 @@ func GetPublicImages(ctx *context.Context) {
IncludeOfficialOnly: ctx.QueryBool("recommend"), IncludeOfficialOnly: ctx.QueryBool("recommend"),
SearchOrderBy: "type desc, num_stars desc,id desc", SearchOrderBy: "type desc, num_stars desc,id desc",
Status: models.IMAGE_STATUS_SUCCESS, Status: models.IMAGE_STATUS_SUCCESS,
CloudbrainType: ctx.QueryInt("cloudbrainType"),
} }


getImages(ctx, &opts) getImages(ctx, &opts)


+ 1
- 1
web_src/js/components/images/Images.vue View File

@@ -672,7 +672,7 @@ export default {
}, },
filters:{ filters:{
transformType(val){ transformType(val){
if(val==0){
if(val==0 || val==2){
return "GPU" return "GPU"
} }
}, },


+ 1
- 1
web_src/js/components/images/selectGrampusImages.vue View File

@@ -84,7 +84,7 @@
currentPagePublic: 1, currentPagePublic: 1,
pageSizePublic: 5, pageSizePublic: 5,
totalNumPublic: 0, totalNumPublic: 0,
paramsPublic: { page: 1, pageSize: 5, q: '', recommend: false },
paramsPublic: { page: 1, pageSize: 5, q: '', recommend: false,cloudbrainType: 2 },
tableDataPublic: [], tableDataPublic: [],
loadingPublic: false, loadingPublic: false,




+ 1
- 1
web_src/js/features/images.js View File

@@ -218,7 +218,7 @@ export default async function initImage(){
new Vue({ new Vue({
el:el, el:el,
render: h => h(selectImages)
render: h => h(selectGrampusImages)
}); });
} }
initVueImages() initVueImages()


Loading…
Cancel
Save