From 225e5e58bc62af6ca5469c08b45acf13d52ed52f Mon Sep 17 00:00:00 2001 From: "DESKTOP-T0O5CDB\\DESK-555BD" Date: Sun, 3 Nov 2024 09:16:46 -0700 Subject: [PATCH] more kiosk fixes. --- Views/Home/Kiosk.cshtml | 20 ++++++++++++++++---- Views/Home/_Kiosk.cshtml | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Views/Home/Kiosk.cshtml b/Views/Home/Kiosk.cshtml index 369a3b22..203a14b0 100644 --- a/Views/Home/Kiosk.cshtml +++ b/Views/Home/Kiosk.cshtml @@ -40,6 +40,15 @@ errorToast('Location Services not Enabled'); } } + function setAccessToken(accessToken){ + //use this function to never worry about user session expiring. + $.ajaxSetup({ + headers: { + 'Authorization': `Basic ${accessToken}` + } + }); + console.log("Access Token for Kiosk Mode Configured!"); + } function retrieveKioskContent(){ clearInterval(refreshTimer); if (kioskMode != 'Cycle'){ @@ -93,9 +102,6 @@ }, 100); } function addVehicleToExceptionList(vehicleId) { - if (kioskMode == 'Cycle') { - return; - } Swal.fire({ title: "Remove Vehicle from Dashboard?", text: "Removed vehicles can be restored by refreshing the page", @@ -105,7 +111,13 @@ }).then((result) => { if (result.isConfirmed) { exceptionList.push(vehicleId); - retrieveKioskContent(); + if (kioskMode == 'Cycle') { + //remove the vehicle programmatically. + $(`[data-vehicleId=${vehicleId}]`).remove(); + } else { + //force a refresh + retrieveKioskContent(); + } } }); } diff --git a/Views/Home/_Kiosk.cshtml b/Views/Home/_Kiosk.cshtml index 71fe6bd3..06414660 100644 --- a/Views/Home/_Kiosk.cshtml +++ b/Views/Home/_Kiosk.cshtml @@ -11,7 +11,7 @@
@foreach (VehicleInfo vehicle in Model) { -
+
@($"{vehicle.VehicleData.Year} {vehicle.VehicleData.Make} {vehicle.VehicleData.Model} ({StaticHelper.GetVehicleIdentifier(vehicle.VehicleData)})")