Skip to content

Commit

Permalink
more kiosk fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hargata committed Nov 3, 2024
1 parent 21d135a commit 225e5e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions Views/Home/Kiosk.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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'){
Expand Down Expand Up @@ -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",
Expand All @@ -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();
}
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion Views/Home/_Kiosk.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="row row-cols-1 row-cols-md-3 g-4 mt-1 kiosk-content" data-masonry='{"percentPosition": true }'>
@foreach (VehicleInfo vehicle in Model)
{
<div class="col">
<div class="col" data-vehicleId="@vehicle.VehicleData.Id">
<div class="card" onclick="addVehicleToExceptionList(@vehicle.VehicleData.Id)">
<div class="card-body" style="padding-top:0.25rem; padding-bottom:0.25rem;">
<h5 class="card-title">@($"{vehicle.VehicleData.Year} {vehicle.VehicleData.Make} {vehicle.VehicleData.Model} ({StaticHelper.GetVehicleIdentifier(vehicle.VehicleData)})")</h5>
Expand Down

0 comments on commit 225e5e5

Please sign in to comment.