using Inspectron.Epson.PrintServer.ConfigurationSources; namespace EpsonPrintService; public static class HtmlPageBuilder { public static string BuildConfigPage( EpsonPrintServiceConfiguration? currentConfig, bool printServerRunning, UsbKeyResult? usbResult, string? errorMessage = null) { var statusColor = printServerRunning ? "#2e7d32" : "#e65100"; var statusText = printServerRunning ? "Running" : "Not Configured"; return $@"
Status: {statusText}
{(currentConfig != null ? $@"Restaurant ID: {Escape(currentConfig.RestaurantId)}
API URL: {Escape(currentConfig.ApiUrl ?? "(not set)")}
{Escape(usbResult.Error)}
No USB drive with print_server_key.txt found. Insert a USB drive and press Refresh.
Restaurant ID: {Escape(usbResult.DecodedRestaurantId ?? "?")}
API URL: {Escape(usbResult.DecodedApiUrl ?? "?")}
The configuration has been saved. The service will restart automatically.
Restaurant ID: {Escape(newConfig.RestaurantId)}
API URL: {Escape(newConfig.ApiUrl ?? "(not set)")}
This page will refresh in 10 seconds...