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:
parent
4a110db078
commit
62f8c685f0
Web/Phantom.Web
@ -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>
|
||||
|
@ -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" />
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user