mirror of https://github.com/abpframework/abp.git
10 changed files with 96 additions and 71 deletions
@ -1,15 +0,0 @@ |
|||
namespace Volo.Docs.Pages.Documents.Shared.DocumentNotFoundComponent |
|||
{ |
|||
public class DocumentNotFoundPageModel |
|||
{ |
|||
public string ProjectName { get; set; } |
|||
|
|||
public string LanguageCode { get; set; } |
|||
|
|||
public string Version { get; set; } |
|||
|
|||
public string DocumentName { get; set; } |
|||
|
|||
public string DocumentsUrlPrefix { get; set; } |
|||
} |
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
|
|||
namespace Volo.Docs.Pages.Documents.Shared.DocumentNotFoundComponent |
|||
{ |
|||
public class DocumentNotFoundViewComponent : AbpViewComponent |
|||
{ |
|||
private readonly DocsUiOptions _options; |
|||
|
|||
public DocumentNotFoundViewComponent(IOptions<DocsUiOptions> options) |
|||
{ |
|||
_options = options.Value; |
|||
} |
|||
public IViewComponentResult Invoke(DocumentNotFoundPageModel model, string defaultErrorMessageKey) |
|||
{ |
|||
model.DocumentsUrlPrefix = _options.RoutePrefix; |
|||
|
|||
return View("~/Pages/Documents/Shared/DocumentNotFoundComponent/Default.cshtml", model); |
|||
} |
|||
} |
|||
} |
|||
@ -1,16 +1,15 @@ |
|||
@using Volo.Docs.Pages.Documents.Shared.DocumentNotFoundComponent |
|||
@model DocumentNotFoundPageModel |
|||
@model Volo.Docs.Pages.Documents.Shared.ErrorComponent.ErrorPageModel |
|||
@{ |
|||
} |
|||
<div class="row position-relative vh-100" style="background: #e8e8e8;"> |
|||
<div class="center"> |
|||
<span class="notfound-404">404</span> |
|||
<span class="notfound-404">@Model.ErrorCode</span> |
|||
<h1> |
|||
<strong>"@Model.DocumentName"</strong> not found in <strong>@Model.ProjectName</strong> documents, with <strong>@Model.Version</strong> version and <strong>@Model.LanguageCode</strong> language. |
|||
@Model.ErrorMessage |
|||
</h1> |
|||
<br /> |
|||
<a href="@(Model.DocumentsUrlPrefix + Model.LanguageCode + "/" +Model.ProjectName + "/" + Model.Version)" class="btn btn-primary px-4"> |
|||
Go Back |
|||
<a href="@(Model.RedirectUrl)" class="btn btn-primary px-4 redirect"> |
|||
Go Back <span class="seconds">(3)</span> |
|||
</a> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,11 @@ |
|||
namespace Volo.Docs.Pages.Documents.Shared.ErrorComponent |
|||
{ |
|||
public class ErrorPageModel |
|||
{ |
|||
public string ErrorMessage { get; set; } |
|||
|
|||
public string ErrorCode { get; set; } |
|||
|
|||
public string RedirectUrl { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
|
|||
namespace Volo.Docs.Pages.Documents.Shared.ErrorComponent |
|||
{ |
|||
public class ErrorViewComponent : AbpViewComponent |
|||
{ |
|||
public IViewComponentResult Invoke(ErrorPageModel model) |
|||
{ |
|||
return View("~/Pages/Documents/Shared/ErrorComponent/Default.cshtml", model); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue