e9cd67f5d9
- Added an Observability back-link at the top of all 7 Observability-area pages (AuditLog, SystemLogs, SystemInfo, AiUsageReport, UsageQuota, BannedIps, Diagnostics/Index) consistent with the Maintenance back-link pattern from PR 2 - Renamed company-level nav label and view title from "Notification Log" to "Email & SMS Log" to distinguish it clearly from the platform-level "Platform Notifications", "Audit Log", and "System Logs" surfaces Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
195 lines
8.2 KiB
Plaintext
195 lines
8.2 KiB
Plaintext
@model PowderCoating.Web.Controllers.DiagnosticsInfo
|
|
@{
|
|
ViewData["Title"] = "System Diagnostics";
|
|
ViewData["PageIcon"] = "bi-activity";
|
|
}
|
|
|
|
<div class="container mt-4">
|
|
<div class="mb-2">
|
|
<a asp-controller="PlatformAdmin" asp-action="Observability" class="text-muted small text-decoration-none">
|
|
<i class="bi bi-arrow-left me-1"></i>Observability
|
|
</a>
|
|
</div>
|
|
|
|
<div class="row mt-4">
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<div class="card-header bg-primary text-white">
|
|
<h5 class="mb-0">Application Information</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-sm">
|
|
<tr>
|
|
<th>Current Time:</th>
|
|
<td>@Model.CurrentTime.ToString("yyyy-MM-dd HH:mm:ss")</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Environment:</th>
|
|
<td><span class="badge bg-info">@Model.EnvironmentName</span></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Application Path:</th>
|
|
<td><code>@Model.ApplicationPath</code></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Running As:</th>
|
|
<td><code>@Model.UserIdentity</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<div class="card-header bg-warning">
|
|
<h5 class="mb-0">Permissions Check</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-sm">
|
|
<tr>
|
|
<th>Can Write to App Path:</th>
|
|
<td>
|
|
@if (Model.CanWriteToAppPath)
|
|
{
|
|
<span class="badge bg-success">✓ YES</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-danger">✗ NO - PERMISSION ISSUE</span>
|
|
}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Logs Directory Exists:</th>
|
|
<td>
|
|
@if (Model.LogsDirectoryExists)
|
|
{
|
|
<span class="badge bg-success">✓ YES</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-warning">✗ NO</span>
|
|
}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Can Write to Logs:</th>
|
|
<td>
|
|
@if (Model.CanWriteToLogsPath)
|
|
{
|
|
<span class="badge bg-success">✓ YES</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-danger">✗ NO - PERMISSION ISSUE</span>
|
|
}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Logs Path:</th>
|
|
<td><code>@Model.LogsPath</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-4">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header @(Model.LoggingTestSuccess ? "bg-success" : "bg-danger") text-white">
|
|
<h5 class="mb-0">Logging Test</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<p><strong>Status:</strong>
|
|
@if (Model.LoggingTestSuccess)
|
|
{
|
|
<span class="badge bg-success">SUCCESS</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-danger">FAILED</span>
|
|
}
|
|
</p>
|
|
<p><strong>Message:</strong> @Model.LoggingTestMessage</p>
|
|
@if (Model.LoggingTestSuccess)
|
|
{
|
|
<div class="alert alert-info alert-permanent">
|
|
<i class="bi bi-info-circle"></i> A test log entry was written. Check the log files below to see if it appears.
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-4">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header bg-secondary text-white d-flex justify-content-between align-items-center">
|
|
<h5 class="mb-0">Log Files</h5>
|
|
<a asp-action="ViewLogs" class="btn btn-sm btn-light">
|
|
<i class="bi bi-eye"></i> View Logs
|
|
</a>
|
|
</div>
|
|
<div class="card-body">
|
|
@if (Model.LogFilesError != null)
|
|
{
|
|
<div class="alert alert-danger alert-permanent">
|
|
<strong>Error reading log files:</strong> @Model.LogFilesError
|
|
</div>
|
|
}
|
|
else if (Model.LogFiles.Any())
|
|
{
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>File Name</th>
|
|
<th>Size</th>
|
|
<th>Last Modified</th>
|
|
<th>Full Path</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var file in Model.LogFiles)
|
|
{
|
|
<tr>
|
|
<td><code>@file.Name</code></td>
|
|
<td>@(file.Size / 1024.0).ToString("N2") KB</td>
|
|
<td>@file.LastModified.ToString("yyyy-MM-dd HH:mm:ss")</td>
|
|
<td><small><code>@file.FullPath</code></small></td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
else
|
|
{
|
|
<div class="alert alert-warning alert-permanent">
|
|
<i class="bi bi-exclamation-triangle"></i> <strong>No log files found!</strong>
|
|
<hr>
|
|
<p class="mb-0">This means logs are not being written. Check the permissions above.</p>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-4">
|
|
<div class="col-12">
|
|
<div class="alert alert-info alert-permanent">
|
|
<h6><i class="bi bi-lightbulb"></i> Troubleshooting Tips</h6>
|
|
<ul class="mb-0">
|
|
<li>If "Can Write to Logs" shows NO, the IIS Application Pool doesn't have write permissions</li>
|
|
<li>Grant "Modify" permissions to <code>IIS AppPool\YourAppPoolName</code> on the application folder</li>
|
|
<li>After fixing permissions, restart the Application Pool in IIS Manager</li>
|
|
<li>Refresh this page to see if log files appear</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|