mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-25 02:39:06 +00:00
Add filter debug page
This commit is contained in:
parent
5aa12c6c65
commit
2d773ed7bf
2 changed files with 50 additions and 0 deletions
22
ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml
Normal file
22
ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml
Normal file
|
@ -0,0 +1,22 @@
|
|||
@page "/debug/filter"
|
||||
@model LBPUnion.ProjectLighthouse.Pages.Debug.FilterTestPage
|
||||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
Model.Title = "Debug - Filter Test";
|
||||
}
|
||||
|
||||
@if (Model.FilteredText != null)
|
||||
{
|
||||
<p>@Model.FilteredText</p>
|
||||
}
|
||||
|
||||
<form>
|
||||
<div class="ui right action input">
|
||||
<input type="text" name="text" placeholder="Text to be filtered" value="@(Model.Text ?? "")">
|
||||
<button type="submit" class="ui blue button">
|
||||
<i class="pen icon"></i>
|
||||
Filter
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
28
ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs
Normal file
28
ProjectLighthouse/Pages/Debug/FilterTestPage.cshtml.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
#nullable enable
|
||||
using System.Threading.Tasks;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Pages.Debug;
|
||||
|
||||
public class FilterTestPage : BaseLayout
|
||||
{
|
||||
public FilterTestPage(Database database) : base(database)
|
||||
{}
|
||||
|
||||
public string? FilteredText = null;
|
||||
public string? Text = null;
|
||||
|
||||
public async Task<IActionResult> OnGet(string? text = null)
|
||||
{
|
||||
#if !DEBUG
|
||||
return this.NotFound();
|
||||
#endif
|
||||
|
||||
if (text != null) this.FilteredText = CensorHelper.ScanMessage(text);
|
||||
this.Text = text;
|
||||
|
||||
return this.Page();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue