Add Templates
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace maintenance.Pages.Errors;
|
||||
|
||||
public sealed class TemplateModel : PageModel
|
||||
{
|
||||
[FromQuery(Name = "errorName")]
|
||||
public string ErrorName { get; set; } = "Error Name";
|
||||
|
||||
[FromQuery(Name = "short")]
|
||||
public string? ShortDescription { get; set; }
|
||||
|
||||
[FromQuery(Name = "desc")]
|
||||
public string Description { get; set; } = "An error has occurred. Please contact MAX Support for assistance.";
|
||||
|
||||
[FromQuery(Name = "instructionsHeader")]
|
||||
public string? InstructionsHeader { get; set; }
|
||||
|
||||
[FromQuery(Name = "steps")]
|
||||
public string? StepsCsv { get; set; }
|
||||
|
||||
[FromQuery(Name = "showSupport")]
|
||||
public bool ShowSupport { get; set; } = true;
|
||||
|
||||
[FromQuery(Name = "showInstructions")]
|
||||
public bool ShowInstructions { get; set; } = true;
|
||||
|
||||
[FromQuery(Name = "code")]
|
||||
public string ErrorCode { get; set; } = "eaX";
|
||||
|
||||
public IReadOnlyList<string> InstructionSteps { get; private set; } = new List<string>
|
||||
{
|
||||
"Change some setting"
|
||||
};
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(StepsCsv))
|
||||
{
|
||||
InstructionSteps = StepsCsv
|
||||
.Split('|', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x))
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user