|
|
|
@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination;
|
|
|
|
|
using Volo.Docs.Documents;
|
|
|
|
|
using Volo.Docs.GitHub.Documents.Version;
|
|
|
|
|
using Volo.Docs.HtmlConverting;
|
|
|
|
@ -24,6 +25,10 @@ namespace Volo.Docs.Pages.Documents
|
|
|
|
|
[BindProperty(SupportsGet = true)] public string LanguageCode { get; set; }
|
|
|
|
|
|
|
|
|
|
[BindProperty(SupportsGet = true)] public string KeyWord { get; set; }
|
|
|
|
|
|
|
|
|
|
[BindProperty(SupportsGet = true)] public int CurrentPage { get; set; } = 1;
|
|
|
|
|
|
|
|
|
|
public PagerModel PagerModel { get; set; }
|
|
|
|
|
|
|
|
|
|
public ProjectDto Project { get; set; }
|
|
|
|
|
|
|
|
|
@ -49,6 +54,11 @@ namespace Volo.Docs.Pages.Documents
|
|
|
|
|
return RedirectToPage("Index");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (keyword.IsNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
return Page();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KeyWord = keyword;
|
|
|
|
|
|
|
|
|
|
Project = await _projectAppService.GetAsync(ProjectName);
|
|
|
|
@ -72,13 +82,25 @@ namespace Volo.Docs.Pages.Documents
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SearchOutputs = await _documentAppService.SearchAsync(new DocumentSearchInput
|
|
|
|
|
var pagedSearchOutputs = await _documentAppService.SearchAsync(new DocumentSearchInput
|
|
|
|
|
{
|
|
|
|
|
ProjectId = Project.Id,
|
|
|
|
|
Context = KeyWord,
|
|
|
|
|
LanguageCode = LanguageCode,
|
|
|
|
|
Version = Version
|
|
|
|
|
Version = Version,
|
|
|
|
|
MaxResultCount = 10,
|
|
|
|
|
SkipCount = (CurrentPage - 1) * 10
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
SearchOutputs = pagedSearchOutputs.Items.ToList();
|
|
|
|
|
|
|
|
|
|
PagerModel = new PagerModel(pagedSearchOutputs.TotalCount, 10, CurrentPage, 10, Url.Page("Search", new
|
|
|
|
|
{
|
|
|
|
|
ProjectName,
|
|
|
|
|
Version,
|
|
|
|
|
LanguageCode,
|
|
|
|
|
KeyWord
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
var highlightTag1 = Guid.NewGuid().ToString();
|
|
|
|
|
var highlightTag2 = Guid.NewGuid().ToString();
|
|
|
|
|