init
Some checks failed
Gitea CI/CD / dotnet-build-and-test (push) Has been cancelled
Gitea CI/CD / Set Tag Name (push) Has been cancelled
Gitea CI/CD / docker-build-and-push (push) Has been cancelled
Gitea CI/CD / Create Tag (push) Has been cancelled

This commit is contained in:
2025-12-05 09:19:46 +01:00
commit e72bc48cc4
94 changed files with 75940 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
@model dynamic
@{
ViewData["Title"] = "Dashboard";
}
<div class="container-fluid px-4">
<!--
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="section-title mb-0">System Dashboard</h1>
<span class="text-muted">Last updated: @DateTime.Now.ToString("HH:mm:ss")</span>
</div>
-->
<div class="row g-4 mb-4">
<div class="col-md-3">
<div class="metric-card">
<div class="metric-label">Total Servers</div>
<div class="metric-value">@ViewBag.TotalServers</div>
</div>
</div>
<div class="col-md-3">
<div class="metric-card">
<div class="metric-label">Online</div>
<div class="metric-value" style="color: var(--success)">@ViewBag.OnlineServers</div>
</div>
</div>
<div class="col-md-3">
<div class="metric-card">
<div class="metric-label">Offline</div>
<div class="metric-value" style="color: var(--danger)">@ViewBag.OfflineServers</div>
</div>
</div>
<div class="col-md-3">
<div class="metric-card">
<div class="metric-label">Totoal Services</div>
<div class="metric-value">@ViewBag.ServiceCount</div>
</div>
</div>
</div>
<div class="row g-4">
<div class="col-lg-8">
<div class="card">
<h2 class="card-title">Monitored Servers</h2>
<ul class="server-list">
@if (ViewBag.Servers != null && ViewBag.Servers.Count > 0)
{
@foreach (var server in ViewBag.Servers)
{
<li class="server-item">
<div class="server-info">
<span class="server-name">@server.Name</span>
<span class="server-ip">@server.IPAddress</span>
</div>
<span class="status-badge @(server.IsOnline ? "status-online" : "status-offline")">
@(server.IsOnline ? "Online" : "Offline")
</span>
</li>
}
}
else
{
<li class="text-center py-4" style="color: var(--text-muted)">
No servers configured yet
</li>
}
</ul>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<h2 class="card-title">Quick Stats</h2>
<div class="card-text">
<div class="d-flex justify-content-between mb-3 pb-3" style="border-bottom: 1px solid var(--border-color)">
<span style="color: var(--text-secondary)">System Uptime</span>
<span class="fw-semibold">99.8%</span>
</div>
<div class="d-flex justify-content-between mb-3 pb-3" style="border-bottom: 1px solid var(--border-color)">
<span style="color: var(--text-secondary)">Avg Response Time</span>
<span class="fw-semibold">42ms</span>
</div>
<div class="d-flex justify-content-between mb-3 pb-3" style="border-bottom: 1px solid var(--border-color)">
<span style="color: var(--text-secondary)">Database Size</span>
<span class="fw-semibold">210 MiB</span>
</div>
<div class="d-flex justify-content-between mb-3 pb-3" style="border-bottom: 1px solid var(--border-color)">
<span style="color: var(--text-secondary)">Last Backup</span>
<span class="fw-semibold">3 Days ago</span>
</div>
</div>
</div>
<div class="card">
<h2 class="card-title">System Health</h2>
<div class="card-text">
<div class="mb-3">
<div class="d-flex justify-content-between mb-1">
<span style="font-size: 0.875rem; color: var(--text-secondary)">Database Health</span>
<span style="font-size: 0.875rem; font-weight: 600">34%</span>
</div>
<div style="height: 8px; background-color: var(--bg-tertiary); border-radius: 4px; overflow: hidden;">
<div style="height: 100%; width: 34%; background-color: var(--success); transition: width 0.3s ease;"></div>
</div>
</div>
<div class="mb-3">
<div class="d-flex justify-content-between mb-1">
<span style="font-size: 0.875rem; color: var(--text-secondary)">Network Status</span>
<span style="font-size: 0.875rem; font-weight: 600">68%</span>
</div>
<div style="height: 8px; background-color: var(--bg-tertiary); border-radius: 4px; overflow: hidden;">
<div style="height: 100%; width: 68%; background-color: var(--warning); transition: width 0.3s ease;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@section Scripts {
<script>
setInterval(function() {
location.reload();
}, 30000);
</script>
}

View File

@@ -0,0 +1,6 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>

View File

@@ -0,0 +1,25 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>

View File

@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - Watcher Monitoring</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/watcher_monitoring.styles.css" asp-append-version="true" />
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark">
<div class="container-fluid px-4">
<a class="navbar-brand fw-bold" asp-area="" asp-controller="Home" asp-action="Index">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="me-2" style="display: inline-block; vertical-align: middle;">
<circle cx="12" cy="12" r="10"></circle>
<path d="M12 6v6l4 2"></path>
</svg>
Watcher
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Index">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Index">Settings</a>
</li>
</ul>
</div>
</div>
</nav>
<main class="main-content">
@RenderBody()
</main>
<footer class="footer">
<div class="container-fluid px-4">
<span>&copy; 2025 Watcher Monitoring</span>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

View File

@@ -0,0 +1,48 @@
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
a {
color: #0077cc;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px;
}

View File

@@ -0,0 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

View File

@@ -0,0 +1,3 @@
@using watcher_monitoring
@using watcher_monitoring.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}