Initialization Error
+@_initializationError
+Connecting to reservation service...
+ } +Selected: @_selectedCarClass.Name for @selectedCustomerName
+ + + @if (!string.IsNullOrEmpty(_reservationMessage)) + { +@_reservationMessage
+ } +Loading car inventory...
+Error: @_errorMessage
+ } + else if (_carInventory?.CarClasses == null || !_carInventory.CarClasses.Any()) + { +No car classes found in inventory.
+ } + else + { +| Car Class | +Available | +Reserved | +Max Allocation | +Actions | +
|---|---|---|---|---|
|
+
+ @{
+ var imgSrc = GetCarImageForClass(carClass.Code);
+ var carClassName = GetCarClassNameForCode(carClass.Code);
+ }
+
+ |
+ + @(carClass.MaxAllocation - carClass.Reserved) + | +
+
+ @carClass.Reserved
+
+
+ @{
+ var percentage = carClass.MaxAllocation > 0
+ ? Math.Min(100, (carClass.Reserved * 100) / carClass.MaxAllocation)
+ : 0;
+ var barColorClass = percentage > 80 ? "bg-red-500" : percentage > 50 ? "bg-yellow-500" : "bg-green-500";
+ }
+
+
+ |
+ + @if (_editingCarClass == carClass.Code) + { + + } + else + { + @carClass.MaxAllocation + } + | +
+ @if (_editingCarClass == carClass.Code)
+ {
+
+
+
+
+ }
+ else
+ {
+
+ }
+ |
+
Loading reservation status...
+Error: @_errorMessage
+ } + else if (CustomerId == Guid.Empty) + { +Please select a customer to view their reservations.
+ } + else if (_reservations == null || !_reservations.Any()) + { +No reservations found for this customer.
+ } + else + { +| Car | +Reservation ID | +Status | +Actions | +
|---|---|---|---|
|
+
+ @{
+ var imgSrc = GetCarImageForClass(reservation.CarClassCode);
+ var carClassName = GetCarClassNameForCode(reservation.CarClassCode);
+ }
+
+ |
+ + @kvp.Key + | +
+
+ @if (reservation.Status == ReservationStatusType.Pending || reservation.Status == ReservationStatusType.CancelPending || reservation.IsProcessing)
+ {
+
+ }
+
+ @if (reservation is { Status: ReservationStatusType.CancelPending, IsProcessing: true })
+ {
+ Cancelling...
+ }
+ else
+ {
+ @reservation.Status
+ }
+
+
+ |
+
+
+
+
+ @if (reservation is { Status: ReservationStatusType.Reserved or ReservationStatusType.CancelFailed, IsProcessing: false })
+ {
+
+ }
+
+ |
+
+
Log is empty.
"); + } + + var htmlBuilder = new System.Text.StringBuilder(); + + // Remove surrounding quotes if present + string processedLog = rawLog.Trim(); + if (processedLog.StartsWith('"') && processedLog.EndsWith('"')) + { + processedLog = processedLog.Substring(1, processedLog.Length - 2); + } + + // Replace escaped newlines with actual newlines, then split + var lines = processedLog.Replace("\\n", "\n").Split('\n'); + + // Define Tailwind classes + const string timestampClass = "text-gray-500 mr-2 font-mono"; + const string startExecutingClass = "text-blue-600 font-medium"; + const string successClass = "text-emerald-600 font-medium"; + const string failClass = "text-red-600 font-medium"; + const string revertClass = "text-orange-600 font-medium"; + const string defaultClass = "text-gray-800"; + const string lineBaseClass = "py-1 flex items-start"; + const string headerClass = "saga-header border-t-2 border-indigo-400 bg-indigo-50 rounded-t-lg mt-6 p-3 text-center font-bold cursor-pointer"; + const string contentClass = "saga-content bg-white p-4 rounded-b-lg mb-4 border-l border-r border-b border-indigo-200 shadow-sm"; + + // Generate unique IDs for collapsible sections + string uniqueId = Guid.NewGuid().ToString().Substring(0, 8); + int sagaCount = 0; + System.Text.StringBuilder currentSagaContent = new(); + bool isFirstSaga = true; + + // Create a list to store saga chunks for better analysis + List<(int Index, List