1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2025-02-24 07:45:59 +01:00

Update Home page on Web

This commit is contained in:
chylex 2024-04-07 21:21:05 +02:00
parent 4a110db078
commit 62f8c685f0
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
3 changed files with 17 additions and 10 deletions
Web/Phantom.Web

View File

@ -11,7 +11,7 @@
<p role="alert">You do not have permission to visit this page.</p>
}
else {
Navigation.NavigateTo("login" + QueryString.Create("return", Navigation.CreateReturnUrl()), forceLoad: true);
_ = Navigation.NavigateTo("login" + QueryString.Create("return", Navigation.CreateReturnUrl()), forceLoad: true);
}
</NotAuthorized>
</AuthorizeRouteView>

View File

@ -17,7 +17,6 @@
<div class="navbar-menu @NavMenuCssClass" @onclick="ToggleNavMenu">
<nav>
<NavMenuItem Label="Home" Icon="home" Match="NavLinkMatch.All" />
<AuthorizeView>
<NotAuthorized>
<NavMenuItem Label="Login" Icon="account-login" Href="login" />
@ -25,6 +24,8 @@
<Authorized>
@{ var permissions = context.GetPermissions(); }
<NavMenuItem Label="Home" Icon="home" Match="NavLinkMatch.All" />
@if (permissions.Check(Permission.ViewInstances)) {
<NavMenuItem Label="Instances" Icon="folder" Href="instances" />
}

View File

@ -1,12 +1,18 @@
@page "/"
@attribute [AllowAnonymous]
@inherits Phantom.Web.Components.PhantomComponent
<h1>Hello, world!</h1>
<h1>Home</h1>
Welcome to your new app.
@if (username != null) {
<p>Welcome back, @username!</p>
}
<AuthorizeView>
<Authorized>
You are logged in as @context.User.Identity!.Name.
</Authorized>
</AuthorizeView>
@code {
private string? username = null;
protected override async Task OnInitializedAsync() {
username = (await GetAuthenticatedUser())?.Info.Name;
}
}