2023-03-03 23:24:18 +03:30
|
|
|
@page
|
2023-06-02 15:26:29 +03:30
|
|
|
@using MTWireGuard.Application.Models.Mikrotik
|
2023-03-03 23:24:18 +03:30
|
|
|
@model MTWireGuard.Pages.LogsModel
|
|
|
|
@{
|
|
|
|
ViewData["Title"] = "Event Logs";
|
|
|
|
ViewData["Breadcrumb"] = "Logs";
|
|
|
|
var Logs = (List<LogViewModel>)ViewData["Logs"];
|
|
|
|
}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="">
|
|
|
|
<table class="table table-bordered border-secondary logs-table">
|
|
|
|
<thead class="table-dark fw-semibold">
|
|
|
|
<tr class="align-middle">
|
|
|
|
<th class="text-center">
|
|
|
|
<svg class="icon">
|
|
|
|
<use xlink:href="vendors/coreui/icons/svg/free.svg#cil-people"></use>
|
|
|
|
</svg>
|
|
|
|
</th>
|
|
|
|
<th>Message</th>
|
|
|
|
<th>Topics</th>
|
|
|
|
<th>Time</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (var log in Logs)
|
|
|
|
{
|
|
|
|
<tr class="align-middle">
|
|
|
|
<td class="text-center">
|
|
|
|
<span class="text-medium-emphasis">#@log.Id</span>
|
|
|
|
</td>
|
|
|
|
<td>@log.Message</td>
|
|
|
|
<td>
|
|
|
|
@foreach (var topic in log.Topics)
|
|
|
|
{
|
|
|
|
switch (topic.ToLower())
|
|
|
|
{
|
|
|
|
case "system":
|
|
|
|
<span class="badge text-bg-dark mx-1">@topic</span>
|
|
|
|
break;
|
|
|
|
case "info":
|
|
|
|
<span class="badge text-bg-info mx-1">@topic</span>
|
|
|
|
break;
|
|
|
|
case "error":
|
|
|
|
case "critical":
|
|
|
|
<span class="badge text-bg-danger mx-1">@topic</span>
|
|
|
|
break;
|
|
|
|
case "account":
|
|
|
|
<span class="badge text-bg-secondary mx-1">@topic</span>
|
|
|
|
break;
|
|
|
|
case "dhcp":
|
|
|
|
case "ppp":
|
|
|
|
case "l2tp":
|
|
|
|
case "pptp":
|
|
|
|
case "sstp":
|
|
|
|
<span class="badge text-bg-light border border-secondary mx-1">@topic</span>
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
<span class="badge text-bg-light border border-secondary mx-1">@topic</span>
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</td>
|
|
|
|
<td>@log.Time</td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@section Scripts {
|
|
|
|
<script>
|
|
|
|
</script>
|
|
|
|
}
|