Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.4.2^2
zouap 4 years ago
parent
commit
9f11ea564f
2 changed files with 15 additions and 12 deletions
  1. +14
    -9
      public/home/search.js
  2. +1
    -3
      routers/repo/attachment.go

+ 14
- 9
public/home/search.js View File

@@ -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 += "<a id=\"page_" + totalPage+ "\" class=\"item\" href=\"javascript:page(" + totalPage +")\">" + totalPage + "</a>";
}

if(currentPage >=totalPage){
html += "<a class=\"disabled item navigation\" href=\"javascript:nextPage()\"><i class=\"icon right arrow\"></i></a>";
html += "<a class=\"disabled item navigation\" href=\"javascript:page(" + totalPage + ")\"><span class=\"navigation_label\">" + getLabel(isZh,"search_last_page") + "</span></a>";


+ 1
- 3
routers/repo/attachment.go View File

@@ -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 {


Loading…
Cancel
Save