mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 00:18:39 +00:00
Add players online count to landing page
This commit is contained in:
parent
276156c5de
commit
e12fa2ea66
3 changed files with 17 additions and 5 deletions
|
@ -9,4 +9,17 @@
|
|||
@if (Model.User != null)
|
||||
{
|
||||
<p>You are currently logged in as <b>@Model.User.Username</b>.</p>
|
||||
}
|
||||
|
||||
@if (Model.PlayersOnline == 1)
|
||||
{
|
||||
<p>There is 1 user currently online.</p>
|
||||
}
|
||||
else if (Model.PlayersOnline == 0)
|
||||
{
|
||||
<p>There are no users online. Why not hop on?</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>There are currently @Model.PlayersOnline users online.</p>
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
#nullable enable
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
||||
|
@ -12,13 +12,12 @@ namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
|
|||
public LandingPage(Database database) : base(database)
|
||||
{}
|
||||
|
||||
public new User? User { get; set; }
|
||||
public int PlayersOnline;
|
||||
|
||||
[UsedImplicitly]
|
||||
public async Task<IActionResult> OnGet()
|
||||
{
|
||||
User = await this.Database.UserFromWebRequest(this.Request);
|
||||
|
||||
this.PlayersOnline = await StatisticsHelper.RecentMatches();
|
||||
return this.Page();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<div class="ui black attached inverted segment">
|
||||
<div class="ui container">
|
||||
|
||||
<p>Page generated by @GitVersionHelper.FullVersion</p>
|
||||
<p>Page generated by @GitVersionHelper.FullVersion.</p>
|
||||
@if (GitVersionHelper.IsDirty)
|
||||
{
|
||||
<p>This page was generated using a modified version of Project Lighthouse. Please make sure you are properly disclosing the source code to any users who may be using this instance.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue