udpate main layout

This commit is contained in:
Đăng Nguyễn
2025-09-26 10:55:39 +07:00
parent 7c4404ec3d
commit 4330879411
13 changed files with 64 additions and 52 deletions

View File

@@ -1,11 +1,17 @@
.app-shell {
display: flex;
min-height: 100vh;
min-height: 100vh;
min-width: 100vw;
width: 100vw;
height: 100vh;
overflow: hidden;
flex-direction: row;
}
.page {
flex: 1 1 auto;
min-width: 0;
overflow: auto;
flex: 1 1 auto;
min-width: 0;
display: flex;
overflow: hidden;
}

View File

@@ -31,6 +31,25 @@
}
</div>
<div class="user">
<div>
<span class="mdi mdi-account mdi-36px text-white "></span>
</div>
<AuthorizeView>
<Authorized>
<div class="nav-label">
<MudText Class="text-white name" Typo="Typo.subtitle1">@context.User.Identity?.Name</MudText>
</div>
</Authorized>
</AuthorizeView>
<MudSpacer />
<form action="Account/Logout" method="post">
<AntiforgeryToken />
<input type="hidden" name="ReturnUrl" value="" />
<button class="btn button">
<i class="mdi mdi-logout" style="color: white; font-size: 35px"></i>
</button>
@* <MudIconButton Class="text-white" ButtonType="@ButtonType.Submit" Icon="@Icons.Material.Filled.Logout" /> *@
</form>
</div>
</div>
@@ -45,7 +64,7 @@
public NavModel[] Navs = [
new(){Icon = "mdi-view-dashboard", Path="/", Label = "Dashboard", Match = NavLinkMatch.All},
new(){Icon = "mdi-map-legend", Path="/", Label = "Maps-manager", Match = NavLinkMatch.All},
new(){Icon = "mdi-map-legend", Path="/Maps-manager", Label = "Mapping", Match = NavLinkMatch.All},
];
private bool collapseNavMenu = true;

View File

@@ -48,10 +48,9 @@
display: flex;
}
/*.sidebar .title .button {
display: flex;
border-radius: 20px;
}*/
.sidebar.collapsed .nav-label {
display: none;
}
.sidebar .title .button:hover {
background-color: rgb(5, 39, 80);
@@ -67,8 +66,8 @@
display: none !important;
}
.sidebar.collapsed .nav-label {
display: none;
.sidebar.collapsed .user .nav-label {
display: none !important;
}
.nav-item {

View File

@@ -1,4 +1,4 @@
@page "/"
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize]
<h1>Welcome to RobotApp!</h1>
<h1>Welcome to RobotApp!</h1>

View File

@@ -1,18 +0,0 @@
@using RobotApp.Client.Layout
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)">
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<LayoutView Layout="typeof(MainLayout)">
<p>Không tìm thấy trang.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>