send status out of paper

This commit is contained in:
EugeneTes
2026-02-12 15:45:49 +01:00
parent b63bd4e84d
commit 59d24cff25
4 changed files with 1019 additions and 3 deletions

View File

@@ -95,7 +95,7 @@ public static class HtmlPageBuilder
<head>
<meta charset=""UTF-8"">
<meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
<meta http-equiv=""refresh"" content=""5"">
<meta http-equiv=""refresh"" content=""10;url=/"">
<title>Configuration Updated</title>
<style>
body {{ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 600px; margin: 40px auto; padding: 0 20px; background: #f5f5f5; color: #333; }}
@@ -116,7 +116,7 @@ public static class HtmlPageBuilder
<p><strong>Restaurant ID:</strong> {Escape(newConfig.RestaurantId)}</p>
<p><strong>API URL:</strong> {Escape(newConfig.ApiUrl ?? "(not set)")}</p>
</div>
<p class=""info"" style=""margin-top: 12px;"">This page will refresh in 5 seconds...</p>
<p class=""info"" style=""margin-top: 12px;"">This page will refresh in 10 seconds...</p>
</div>
</body>
</html>";

View File

@@ -4,5 +4,6 @@ public enum PrintJobStatus
{
Received=1,
Completed=2,
Failed=3
Failed=3,
OutOfPaper=4,
}

View File

@@ -90,6 +90,10 @@ public class PrinterQueue
{
// Re-queue with retry logic
job.RetryCount++;
if (job.RetryCount == 1)
{
await _statusReporter.ReportStatusAsync(job, PrintJobStatus.OutOfPaper);
}
_logger.LogWarning("Job failed, retrying ({RetryCount}/3)", job.RetryCount);
await Task.Delay(5000, cancellationToken); // Wait before retry
EnqueuePriority(job);

1011
report.html Normal file

File diff suppressed because it is too large Load Diff