Restore all zeroed views + add bulk gift certificate creation
The HTML entity sweep script had a bug where it wrote empty files for any
view that contained no target Unicode characters, zeroing out 215 view files.
All views restored from the pre-sweep commit (cefdf3e).
Bulk gift certificate feature:
- BulkCreateGiftCertificateDto with Quantity (1-500), Amount, Reason, Expiry, Notes
- GenerateBulkGiftCertificatePdfAsync on IPdfService / PdfService: one Letter page
per cert, reusing the same purple/gold branded ComposeGiftCertificateContent helper
- GiftCertificatesController: BulkCreate GET/POST, BulkResult GET, BulkDownloadPdf POST
- Views: BulkCreate.cshtml (form with live total preview), BulkResult.cshtml (table +
Download All PDF button that POSTs cert IDs to avoid URL length limits)
- gift-certificate-bulk.js: live preview + spinner/disable on submit
- Index.cshtml: Bulk Create button added alongside New Certificate
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,194 @@
|
||||
@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>
|
||||
|
||||
Reference in New Issue
Block a user