first commit -push
This commit is contained in:
12
RobotNet.WebApp/Layout/HMILayout.razor
Normal file
12
RobotNet.WebApp/Layout/HMILayout.razor
Normal file
@@ -0,0 +1,12 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<main>
|
||||
<div>
|
||||
@Body
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<MudThemeProvider IsDarkMode />
|
||||
<MudPopoverProvider />
|
||||
<MudDialogProvider MaxWidth="MaxWidth.ExtraLarge" />
|
||||
<MudSnackbarProvider />
|
||||
13
RobotNet.WebApp/Layout/MainLayout.razor
Normal file
13
RobotNet.WebApp/Layout/MainLayout.razor
Normal file
@@ -0,0 +1,13 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<NavMenu />
|
||||
<main>
|
||||
<div>
|
||||
@Body
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<MudThemeProvider IsDarkMode />
|
||||
<MudPopoverProvider />
|
||||
<MudDialogProvider MaxWidth="MaxWidth.ExtraLarge" />
|
||||
<MudSnackbarProvider />
|
||||
67
RobotNet.WebApp/Layout/NavMenu.razor
Normal file
67
RobotNet.WebApp/Layout/NavMenu.razor
Normal file
@@ -0,0 +1,67 @@
|
||||
<script>
|
||||
function toggleSidebar() {
|
||||
let sidebar = document.querySelector(".sidebar");
|
||||
sidebar.classList.toggle("collapsed");
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="sidebar collapsed">
|
||||
<div class="flex-grow-1 d-flex flex-column">
|
||||
<div class="title">
|
||||
<img src="images/logoLight.svg" alt="PhenikaaX" style="height: 35px;" onclick="toggleSidebar()" />
|
||||
<button class="btn button" onclick="toggleSidebar()">
|
||||
<i class="mdi mdi-menu" style="color: white; font-size: 35px"></i>
|
||||
</button>
|
||||
</div>
|
||||
<hr />
|
||||
@foreach (var nav in Navs)
|
||||
{
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="@nav.Path" Match="@nav.Match">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="nav-icon">
|
||||
<span class="mdi @nav.Icon mdi-36px" aria-hidden="true"></span>
|
||||
</div>
|
||||
<span class="nav-label">@nav.Label</span>
|
||||
</div>
|
||||
</NavLink>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="user">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
public class NavModel
|
||||
{
|
||||
public string Icon { get; set; } = "";
|
||||
public string Path { get; set; } = "";
|
||||
public string Label { get; set; } = "";
|
||||
public NavLinkMatch Match { get; set; }
|
||||
}
|
||||
|
||||
public NavModel[] Navs = [
|
||||
new(){Icon = "mdi-view-dashboard", Path="/", Label = "Dashboard", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-file-cog", Path="/script-manager", Label = "Script Manager", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-file-code", Path="/script-editor", Label = "Script Editor", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-flag-checkered", Path="/missions", Label = "Missions", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-map-legend", Path="/navigation-maps", Label = "Maps", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-robot-mower", Path="/robots", Label = "Robots", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-robot-industrial", Path="/robots/model", Label = "Robot Models", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-monitor-eye", Path="/robots/monitor", Label = "Monitor", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-traffic-light", Path="/traffic-manager", Label = "Traffic", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-factory", Path="/open-acs", Label = "Open ACS", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-math-log", Path="/logs", Label = "Logs", Match = NavLinkMatch.All},
|
||||
new(){Icon = "mdi-account", Path="/user", Label = "User", Match = NavLinkMatch.All},
|
||||
];
|
||||
|
||||
private bool collapseNavMenu = true;
|
||||
|
||||
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
||||
|
||||
private void ToggleNavMenu()
|
||||
{
|
||||
collapseNavMenu = !collapseNavMenu;
|
||||
}
|
||||
}
|
||||
117
RobotNet.WebApp/Layout/NavMenu.razor.css
Normal file
117
RobotNet.WebApp/Layout/NavMenu.razor.css
Normal file
@@ -0,0 +1,117 @@
|
||||
.sidebar {
|
||||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
|
||||
height: 100%;
|
||||
width: 250px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: width 0.3s;
|
||||
}
|
||||
|
||||
.sidebar.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar .title {
|
||||
margin: 8px 4px 0 4px;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.sidebar .title button {
|
||||
height: 35px;
|
||||
width: 35px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sidebar:not(.collapsed) .title button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar.collapsed {
|
||||
width: 74px;
|
||||
}
|
||||
|
||||
.sidebar.collapsed .title {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.sidebar.collapsed .title img {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar.collapsed .title button {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/*.sidebar .title .button {
|
||||
display: flex;
|
||||
border-radius: 20px;
|
||||
}*/
|
||||
|
||||
.sidebar .title .button:hover {
|
||||
background-color: rgb(5, 39, 80);
|
||||
}
|
||||
|
||||
.sidebar .user {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.sidebar.collapsed .user > div {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.sidebar.collapsed .nav-label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
font-size: 0.9rem;
|
||||
padding-bottom: 0.5rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.nav-item .nav-label {
|
||||
font-size: 18px;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
|
||||
.nav-item .nav-icon {
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.nav-item:first-of-type {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.nav-item:last-of-type {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep a {
|
||||
color: #d7d7d7;
|
||||
border-radius: 4px;
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav-item ::deep a.active {
|
||||
background-color: rgba(255,255,255,0.37);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-item ::deep a:hover {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
color: white;
|
||||
}
|
||||
9
RobotNet.WebApp/Layout/RedirectToLogin.razor
Normal file
9
RobotNet.WebApp/Layout/RedirectToLogin.razor
Normal file
@@ -0,0 +1,9 @@
|
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
@code {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Navigation.NavigateToLogin("authentication/login");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user