Files
watcher/Watcher/Views/Shared/_Layout.cshtml
2025-09-12 11:50:04 +02:00

127 lines
3.7 KiB
Plaintext

@using Microsoft.AspNetCore.Authentication
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Http
@inject IHttpContextAccessor HttpContextAccessor
@{
var pictureUrl = User.FindFirst("picture")?.Value;
var preferredUsername = User.FindFirst("preferred_username")?.Value ?? "User";
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewData["Title"] - Watcher</title>
<link rel="stylesheet" href="~/css/main.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet">
<style>
body {
overflow-y: auto;
}
.sidebar {
width: 15rem;
height: 100vh;
position: fixed;
background-color: #212121;
left: 0;
top: 0;
color: white;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 1rem;
}
.main {
margin-left: 240px;
padding: 2rem;
}
.nav-link {
color: #adb5bd;
}
.nav-link:hover {
color: white;
}
.account-box {
font-size: 0.9rem;
color: #ced4da;
}
</style>
</head>
<body>
<div class="sidebar">
<div>
<h4>
<a href="https://git.triggermeelmo.com/daniel-hbn/Watcher" target="_blank" rel="noopener noreferrer" style="text-decoration: none;">
Watcher
</a>
</h4>
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" href="/">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Netzwerk</a>
</li>
<li class="nav-item"></li>
<a class="nav-link" href="/Server/Overview">Servers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Container/Overview">Services</a>
</li>
<!-- Noch nicht implementiert
<li class="nav-item"></li>
<a class="nav-link" href="/Uptime/Overview">Uptime</a>
</li>
-->
<li class="nav-item">
<a class="nav-link" href="/System/Settings">Einstellungen</a>
</li>
</ul>
</div>
<div class="account-box mt-auto">
@if (User.Identity?.IsAuthenticated ?? false)
{
<a href="/User/Info" class="d-block text-decoration-none text-light">
<div class="d-flex align-items-center gap-2">
<div class="rounded-circle bg-secondary text-white px-2 py-1">
<i class="bi bi-person"></i>
</div>
<div>
<strong>@User.Identity?.Name</strong><br />
<small class="text-muted">Profil ansehen</small>
</div>
</div>
</a>
}
else
{
<a class="nav-link p-0 text-primary" href="/Account/Login">Login</a>
}
</div>
</div>
<main class="main">
@RenderBody()
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
@RenderSection("Scripts", required: false)
</body>
</html>