| @@ -583,7 +583,7 @@ func AttachmentsByDatasetOption(datasets []int64, opts *SearchDatasetOptions) ([ | |||||
| } | } | ||||
| if opts.UploadAttachmentByMe { | if opts.UploadAttachmentByMe { | ||||
| cond = cond.And( | cond = cond.And( | ||||
| builder.Eq{"attachment.uploader_id": opts.OwnerID}, | |||||
| builder.Eq{"attachment.uploader_id": opts.User.ID}, | |||||
| ) | ) | ||||
| } | } | ||||
| @@ -249,6 +249,10 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { | |||||
| subCon = generateFilterCond(opts, subCon) | subCon = generateFilterCond(opts, subCon) | ||||
| cond = cond.Or(subCon) | cond = cond.Or(subCon) | ||||
| } | } | ||||
| } else { | |||||
| if opts.StarByMe { | |||||
| cond = cond.And(builder.Eq{"dataset.id": -1}) | |||||
| } | |||||
| } | } | ||||
| return cond | return cond | ||||
| @@ -282,7 +286,7 @@ func generateFilterCond(opts *SearchDatasetOptions, cond builder.Cond) builder.C | |||||
| cond = cond.And(builder.Eq{"attachment.type": opts.CloudBrainType}) | cond = cond.And(builder.Eq{"attachment.type": opts.CloudBrainType}) | ||||
| } | } | ||||
| if opts.UploadAttachmentByMe { | if opts.UploadAttachmentByMe { | ||||
| cond = cond.And(builder.Eq{"attachment.uploader_id": opts.OwnerID}) | |||||
| cond = cond.And(builder.Eq{"attachment.uploader_id": opts.User.ID}) | |||||
| } | } | ||||
| return cond | return cond | ||||
| @@ -311,7 +315,6 @@ func SearchDatasetByCondition(opts *SearchDatasetOptions, cond builder.Cond) (Da | |||||
| sess.Select(selectColumnsSql).Join("INNER", "repository", "repository.id = dataset.repo_id"). | sess.Select(selectColumnsSql).Join("INNER", "repository", "repository.id = dataset.repo_id"). | ||||
| Join("INNER", "attachment", "attachment.dataset_id=dataset.id"). | Join("INNER", "attachment", "attachment.dataset_id=dataset.id"). | ||||
| Where(cond).OrderBy(opts.SearchOrderBy.String()) | Where(cond).OrderBy(opts.SearchOrderBy.String()) | ||||
| if opts.PageSize > 0 { | if opts.PageSize > 0 { | ||||
| sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize) | sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize) | ||||
| } | } | ||||
| @@ -2270,7 +2270,7 @@ func getTrainJobCommand(form auth.CreateCloudBrainForm, fileNames string) (strin | |||||
| } | } | ||||
| } | } | ||||
| param += " --dataset_list=" + fileNames | |||||
| param += " --dataset_list='" + fileNames + "'" | |||||
| command += "python /code/" + bootFile + param + " > " + cloudbrain.ModelMountPath + "/" + form.DisplayJobName + "-" + cloudbrain.LogFile | command += "python /code/" + bootFile + param + " > " + cloudbrain.ModelMountPath + "/" + form.DisplayJobName + "-" + cloudbrain.LogFile | ||||
| @@ -415,14 +415,8 @@ func datasetMultiple(ctx *context.Context, opts *models.SearchDatasetOptions) { | |||||
| cloudbrainType := ctx.QueryInt("type") | cloudbrainType := ctx.QueryInt("type") | ||||
| keyword := strings.Trim(ctx.Query("q"), " ") | keyword := strings.Trim(ctx.Query("q"), " ") | ||||
| orderBy := models.SearchOrderByRecentUpdated | orderBy := models.SearchOrderByRecentUpdated | ||||
| var ownerID int64 | |||||
| if ctx.User != nil { | |||||
| ownerID = ctx.User.ID | |||||
| } | |||||
| opts.Keyword = keyword | opts.Keyword = keyword | ||||
| opts.SearchOrderBy = orderBy | opts.SearchOrderBy = orderBy | ||||
| opts.OwnerID = ownerID | |||||
| opts.RecommendOnly = ctx.QueryBool("recommend") | opts.RecommendOnly = ctx.QueryBool("recommend") | ||||
| opts.CloudBrainType = cloudbrainType | opts.CloudBrainType = cloudbrainType | ||||
| opts.ListOptions = models.ListOptions{ | opts.ListOptions = models.ListOptions{ | ||||
| @@ -97,7 +97,7 @@ | |||||
| <svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg> | <svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg> | ||||
| {{.i18n.Tr "cloudbrain.resource_cluster_openi"}} | {{.i18n.Tr "cloudbrain.resource_cluster_openi"}} | ||||
| </a> | </a> | ||||
| <a class="item" href="{{.RepoLink}}/grampus/train-job/{{if.NPUEnabled}}npu{{else}}gpu{{end}}/create"> | |||||
| <a class="item" href="{{.RepoLink}}/grampus/train-job/npu/create"> | |||||
| <svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg> | <svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg> | ||||
| {{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta) | {{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta) | ||||
| </a> | </a> | ||||