mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-03 08:10:43 +00:00
Add room visualizer debug page
This commit is contained in:
parent
bf49ae422c
commit
dc46534141
2 changed files with 49 additions and 0 deletions
28
ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml
Normal file
28
ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
@page "/debug/roomVisualizer"
|
||||||
|
@using LBPUnion.ProjectLighthouse.Helpers
|
||||||
|
@using LBPUnion.ProjectLighthouse.Types
|
||||||
|
@using LBPUnion.ProjectLighthouse.Types.Match
|
||||||
|
@model LBPUnion.ProjectLighthouse.Pages.Debug.RoomVisualizerPage
|
||||||
|
|
||||||
|
@{
|
||||||
|
Layout = "Layouts/BaseLayout";
|
||||||
|
Model.Title = "Debug - Room Visualizer";
|
||||||
|
}
|
||||||
|
|
||||||
|
<meta http-equiv="refresh" content="1"> @* Refresh page every second *@
|
||||||
|
|
||||||
|
<p>The page will automatically refresh once a second.</p>
|
||||||
|
<p>@RoomHelper.Rooms.Count rooms</p>
|
||||||
|
|
||||||
|
@foreach (Room room in RoomHelper.Rooms)
|
||||||
|
{
|
||||||
|
<div class="ui blue inverted segment">
|
||||||
|
<h2>Room @room.RoomId</h2>
|
||||||
|
<p>@room.Players.Count players, State is @room.State</p>
|
||||||
|
<p>Slot type: @room.Slot.SlotType, slot id: @room.Slot.SlotId</p>
|
||||||
|
@foreach (User player in room.Players)
|
||||||
|
{
|
||||||
|
<div class="ui segment">@player.Username</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
21
ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs
Normal file
21
ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace LBPUnion.ProjectLighthouse.Pages.Debug;
|
||||||
|
|
||||||
|
public class RoomVisualizerPage : BaseLayout
|
||||||
|
{
|
||||||
|
public RoomVisualizerPage([NotNull] Database database) : base(database)
|
||||||
|
{}
|
||||||
|
|
||||||
|
public async Task<IActionResult> OnGet()
|
||||||
|
{
|
||||||
|
#if !DEBUG
|
||||||
|
return this.NotFound();
|
||||||
|
#else
|
||||||
|
return this.Page();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue