Files
watcher/Watcher/Views/Server/overview.cshtml

43 lines
1.6 KiB
Plaintext

@model Watcher.ViewModels.ServerOverviewViewModel
@{
ViewData["Title"] = "Serverübersicht";
}
<div class="flex items-center justify-between mb-6">
<h1 class="text-2xl font-bold">Serverübersicht</h1>
<a asp-action="AddServer" class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700">
+ Server hinzufügen
</a>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
@foreach (var s in Model.Servers)
{
<div class="bg-white rounded-xl shadow p-4 border border-gray-200">
<div class="flex justify-between items-start">
<div>
<h2 class="text-lg font-semibold">@s.Name</h2>
<p class="text-sm text-gray-500">@s.Hostname</p>
</div>
<span class="text-sm px-2 py-1 rounded
@(s.IsOnline ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700")">
@(s.IsOnline ? "Online" : "Offline")
</span>
</div>
<div class="mt-4 text-sm space-y-1 text-gray-700">
<div><strong>IP:</strong> Ip</div>
<div><strong>Typ:</strong> @s.Type</div>
<div><strong>Status:</strong> @(string.IsNullOrEmpty(s.Status) ? "-" : s.Status)</div>
<div><strong>Erstellt:</strong> @s.CreatedAt.ToLocalTime().ToString("dd.MM.yyyy HH:mm")</div>
</div>
<div class="mt-4 flex justify-end gap-2">
<a asp-action="Edit" asp-route-id="@s.Id" class="text-blue-600 hover:underline text-sm">Bearbeiten</a>
<a asp-action="Delete" asp-route-id="@s.Id" class="text-red-600 hover:underline text-sm">Löschen</a>
</div>
</div>
}
</div>