diff --git a/public/home/search.js b/public/home/search.js index 6de502721..ca23e55be 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -810,17 +810,21 @@ var repoAndOrgEN={ function page(current){ currentPage=current; + startIndex = currentPage -1; + if(startIndex < 1){ + startIndex = 1; + } + endIndex = currentPage + 1; + if(endIndex >= totalPage){ + endIndex = totalPage; + } doSearch(currentSearchTableName,currentSearchKeyword,current,pageSize,false,currentSearchSortBy,OnlySearchLabel); - } function nextPage(){ currentPage = currentPage+1; console.log("currentPage=" + currentPage); - if(currentPage >= endIndex){ - startIndex=startIndex+1; - endIndex = endIndex +1; - } + page(currentPage); } @@ -828,10 +832,6 @@ function page(current){ console.log("currentPage=" + currentPage); if(currentPage > 1){ currentPage = currentPage-1; - if(currentPage <= startIndex && startIndex > 1){ - startIndex = startIndex -1; - endIndex = endIndex - 1; - } console.log("currentPage=" + (currentPage)); page(currentPage); } @@ -912,6 +912,11 @@ function getYPosition(e){ } } + if (endIndex < totalPage-1){ + html += "..."; + html += "" + totalPage + ""; + } + if(currentPage >=totalPage){ html += ""; html += "" + getLabel(isZh,"search_last_page") + ""; diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index da9f17dad..8511a1f29 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -909,9 +909,7 @@ func CompleteMultipart(ctx *context.Context) { } repository, _ := models.GetRepositoryByID(dataset.RepoID) - if !repository.IsPrivate && !attachment.IsPrivate { - notification.NotifyOtherTask(ctx.User, repository, fmt.Sprint(attachment.Type), attachment.Name, models.ActionUploadAttachment) - } + notification.NotifyOtherTask(ctx.User, repository, fmt.Sprint(repository.IsPrivate, attachment.IsPrivate), attachment.Name, models.ActionUploadAttachment) if attachment.DatasetID != 0 { if isCanDecompress(attachment.Name) { if typeCloudBrain == models.TypeCloudBrainOne {