diff --git a/models/attachment.go b/models/attachment.go index 40fcd7f08..ea8f1645f 100755 --- a/models/attachment.go +++ b/models/attachment.go @@ -65,6 +65,7 @@ type AttachmentInfo struct { Repo *Repository `xorm:"extends"` RelAvatarLink string `xorm:"extends"` UserName string `xorm:"extends"` + Recommend bool `xorm:"-"` } type AttachmentsOptions struct { @@ -79,6 +80,7 @@ type AttachmentsOptions struct { JustNeedZipFile bool NeedRepoInfo bool Keyword string + RecommendOnly bool } func (a *Attachment) AfterUpdate() { @@ -579,6 +581,11 @@ func Attachments(opts *AttachmentsOptions) ([]*AttachmentInfo, int64, error) { builder.Eq{"attachment.is_private": opts.IsPrivate}, ) } + if opts.RecommendOnly { + cond = cond.And(builder.In("attachment.id", builder.Select("attachment.id"). + From("attachment"). + Join("INNER", "dataset", "attachment.dataset_id = dataset.id and dataset.recommend=true"))) + } if opts.JustNeedZipFile { var DecompressState []int32 @@ -627,6 +634,7 @@ func Attachments(opts *AttachmentsOptions) ([]*AttachmentInfo, int64, error) { if err != nil { return nil, 0, fmt.Errorf("GetDatasetByID failed error: %v", err) } + attachment.Recommend = dataset.Recommend repo, err := GetRepositoryByID(dataset.RepoID) if err == nil { attachment.Repo = repo diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 0465faf9a..44b177471 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -580,6 +580,8 @@ type CommitImageParams struct { Topics []string CloudBrainType int UID int64 + Place string + Type int } type CommitImageResult struct { diff --git a/models/cloudbrain_image.go b/models/cloudbrain_image.go index c88db0f67..eb21e0d87 100644 --- a/models/cloudbrain_image.go +++ b/models/cloudbrain_image.go @@ -567,12 +567,12 @@ func isImageStaring(e Engine, userID, imageID int64) bool { } func RecommendImage(imageId int64, recommond bool) error { - image := Image{Type: getRecommondType(recommond)} + image := Image{Type: GetRecommondType(recommond)} _, err := x.ID(imageId).Cols("type").Update(image) return err } -func getRecommondType(recommond bool) int { +func GetRecommondType(recommond bool) int { if recommond { return RECOMMOND_TYPE diff --git a/models/dataset.go b/models/dataset.go index 95800100c..e841261c7 100755 --- a/models/dataset.go +++ b/models/dataset.go @@ -23,7 +23,8 @@ type Dataset struct { Category string Description string `xorm:"TEXT"` DownloadTimes int64 - NumStars int `xorm:"INDEX NOT NULL DEFAULT 0"` + NumStars int `xorm:"INDEX NOT NULL DEFAULT 0"` + Recommend bool `xorm:"INDEX NOT NULL DEFAULT false"` License string Task string ReleaseID int64 `xorm:"INDEX"` @@ -99,6 +100,7 @@ type SearchDatasetOptions struct { OwnerID int64 RepoID int64 IncludePublic bool + RecommendOnly bool Category string Task string License string @@ -132,6 +134,13 @@ func CreateDataset(dataset *Dataset) (err error) { } +func RecommendDataset(dataSetId int64, recommend bool) error { + + dataset := Dataset{Recommend: recommend} + _, err := x.ID(dataSetId).Cols("recommend").Update(dataset) + return err +} + func SearchDataset(opts *SearchDatasetOptions) (DatasetList, int64, error) { cond := SearchDatasetCondition(opts) return SearchDatasetByCondition(opts, cond) @@ -146,6 +155,9 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { if opts.RepoID > 0 { cond = cond.And(builder.Eq{"dataset.repo_id": opts.RepoID}) } + if opts.RecommendOnly { + cond = cond.And(builder.Eq{"dataset.recommend": opts.RecommendOnly}) + } if opts.IncludePublic { cond = cond.And(builder.Eq{"dataset.status": DatasetStatusPublic}) @@ -198,7 +210,7 @@ func SearchDatasetByCondition(opts *SearchDatasetOptions, cond builder.Cond) (Da defer sess.Close() datasets := make(DatasetList, 0, opts.PageSize) - selectColumnsSql := "distinct dataset.id,dataset.title, dataset.status, dataset.category, dataset.description, dataset.download_times, dataset.license, dataset.task, dataset.release_id, dataset.user_id, dataset.repo_id, dataset.created_unix,dataset.updated_unix,dataset.num_stars" + selectColumnsSql := "distinct dataset.id,dataset.title, dataset.status, dataset.category, dataset.description, dataset.download_times, dataset.license, dataset.task, dataset.release_id, dataset.user_id, dataset.repo_id, dataset.created_unix,dataset.updated_unix,dataset.num_stars,dataset.recommend" count, err := sess.Distinct("dataset.id").Join("INNER", "repository", "repository.id = dataset.repo_id"). Join("INNER", "attachment", "attachment.dataset_id=dataset.id"). diff --git a/modules/auth/cloudbrain.go b/modules/auth/cloudbrain.go index 85f3a2127..e5be38084 100755 --- a/modules/auth/cloudbrain.go +++ b/modules/auth/cloudbrain.go @@ -33,6 +33,16 @@ type CommitImageCloudBrainForm struct { Topics string `form:"topics"` } +type CommitAdminImageCloudBrainForm struct { + Description string `form:"description" binding:"Required"` + Type int `form:"type" binding:"Required"` + Tag string `form:"tag" binding:"Required;MaxSize(100)" ` + IsPrivate bool `form:"isPrivate" binding:"Required"` + Topics string `form:"topics"` + Place string `form:"place" binding:"Required"` + IsRecommend bool `form:"isRecommend" binding:"Required"` +} + type EditImageCloudBrainForm struct { ID int64 `form:"id" binding:"Required"` Description string `form:"description" binding:"Required"` diff --git a/modules/cloudbrain/resty.go b/modules/cloudbrain/resty.go index f1f213bea..1565d3044 100755 --- a/modules/cloudbrain/resty.go +++ b/modules/cloudbrain/resty.go @@ -312,12 +312,51 @@ sendjob: return nil }) if err == nil { - go updateImageStatus(image, isSetCreatedUnix, createTime) } return err } +func CommitAdminImage(params models.CommitImageParams) error { + + exist, err := models.IsImageExist(params.ImageTag) + + if err != nil { + return fmt.Errorf("resty CommitImage: %v", err) + } + if exist { + return models.ErrorImageTagExist{ + Tag: params.ImageTag, + } + } + + image := models.Image{ + CloudbrainType: params.CloudBrainType, + UID: params.UID, + IsPrivate: params.IsPrivate, + Tag: params.ImageTag, + Description: params.ImageDescription, + Place: params.Place, + Status: models.IMAGE_STATUS_SUCCESS, + Type: params.Type, + } + + err = models.WithTx(func(ctx models.DBContext) error { + + if err := models.CreateLocalImage(&image); err != nil { + log.Error("Failed to insert image record.", err) + return fmt.Errorf("resty CommitImage: %v", err) + } + + if err := models.SaveImageTopics(image.ID, params.Topics...); err != nil { + log.Error("Failed to insert image record.", err) + return fmt.Errorf("resty CommitImage: %v", err) + } + return nil + }) + return err +} + func updateImageStatus(image models.Image, isSetCreatedUnix bool, createTime time.Time) { attemps := 5 commitSuccess := false diff --git a/modules/storage/minio_ext.go b/modules/storage/minio_ext.go index 2f738ebad..167cd0488 100755 --- a/modules/storage/minio_ext.go +++ b/modules/storage/minio_ext.go @@ -2,6 +2,7 @@ package storage import ( "encoding/xml" + "errors" "path" "sort" "strconv" @@ -129,7 +130,7 @@ func NewMultiPartUpload(uuid string) (string, error) { return core.NewMultipartUpload(bucketName, objectName, miniov6.PutObjectOptions{}) } -func CompleteMultiPartUpload(uuid string, uploadID string) (string, error) { +func CompleteMultiPartUpload(uuid string, uploadID string, totalChunks int) (string, error) { client, core, err := getClients() if err != nil { log.Error("getClients failed:", err.Error()) @@ -146,6 +147,11 @@ func CompleteMultiPartUpload(uuid string, uploadID string) (string, error) { return "", err } + if len(partInfos) != totalChunks { + log.Error("ListObjectParts number(%d) is not equal the set total chunk number(%d)", len(partInfos), totalChunks) + return "", errors.New("the parts is not complete") + } + var complMultipartUpload completeMultipartUpload for _, partInfo := range partInfos { complMultipartUpload.Parts = append(complMultipartUpload.Parts, miniov6.CompletePart{ diff --git a/modules/storage/obs.go b/modules/storage/obs.go index 2b52ab603..03349864a 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -85,7 +85,7 @@ func listAllParts(uuid, uploadID, key string) (output *obs.ListPartsOutput, err }) } - if len(temp.Parts) < temp.MaxParts { + if !temp.IsTruncated { break } else { continue @@ -128,7 +128,7 @@ func NewObsMultiPartUpload(uuid, fileName string) (string, error) { return output.UploadId, nil } -func CompleteObsMultiPartUpload(uuid, uploadID, fileName string) error { +func CompleteObsMultiPartUpload(uuid, uploadID, fileName string, totalChunks int) error { input := &obs.CompleteMultipartUploadInput{} input.Bucket = setting.Bucket input.Key = strings.TrimPrefix(path.Join(setting.BasePath, path.Join(uuid[0:1], uuid[1:2], uuid, fileName)), "/") @@ -140,6 +140,11 @@ func CompleteObsMultiPartUpload(uuid, uploadID, fileName string) error { return err } + if len(allParts.Parts) != totalChunks { + log.Error("listAllParts number(%d) is not equal the set total chunk number(%d)", len(allParts.Parts), totalChunks) + return errors.New("the parts is not complete") + } + input.Parts = allParts.Parts output, err := ObsCli.CompleteMultipartUpload(input) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 618b46b3b..f53bea7b1 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1389,6 +1389,7 @@ issues.filter_sort.feweststars = Fewest stars issues.filter_sort.mostforks = Most forks issues.filter_sort.fewestforks = Fewest forks issues.filter_sort.downloadtimes = Most downloaded +issues.filter_sort.moststars = Most star issues.action_open = Open issues.action_close = Close issues.action_label = Label @@ -2502,11 +2503,15 @@ repos.contributor=Contributor repos.yes=Yes repos.no=No +images.recommend = Recommend +images.unrecommend = Unrecommend datasets.dataset_manage_panel= Dataset Manage datasets.owner=Owner datasets.name=name datasets.private=Private +datasets.recommend=Set recommend +datasets.unrecommend=Set unrecommend cloudbrain.all_task_types=All Task Types cloudbrain.all_computing_resources=All Computing Resources @@ -2964,6 +2969,7 @@ snn4imagenet_path = Snn4imagenet script path brainscore_path = Brainscore script path start_command = Start command choose_mirror = select mirror or enter mirror path +input_mirror = Please enter image path select_dataset = select dataset specification = specification select_specification = select specification diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 392e3ae1c..c82347d5e 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1401,6 +1401,7 @@ issues.filter_sort.feweststars=点赞由少到多 issues.filter_sort.mostforks=派生由多到少 issues.filter_sort.fewestforks=派生由少到多 issues.filter_sort.downloadtimes=下载次数 +issues.filter_sort.moststars=收藏数量 issues.action_open=开启 issues.action_close=关闭 issues.action_label=标签 @@ -2512,11 +2513,15 @@ repos.contributor=贡献者数 repos.yes=是 repos.no=否 +images.recommend = 推荐 +images.unrecommend = 不推荐 datasets.dataset_manage_panel=数据集管理 datasets.owner=所有者 datasets.name=名称 datasets.private=私有 +datasets.recommend=设为推荐 +datasets.unrecommend=取消推荐 cloudbrain.all_task_types=全部任务类型 cloudbrain.all_computing_resources=全部计算资源 @@ -2974,6 +2979,7 @@ snn4imagenet_path = snn4imagenet脚本存放路径 brainscore_path = brainscore脚本存放路径 start_command = 启动命令 choose_mirror = 选择镜像或输入镜像地址 +input_mirror = 请输入云脑镜像地址 select_dataset = 选择数据集 specification = 规格 select_specification = 选择资源规格 diff --git a/routers/admin/cloudbrains.go b/routers/admin/cloudbrains.go index 91d866093..6687b990a 100755 --- a/routers/admin/cloudbrains.go +++ b/routers/admin/cloudbrains.go @@ -21,6 +21,7 @@ import ( const ( tplCloudBrains base.TplName = "admin/cloudbrain/list" tplImages base.TplName = "admin/cloudbrain/images" + tplCommitImages base.TplName = "admin/cloudbrain/imagecommit" EXCEL_DATE_FORMAT = "20060102150405" CREATE_TIME_FORMAT = "2006/01/02 15:04:05" ) @@ -114,6 +115,12 @@ func Images(ctx *context.Context) { } +func CloudBrainCommitImageShow(ctx *context.Context) { + ctx.Data["PageIsAdminImages"] = true + ctx.HTML(200, tplCommitImages) + +} + func DownloadCloudBrains(ctx *context.Context) { page := 1 diff --git a/routers/admin/dataset.go b/routers/admin/dataset.go index a4378cf67..6b29b06ff 100644 --- a/routers/admin/dataset.go +++ b/routers/admin/dataset.go @@ -1,6 +1,8 @@ package admin import ( + "net/http" + "strconv" "strings" "code.gitea.io/gitea/models" @@ -49,6 +51,8 @@ func Datasets(ctx *context.Context) { orderBy = models.SearchOrderBySizeReverse case "size": orderBy = models.SearchOrderBySize + case "downloadtimes": + orderBy = models.SearchOrderByDownloadTimes case "moststars": orderBy = models.SearchOrderByStarsReverse case "feweststars": @@ -70,6 +74,7 @@ func Datasets(ctx *context.Context) { PageSize: setting.UI.ExplorePagingNum, }, Keyword: keyword, + RecommendOnly: ctx.QueryBool("recommend"), SearchOrderBy: orderBy, }) if err != nil { @@ -80,7 +85,7 @@ func Datasets(ctx *context.Context) { ctx.Data["Keyword"] = keyword ctx.Data["Total"] = count ctx.Data["Datasets"] = datasets - + ctx.Data["Recommend"] = ctx.QueryBool("recommend") pager := context.NewPagination(int(count), setting.UI.ExplorePagingNum, page, 5) pager.SetDefaultParams(ctx) ctx.Data["Page"] = pager @@ -88,6 +93,23 @@ func Datasets(ctx *context.Context) { ctx.HTML(200, tplDatasets) } +func DatasetAction(ctx *context.Context) { + var err error + datasetId, _ := strconv.ParseInt(ctx.Params(":id"), 10, 64) + switch ctx.Params(":action") { + + case "recommend": + err = models.RecommendDataset(datasetId, true) + case "unrecommend": + err = models.RecommendDataset(datasetId, false) + } + if err != nil { + ctx.JSON(http.StatusOK, models.BaseErrorMessage(ctx.Tr("repo.star_fail", ctx.Params(":action")))) + } else { + ctx.JSON(http.StatusOK, models.BaseOKMessage) + } +} + func DeleteDataset(ctx *context.Context) { dataset, err := models.GetDatasetByID(ctx.QueryInt64("id")) if err != nil { diff --git a/routers/home.go b/routers/home.go index 324bb1032..5dec05ebe 100755 --- a/routers/home.go +++ b/routers/home.go @@ -331,6 +331,7 @@ func ExploreDatasets(ctx *context.Context) { Task: task, License: license, OwnerID: ownerID, + RecommendOnly: ctx.QueryBool("recommend"), ListOptions: models.ListOptions{ Page: page, PageSize: 30, @@ -357,6 +358,7 @@ func ExploreDatasets(ctx *context.Context) { ctx.Data["Category"] = category ctx.Data["Task"] = task ctx.Data["License"] = license + ctx.Data["Recommend"] = ctx.QueryBool("recommend") pager.SetDefaultParams(ctx) ctx.Data["Page"] = pager diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index ccedbdf1b..aa52a1400 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -855,13 +855,13 @@ func CompleteMultipart(ctx *context.Context) { } if typeCloudBrain == models.TypeCloudBrainOne { - _, err = storage.CompleteMultiPartUpload(uuid, uploadID) + _, err = storage.CompleteMultiPartUpload(uuid, uploadID, fileChunk.TotalChunks) if err != nil { ctx.Error(500, fmt.Sprintf("CompleteMultiPartUpload failed: %v", err)) return } } else { - err = storage.CompleteObsMultiPartUpload(uuid, uploadID, fileName) + err = storage.CompleteObsMultiPartUpload(uuid, uploadID, fileName, fileChunk.TotalChunks) if err != nil { ctx.Error(500, fmt.Sprintf("CompleteObsMultiPartUpload failed: %v", err)) return diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 6b3452656..4ef205af2 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -703,6 +703,53 @@ func CloudBrainCommitImageCheck(ctx *context.Context, form auth.CommitImageCloud } +func CloudBrainAdminCommitImage(ctx *context.Context, form auth.CommitAdminImageCloudBrainForm) { + + if !NamePattern.MatchString(form.Tag) { + ctx.JSON(http.StatusOK, models.BaseErrorMessage(ctx.Tr("dataset.title_format_err"))) + return + } + + if utf8.RuneCountInString(form.Description) > 255 { + ctx.JSON(http.StatusOK, models.BaseErrorMessage(ctx.Tr("dataset.description_format_err", 255))) + return + } + + validTopics, errMessage := checkTopics(form.Topics) + if errMessage != "" { + ctx.JSON(http.StatusOK, models.BaseErrorMessage(ctx.Tr(errMessage))) + return + } + + err := cloudbrain.CommitAdminImage(models.CommitImageParams{ + CommitImageCloudBrainParams: models.CommitImageCloudBrainParams{ + ImageDescription: form.Description, + ImageTag: form.Tag, + }, + IsPrivate: form.IsPrivate, + CloudBrainType: form.Type, + Topics: validTopics, + UID: ctx.User.ID, + Type: models.GetRecommondType(form.IsRecommend), + Place: form.Place, + }) + if err != nil { + log.Error("CommitImagefailed") + if models.IsErrImageTagExist(err) { + ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_exist"))) + + } else if models.IsErrorImageCommitting(err) { + ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_committing"))) + } else { + ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_commit_fail"))) + } + + return + } + + ctx.JSON(200, models.BaseOKMessage) +} + func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrainForm) { if !NamePattern.MatchString(form.Tag) { diff --git a/routers/repo/dataset.go b/routers/repo/dataset.go index 1a3762be3..73036a2cc 100755 --- a/routers/repo/dataset.go +++ b/routers/repo/dataset.go @@ -358,6 +358,7 @@ func MyDatasets(ctx *context.Context) { NeedIsPrivate: false, JustNeedZipFile: true, NeedRepoInfo: true, + RecommendOnly: ctx.QueryBool("recommend"), }) if err != nil { ctx.ServerError("datasets", err) @@ -398,6 +399,7 @@ func PublicDataset(ctx *context.Context) { Type: cloudbrainType, JustNeedZipFile: true, NeedRepoInfo: true, + RecommendOnly: ctx.QueryBool("recommend"), }) if err != nil { ctx.ServerError("datasets", err) @@ -454,6 +456,7 @@ func MyFavoriteDataset(ctx *context.Context) { Type: cloudbrainType, JustNeedZipFile: true, NeedRepoInfo: true, + RecommendOnly: ctx.QueryBool("recommend"), }) if err != nil { ctx.ServerError("datasets", err) diff --git a/routers/routes/routes.go b/routers/routes/routes.go index e6bda142b..8929666e5 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -525,6 +525,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/datasets", func() { m.Get("", admin.Datasets) + m.Put("/:id/action/:action", admin.DatasetAction) // m.Post("/delete", admin.DeleteDataset) }) m.Group("/cloudbrains", func() { @@ -534,6 +535,8 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/images", func() { m.Get("", admin.Images) m.Get("/data", repo.GetAllImages) + m.Get("/commit_image", admin.CloudBrainCommitImageShow) + m.Post("/commit_image", bindIgnErr(auth.CommitAdminImageCloudBrainForm{}), repo.CloudBrainAdminCommitImage) }) m.Put("/image/:id/action/:action", image.Action) diff --git a/routers/user/profile.go b/routers/user/profile.go index 41d8561d6..f82c03a75 100755 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -106,9 +106,9 @@ func Profile(ctx *context.Context) { for _, org := range orgs { _, repoCount, err := models.SearchRepository(&models.SearchRepoOptions{ - OwnerID: org.ID, - Private: ctx.IsSigned, - Actor: ctx.User, + OwnerID: org.ID, + Private: ctx.IsSigned, + Actor: ctx.User, }) if err != nil { ctx.ServerError("SearchRepository", err) @@ -175,6 +175,8 @@ func Profile(ctx *context.Context) { orderBy = models.SearchOrderByAlphabeticallyReverse case "alphabetically": orderBy = models.SearchOrderByAlphabetically + case "downloadtimes": + orderBy = models.SearchOrderByDownloadTimes case "moststars": orderBy = models.SearchOrderByStarsReverse case "feweststars": diff --git a/templates/admin/cloudbrain/imagecommit.tmpl b/templates/admin/cloudbrain/imagecommit.tmpl new file mode 100644 index 000000000..e504f08b0 --- /dev/null +++ b/templates/admin/cloudbrain/imagecommit.tmpl @@ -0,0 +1,129 @@ + +{{template "base/head" .}} +
+
+
+
+
+
+
+
+
+
+ {{template "repo/header" .}} +
+
+
+ + + +

+ {{.i18n.Tr "repo.submit_image"}} +

+ +
+
+ + {{.CsrfTokenHtml}} +
+ +
+ + CPU/GPU +
+ +
+
+ + + {{.i18n.Tr "repo.images.name_rule"}} +
+
+ + + +
+
+ + +
+
+   + +
+ {{.i18n.Tr "repo.image.label_tooltips"}} +
+ +
+
+ + +
+
+
+
+ + +
+
+ +
+
+ +
+
+ + +
+
+
+
+ + +
+
+
+ {{.i18n.Tr "repo.images.public_tooltips"}} +
+
+
+ + + {{.i18n.Tr "repo.cloudbrain.cancel"}} +
+
+
+
+
+
+ + +
+ +
+{{template "base/footer" .}} + \ No newline at end of file diff --git a/templates/admin/dataset/list.tmpl b/templates/admin/dataset/list.tmpl index 1044e4c28..3d32ec7a7 100644 --- a/templates/admin/dataset/list.tmpl +++ b/templates/admin/dataset/list.tmpl @@ -3,6 +3,9 @@ {{template "admin/navbar" .}}
{{template "base/alert" .}} +

{{.i18n.Tr "admin.datasets.dataset_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}})

@@ -24,10 +27,10 @@ {{range .Datasets}} {{.ID}} - {{.Title}} + {{.Title}}{{if .Recommend}}{{end}} {{.CreatedUnix.FormatShort}} - + {{if .Recommend}}{{$.i18n.Tr "admin.datasets.unrecommend"}}{{else}}{{$.i18n.Tr "admin.datasets.recommend"}}{{end}} {{end}} @@ -37,16 +40,4 @@ {{template "base/paginate" .}}
- - -{{template "base/footer" .}} +{{template "base/footer" .}} \ No newline at end of file diff --git a/templates/custom/select_dataset.tmpl b/templates/custom/select_dataset.tmpl index cd4ce50da..befd186c5 100644 --- a/templates/custom/select_dataset.tmpl +++ b/templates/custom/select_dataset.tmpl @@ -23,7 +23,7 @@
-
${dataset.Repo.OwnerName}/${dataset.Repo.Alias} ${dataset.Name}
+
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
@@ -49,7 +49,7 @@
-
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
+
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
@@ -74,7 +74,7 @@
-
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
+
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
@@ -99,7 +99,7 @@
-
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
+
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
diff --git a/templates/custom/select_dataset_train.tmpl b/templates/custom/select_dataset_train.tmpl index 3da9be9aa..b8260f279 100644 --- a/templates/custom/select_dataset_train.tmpl +++ b/templates/custom/select_dataset_train.tmpl @@ -23,7 +23,7 @@
-
${dataset.Repo.OwnerName}/${dataset.Repo.Alias} ${dataset.Name}
+
${dataset.Repo.OwnerName}/${dataset.Repo.Alias} ${dataset.Name}
@@ -49,7 +49,7 @@
-
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
+
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
@@ -74,7 +74,7 @@
-
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
+
${dataset.Repo.OwnerName}/${dataset.Repo.Alias}${dataset.Name}
@@ -99,7 +99,7 @@ @@ -144,7 +145,8 @@
- {{.Repo.OwnerName}} / {{.Repo.Alias}} + {{.Repo.OwnerName}} / {{.Repo.Alias}}{{if .Recommend}}{{end}} + {{if $.IsSigned}}
diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index c596d06bc..e3e3dbd1c 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -179,7 +179,26 @@
- +
+ + +