Add Templates

This commit is contained in:
Ccjcarkbla
2026-02-23 12:53:03 -05:00
parent 829a71ab5e
commit 637787d016
7 changed files with 344 additions and 0 deletions
+47
View File
@@ -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();
}
}
}