mirror of https://github.com/abpframework/abp.git
committed by
GitHub
13 changed files with 173 additions and 141 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); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
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; } |
|||
|
|||
public bool AutoRedirect { get; set; } = true; |
|||
} |
|||
} |
|||
@ -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); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
(function ($) { |
|||
|
|||
$(function () { |
|||
var errorPageRedirect = function () { |
|||
var second = 3; |
|||
var close = setInterval(() => { |
|||
$("#ErrorRedirectSeconds").text(`(${--second})`); |
|||
if (second === 0) { |
|||
clearInterval(close); |
|||
$("#ErrorRedirect")[0].click(); |
|||
} |
|||
}, 1000); |
|||
} |
|||
|
|||
if (document.getElementById("ErrorRedirect")) { |
|||
errorPageRedirect(); |
|||
} |
|||
}); |
|||
|
|||
})(jQuery); |
|||
Loading…
Reference in new issue